WIP(teams): updated completion states

and fixed an issue with cron saving
This commit is contained in:
SabreCat
2022-02-24 16:23:46 -06:00
parent 31cbcf53a2
commit 35ed158dd9
4 changed files with 14 additions and 18 deletions

View File

@@ -55,8 +55,9 @@ async function updateTeamTasks (team) {
for (const assignedUser in daily.group.assignedUsers) { for (const assignedUser in daily.group.assignedUsers) {
if (Object.prototype.hasOwnProperty.call(daily.group.assignedUsers, assignedUser)) { if (Object.prototype.hasOwnProperty.call(daily.group.assignedUsers, assignedUser)) {
assignments += 1; assignments += 1;
if (assignedUser.completed) completions += 1; if (daily.group.assignedUsers[assignedUser].completed) completions += 1;
assignedUser.completed = false; daily.group.assignedUsers[assignedUser].completed = false;
daily.markModified('group.assignedUsers');
} }
} }
processChecklist = true; processChecklist = true;

View File

@@ -1,6 +1,3 @@
<svg width="16" height="14" viewBox="0 0 16 14" xmlns="http://www.w3.org/2000/svg"> <svg width="16" height="14" viewBox="0 0 16 14" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd"> <path d="m12.707 5.707-1.414-1.414L8 7.586 6.707 6.293 5.293 7.707 8 10.414l4.707-4.707zM16 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-2h2v2h10V2H4v2.5h2l-3 3-3-3h2V2a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" fill="#878190" fill-rule="evenodd"/>
<path d="M16 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-2h2v2h10V2H4v2.5h2l-3 3-3-3h2V2a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" fill="#878190"/>
<path fill="#1CA372" d="m12.707 5.707-1.414-1.414L8 7.586 6.707 6.293 5.293 7.707 8 10.414z"/>
</g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 325 B

View File

@@ -32,7 +32,7 @@
</div> </div>
<div <div
v-if='completion.completedDate' v-if='completion.completedDate'
:class="{'green-10': completion.completedToday}" :class="{'green-10': completion.completed}"
> >
{{ completion.completedDateString }} {{ completion.completedDateString }}
</div> </div>
@@ -44,7 +44,7 @@
> >
<div <div
class="mr-auto ml-2" class="mr-auto ml-2"
:class="{'green-10': showGreen && task.type === 'todo'}" :class="{'green-10': showGreen}"
v-html="message" v-html="message"
></div> ></div>
<div <div
@@ -82,17 +82,18 @@
</a> </a>
</span> </span>
<span <span
v-if="assignedUsersCount === 1 && task.type === 'daily'" v-if="assignedUsersCount === 1 && task.type === 'daily' && !task.completed"
class="mr-1 d-inline-flex" class="mr-1 d-inline-flex"
> >
<span <span
v-if="singleAssignLastDone"
v-html="icons.lastComplete" v-html="icons.lastComplete"
v-b-tooltip.hover.bottom="$t('lastCompleted')"
class="last-completed mr-1" class="last-completed mr-1"
:class="{'gray-200': !showGreen}" :class="{'gray-200': !showGreen}"
> >
</span> </span>
<span <span
class="my-auto"
:class="{'green-10': showGreen}" :class="{'green-10': showGreen}"
> >
{{ formattedCompletionTime }} {{ formattedCompletionTime }}
@@ -142,6 +143,7 @@
padding-bottom: 0.25rem; padding-bottom: 0.25rem;
padding-top: 0.25rem; padding-top: 0.25rem;
z-index: 9; z-index: 9;
height: 24px;
.blue-10 { .blue-10 {
color: $blue-10; color: $blue-10;
@@ -206,10 +208,7 @@
.last-completed { .last-completed {
width: 16px; width: 16px;
height: 14px; height: 14px;
margin-bottom: 4px;
+ .green-10 {
margin-top: 1px;
}
} }
</style> </style>
@@ -277,7 +276,6 @@ export default {
completed: this.task.group.assignedUsers[userId].completed, completed: this.task.group.assignedUsers[userId].completed,
completedDate, completedDate,
completedDateString, completedDateString,
completedToday: moment().diff(completedDate, 'days') === 0,
}); });
} }
} }
@@ -297,7 +295,7 @@ export default {
); );
const userName = this.group.members[index].auth.local.username; const userName = this.group.members[index].auth.local.username;
if (this.task.type === 'todo' && this.task.group.assignedUsers[userId].completed) { // completed if (this.task.group.assignedUsers[userId].completed) { // completed
const { completedDate } = this.task.group.assignedUsers[userId]; const { completedDate } = this.task.group.assignedUsers[userId];
if (this.userIsAssigned) { if (this.userIsAssigned) {
if (moment().diff(completedDate, 'days') > 0) { if (moment().diff(completedDate, 'days') > 0) {
@@ -320,7 +318,6 @@ export default {
singleAssignLastDone () { singleAssignLastDone () {
const userId = this.assignedUsersKeys[0]; const userId = this.assignedUsersKeys[0];
const completion = this.task.group.assignedUsers[userId]; const completion = this.task.group.assignedUsers[userId];
if (!completion.completed) return null;
return completion.completedDate; return completion.completedDate;
}, },
showGreen () { showGreen () {

View File

@@ -365,5 +365,6 @@
"assignedDateAndUser": "Assigned by <strong>@<%- username %></strong> on <strong><%= date %></strong>", "assignedDateAndUser": "Assigned by <strong>@<%- username %></strong> on <strong><%= date %></strong>",
"claimRewards": "Claim Rewards", "claimRewards": "Claim Rewards",
"dayStart": "<strong>Day start</strong>: <%= startTime %>", "dayStart": "<strong>Day start</strong>: <%= startTime %>",
"viewStatus": "View Status" "viewStatus": "View Status",
"lastCompleted": "Last completed"
} }