mirror of https://github.com/portainer/portainer
fix(stack): prepopulate when creating template from stack EE-6853 (#11379)
parent
d9ae249ffe
commit
f15be1d92a
|
@ -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…
Reference in New Issue