Compare commits
No commits in common. "036b97f8e40e46c17fbb3792b177ae0e28162bcb" and "25be3947a6839df073cf50faf1d3e2958aa368b1" have entirely different histories.
036b97f8e4
...
25be3947a6
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "1.0.0-alpha.5",
|
"version": "1.0.0-alpha.4",
|
||||||
"name": "@flaschengeist/users",
|
"name": "@flaschengeist/users",
|
||||||
"author": "Ferdinand Thiessen <rpm@fthiessen.de>",
|
"author": "Ferdinand Thiessen <rpm@fthiessen.de>",
|
||||||
"homepage": "https://flaschengeist.dev/Flaschengeist",
|
"homepage": "https://flaschengeist.dev/Flaschengeist",
|
||||||
|
|
|
@ -45,8 +45,6 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Screen } from 'quasar';
|
import { Screen } from 'quasar';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
|
||||||
import { onBeforeMount, watch } from 'vue';
|
|
||||||
import { PERMISSIONS } from '../permissions';
|
import { PERMISSIONS } from '../permissions';
|
||||||
import NewUser from '../components/NewUser.vue';
|
import NewUser from '../components/NewUser.vue';
|
||||||
import { hasPermission } from '@flaschengeist/api';
|
import { hasPermission } from '@flaschengeist/api';
|
||||||
|
@ -59,8 +57,6 @@ export default defineComponent({
|
||||||
components: { RoleSettings, UpdateUser, NewUser },
|
components: { RoleSettings, UpdateUser, NewUser },
|
||||||
setup() {
|
setup() {
|
||||||
const canEditRoles = computed(() => hasPermission(PERMISSIONS.ROLES_EDIT));
|
const canEditRoles = computed(() => hasPermission(PERMISSIONS.ROLES_EDIT));
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
interface Tab {
|
interface Tab {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -78,16 +74,6 @@ export default defineComponent({
|
||||||
{ name: 'roles', label: 'Rollen', permissions: [PERMISSIONS.ROLES_EDIT] },
|
{ name: 'roles', label: 'Rollen', permissions: [PERMISSIONS.ROLES_EDIT] },
|
||||||
];
|
];
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
|
||||||
if (
|
|
||||||
route.query.keys?.length === 0 ||
|
|
||||||
!tabs.some((value) => value.name == route.query.q_tab)
|
|
||||||
) {
|
|
||||||
await router.replace({ query: { q_tab: 'user' } });
|
|
||||||
}
|
|
||||||
tab.value = route.query.q_tab as string;
|
|
||||||
});
|
|
||||||
|
|
||||||
const _tabs = computed(() =>
|
const _tabs = computed(() =>
|
||||||
tabs.filter((tab) => {
|
tabs.filter((tab) => {
|
||||||
return tab.permissions.every((permission) => hasPermission(permission));
|
return tab.permissions.every((permission) => hasPermission(permission));
|
||||||
|
@ -107,10 +93,6 @@ export default defineComponent({
|
||||||
|
|
||||||
const tab = ref<string>('user');
|
const tab = ref<string>('user');
|
||||||
|
|
||||||
watch(tab, async (val) => {
|
|
||||||
await router.replace({ query: { q_tab: val } });
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
canEditRoles,
|
canEditRoles,
|
||||||
showDrawer,
|
showDrawer,
|
||||||
|
|
Loading…
Reference in New Issue