1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Allow default project workflow to be set via settings

This commit is contained in:
Nick O'Leary 2020-11-18 12:02:45 +00:00
parent c6129b44a1
commit 81f200641b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 16 additions and 3 deletions

View File

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

View File

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

View File

@ -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"
}
}
}
}