adminizer 4.3.0-build.116 → 4.3.0-build.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -26,3 +26,4 @@ export * from "./models/MediaManagerAssociationsAP";
26
26
  export * from "./models/MediaManagerMetaAP";
27
27
  export * from "./models/NavigationAP";
28
28
  export * from "./migrations";
29
+ export * from "./system/bindNavigation";
package/index.js CHANGED
@@ -26,3 +26,4 @@ export * from "./models/MediaManagerAssociationsAP";
26
26
  export * from "./models/MediaManagerMetaAP";
27
27
  export * from "./models/NavigationAP";
28
28
  export * from "./migrations";
29
+ export * from "./system/bindNavigation";
@@ -457,6 +457,7 @@ export interface NavigationConfig {
457
457
  allowContentInGroup?: boolean;
458
458
  items: NavigationItemTypeConfig[];
459
459
  movingGroupsRootOnly?: boolean;
460
+ bindAfter: boolean;
460
461
  }
461
462
  export interface MediaManagerConfig {
462
463
  fileStoragePath: string;
package/lib/Adminizer.js CHANGED
@@ -8,7 +8,7 @@ import Router from "./../system/Router";
8
8
  import bindAssets from "../system/bindAssets";
9
9
  import bindDev from "../system/bindDev";
10
10
  import bindDashboardWidgets from "../system/bindDashboardWidgets";
11
- import bindNavigation from "../system/bindNavigation";
11
+ import { bindNavigation } from "../system/bindNavigation";
12
12
  import bindMediaManager from "../system/bindMediaManager";
13
13
  import bindAccessRights from "../system/bindAccessRights";
14
14
  import bindAuthorization from "../system/bindAuthorization";
@@ -208,7 +208,14 @@ export class Adminizer {
208
208
  }
209
209
  }
210
210
  await bindDashboardWidgets(this);
211
- bindNavigation(this);
211
+ if (this.config.navigation?.bindAfter) {
212
+ this._emitter.on('isSeeding', async () => {
213
+ await bindNavigation(this);
214
+ });
215
+ }
216
+ else {
217
+ await bindNavigation(this);
218
+ }
212
219
  bindMediaManager(this);
213
220
  await bindAccessRights(this);
214
221
  if (I18n.appendLocale) {
@@ -7,13 +7,13 @@ export interface NavItem extends Item {
7
7
  targetBlank?: boolean;
8
8
  visible?: boolean;
9
9
  }
10
- declare class StorageService {
10
+ export declare class StorageService {
11
11
  protected storageMap: Map<string | number, NavItem>;
12
12
  protected id: string;
13
13
  protected model: string;
14
14
  protected readonly adminizer: Adminizer;
15
15
  constructor(adminizer: Adminizer, id: string, model: string);
16
- protected initModel(): Promise<void>;
16
+ initModel(): Promise<void>;
17
17
  getId(): string;
18
18
  buildTree(): Promise<any>;
19
19
  populateFromTree(tree: any[]): Promise<void>;
@@ -41,4 +41,3 @@ export declare class Navigation extends AbstractCatalog {
41
41
  constructor(adminizer: Adminizer, config: NavigationConfig);
42
42
  getIdList(): Promise<string[]>;
43
43
  }
44
- export {};
@@ -1,7 +1,7 @@
1
1
  import { AbstractCatalog, AbstractGroup, AbstractItem } from "./AbstractCatalog";
2
2
  import { v4 as uuid } from "uuid";
3
3
  import { Adminizer } from "../Adminizer";
4
- class StorageService {
4
+ export class StorageService {
5
5
  storageMap = new Map();
6
6
  id;
7
7
  model;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adminizer",
3
3
  "type": "module",
4
- "version": "4.3.0-build.116",
4
+ "version": "4.3.0-build.118",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",
@@ -1,2 +1,2 @@
1
1
  import { Adminizer } from "../lib/Adminizer";
2
- export default function bindNavigation(adminizer: Adminizer): void;
2
+ export declare function bindNavigation(adminizer: Adminizer): Promise<void>;
@@ -1,40 +1,38 @@
1
1
  import { Navigation } from "../lib/catalog/Navigation";
2
- export default function bindNavigation(adminizer) {
3
- adminizer.emitter.on("adminizer:loaded", async () => {
4
- if (adminizer.config.navigation) {
5
- try {
6
- adminizer.config.navigation.model = adminizer.config.navigation.model ? adminizer.config.navigation.model : 'NavigationAP';
7
- let navigation = new Navigation(adminizer, adminizer.config.navigation);
8
- adminizer.catalogHandler.add(navigation);
9
- adminizer.config.models[adminizer.config.navigation.model.toLowerCase()] = {
10
- add: false,
11
- edit: {
12
- controller: '../controllers/navigation/edit',
13
- },
2
+ export async function bindNavigation(adminizer) {
3
+ if (adminizer.config.navigation) {
4
+ try {
5
+ adminizer.config.navigation.model = adminizer.config.navigation.model ? adminizer.config.navigation.model : 'NavigationAP';
6
+ let navigation = new Navigation(adminizer, adminizer.config.navigation);
7
+ adminizer.catalogHandler.add(navigation);
8
+ adminizer.config.models[adminizer.config.navigation.model.toLowerCase()] = {
9
+ add: false,
10
+ edit: {
11
+ controller: '../controllers/navigation/edit',
12
+ },
13
+ fields: {
14
+ createdAt: false,
15
+ updatedAt: false
16
+ },
17
+ navbar: {
18
+ visible: false
19
+ },
20
+ icon: 'storage',
21
+ identifierField: "",
22
+ list: {
14
23
  fields: {
15
- createdAt: false,
16
- updatedAt: false
17
- },
18
- navbar: {
19
- visible: false
24
+ tree: false,
25
+ id: false,
20
26
  },
21
- icon: 'storage',
22
- identifierField: "",
23
- list: {
24
- fields: {
25
- tree: false,
26
- id: false,
27
- },
28
- },
29
- model: adminizer.config.navigation.model.toLowerCase(),
30
- remove: false,
31
- title: adminizer.config.navigation.model,
32
- tools: []
33
- };
34
- }
35
- catch (e) {
36
- console.log('bindNavigation Error: ', e);
37
- }
27
+ },
28
+ model: adminizer.config.navigation.model.toLowerCase(),
29
+ remove: false,
30
+ title: adminizer.config.navigation.model,
31
+ tools: []
32
+ };
33
+ }
34
+ catch (e) {
35
+ console.log('bindNavigation Error: ', e);
38
36
  }
39
- });
37
+ }
40
38
  }