fix(stack): prepopulate when creating template from stack EE-6853 (#11380)
parent
bb02c69d14
commit
31658d4028
|
@ -125,7 +125,7 @@ angular.module('portainer.docker', ['portainer.app', reactModule]).config([
|
||||||
|
|
||||||
const customTemplatesNew = {
|
const customTemplatesNew = {
|
||||||
name: 'docker.templates.custom.new',
|
name: 'docker.templates.custom.new',
|
||||||
url: '/new?appTemplateId&type',
|
url: '/new?fileContent&appTemplateId&type',
|
||||||
|
|
||||||
views: {
|
views: {
|
||||||
'content@': {
|
'content@': {
|
||||||
|
|
|
@ -23,6 +23,10 @@ export function useInitialValues({
|
||||||
|
|
||||||
const { appTemplateId, type = defaultType } = useAppTemplateParams();
|
const { appTemplateId, type = defaultType } = useAppTemplateParams();
|
||||||
|
|
||||||
|
const {
|
||||||
|
params: { fileContent = '' },
|
||||||
|
} = useCurrentStateAndParams();
|
||||||
|
|
||||||
const fileContentQuery = useFetchTemplateFile(appTemplateId);
|
const fileContentQuery = useFetchTemplateFile(appTemplateId);
|
||||||
if (fileContentQuery.isLoading) {
|
if (fileContentQuery.isLoading) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@ -30,7 +34,7 @@ export function useInitialValues({
|
||||||
|
|
||||||
return {
|
return {
|
||||||
Title: '',
|
Title: '',
|
||||||
FileContent: fileContentQuery.data ?? '',
|
FileContent: (fileContentQuery.data ?? '') || fileContent,
|
||||||
Type: type,
|
Type: type,
|
||||||
Platform: Platform.LINUX,
|
Platform: Platform.LINUX,
|
||||||
File: undefined,
|
File: undefined,
|
||||||
|
|
Loading…
Reference in New Issue