fix(stack): prepopulate when creating template from stack EE-6853 (#11380)

pull/11391/head
cmeng 8 months ago committed by GitHub
parent bb02c69d14
commit 31658d4028
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -125,7 +125,7 @@ angular.module('portainer.docker', ['portainer.app', reactModule]).config([
const customTemplatesNew = {
name: 'docker.templates.custom.new',
url: '/new?appTemplateId&type',
url: '/new?fileContent&appTemplateId&type',
views: {
'content@': {

@ -23,6 +23,10 @@ export function useInitialValues({
const { appTemplateId, type = defaultType } = useAppTemplateParams();
const {
params: { fileContent = '' },
} = useCurrentStateAndParams();
const fileContentQuery = useFetchTemplateFile(appTemplateId);
if (fileContentQuery.isLoading) {
return undefined;
@ -30,7 +34,7 @@ export function useInitialValues({
return {
Title: '',
FileContent: fileContentQuery.data ?? '',
FileContent: (fileContentQuery.data ?? '') || fileContent,
Type: type,
Platform: Platform.LINUX,
File: undefined,

Loading…
Cancel
Save