Add any/all option for workflow node convergence

This commit is contained in:
Jake McDermott 2020-01-13 14:52:58 -05:00 committed by Rebeccah
parent 70cf4cf5d4
commit 987fc26537
4 changed files with 33 additions and 3 deletions

View File

@ -153,7 +153,8 @@ function TemplatesStrings (BaseString) {
TIMED_OUT: t.s('APPROVAL TIMED OUT'),
TIMEOUT: t.s('Timeout'),
APPROVED: t.s('APPROVED'),
DENIED: t.s('DENIED')
DENIED: t.s('DENIED'),
ALL_PARENTS_MUST_CONVERGE: t.s('All parents must converge before running'),
};
}

View File

@ -500,6 +500,10 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
type: 'workflow_job_template,job_template'
};
$scope.all_parents_must_converge = _.get(
$scope, ['nodeConfig', 'node', 'all_parents_must_converge'],
_.get($scope, ['nodeConfig', 'node', 'originalNodeObject', 'all_parents_must_converge'], false)
);
$scope.wf_maker_templates = [];
$scope.wf_maker_template_dataset = {};
@ -617,7 +621,8 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
$scope.confirmNodeForm = () => {
const nodeFormData = {
edgeType: $scope.edgeType
edgeType: $scope.edgeType,
all_parents_must_converge: $scope.all_parents_must_converge,
};
if ($scope.activeTab === "approval") {

View File

@ -183,6 +183,28 @@
</select>
</div>
</div>
<div id="workflow_node_checkbox_group" class="form-group Form-formGroup Form-formGroup--singleColumn" >
<label class="Form-inputLabelContainer" for="checkbox_group">
<span translate class="Form-inputLabel">Options</span>
</label>
<div>
<div id="workflow_node_checkbox_group_chbox_group" class="checkbox-group">
<div class="form-check">
<label for="all_parents_must_converge" class="form-check-label">
<input
ng-disabled="readOnly"
id="workflow_node_all_parents_must_converge_checkbox"
class="form-check-input"
type="checkbox"
name="all_parents_must_converge"
ng-model="all_parents_must_converge"
/>
<span class="Form-inputLabel">{{:: strings.get('workflow_maker.ALL_PARENTS_MUST_CONVERGE') }}</span>
</label>
</div>
</div>
</div>
</div>
<div ng-show="readOnly">
<div
class="WorkflowMaker-readOnlyPromptText"

View File

@ -92,7 +92,8 @@ export default ['$scope', 'TemplatesService',
limit: null,
diff_mode: null,
verbosity: null,
credential: null
credential: null,
all_parents_must_converge: _.get(node, 'all_parents_must_converge', false)
};
if (_.has(node, 'fullUnifiedJobTemplateObject')) {
@ -637,6 +638,7 @@ export default ['$scope', 'TemplatesService',
});
}
}
nodeRef[$scope.nodeConfig.nodeId].all_parents_must_converge = nodeFormData.all_parents_must_converge;
$scope.graphState.arrayOfNodesForChart.map( (node) => {
if (node.id === nodeId) {