Skip to content

Commit

Permalink
Merge pull request #490 from ChicagoWorldcon/PLAN-593-participant-sta…
Browse files Browse the repository at this point in the history
…tus-display

PLAN-593 add status display to admin tab
  • Loading branch information
Gailbear authored Jul 27, 2022
2 parents 965e97b + af422ec commit 6d53f9c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 27 deletions.
39 changes: 24 additions & 15 deletions app/javascript/people/people_admin_tab.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
<template>
<div class="container-fluid">
<dl class="row">
<dt class="col-sm-4">Convention Class:</dt>
<dd class="col-sm-8">
<span v-for="role of selected.convention_roles" :key="role.id">
{{ role.role }}
</span>
</dd>
<dt class="col-sm-12">Comments:</dt>
<dd class="col-sm-12">
<b-form-textarea v-model="comments"></b-form-textarea>
<b-button class="float-right mt-1" @click="patchSelected({comments})" variant="primary">Save Comments</b-button>
</dd>
</dl>
<dl class="row">
<div class="col-12 col-sm-6 col-lg-4">
<dt>Status</dt>
<dd class="font-italic ml-2">{{PERSON_CON_STATE[selected.con_state || 'not_set']}}</dd>
</div>
<div class="col-12 col-sm-6 col-lg-4">
<dt>Convention Class</dt>
<dd class="font-italic ml-2">{{conventionClasses}}</dd>
</div>
<dt class="col-12 mt-2">Comments</dt>
<dd class="col-12">
<b-form-textarea v-model="comments"></b-form-textarea>
<b-button class="float-right mt-1" @click="patchSelected({comments})" variant="primary">Save Comments</b-button>
</dd>
</dl>
</div>
</template>

<script>
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 {
Expand All @@ -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(', ')
}
}
}
</script>

Expand Down
30 changes: 18 additions & 12 deletions app/javascript/people/person_tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
},
Expand Down Expand Up @@ -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 = '';
Expand Down

0 comments on commit 6d53f9c

Please sign in to comment.