mirror of https://github.com/portainer/portainer
				
				
				
			fix(stack): make web editor readonly for git template EE-6706 (#11183)
							parent
							
								
									380b23a9f5
								
							
						
					
					
						commit
						988064a542
					
				| 
						 | 
				
			
			@ -204,6 +204,9 @@ class CustomTemplatesViewController {
 | 
			
		|||
 | 
			
		||||
    const template = _.find(this.templates, { Id: templateId });
 | 
			
		||||
 | 
			
		||||
    const isGit = template.GitConfig !== null;
 | 
			
		||||
    this.state.isEditorReadOnly = isGit;
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
      this.state.templateContent = this.formValues.fileContent = await this.CustomTemplateService.customTemplateFile(template.Id, template.GitConfig !== null);
 | 
			
		||||
    } catch (err) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -302,10 +302,11 @@ angular
 | 
			
		|||
            $scope.state.selectedTemplate = template;
 | 
			
		||||
 | 
			
		||||
            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);
 | 
			
		||||
 | 
			
		||||
              $scope.state.isEditorReadOnly = false;
 | 
			
		||||
              $scope.state.isEditorReadOnly = isGit;
 | 
			
		||||
            } catch (err) {
 | 
			
		||||
              $scope.state.templateLoadFailed = true;
 | 
			
		||||
              throw err;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue