From 98fd509530a2222f162116bf2fe9369dcae28aa9 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Fri, 15 Feb 2019 16:01:33 -0600 Subject: [PATCH] Hotfix: correct issues from PRs rollout (#10993) * fix(various): correct issues from PRs rollout 1. Send Gems modal opens from profiles again 2. Contributor titles appear on hover again 3. Tags dropdown in tasks appears again 4. Only user's own @mentions get highlighted again * fix(test): correct order of css classes in expect --- test/client/unit/specs/libs/highlightUsers.js | 10 +++++----- website/client/components/header/menu.vue | 9 ++++++--- website/client/components/payments/sendGemsModal.vue | 8 +++++++- website/client/components/tasks/taskModal.vue | 2 +- website/client/components/userLink.vue | 2 +- website/client/components/userMenu/profile.vue | 7 +------ website/client/libs/highlightUsers.js | 5 ++--- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/test/client/unit/specs/libs/highlightUsers.js b/test/client/unit/specs/libs/highlightUsers.js index 22d33564a7..a1e24d03d8 100644 --- a/test/client/unit/specs/libs/highlightUsers.js +++ b/test/client/unit/specs/libs/highlightUsers.js @@ -7,14 +7,14 @@ describe('highlightUserAndEmail', () => { const result = highlightUsers(text, 'user', 'displayedUser'); - expect(result).to.contain('@displayedUser'); + expect(result).to.contain('@displayedUser'); }); it('highlights username', () => { const text = 'hello @user'; const result = highlightUsers(text, 'user', 'displayedUser'); - expect(result).to.contain('@user'); + expect(result).to.contain('@user'); }); it('not highlights any email', () => { @@ -32,8 +32,8 @@ describe('highlightUserAndEmail', () => { const result = highlightUsers(text, 'use', 'mentions'); - expect(result).to.contain('@mentions'); - expect(result).to.contain('@use'); - expect(result).to.not.contain('@mentions.com'); + expect(result).to.contain('@mentions'); + expect(result).to.contain('@use'); + expect(result).to.not.contain('@mentions.com'); }); }); diff --git a/website/client/components/header/menu.vue b/website/client/components/header/menu.vue index 040557c5c9..67dcb5a82b 100644 --- a/website/client/components/header/menu.vue +++ b/website/client/components/header/menu.vue @@ -3,6 +3,7 @@ div inbox-modal creator-intro profileModal + send-gems-modal b-navbar.topbar.navbar-inverse.static-top.navbar-expand-lg(type="dark", :class="navbarZIndexClass") b-navbar-brand.brand .logo.svg-icon.d-none.d-xl-block(v-html="icons.logo") @@ -343,19 +344,21 @@ import syncIcon from 'assets/svg/sync.svg'; import svgHourglasses from 'assets/svg/hourglass.svg'; import logo from 'assets/svg/logo.svg'; +import creatorIntro from '../creatorIntro'; import InboxModal from '../userMenu/inbox.vue'; import notificationMenu from './notificationsDropdown'; -import creatorIntro from '../creatorIntro'; import profileModal from '../userMenu/profileModal'; +import sendGemsModal from 'client/components/payments/sendGemsModal'; import userDropdown from './userDropdown'; export default { components: { - userDropdown, + creatorIntro, InboxModal, notificationMenu, - creatorIntro, profileModal, + sendGemsModal, + userDropdown, }, data () { return { diff --git a/website/client/components/payments/sendGemsModal.vue b/website/client/components/payments/sendGemsModal.vue index 4933232f98..b03f521f57 100644 --- a/website/client/components/payments/sendGemsModal.vue +++ b/website/client/components/payments/sendGemsModal.vue @@ -91,7 +91,6 @@ import notificationsMixin from 'client/mixins/notifications'; const TECH_ASSISTANCE_EMAIL = 'admin@habitica.com'; export default { - props: ['userReceivingGems'], mixins: [paymentsMixin, notificationsMixin], data () { return { @@ -110,6 +109,7 @@ export default { hrefTechAssistanceEmail: `${TECH_ASSISTANCE_EMAIL}`, }, sendingInProgress: false, + userReceivingGems: null, }; }, computed: { @@ -176,5 +176,11 @@ export default { this.$root.$emit('bv::hide::modal', 'send-gems'); }, }, + mounted () { + this.$root.$on('habitica::send-gems', (data) => { + this.userReceivingGems = data; + this.$root.$emit('bv::show::modal', 'send-gems'); + }); + }, }; diff --git a/website/client/components/tasks/taskModal.vue b/website/client/components/tasks/taskModal.vue index f4777f84ce..793ffeafe3 100644 --- a/website/client/components/tasks/taskModal.vue +++ b/website/client/components/tasks/taskModal.vue @@ -1009,7 +1009,7 @@ export default { } }, handleClick (e) { - if (this.$refs.popup && !this.$refs.popup.$el.contains(e.target)) { + if (this.$refs.popup && !this.$refs.popup.$el.parentNode.contains(e.target)) { this.closeTagsPopup(); } }, diff --git a/website/client/components/userLink.vue b/website/client/components/userLink.vue index b8d4dc397a..a0fbc576d2 100644 --- a/website/client/components/userLink.vue +++ b/website/client/components/userLink.vue @@ -103,7 +103,7 @@ return this.icons[`tier${this.level}`]; }, tierTitle () { - return achievementsLib.getContribText(this.level, this.isNPC) || ''; + return achievementsLib.getContribText(this.contributor, this.isNPC) || ''; }, levelStyle () { return this.userLevelStyleFromLevel(this.level, this.isNPC); diff --git a/website/client/components/userMenu/profile.vue b/website/client/components/userMenu/profile.vue index df5a0a924e..cf544bfbda 100644 --- a/website/client/components/userMenu/profile.vue +++ b/website/client/components/userMenu/profile.vue @@ -136,7 +136,6 @@ v-show='selectedPage === "stats"', :showAllocation='showAllocation()', v-if='user.preferences') - send-gems-modal(:userReceivingGems='userReceivingGems')