fix(stack): make web editor readonly for git template EE-6706 (#11183)

pull/11254/head
cmeng 9 months ago committed by GitHub
parent 380b23a9f5
commit 988064a542
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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) {

@ -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;

Loading…
Cancel
Save