Files
pillar/src/scripts/js/es6/common/vuecomponents/table/rows/RowObjectBase.js
Tobias Johansson 379f743864 Attract multi edit: Edit multiple tasks/shots/assets at the same time
For the user:
Ctrl + L-Mouse to select multiple tasks/shots/assets and then edit
the nodes as before. When multiple items are selected a chain icon
can be seen in editor next to the fields. If the chain is broken
it indicates that the values are not the same on all the selected
items.

When a field has been edited it will be marked with a green background
color.

The items are saved one by one in parallel. This means that one item
could fail to be saved, while the others get updated.

For developers:
The editor and activities has been ported to Vue. The table and has
been updated to support multi select.

MultiEditEngine is the core of the multi edit. It keeps track of
what values differs and what has been edited.
2019-03-13 13:53:40 +01:00

59 lines
1.1 KiB
JavaScript

class RowState {
constructor(selectedIds) {
this.selectedIds = selectedIds || [];
}
/**
*
* @param {RowBase} rowObject
*/
applyState(rowObject) {
rowObject.isSelected = this.selectedIds.includes(rowObject.getId());
}
}
class RowBase {
constructor(underlyingObject) {
this.underlyingObject = underlyingObject;
this.isInitialized = false;
this.isVisible = true;
this.isSelected = false;
}
thenInit() {
return this._thenInitImpl()
.then(() => {
this.isInitialized = true
})
}
_thenInitImpl() {
return Promise.resolve();
}
getName() {
return this.underlyingObject.name;
}
getId() {
return this.underlyingObject._id;
}
getProperties() {
return this.underlyingObject.properties;
}
getRowClasses() {
return {
"is-busy": !this.isInitialized
}
}
getChildObjects() {
return [];
}
}
export { RowBase, RowState }