mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 10:42:41 +01:00
9a8019d4a9
Summary: Depends on D20267. Depends on D20268. Ref T10333. Currently, we support "Natural" and "Priority" orders, but a lot of the particulars are pretty hard-coded, including some logic in `ManiphestTask`. Although it's not clear that we'll ever put other types of objects on workboards, it seems generally bad that you need to modify `ManiphestTask` to get a new ordering. Pull the ordering logic out into a `ProjectColumnOrder` hierarchy instead, and let each ordering define the things it needs to work (name, icon, what headers look like, how different objects are sorted, and how to apply an edit when you drop an object under a header). Then move the existing "Natural" and "Priority" orders into this new hierarchy. This has a minor bug where using the "Edit" workflow to change a card's priority on a priority-ordered board doesn't fully refresh card/header order since the response isn't ordering-aware. I'll fix that in an upcoming change. Test Plan: Grouped workboards by "Natural" and "Priority", dragged stuff around within and between columns, grepped for all touched symbols. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T10333 Differential Revision: https://secure.phabricator.com/D20269
64 lines
1.1 KiB
JavaScript
64 lines
1.1 KiB
JavaScript
/**
|
|
* @provides javelin-workboard-card-template
|
|
* @requires javelin-install
|
|
* @javelin
|
|
*/
|
|
|
|
JX.install('WorkboardCardTemplate', {
|
|
|
|
construct: function(phid) {
|
|
this._phid = phid;
|
|
this._vectors = {};
|
|
this._headerKeys = {};
|
|
|
|
this.setObjectProperties({});
|
|
},
|
|
|
|
properties: {
|
|
objectProperties: null
|
|
},
|
|
|
|
members: {
|
|
_phid: null,
|
|
_html: null,
|
|
_vectors: null,
|
|
_headerKeys: null,
|
|
|
|
getPHID: function() {
|
|
return this._phid;
|
|
},
|
|
|
|
setNodeHTMLTemplate: function(html) {
|
|
this._html = html;
|
|
return this;
|
|
},
|
|
|
|
setSortVector: function(order, vector) {
|
|
this._vectors[order] = vector;
|
|
return this;
|
|
},
|
|
|
|
getSortVector: function(order) {
|
|
return this._vectors[order];
|
|
},
|
|
|
|
setHeaderKey: function(order, key) {
|
|
this._headerKeys[order] = key;
|
|
return this;
|
|
},
|
|
|
|
getHeaderKey: function(order) {
|
|
return this._headerKeys[order];
|
|
},
|
|
|
|
newNode: function() {
|
|
return JX.$H(this._html).getFragment().firstChild;
|
|
},
|
|
|
|
setObjectProperty: function(key, value) {
|
|
this.getObjectProperties()[key] = value;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
});
|