mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Client: async resources, make store reusable, move plugins and add getTaskFor getter (#8575)
Add library to manage async resource Make Store reusable for easier testing Move plugin to libs Add getTaskFor getter with tests
This commit is contained in:
@@ -17,19 +17,17 @@ li
|
||||
li(v-if="task.type === 'todo'") due date: {{task.date}}
|
||||
li attribute {{task.attribute}}
|
||||
li difficulty {{task.priority}}
|
||||
li tags {{taskTags}}
|
||||
li tags {{getTagsFor(task)}}
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'client/libs/store';
|
||||
|
||||
export default {
|
||||
props: ['task'],
|
||||
computed: {
|
||||
taskTags () {
|
||||
let taskTags = this.task.tags;
|
||||
return this.$store.state.user.tags
|
||||
.filter(tag => taskTags.indexOf(tag.id) !== -1)
|
||||
.map(tag => tag.name);
|
||||
},
|
||||
...mapState({user: 'user.data'}),
|
||||
...mapGetters({getTagsFor: 'tasks:getTagsFor'}),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user