mirror of
https://github.com/directus/directus.git
synced 2026-02-19 10:14:33 -05:00
Users nav (#400)
* Add filters-to-query util * Add all users string * Suppot filters in tabular layout * Sync filters with collection presets * Support filters in use-items composition * Render users nav + use skeleton loader * Add list-item-icon type to skeleton loader * Fix missing loader indicator on table * Cleanup has click check * Dont route based on id * Fix loading state in table * Revert "Dont route based on id" This reverts commit 6de7cbe1b801d5e5e267f09a6e77dc73dcc60a37. * Fix table loading state * Fix routing for users module * Force role field to be fetched * Add roles store * Dont render avatar until user is known * Speed up hydration absurd much * Rely on roles store to prevent nav from loading * Fix tests
This commit is contained in:
@@ -127,6 +127,7 @@ describe('Views / Private / Module Bar Avatar', () => {
|
||||
userStore.state.currentUser = {
|
||||
id: 1,
|
||||
avatar: null,
|
||||
role: { id: 15 },
|
||||
} as any;
|
||||
|
||||
const component = shallowMount(ModuleBarAvatar, {
|
||||
@@ -137,7 +138,7 @@ describe('Views / Private / Module Bar Avatar', () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect((component.vm as any).userProfileLink).toBe('/my-project/users/1');
|
||||
expect((component.vm as any).userProfileLink).toBe('/my-project/users/15/1');
|
||||
expect((component.vm as any).signOutLink).toBe('/my-project/logout');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -52,11 +52,10 @@ export default defineComponent({
|
||||
|
||||
const userProfileLink = computed<string>(() => {
|
||||
const project = projectsStore.state.currentProjectKey;
|
||||
// This is rendered in the private view, which is only accessible as a logged in user
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const id = userStore.state.currentUser!.id;
|
||||
const id = userStore.state.currentUser?.id;
|
||||
const role = userStore.state.currentUser?.role?.id;
|
||||
|
||||
return `/${project}/users/${id}`;
|
||||
return `/${project}/users/${role}/${id}`;
|
||||
});
|
||||
|
||||
const signOutLink = computed<string>(() => {
|
||||
|
||||
Reference in New Issue
Block a user