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:
parent
c6129b44a1
commit
81f200641b
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user