diff --git a/app/javascript/people/people_admin_tab.vue b/app/javascript/people/people_admin_tab.vue index a1ef304ec..31f519b03 100644 --- a/app/javascript/people/people_admin_tab.vue +++ b/app/javascript/people/people_admin_tab.vue @@ -1,18 +1,20 @@ @@ -20,6 +22,7 @@ import { makeSelectedFieldMixin } from '@/mixins' import { modelMixinNoProp } from '@/store/model.mixin'; import { personModel as model } from '@/store/person.store'; +import { PERSON_CON_STATE } from '@/constants/strings'; const commentsMixin = makeSelectedFieldMixin('comments'); export default { @@ -29,8 +32,14 @@ export default { commentsMixin ], data: () => ({ - model - }) + model, + PERSON_CON_STATE + }), + computed: { + conventionClasses() { + return (Object.values(this.selected.convention_roles) || []).map(r => r.role[0].toUpperCase() + r.role.substring(1)).join(', ') + } + } } diff --git a/app/javascript/people/person_tabs.vue b/app/javascript/people/person_tabs.vue index c730b65fa..c9c6f6dee 100644 --- a/app/javascript/people/person_tabs.vue +++ b/app/javascript/people/person_tabs.vue @@ -85,17 +85,6 @@ import VueRouter from 'vue-router'; import { mapActions } from 'vuex'; const { isNavigationFailure, NavigationFailureType } = VueRouter; -// This needs to be kept in sync with the tab order above -const tabsArray = [ - 'edit', - 'other', - 'availability', - 'session-selection', - 'session-ranking', - 'schedule', - 'draft-schedule', - 'admin' -] export default { name: "PeopleTabs", @@ -124,6 +113,23 @@ export default { sessionAssignmentModel, }), computed: { + tabsArray() { + const baseTabs = [ + 'edit', + 'other', + 'availability', + 'session-selection', + 'session-ranking', + 'admin' + ] + if (this.displayDraftSchedule) { + baseTabs.splice(5, 0, 'draft_schedule') + } + if (this.currentUserIsAdmin || this.currentUserIsStaff || this.firmSchedule) { + baseTabs.splice(5, 0, 'schedule') + } + return baseTabs; + }, person() { return this.selected_model(personModel); }, @@ -162,7 +168,7 @@ export default { // change the router path to match the current tab // so that reloads work right // IF YOU ADD A TAB make sure you update the tabsArray or badness will happen - let path = tabsArray[newTab]; + let path = this.tabsArray[newTab]; const pathStart = this.$route.path.split('/')[1]; if (newTab === '0' && pathStart !== 'people') { path = '';