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

pull/11390/head
cmeng 8 months ago committed by GitHub
parent d9ae249ffe
commit f15be1d92a
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