Skip to content

Commit

Permalink
Renamed dirty -> updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ActiveChooN committed Nov 18, 2020
1 parent 65df3c9 commit c1efd37
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions cvat-core/src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@
task: undefined,
};

let dirtyFields = {
let updatedFields = {
assignee: false,
status: false,
};
Expand Down Expand Up @@ -720,7 +720,7 @@
if (assignee !== null && !(assignee instanceof User)) {
throw new ArgumentError('Value must be a user instance');
}
dirtyFields.assignee = true;
updatedFields.assignee = true;
data.assignee = assignee;
},
},
Expand Down Expand Up @@ -749,7 +749,7 @@
);
}

dirtyFields.status = true;
updatedFields.status = true;
data.status = status;
},
},
Expand Down Expand Up @@ -783,10 +783,10 @@
task: {
get: () => data.task,
},
__dirtyFields: {
get: () => dirtyFields,
__updatedFields: {
get: () => updatedFields,
set: (fields) => {
dirtyFields = fields;
updatedFields = fields;
},
},
}),
Expand Down Expand Up @@ -892,7 +892,7 @@
use_cache: undefined,
};

let dirtyFields = {
let updatedFields = {
name: false,
assignee: false,
bug_tracker: false,
Expand Down Expand Up @@ -968,7 +968,7 @@
if (!value.trim().length) {
throw new ArgumentError('Value must not be empty');
}
dirtyFields.name = true;
updatedFields.name = true;
data.name = value;
},
},
Expand Down Expand Up @@ -1027,7 +1027,7 @@
if (assignee !== null && !(assignee instanceof User)) {
throw new ArgumentError('Value must be a user instance');
}
dirtyFields.assignee = true;
updatedFields.assignee = true;
data.assignee = assignee;
},
},
Expand Down Expand Up @@ -1061,7 +1061,7 @@
bugTracker: {
get: () => data.bug_tracker,
set: (tracker) => {
dirtyFields.bug_tracker = true;
updatedFields.bug_tracker = true;
data.bug_tracker = tracker;
},
},
Expand Down Expand Up @@ -1168,7 +1168,7 @@
}
}

dirtyFields.labels = true;
updatedFields.labels = true;
data.labels = [...labels];
},
},
Expand Down Expand Up @@ -1335,10 +1335,10 @@
dataChunkType: {
get: () => data.data_compressed_chunk_type,
},
__dirtyFields: {
get: () => dirtyFields,
__updatedFields: {
get: () => updatedFields,
set: (fields) => {
dirtyFields = fields;
updatedFields = fields;
},
},
}),
Expand Down Expand Up @@ -1475,8 +1475,8 @@
if (this.id) {
const jobData = {};

for (const [field, isDirty] of Object.entries(this.__dirtyFields)) {
if (isDirty) {
for (const [field, isUpdated] of Object.entries(this.__updatedFields)) {
if (isUpdated) {
switch (field) {
case 'status':
jobData.status = this.status;
Expand All @@ -1492,7 +1492,7 @@

await serverProxy.jobs.saveJob(this.id, jobData);

this.__dirtyFields = {
this.__updatedFields = {
status: false,
assignee: false,
};
Expand Down Expand Up @@ -1703,8 +1703,8 @@
// If the task has been already created, we update it
const taskData = {};

for (const [field, isDirty] of Object.entries(this.__dirtyFields)) {
if (isDirty) {
for (const [field, isUpdated] of Object.entries(this.__updatedFields)) {
if (isUpdated) {
switch (field) {
case 'assignee':
taskData.assignee_id = this.assignee ? this.assignee.id : null;
Expand All @@ -1726,7 +1726,7 @@

await serverProxy.tasks.saveTask(this.id, taskData);

this.dirtyFields = {
this.updatedFields = {
assignee: false,
name: false,
bugTracker: false,
Expand Down

0 comments on commit c1efd37

Please sign in to comment.