Add workflows option definition
Bug: twpowertools:74
Change-Id: I923966a40493496ecc006e0c2fcde2ecf823b807
diff --git a/src/common/optionsPrototype.json5 b/src/common/optionsPrototype.json5
index 824b754..ca38042 100644
--- a/src/common/optionsPrototype.json5
+++ b/src/common/optionsPrototype.json5
@@ -121,6 +121,11 @@
// #!endif
// Experiments:
+ 'workflows': {
+ defaultValue: false,
+ context: 'experiments',
+ killSwitchType: 'experiment',
+ },
// Internal options:
'ccdarktheme_switch_enabled': {
diff --git a/src/options/optionsCommon.js b/src/options/optionsCommon.js
index b442fad..abfc306 100644
--- a/src/options/optionsCommon.js
+++ b/src/options/optionsCommon.js
@@ -179,6 +179,16 @@
i18n();
+ // Add custom handlers
+ let manageWorkflowsBtn = document.getElementById('manage-workflows');
+ if (manageWorkflowsBtn)
+ manageWorkflowsBtn.addEventListener('click', e => {
+ e.preventDefault();
+ chrome.tabs.create({
+ url: chrome.runtime.getURL('options/workflows.html'),
+ })
+ });
+
chrome.storage.sync.get(null, function(items) {
items = cleanUpOptions(items, false);
diff --git a/src/static/_locales/en/messages.json b/src/static/_locales/en/messages.json
index f85ad5b..99a0132 100644
--- a/src/static/_locales/en/messages.json
+++ b/src/static/_locales/en/messages.json
@@ -143,6 +143,14 @@
"message": "Block the sending of your replies as you type to Google servers in the Community Console.",
"description": "Feature checkbox in the options page"
},
+ "options_workflows": {
+ "message": "Enable the workflows feature.",
+ "description": "Feature checkbox in the options page"
+ },
+ "options_workflows_manage": {
+ "message": "Manage workflows",
+ "description": "Button in the options page which opens the workflow management page."
+ },
"options_save": {
"message": "Save",
"description": "Button in the options page to save the settings"
diff --git a/src/static/options/experiments.html b/src/static/options/experiments.html
index 0f42f11..83a58cb 100644
--- a/src/static/options/experiments.html
+++ b/src/static/options/experiments.html
@@ -13,6 +13,7 @@
<p data-i18n="experiments_description"></p>
<form>
<div id="optional-permissions-warning" hidden data-i18n="optionalpermissionswarning_header"></div>
+ <div class="option"><input type="checkbox" id="workflows"> <label for="workflows" data-i18n="workflows"></label> <button id="manage-workflows" data-i18n="workflows_manage"></button></div>
<div class="actions"><button id="save" data-i18n="save"></button></div>
</form>
<div id="save-indicator"></div>