1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 05:45:22 +02:00

fix(stack): make web editor readonly for git template EE-6706 (#11183)
Some checks failed
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled

This commit is contained in:
cmeng 2024-02-23 13:28:20 +13:00 committed by GitHub
parent 380b23a9f5
commit 988064a542
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -204,6 +204,9 @@ class CustomTemplatesViewController {
const template = _.find(this.templates, { Id: templateId }); const template = _.find(this.templates, { Id: templateId });
const isGit = template.GitConfig !== null;
this.state.isEditorReadOnly = isGit;
try { try {
this.state.templateContent = this.formValues.fileContent = await this.CustomTemplateService.customTemplateFile(template.Id, template.GitConfig !== null); this.state.templateContent = this.formValues.fileContent = await this.CustomTemplateService.customTemplateFile(template.Id, template.GitConfig !== null);
} catch (err) { } catch (err) {

View file

@ -302,10 +302,11 @@ angular
$scope.state.selectedTemplate = template; $scope.state.selectedTemplate = template;
try { try {
$scope.state.templateContent = await this.CustomTemplateService.customTemplateFile(templateId, template.GitConfig !== null); const isGit = template.GitConfig !== null;
$scope.state.templateContent = await this.CustomTemplateService.customTemplateFile(templateId, isGit);
onChangeFileContent($scope.state.templateContent); onChangeFileContent($scope.state.templateContent);
$scope.state.isEditorReadOnly = false; $scope.state.isEditorReadOnly = isGit;
} catch (err) { } catch (err) {
$scope.state.templateLoadFailed = true; $scope.state.templateLoadFailed = true;
throw err; throw err;