mirror of
https://github.com/directus/directus.git
synced 2026-02-14 19:15:01 -05:00
* v-menu de/activated onKeyDown. No List yet. * v-list * add user suggestion * uuids replaced * user-popover working * avatars flex row with usernames in suggestions * added space to end of uuid insert * autofocus + move caret to end of last insert * removed unnecessary setTimeout() * fixed filter 500 with ids * better fix * New translations en-US.yaml (French) (#9907) * New translations en-US.yaml (French) (#9912) * New translations en-US.yaml (French) (#9916) * New translations en-US.yaml (Russian) (#9918) * New translations en-US.yaml (Swedish) (#9920) * Email updates (#9921) * add from name for emails * updatd email template style * reset password email copy * updated logo to newest version * update invite email copy * decouple field template logic * push up styling * Start on new v-template-input * Add notifications API endpoints Squashed commit of the following: commit 9d86721ef795d03bc55693c0f99bde8e269d60e9 Merge: b4458c19f34131d06eAuthor: rijkvanzanten <rijkvanzanten@me.com> Date: Mon Nov 22 09:27:43 2021 -0500 Merge branch 'mentions' into mentions-api commit b4458c19f7c54f18fa415fc04c63642c2f5a17b0 Author: rijkvanzanten <rijkvanzanten@me.com> Date: Thu Nov 18 18:34:04 2021 -0500 Remove unused import commit e6a9d36bbfdf95cb18d29336da61ecb14b677934 Author: rijkvanzanten <rijkvanzanten@me.com> Date: Thu Nov 18 18:28:31 2021 -0500 Extract user mentions from comments commit b3e571a2daa287e1740a050096913662a57e9861 Merge: c93b833d2af2a6dd7fAuthor: rijkvanzanten <rijkvanzanten@me.com> Date: Thu Nov 18 17:39:52 2021 -0500 Merge branch 'mentions' into mentions-api commit c93b833d2b848e306c434b370d4e4e11967e85d0 Author: rijkvanzanten <rijkvanzanten@me.com> Date: Thu Nov 18 17:35:45 2021 -0500 Send emails w/ parsed MD commit 64bbd6596f20a07028d2387d60e33dfe4f91c032 Author: rijkvanzanten <rijkvanzanten@me.com> Date: Thu Nov 18 16:18:16 2021 -0500 Add notifications endpoint + permissions commit fba55c02dc9c303a38b1b958350684cccd3dd82c Author: rijkvanzanten <rijkvanzanten@me.com> Date: Thu Nov 18 15:33:28 2021 -0500 Add system data for notifications * push * Make v-template-input work * Add the two-way binding * submit button posting, not clearing text area * comment text area clearing on submit * Replace insertion correctly * Added scope support to LDAP group and user search (#9529) * Added scope support LDAP group and user search * Fixed linter screwing up my markdown * Update docs/configuration/config-options.md * Always return correct DN for user with sub scope * Fix indeterminate meta and schema property in advanded field creation (#9924) * Fix impossibility to save M2M (alterations not triggered) (#9992) * Fix alterations refactor * fix roles aggregate query (#9994) * Update iis.md (#9998) added the IIS URL Rewrite module as a requirement * New translations en-US.yaml (English, United Kingdom) (#10001) * Fix LDAP race condition (#9993) * Fix input ui * Revert changes to v-field-template * Update mentions permissions * Fix linter warnings * Optimize sending flow * Revert "Rename activity->notifications module (#9446)" This reverts commit428e5d4ea9. * Add notifications drawer * Update migrations * Improve constraints * Add email notifications toggle on users * Add docs, fix graphql support * Move caret-pos to devdeps * Remove unused new triggerKeyPressed system * Remove unused use-caret composable Co-authored-by: Nitwel <nitwel@arcor.de> Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com> Co-authored-by: Ben Haynes <ben@rngr.org> Co-authored-by: Aiden Foxx <aiden.foxx@sbab.se> Co-authored-by: Oreille <33065839+Oreilles@users.noreply.github.com> Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Co-authored-by: Paul Boudewijn <paul@helderinternet.nl>
99 lines
2.3 KiB
TypeScript
99 lines
2.3 KiB
TypeScript
import { setLanguage } from '@/lang/set-language';
|
|
import { register as registerModules, unregister as unregisterModules } from '@/modules/register';
|
|
import { getBasemapSources } from '@/utils/geometry/basemap';
|
|
import {
|
|
useAppStore,
|
|
useCollectionsStore,
|
|
useFieldsStore,
|
|
useLatencyStore,
|
|
useInsightsStore,
|
|
usePermissionsStore,
|
|
usePresetsStore,
|
|
useRelationsStore,
|
|
useRequestsStore,
|
|
useServerStore,
|
|
useSettingsStore,
|
|
useUserStore,
|
|
useNotificationsStore,
|
|
} from '@/stores';
|
|
|
|
type GenericStore = {
|
|
$id: string;
|
|
hydrate?: () => Promise<void>;
|
|
dehydrate?: () => Promise<void>;
|
|
|
|
[key: string]: any;
|
|
};
|
|
|
|
export function useStores(
|
|
stores = [
|
|
useCollectionsStore,
|
|
useFieldsStore,
|
|
useUserStore,
|
|
useRequestsStore,
|
|
usePresetsStore,
|
|
useSettingsStore,
|
|
useServerStore,
|
|
useLatencyStore,
|
|
useRelationsStore,
|
|
usePermissionsStore,
|
|
useInsightsStore,
|
|
useNotificationsStore,
|
|
]
|
|
): GenericStore[] {
|
|
return stores.map((useStore) => useStore()) as GenericStore[];
|
|
}
|
|
|
|
export async function hydrate(stores = useStores()): Promise<void> {
|
|
const appStore = useAppStore();
|
|
const userStore = useUserStore();
|
|
const permissionsStore = usePermissionsStore();
|
|
|
|
if (appStore.hydrated) return;
|
|
if (appStore.hydrating) return;
|
|
|
|
appStore.hydrating = true;
|
|
|
|
try {
|
|
/**
|
|
* @NOTE
|
|
* Multiple stores rely on the userStore to be set, so they can fetch user specific data. The
|
|
* following makes sure that the user store is always fetched first, before we hydrate anything
|
|
* else.
|
|
*/
|
|
await userStore.hydrate();
|
|
|
|
if (userStore.currentUser?.role) {
|
|
await permissionsStore.hydrate();
|
|
const hydratedStores = ['userStore', 'permissionsStore'];
|
|
|
|
await Promise.all(stores.filter(({ $id }) => !hydratedStores.includes($id)).map((store) => store.hydrate?.()));
|
|
await registerModules();
|
|
|
|
await setLanguage(userStore.currentUser?.language ?? 'en-US');
|
|
}
|
|
|
|
appStore.basemap = getBasemapSources()[0].name;
|
|
} catch (error: any) {
|
|
appStore.error = error;
|
|
} finally {
|
|
appStore.hydrating = false;
|
|
}
|
|
|
|
appStore.hydrated = true;
|
|
}
|
|
|
|
export async function dehydrate(stores = useStores()): Promise<void> {
|
|
const appStore = useAppStore();
|
|
|
|
if (appStore.hydrated === false) return;
|
|
|
|
for (const store of stores) {
|
|
await store.dehydrate?.();
|
|
}
|
|
|
|
unregisterModules();
|
|
|
|
appStore.hydrated = false;
|
|
}
|