[permissions] Fixed permission parsing

This commit is contained in:
Ferdinand Thiessen 2021-11-13 14:52:50 +01:00
parent 3db6e0d2d1
commit 9331006db3
2 changed files with 6 additions and 14 deletions

View File

@ -108,7 +108,7 @@ export default defineComponent({
const calendarRealView = computed(() => (calendarDays.value != 7 ? 'day' : 'week'));
const calendarDays = computed(() =>
// <= 1023 is the breakpoint for sm to md
calendarView.value == 'day' ? 1 : windowWidth.value <= 1023 ? 3 : 7
calendarView.value == 'day' ? 1 : (windowWidth.value <= 1023 ? 3 : 7)
);
const events = ref<Agendas>({});
const editor = ref<FG.Event | undefined>(undefined);

View File

@ -38,7 +38,7 @@
<EventTypes />
</q-tab-panel>
<q-tab-panel name="jobtypes">
<JobTypes v-if="canEditJobTypes" />
<JobTypes />
</q-tab-panel>
</q-tab-panels>
</q-page>
@ -58,18 +58,11 @@ export default defineComponent({
name: 'EventManagement',
components: { EditEvent, EventTypes, JobTypes },
setup() {
const canEditJobTypes = computed(() => hasPermission(PERMISSIONS.JOB_TYPE));
interface Tab {
name: string;
label: string;
}
const tabs: Tab[] = [
const tabs = computed(() => [
{ name: 'create', label: 'Veranstaltungen' },
{ name: 'eventtypes', label: 'Veranstaltungsarten' },
{ name: 'jobtypes', label: 'Dienstarten' },
];
...(hasPermission(PERMISSIONS.JOB_TYPE) ? [{ name: 'jobtypes', label: 'Dienstarten' }] : []),
...(hasPermission(PERMISSIONS.EVENT_TYPE) ? [{ name: 'eventtypes', label: 'Veranstaltungsarten' }] : [])
]);
const drawer = ref<boolean>(false);
@ -85,7 +78,6 @@ export default defineComponent({
const tab = ref<string>('create');
return {
canEditJobTypes,
showDrawer,
tab,
tabs,