mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Allow default project workflow to be set via settings
This commit is contained in:
		| @@ -43,9 +43,11 @@ RED.projects.userSettings = (function() { | ||||
|  | ||||
|     function createWorkflowSection(pane) { | ||||
|  | ||||
|         var defaultWorkflowMode = RED.settings.theme("projects.workflow.mode","manual"); | ||||
|  | ||||
|         var currentGitSettings = RED.settings.get('git') || {}; | ||||
|         currentGitSettings.workflow = currentGitSettings.workflow || {}; | ||||
|         currentGitSettings.workflow.mode = currentGitSettings.workflow.mode || "manual"; | ||||
|         currentGitSettings.workflow.mode = currentGitSettings.workflow.mode || defaultWorkflowMode; | ||||
|  | ||||
|         var title = $('<h3></h3>').text(RED._("editor:sidebar.project.userSettings.workflow")).appendTo(pane); | ||||
|  | ||||
|   | ||||
| @@ -294,7 +294,10 @@ RED.sidebar.versionControl = (function() { | ||||
|                 // TODO: this is a full refresh of the files - should be able to | ||||
|                 //       just do an incremental refresh | ||||
|  | ||||
|                 var workflowMode = ((RED.settings.get('git') || {}).workflow || {}).mode || "manual"; | ||||
|                 // Get the default workflow mode from theme settings | ||||
|                 var defaultWorkflowMode = RED.settings.theme("projects.workflow.mode","manual"); | ||||
|                 // Check for the user-defined choice of mode | ||||
|                 var workflowMode = ((RED.settings.get('git') || {}).workflow || {}).mode || defaultWorkflowMode; | ||||
|                 if (workflowMode === 'auto') { | ||||
|                     refresh(true); | ||||
|                 } else { | ||||
|   | ||||
							
								
								
									
										10
									
								
								packages/node_modules/node-red/settings.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								packages/node_modules/node-red/settings.js
									
									
									
									
										vendored
									
									
								
							| @@ -290,7 +290,15 @@ module.exports = { | ||||
|     editorTheme: { | ||||
|         projects: { | ||||
|             // To enable the Projects feature, set this value to true | ||||
|             enabled: false | ||||
|             enabled: false, | ||||
|             workflow: { | ||||
|                 // Set the default projects workflow mode. | ||||
|                 //  - manual - you must manually commit changes | ||||
|                 //  - auto - changes are automatically committed | ||||
|                 // This can be overridden per-user from the 'Git config' | ||||
|                 // section of 'User Settings' within the editor | ||||
|                 mode: "manual" | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user