mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
WIP(teams): updated completion states
and fixed an issue with cron saving
This commit is contained in:
@@ -55,8 +55,9 @@ async function updateTeamTasks (team) {
|
||||
for (const assignedUser in daily.group.assignedUsers) {
|
||||
if (Object.prototype.hasOwnProperty.call(daily.group.assignedUsers, assignedUser)) {
|
||||
assignments += 1;
|
||||
if (assignedUser.completed) completions += 1;
|
||||
assignedUser.completed = false;
|
||||
if (daily.group.assignedUsers[assignedUser].completed) completions += 1;
|
||||
daily.group.assignedUsers[assignedUser].completed = false;
|
||||
daily.markModified('group.assignedUsers');
|
||||
}
|
||||
}
|
||||
processChecklist = true;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
<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="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>
|
||||
<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"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 325 B |
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
<div
|
||||
v-if='completion.completedDate'
|
||||
:class="{'green-10': completion.completedToday}"
|
||||
:class="{'green-10': completion.completed}"
|
||||
>
|
||||
{{ completion.completedDateString }}
|
||||
</div>
|
||||
@@ -44,7 +44,7 @@
|
||||
>
|
||||
<div
|
||||
class="mr-auto ml-2"
|
||||
:class="{'green-10': showGreen && task.type === 'todo'}"
|
||||
:class="{'green-10': showGreen}"
|
||||
v-html="message"
|
||||
></div>
|
||||
<div
|
||||
@@ -82,17 +82,18 @@
|
||||
</a>
|
||||
</span>
|
||||
<span
|
||||
v-if="assignedUsersCount === 1 && task.type === 'daily'"
|
||||
v-if="assignedUsersCount === 1 && task.type === 'daily' && !task.completed"
|
||||
class="mr-1 d-inline-flex"
|
||||
>
|
||||
<span
|
||||
v-if="singleAssignLastDone"
|
||||
v-html="icons.lastComplete"
|
||||
v-b-tooltip.hover.bottom="$t('lastCompleted')"
|
||||
class="last-completed mr-1"
|
||||
:class="{'gray-200': !showGreen}"
|
||||
>
|
||||
</span>
|
||||
<span
|
||||
class="my-auto"
|
||||
:class="{'green-10': showGreen}"
|
||||
>
|
||||
{{ formattedCompletionTime }}
|
||||
@@ -142,6 +143,7 @@
|
||||
padding-bottom: 0.25rem;
|
||||
padding-top: 0.25rem;
|
||||
z-index: 9;
|
||||
height: 24px;
|
||||
|
||||
.blue-10 {
|
||||
color: $blue-10;
|
||||
@@ -206,10 +208,7 @@
|
||||
.last-completed {
|
||||
width: 16px;
|
||||
height: 14px;
|
||||
|
||||
+ .green-10 {
|
||||
margin-top: 1px;
|
||||
}
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -277,7 +276,6 @@ export default {
|
||||
completed: this.task.group.assignedUsers[userId].completed,
|
||||
completedDate,
|
||||
completedDateString,
|
||||
completedToday: moment().diff(completedDate, 'days') === 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -297,7 +295,7 @@ export default {
|
||||
);
|
||||
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];
|
||||
if (this.userIsAssigned) {
|
||||
if (moment().diff(completedDate, 'days') > 0) {
|
||||
@@ -320,7 +318,6 @@ export default {
|
||||
singleAssignLastDone () {
|
||||
const userId = this.assignedUsersKeys[0];
|
||||
const completion = this.task.group.assignedUsers[userId];
|
||||
if (!completion.completed) return null;
|
||||
return completion.completedDate;
|
||||
},
|
||||
showGreen () {
|
||||
|
||||
@@ -365,5 +365,6 @@
|
||||
"assignedDateAndUser": "Assigned by <strong>@<%- username %></strong> on <strong><%= date %></strong>",
|
||||
"claimRewards": "Claim Rewards",
|
||||
"dayStart": "<strong>Day start</strong>: <%= startTime %>",
|
||||
"viewStatus": "View Status"
|
||||
"viewStatus": "View Status",
|
||||
"lastCompleted": "Last completed"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user