mirror of
https://github.com/plankanban/planka.git
synced 2025-08-02 20:15:27 +02:00
ref: Little refactoring
This commit is contained in:
parent
70cadcd974
commit
3aba4d4a56
14 changed files with 123 additions and 52 deletions
|
@ -67,7 +67,7 @@ module.exports = {
|
|||
delete values.position;
|
||||
}
|
||||
|
||||
if (values.list.type === List.Types.CLOSED) {
|
||||
if (List.TYPE_STATE_BY_TYPE[values.list.type] === List.TypeStates.CLOSED) {
|
||||
values.isClosed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -386,11 +386,13 @@ module.exports = {
|
|||
values.prevListId = null;
|
||||
}
|
||||
|
||||
const typeState = List.TYPE_STATE_BY_TYPE[values.list.type];
|
||||
|
||||
if (inputs.record.isClosed) {
|
||||
if (values.list.type === List.Types.ACTIVE) {
|
||||
if (typeState === List.TypeStates.OPENED) {
|
||||
values.isClosed = false;
|
||||
}
|
||||
} else if (values.list.type === List.Types.CLOSED) {
|
||||
} else if (typeState === List.TypeStates.CLOSED) {
|
||||
values.isClosed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,9 +34,17 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
|
||||
exists: {
|
||||
linkedCardOrNameMustBeInValues: {},
|
||||
},
|
||||
|
||||
async fn(inputs) {
|
||||
const { values } = inputs;
|
||||
|
||||
if (!values.linkedCard && !values.name) {
|
||||
throw 'linkedCardOrNameMustBeInValues';
|
||||
}
|
||||
|
||||
const tasks = await Task.qm.getByTaskListId(values.taskList.id);
|
||||
|
||||
const { position, repositions } = sails.helpers.utils.insertToPositionables(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue