mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fix(groups): style and data sync fixes
This commit is contained in:
@@ -44,31 +44,37 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="assignedUsersCount > 0"
|
v-if="assignedUsersCount > 0"
|
||||||
class="svg-icon icon-16 ml-2 users-icon"
|
class="svg-icon icon-16 ml-2 users-icon color"
|
||||||
:class="{'green-50': completionsCount === assignedUsersCount}"
|
:class="{'green-10': completionsCount === assignedUsersCount}"
|
||||||
v-html="icons.users"
|
v-html="icons.users"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
class="mr-auto ml-1 my-auto"
|
class="mr-auto ml-1 my-auto"
|
||||||
:class="{'green-10': showGreen}"
|
:class="{'green-10': completionsCount === assignedUsersCount}"
|
||||||
v-html="message"
|
v-html="message"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
class="ml-auto mr-1 my-auto"
|
class="d-flex ml-auto mr-1 my-auto"
|
||||||
v-if="task.group.assignedUsers && ['daily','todo'].indexOf(task.type) !== -1"
|
v-if="task.group.assignedUsers && ['daily','todo'].indexOf(task.type) !== -1"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-if="assignedUsersCount > 1"
|
v-if="assignedUsersCount > 1"
|
||||||
class="mr-1 d-inline-flex align-items-center"
|
class="d-flex mr-1 my-auto"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="small-check"
|
class="small-check"
|
||||||
v-if="!showStatus && completionsCount"
|
v-if="!showStatus && completionsCount"
|
||||||
:class="{'green-50': completionsCount === assignedUsersCount}"
|
>
|
||||||
v-html="icons.check"
|
<div
|
||||||
></span>
|
class="svg-icon color"
|
||||||
|
:class="{'green-10': completionsCount === assignedUsersCount}"
|
||||||
|
v-html="icons.check"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
<span
|
<span
|
||||||
class="ml-1 mr-2"
|
class="ml-1 mr-2 my-auto"
|
||||||
|
:class="{'green-10': completionsCount === assignedUsersCount}"
|
||||||
v-if="!showStatus && completionsCount"
|
v-if="!showStatus && completionsCount"
|
||||||
>
|
>
|
||||||
{{ completionsCount }}/{{ assignedUsersCount }}
|
{{ completionsCount }}/{{ assignedUsersCount }}
|
||||||
@@ -95,12 +101,12 @@
|
|||||||
<span
|
<span
|
||||||
v-html="icons.lastComplete"
|
v-html="icons.lastComplete"
|
||||||
v-b-tooltip.hover.bottom="$t('lastCompleted')"
|
v-b-tooltip.hover.bottom="$t('lastCompleted')"
|
||||||
class="last-completed"
|
class="svg-icon color last-completed mr-1 my-auto"
|
||||||
:class="{'gray-200': !showGreen}"
|
:class="{'gray-200': completionsCount !== assignedUsersCount}"
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
:class="{'green-10': showGreen}"
|
:class="{'green-10': completionsCount === assignedUsersCount}"
|
||||||
>
|
>
|
||||||
{{ formattedCompletionTime }}
|
{{ formattedCompletionTime }}
|
||||||
</span>
|
</span>
|
||||||
@@ -110,39 +116,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.gray-200 > svg > g > path {
|
|
||||||
fill: #878190;
|
|
||||||
}
|
|
||||||
|
|
||||||
.green-50 > svg > g > g {
|
|
||||||
fill: #20b780;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-check {
|
|
||||||
display: inline-flex;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
border-radius: 2px;
|
|
||||||
padding-left: 2px;
|
|
||||||
padding-top: 1px;
|
|
||||||
background-color: #e1e0e3;
|
|
||||||
|
|
||||||
svg {
|
|
||||||
margin: auto;
|
|
||||||
width: 8px;
|
|
||||||
|
|
||||||
path {
|
|
||||||
fill: #878190;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.green-50 svg path {
|
|
||||||
fill: #20b780;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '~@/assets/scss/colors.scss';
|
@import '~@/assets/scss/colors.scss';
|
||||||
.claim-bottom-message {
|
.claim-bottom-message {
|
||||||
@@ -222,6 +195,20 @@
|
|||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.small-check {
|
||||||
|
display: inline-flex;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
border-radius: 2px;
|
||||||
|
background-color: $gray-500;
|
||||||
|
|
||||||
|
.svg-icon {
|
||||||
|
width: 8px;
|
||||||
|
height: 6px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.users-icon {
|
.users-icon {
|
||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
}
|
}
|
||||||
@@ -327,11 +314,6 @@ export default {
|
|||||||
if (completion) return completion.completedDate;
|
if (completion) return completion.completedDate;
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
showGreen () {
|
|
||||||
if (this.assignedUsersCount !== 1) return false;
|
|
||||||
return this.singleAssignLastDone
|
|
||||||
&& this.task?.group?.assignedUsersDetail[this.user._id].completed;
|
|
||||||
},
|
|
||||||
formattedCompletionTime () {
|
formattedCompletionTime () {
|
||||||
if (!this.singleAssignLastDone) return '';
|
if (!this.singleAssignLastDone) return '';
|
||||||
if (moment().diff(this.singleAssignLastDone, 'days') < 1) {
|
if (moment().diff(this.singleAssignLastDone, 'days') < 1) {
|
||||||
|
|||||||
@@ -8,15 +8,16 @@
|
|||||||
:text="$t('checklist')"
|
:text="$t('checklist')"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="svg-icon icon-16 my-auto ml-auto"
|
class="svg-icon icon-16 my-auto ml-auto pointer"
|
||||||
:class="{'chevron-flip': !hideChecklist}"
|
:class="{'chevron-flip': showChecklist}"
|
||||||
v-html="icons.chevron"
|
v-html="icons.chevron"
|
||||||
@click="hideChecklist = !hideChecklist"
|
@click="showChecklist = !showChecklist"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<b-collapse
|
||||||
v-if="!hideChecklist"
|
id="checklistCollapse"
|
||||||
|
v-model="showChecklist"
|
||||||
>
|
>
|
||||||
<draggable
|
<draggable
|
||||||
v-model="checklist"
|
v-model="checklist"
|
||||||
@@ -91,7 +92,7 @@
|
|||||||
@blur="addChecklistItem($event, false)"
|
@blur="addChecklistItem($event, false)"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</b-collapse>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -131,7 +132,7 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
checklist: this.items,
|
checklist: this.items,
|
||||||
hideChecklist: false,
|
showChecklist: true,
|
||||||
hasPossibilityOfIMEConversion: true,
|
hasPossibilityOfIMEConversion: true,
|
||||||
newChecklistItem: null,
|
newChecklistItem: null,
|
||||||
icons: Object.freeze({
|
icons: Object.freeze({
|
||||||
@@ -193,14 +194,18 @@ export default {
|
|||||||
transform: translateY(-5px) rotate(180deg);
|
transform: translateY(-5px) rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-border {
|
|
||||||
border-top: 1px solid $gray-500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lock-icon {
|
.lock-icon {
|
||||||
color: $gray-200;
|
color: $gray-200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pointer {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-border {
|
||||||
|
border-top: 1px solid $gray-500;
|
||||||
|
}
|
||||||
|
|
||||||
.checklist-group {
|
.checklist-group {
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
border-bottom: 1px solid $gray-500;
|
border-bottom: 1px solid $gray-500;
|
||||||
|
|||||||
@@ -1061,7 +1061,7 @@ export default {
|
|||||||
},
|
},
|
||||||
isOpenTask () {
|
isOpenTask () {
|
||||||
if (!this.isGroupTask) return false;
|
if (!this.isGroupTask) return false;
|
||||||
if (this.task.group.assignedUsers.length > 0) return false;
|
if (this.task?.group?.assignedUsers?.length > 0) return false;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
showCheckIcon () {
|
showCheckIcon () {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<b-modal
|
<b-modal
|
||||||
id="task-summary"
|
id="task-summary"
|
||||||
:hide-footer="true"
|
:hide-footer="true"
|
||||||
@show="syncTask()"
|
|
||||||
@hidden="$emit('cancel')"
|
@hidden="$emit('cancel')"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -58,18 +57,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="summary-block"
|
class="summary-block"
|
||||||
v-if="assignedMembers.length > 0"
|
v-if="assignedUsernames.length > 0"
|
||||||
>
|
>
|
||||||
<h3> {{ $t('assignedTo') }} </h3>
|
<h3> {{ $t('assignedTo') }} </h3>
|
||||||
<div
|
<div
|
||||||
class="d-flex flex-wrap"
|
class="d-flex flex-wrap"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-for="member in assignedMembers"
|
v-for="member in assignedUsernames"
|
||||||
:key="member"
|
:key="member"
|
||||||
class="assigned-member py-1 px-75 mr-1"
|
class="assigned-member py-1 px-75 mr-1"
|
||||||
v-html="memberNamesById[member]"
|
|
||||||
>
|
>
|
||||||
|
@{{ member }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -139,6 +138,7 @@
|
|||||||
width: 16px;
|
width: 16px;
|
||||||
position: relative;
|
position: relative;
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover, &:focus {
|
&:hover, &:focus {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@@ -180,7 +180,6 @@ import moment from 'moment';
|
|||||||
import pickBy from 'lodash/pickBy';
|
import pickBy from 'lodash/pickBy';
|
||||||
|
|
||||||
import checklist from './modal-controls/checklist';
|
import checklist from './modal-controls/checklist';
|
||||||
import syncTask from '../../mixins/syncTask';
|
|
||||||
import { mapGetters, mapState } from '@/libs/store';
|
import { mapGetters, mapState } from '@/libs/store';
|
||||||
|
|
||||||
import closeIcon from '@/assets/svg/close.svg';
|
import closeIcon from '@/assets/svg/close.svg';
|
||||||
@@ -189,7 +188,6 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
checklist,
|
checklist,
|
||||||
},
|
},
|
||||||
mixins: [syncTask],
|
|
||||||
props: ['task'],
|
props: ['task'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@@ -205,10 +203,6 @@ export default {
|
|||||||
icons: Object.freeze({
|
icons: Object.freeze({
|
||||||
close: closeIcon,
|
close: closeIcon,
|
||||||
}),
|
}),
|
||||||
assignedMembers: [],
|
|
||||||
members: [],
|
|
||||||
membersNameAndId: [],
|
|
||||||
memberNamesById: {},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -218,6 +212,14 @@ export default {
|
|||||||
...mapState({
|
...mapState({
|
||||||
user: 'user.data',
|
user: 'user.data',
|
||||||
}),
|
}),
|
||||||
|
assignedUsernames () {
|
||||||
|
if (!this.task.group || !this.task.group.assignedUsers) return [];
|
||||||
|
const usernames = [];
|
||||||
|
for (const user of this.task.group.assignedUsers) {
|
||||||
|
usernames.push(this.task.group.assignedUsersDetail[user].assignedUsername);
|
||||||
|
}
|
||||||
|
return usernames;
|
||||||
|
},
|
||||||
summarySentence () {
|
summarySentence () {
|
||||||
if (this.task.type === 'daily' && moment().isBefore(this.task.startDate)) {
|
if (this.task.type === 'daily' && moment().isBefore(this.task.startDate)) {
|
||||||
return `This is ${this.formattedDifficulty(this.task.priority)} task that will repeat
|
return `This is ${this.formattedDifficulty(this.task.priority)} task that will repeat
|
||||||
|
|||||||
Reference in New Issue
Block a user