1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 23:40:57 +01:00
phorge-phorge/webroot/rsrc/js/application/trigger/TriggerRuleControl.js
epriestley 567dea5449 Mostly make the editor UI for triggers work
Summary:
Ref T5474. This provides a Herald-like UI for editing workboard trigger rules.

This probably has some missing pieces and doesn't actually save anything to the database yet, but the basics at least roughly work.

Test Plan: {F6299886}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T5474

Differential Revision: https://secure.phabricator.com/D20301
2019-03-25 13:25:14 -07:00

40 lines
715 B
JavaScript

/**
* @requires phuix-form-control-view
* @provides trigger-rule-control
* @javelin
*/
JX.install('TriggerRuleControl', {
construct: function() {
},
properties: {
type: null,
specification: null
},
statics: {
newFromDictionary: function(map) {
return new JX.TriggerRuleControl()
.setType(map.type)
.setSpecification(map.specification);
},
},
members: {
newInput: function(rule) {
var phuix = new JX.PHUIXFormControl()
.setControl(this.getType(), this.getSpecification());
phuix.setValue(rule.getValue());
return {
node: phuix.getRawInputNode(),
get: JX.bind(phuix, phuix.getValue)
};
}
}
});