Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | import Vue from 'vue'; // eslint-disable-next-line no-restricted-imports import { mapActions, mapState } from 'vuex'; import { parseBoolean } from '~/lib/utils/common_utils'; import AwardsList from '~/vue_shared/components/awards_list.vue'; import createstore from './store'; export default (el) => { if (!el) return null; const { dataset: { path, newCustomEmojiPath }, } = el; const canAwardEmoji = parseBoolean(el.dataset.canAwardEmoji); const showDefaultAwardEmojis = parseBoolean(el.dataset.showDefaultAwardEmojis); return new Vue({ el, name: 'AwardsListRoot', store: createstore(), provide: { newCustomEmojiPath, }, computed: { ...mapState(['currentUserId', 'canAwardEmoji', 'awards']), }, created() { this.setInitialData({ path, currentUserId: window.gon.current_user_id, canAwardEmoji }); }, mounted() { this.fetchAwards(); }, methods: { ...mapActions(['setInitialData', 'fetchAwards', 'toggleAward']), }, render(createElement) { return createElement(AwardsList, { props: { awards: this.awards, canAwardEmoji: this.canAwardEmoji, currentUserId: this.currentUserId, defaultAwards: showDefaultAwardEmojis ? ['thumbsup', 'thumbsdown'] : [], selectedClass: 'selected', }, on: { award: this.toggleAward, }, }); }, }); }; |