From 577e6f005ee76421d179a7bd5bfc3c30754de651 Mon Sep 17 00:00:00 2001 From: Laurel Thomson <31464777+laurel-thomson@users.noreply.github.com> Date: Mon, 20 Apr 2020 08:23:40 -0700 Subject: [PATCH] Fixing the equipment popover message when equipment is from a different class - Fixes #11988 (#11993) * Updating the equipment attributes popover to display the correct message when the equipment doesn't match the user's class * Rewriting 'is wrong class' and abstracting logic into computed property of shop item * Moving isWrongClass computed function from shopItem to popoverAttribute component * Reverting accidental whitespace change * Adding newline to end of profile.vue to get client to compile * Reverting profile.vue back to develop branch Co-authored-by: Laurel Thomson --- .../components/inventory/equipment/attributesPopover.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/website/client/src/components/inventory/equipment/attributesPopover.vue b/website/client/src/components/inventory/equipment/attributesPopover.vue index 4672bddd6f..335405f909 100644 --- a/website/client/src/components/inventory/equipment/attributesPopover.vue +++ b/website/client/src/components/inventory/equipment/attributesPopover.vue @@ -5,7 +5,7 @@ {{ `${$t('lockedItem')}` }}
{{ `${$t('classLockedItem')}` }} @@ -71,6 +71,11 @@ export default { } return this.item.notes; }, + isWrongClass () { + const wrongKlass = this.item.klass && !['special', 'armoire', this.user.stats.class].includes(this.item.klass); + const wrongSpecialClass = this.item.klass === 'special' && this.item.specialClass && this.item.specialClass !== this.user.stats.class; + return wrongKlass || wrongSpecialClass; + }, }, };