Tasks: fixes and new edit task design (#9442)

* add missing tooltips

* makes sure due date is update correctly, fixes #9436

* do not collapse checklist when casting spells, fixes #9345

* start to fix spells drawer

* fix drawer requiring two clicks to open
This commit is contained in:
Matteo Pagliazzi
2017-11-09 19:38:48 +01:00
committed by GitHub
parent 03a09b7546
commit d8d7a81edf
5 changed files with 20 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
<template lang="pug"> <template lang="pug">
menu-dropdown.item-notifications(:right="true") menu-dropdown.item-notifications(:right="true")
div(slot="dropdown-toggle") div(slot="dropdown-toggle")
div div(v-b-tooltip.hover.bottom="$t('notifications')")
message-count(v-if='notificationsCount > 0', :count="notificationsCount", :top="true") message-count(v-if='notificationsCount > 0', :count="notificationsCount", :top="true")
.svg-icon.notifications(v-html="icons.notifications") .svg-icon.notifications(v-html="icons.notifications")
div(slot="dropdown-content") div(slot="dropdown-content")
@@ -58,7 +58,6 @@ menu-dropdown.item-notifications(:right="true")
import axios from 'axios'; import axios from 'axios';
import isEmpty from 'lodash/isEmpty'; import isEmpty from 'lodash/isEmpty';
import map from 'lodash/map'; import map from 'lodash/map';
// import bTooltip from 'bootstrap-vue/lib/directives/tooltip';
import { mapState } from 'client/libs/store'; import { mapState } from 'client/libs/store';
import * as Analytics from 'client/libs/analytics'; import * as Analytics from 'client/libs/analytics';

View File

@@ -20,17 +20,17 @@
.is-buffed(v-if="isBuffed") .is-buffed(v-if="isBuffed")
.svg-icon(v-html="icons.buff") .svg-icon(v-html="icons.buff")
span.small-text.character-level {{ characterLevel }} span.small-text.character-level {{ characterLevel }}
.progress-container(b-tooltip.hover.bottom="$t('health')") .progress-container(v-b-tooltip.hover.bottom="$t('health')")
.svg-icon(v-html="icons.health") .svg-icon(v-html="icons.health")
.progress .progress
.progress-bar.bg-health(:style="{width: `${percent(member.stats.hp, MAX_HEALTH)}%`}") .progress-bar.bg-health(:style="{width: `${percent(member.stats.hp, MAX_HEALTH)}%`}")
span.small-text {{member.stats.hp | statFloor}} / {{MAX_HEALTH}} span.small-text {{member.stats.hp | statFloor}} / {{MAX_HEALTH}}
.progress-container(b-tooltip.hover.bottom="$t('experience')") .progress-container(v-b-tooltip.hover.bottom="$t('experience')")
.svg-icon(v-html="icons.experience") .svg-icon(v-html="icons.experience")
.progress .progress
.progress-bar.bg-experience(:style="{width: `${percent(member.stats.exp, toNextLevel)}%`}") .progress-bar.bg-experience(:style="{width: `${percent(member.stats.exp, toNextLevel)}%`}")
span.small-text {{member.stats.exp | statFloor}} / {{toNextLevel}} span.small-text {{member.stats.exp | statFloor}} / {{toNextLevel}}
.progress-container(v-if="hasClass", b-tooltip.hover.bottom="$t('mana')") .progress-container(v-if="hasClass", v-b-tooltip.hover.bottom="$t('mana')")
.svg-icon(v-html="icons.mana") .svg-icon(v-html="icons.mana")
.progress .progress
.progress-bar.bg-mana(:style="{width: `${percent(member.stats.mp, maxMP)}%`}") .progress-bar.bg-mana(:style="{width: `${percent(member.stats.mp, maxMP)}%`}")
@@ -186,7 +186,6 @@ import Profile from './userMenu/profile';
import { toNextLevel } from '../../common/script/statHelpers'; import { toNextLevel } from '../../common/script/statHelpers';
import statsComputed from '../../common/script/libs/statsComputed'; import statsComputed from '../../common/script/libs/statsComputed';
import percent from '../../common/script/libs/percent'; import percent from '../../common/script/libs/percent';
// import bTooltip from 'bootstrap-vue/lib/directives/tooltip';
import buffIcon from 'assets/svg/buff.svg'; import buffIcon from 'assets/svg/buff.svg';
import healthIcon from 'assets/svg/health.svg'; import healthIcon from 'assets/svg/health.svg';

View File

@@ -9,11 +9,14 @@ div(v-if='user.stats.lvl > 10')
.col-4.mana .col-4.mana
.img(:class='`shop_${spell.key} shop-sprite item-img`') .img(:class='`shop_${spell.key} shop-sprite item-img`')
drawer(:title="$t('skillsTitle')", drawer(
:title="$t('skillsTitle')",
v-if='user.stats.class && !user.preferences.disableClasses', v-if='user.stats.class && !user.preferences.disableClasses',
v-mousePosition="30", @mouseMoved="mouseMoved($event)", v-mousePosition="30",
@mouseMoved="mouseMoved($event)",
:openStatus='openStatus', :openStatus='openStatus',
v-on:toggled='drawerToggled') @toggled='drawerToggled'
)
div(slot="drawer-slider") div(slot="drawer-slider")
.container.spell-container .container.spell-container
.row .row

View File

@@ -56,10 +56,15 @@
.svg-icon(v-html="icons.checklist") .svg-icon(v-html="icons.checklist")
span {{ checklistProgress }} span {{ checklistProgress }}
label.custom-control.custom-checkbox.checklist-item( label.custom-control.custom-checkbox.checklist-item(
v-if='!castingSpell && !task.collapseChecklist', v-if='!task.collapseChecklist',
v-for="item in task.checklist", :class="{'checklist-item-done': item.completed}", v-for="item in task.checklist", :class="{'checklist-item-done': item.completed}",
) )
input.custom-control-input(type="checkbox", :checked="item.completed", @change="toggleChecklistItem(item)") input.custom-control-input(
type="checkbox",
:checked="item.completed",
@change="toggleChecklistItem(item)",
:disabled="castingSpell",
)
span.custom-control-indicator span.custom-control-indicator
span.custom-control-description(v-markdown='item.text') span.custom-control-description(v-markdown='item.text')
.icons.small-text.d-flex.align-items-center .icons.small-text.d-flex.align-items-center
@@ -593,7 +598,8 @@ export default {
return moment().diff(this.task.date, 'days') >= 0; return moment().diff(this.task.date, 'days') >= 0;
}, },
dueIn () { dueIn () {
const dueIn = moment().to(this.task.date); // this.task && is necessary to make sure the computed property updates correctly
const dueIn = moment().to(this.task && this.task.date);
return this.$t('dueIn', {dueIn}); return this.$t('dueIn', {dueIn});
}, },
hasTags () { hasTags () {

View File

@@ -179,7 +179,7 @@ export default {
standardPage.style.paddingBottom = `${drawerHeight + minPaddingBottom}px`; standardPage.style.paddingBottom = `${drawerHeight + minPaddingBottom}px`;
}, },
toggle () { toggle () {
this.open = !this.open; this.open = !this.isOpen;
this.$emit('toggled', this.open); this.$emit('toggled', this.open);
}, },
}, },