strapi-plugin-navigation 2.2.11 → 2.2.13
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/README.md +1 -1
- package/admin/src/components/AdditionalFieldInput/types.d.ts +3 -3
- package/admin/src/components/ConfirmationDialog/index.d.ts +10 -10
- package/admin/src/components/EmptyView/index.js +2 -0
- package/admin/src/components/Item/index.d.ts +15 -15
- package/admin/src/components/NavigationItemList/index.d.ts +11 -11
- package/admin/src/index.d.ts +5 -7
- package/admin/src/index.js +9 -17
- package/admin/src/pages/DataManagerProvider/index.d.ts +1 -1
- package/admin/src/pages/DataManagerProvider/index.js +18 -4
- package/admin/src/pages/DataManagerProvider/reducer.d.ts +15 -15
- package/admin/src/pages/SettingsPage/types.d.ts +8 -8
- package/admin/src/pages/SettingsPage/utils/functions.d.ts +0 -2
- package/admin/src/pages/View/components/NavigationHeader/index.js +2 -0
- package/admin/src/pages/View/components/NavigationItemForm/types.d.ts +8 -8
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +9 -9
- package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts +11 -11
- package/admin/src/pages/View/components/NavigationManager/Footer/index.d.ts +1 -1
- package/admin/src/pages/View/components/NavigationManager/types.d.ts +3 -3
- package/admin/src/pages/View/index.d.ts +1 -1
- package/admin/src/pages/View/index.js +3 -0
- package/admin/src/permissions.d.ts +3 -3
- package/admin/src/translations/ca.json +197 -0
- package/admin/src/translations/en.json +2 -1
- package/admin/src/translations/fr.json +2 -1
- package/admin/src/translations/index.d.ts +2 -0
- package/admin/src/translations/index.js +2 -0
- package/admin/src/utils/functions.d.ts +2 -2
- package/package.json +4 -4
- package/server/config/setupStrategy.js +11 -0
- package/server/i18n/graphQLEnhancers.d.ts +1 -1
- package/server/i18n/types.d.ts +11 -11
- package/server/i18n/utils.d.ts +2 -2
- package/server/services/admin.js +1 -1
- package/server/services/common.js +16 -9
- package/server/utils/functions.d.ts +2 -1
- package/server/utils/functions.js +16 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/config.d.ts +8 -8
- package/types/contentTypes.d.ts +20 -20
- package/types/controllers.d.ts +2 -2
- package/types/graphQL.d.ts +1 -1
- package/types/i18n.d.ts +2 -2
- package/types/services.d.ts +2 -2
- package/types/utils.d.ts +21 -21
package/types/config.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NavigationItemAdditionalField } from "./contentTypes";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
2
|
+
export type PluginConfigNameFields = Record<string, string[]>;
|
|
3
|
+
export type PluginConfigPopulate = Record<string, string[]>;
|
|
4
|
+
export type PluginConfigPathDefaultFields = Record<string, string[]>;
|
|
5
|
+
export type PluginConfigGraphQL = {
|
|
6
6
|
navigationItemRelated: string[];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type NavigationPluginConfig = {
|
|
9
9
|
additionalFields: NavigationItemAdditionalField[];
|
|
10
10
|
contentTypes: string[];
|
|
11
11
|
contentTypesNameFields: PluginConfigNameFields;
|
|
@@ -17,9 +17,9 @@ export declare type NavigationPluginConfig = {
|
|
|
17
17
|
pathDefaultFields: PluginConfigPathDefaultFields;
|
|
18
18
|
cascadeMenuAttached: boolean;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type StrapiConfig<T> = {
|
|
21
21
|
default: T;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type PluginConfigKeys = keyof NavigationPluginConfig;
|
|
24
|
+
export type PluginDefaultConfigGetter = (key: PluginConfigKeys) => NavigationPluginConfig[PluginConfigKeys];
|
|
25
25
|
//# sourceMappingURL=config.d.ts.map
|
package/types/contentTypes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Id, StringMap, TypeResult } from "strapi-typed";
|
|
2
2
|
import { DateString, ToBeFixed } from "./utils";
|
|
3
|
-
export
|
|
3
|
+
export type Navigation = {
|
|
4
4
|
id: Id;
|
|
5
5
|
name: string;
|
|
6
6
|
slug: string;
|
|
@@ -11,7 +11,7 @@ export declare type Navigation = {
|
|
|
11
11
|
localeCode?: string | null;
|
|
12
12
|
localizations?: Navigation[] | null;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type NavigationItem = NavigationItemPartial & {
|
|
15
15
|
id?: number;
|
|
16
16
|
master: number;
|
|
17
17
|
parent: number | null;
|
|
@@ -22,10 +22,10 @@ export declare type NavigationItem = NavigationItemPartial & {
|
|
|
22
22
|
updated: boolean;
|
|
23
23
|
slug?: string;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type NavigationItemInput = NavigationItemPartial & Omit<NavigationItem, "related"> & {
|
|
26
26
|
related: RelatedRefBase[];
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type NavigationItemEntity<RelatedType = NavigationItemRelated> = TypeResult<NavigationItemPartial & EntityDatePartial & {
|
|
29
29
|
id: number;
|
|
30
30
|
parent: NavigationItemEntity | null;
|
|
31
31
|
master: Navigation;
|
|
@@ -34,7 +34,7 @@ export declare type NavigationItemEntity<RelatedType = NavigationItemRelated> =
|
|
|
34
34
|
related: RelatedType | null;
|
|
35
35
|
additionalFields: StringMap<string | boolean>;
|
|
36
36
|
}>;
|
|
37
|
-
|
|
37
|
+
type NavigationItemPartial = {
|
|
38
38
|
path: string | null;
|
|
39
39
|
title: string;
|
|
40
40
|
type: NavigationItemType;
|
|
@@ -43,25 +43,25 @@ declare type NavigationItemPartial = {
|
|
|
43
43
|
order: number;
|
|
44
44
|
uiRouterKey: string;
|
|
45
45
|
};
|
|
46
|
-
export
|
|
46
|
+
export type NestedStructure<T> = T & {
|
|
47
47
|
items: NestedStructure<T>[];
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type RelatedRefBase = {
|
|
50
50
|
refId: number;
|
|
51
51
|
ref: string;
|
|
52
52
|
field: string;
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type RelatedRef = RelatedRefBase & {
|
|
55
55
|
id: Id;
|
|
56
56
|
__templateName?: string;
|
|
57
57
|
__contentType?: string;
|
|
58
58
|
};
|
|
59
|
-
export
|
|
59
|
+
export type Audience = {
|
|
60
60
|
id: Id;
|
|
61
61
|
name: string;
|
|
62
62
|
key: string;
|
|
63
63
|
};
|
|
64
|
-
export
|
|
64
|
+
export type NavigationItemRelated = {
|
|
65
65
|
id: Id;
|
|
66
66
|
related_id: string;
|
|
67
67
|
related_type: string;
|
|
@@ -76,31 +76,31 @@ export declare type NavigationItemRelated = {
|
|
|
76
76
|
refId?: Id;
|
|
77
77
|
ref?: string;
|
|
78
78
|
};
|
|
79
|
-
export
|
|
80
|
-
|
|
79
|
+
export type NavigationItemType = "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
80
|
+
type EntityDatePartial = {
|
|
81
81
|
createdAt: DateString;
|
|
82
82
|
updatedAt: DateString;
|
|
83
83
|
};
|
|
84
|
-
export
|
|
85
|
-
export
|
|
86
|
-
|
|
84
|
+
export type NotVoid<T> = T extends undefined ? never : T;
|
|
85
|
+
export type NavigationItemCustomFieldType = 'boolean' | 'string' | 'select';
|
|
86
|
+
type NavigationItemCustomFieldBase = {
|
|
87
87
|
name: string;
|
|
88
88
|
label: string;
|
|
89
89
|
required: boolean;
|
|
90
90
|
enabled?: boolean;
|
|
91
91
|
};
|
|
92
|
-
|
|
92
|
+
type NavigationItemCustomFieldSelect = NavigationItemCustomFieldBase & {
|
|
93
93
|
type: 'select';
|
|
94
94
|
multi: boolean;
|
|
95
95
|
options: string[];
|
|
96
96
|
};
|
|
97
|
-
|
|
97
|
+
type NavigationItemCustomFieldPrimitive = NavigationItemCustomFieldBase & {
|
|
98
98
|
type: 'boolean' | 'string';
|
|
99
99
|
multi: false;
|
|
100
100
|
options: [];
|
|
101
101
|
};
|
|
102
|
-
export
|
|
103
|
-
export
|
|
104
|
-
export
|
|
102
|
+
export type NavigationItemCustomField = NavigationItemCustomFieldPrimitive | NavigationItemCustomFieldSelect;
|
|
103
|
+
export type NavigationItemAdditionalField = NavigationItemCustomField | 'audience';
|
|
104
|
+
export type NavigationItemAdditionalFieldValues = Record<string, string | boolean | string[]>;
|
|
105
105
|
export {};
|
|
106
106
|
//# sourceMappingURL=contentTypes.d.ts.map
|
package/types/controllers.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { StrapiController } from "strapi-typed";
|
|
|
2
2
|
import { Navigation, NotVoid } from "./contentTypes";
|
|
3
3
|
import { IAdminService, IClientService, NavigationService, NavigationServiceName } from "./services";
|
|
4
4
|
import { AuditLogContext, StrapiControllerContext, ToBeFixed } from "./utils";
|
|
5
|
-
|
|
5
|
+
type ControllerCommonContext = {
|
|
6
6
|
auditLog: AuditLogContext;
|
|
7
7
|
};
|
|
8
8
|
export interface IAdminController {
|
|
@@ -45,7 +45,7 @@ export interface IClientController {
|
|
|
45
45
|
render: (ctx: StrapiControllerContext) => ToBeFixed;
|
|
46
46
|
renderChild: (ctx: StrapiControllerContext) => ToBeFixed;
|
|
47
47
|
}
|
|
48
|
-
export
|
|
48
|
+
export type NavigationController = {
|
|
49
49
|
admin: IAdminController;
|
|
50
50
|
client: IClientController;
|
|
51
51
|
};
|
package/types/graphQL.d.ts
CHANGED
package/types/i18n.d.ts
CHANGED
package/types/services.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { NavigationPluginConfig } from "./config";
|
|
|
3
3
|
import { Navigation, NavigationItem, NavigationItemCustomField, NavigationItemEntity, NavigationItemInput, NestedStructure, NotVoid, RelatedRef, RelatedRefBase } from "./contentTypes";
|
|
4
4
|
import { I18nQueryParams } from "./i18n";
|
|
5
5
|
import { AuditLogContext, ContentTypeEntity, NavigationActions, NavigationActionsPerItem, PopulateQueryParam, RenderType, RFRNavItem, ToBeFixed } from "./utils";
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type NavigationServiceName = "common" | "admin" | "client";
|
|
7
|
+
export type NavigationService = ICommonService | IAdminService | IClientService;
|
|
8
8
|
export interface IAdminService {
|
|
9
9
|
config: (viaSettingsPage?: boolean) => Promise<NavigationPluginConfig>;
|
|
10
10
|
get: () => Promise<Navigation[]>;
|
package/types/utils.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { Id, PopulateClause } from "strapi-typed";
|
|
2
2
|
import { Navigation, NavigationItem, NavigationItemType, NestedStructure } from "./contentTypes";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
3
|
+
export type Effect<T> = (value: T) => void;
|
|
4
|
+
export type VoidEffect = Effect<void>;
|
|
5
|
+
export type NavigationActionsCategories = 'toCreate' | 'toUpdate' | 'toRemove';
|
|
6
|
+
export type RenderTypeOptions = Readonly<{
|
|
7
7
|
FLAT: 'FLAT';
|
|
8
8
|
TREE: 'TREE';
|
|
9
9
|
RFR: 'RFR';
|
|
10
10
|
}>;
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
11
|
+
export type RenderType = keyof RenderTypeOptions;
|
|
12
|
+
export type StrapiRoutesTypes = 'admin' | 'content-api';
|
|
13
|
+
export type ToBeFixed = any;
|
|
14
|
+
export type DateString = string;
|
|
15
|
+
export type PopulateQueryParam = string | PopulateClause;
|
|
16
|
+
export type PluginPermissions = {
|
|
17
17
|
canAccess: boolean;
|
|
18
18
|
canUpdate?: boolean;
|
|
19
19
|
canUpdateSettings?: boolean;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export type NavigationActions = {
|
|
22
22
|
create?: boolean;
|
|
23
23
|
update?: boolean;
|
|
24
24
|
remove?: boolean;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
26
|
+
export type NavigationActionsPerItem = Record<NavigationActionsCategories, NestedStructure<NavigationItem>[]>;
|
|
27
|
+
export type AuditLogContext = any;
|
|
28
|
+
export type AuditLogParams = {
|
|
29
29
|
actionType: string;
|
|
30
30
|
oldEntity: Navigation;
|
|
31
31
|
newEntity: Navigation;
|
|
@@ -33,10 +33,10 @@ export declare type AuditLogParams = {
|
|
|
33
33
|
actionType: "DELETE";
|
|
34
34
|
entity: Navigation;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type ContentTypeEntity = {
|
|
37
37
|
id: Id;
|
|
38
38
|
} & Record<string, unknown>;
|
|
39
|
-
export
|
|
39
|
+
export type NestedPath = {
|
|
40
40
|
id: Id;
|
|
41
41
|
parent?: {
|
|
42
42
|
id: Id;
|
|
@@ -44,25 +44,25 @@ export declare type NestedPath = {
|
|
|
44
44
|
};
|
|
45
45
|
path: string;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type RFRNavItem = {
|
|
48
48
|
label?: string;
|
|
49
49
|
type: NavigationItemType;
|
|
50
50
|
page?: string;
|
|
51
51
|
url?: string;
|
|
52
52
|
audience?: string[];
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type StrapiRoute = {
|
|
55
55
|
method: string;
|
|
56
56
|
path: string;
|
|
57
57
|
handler: string;
|
|
58
58
|
config?: ToBeFixed;
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type StrapiRoutes = {
|
|
61
61
|
type: StrapiRoutesTypes;
|
|
62
62
|
routes: StrapiRoute[];
|
|
63
63
|
};
|
|
64
|
-
export
|
|
65
|
-
export
|
|
64
|
+
export type StrapiControllerContext = any;
|
|
65
|
+
export type StrapiControllerContextParams = any;
|
|
66
66
|
export declare const assertNotEmpty: <T>(value: T | null | undefined, customError?: Error) => asserts value is T;
|
|
67
67
|
export declare const isNumber: (x: unknown) => boolean;
|
|
68
68
|
export declare const assertIsNumber: (n: unknown, customError?: Error) => asserts n is number;
|