@cccsaurora/howler-ui 2.14.0-dev.228 → 2.14.0-dev.245
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/commons/components/app/AppConfigs.d.ts +9 -3
- package/components/app/App.js +1 -0
- package/components/app/providers/FavouritesProvider.js +2 -2
- package/components/hooks/useMyPreferences.js +208 -193
- package/components/hooks/useMySitemap.js +3 -1
- package/components/routes/hits/search/InformationPane.js +3 -3
- package/components/routes/hits/view/HitViewer.js +1 -1
- package/package.json +102 -102
- package/plugins/HowlerPlugin.d.ts +53 -1
- package/plugins/HowlerPlugin.js +146 -14
- package/plugins/store.d.ts +51 -14
- package/plugins/store.js +36 -21
- package/utils/menuUtils.d.ts +89 -0
- package/utils/menuUtils.js +243 -0
package/package.json
CHANGED
|
@@ -95,160 +95,160 @@
|
|
|
95
95
|
"internal-slot": "1.0.7"
|
|
96
96
|
},
|
|
97
97
|
"type": "module",
|
|
98
|
-
"version": "2.14.0-dev.
|
|
98
|
+
"version": "2.14.0-dev.245",
|
|
99
99
|
"exports": {
|
|
100
100
|
"./i18n": "./i18n.js",
|
|
101
101
|
"./index.css": "./index.css",
|
|
102
|
-
"./tests/*": "./tests/*.js",
|
|
103
|
-
"./utils/*": "./utils/*.js",
|
|
104
|
-
"./utils/*.json": "./utils/*.json",
|
|
105
|
-
"./branding/*": "./branding/*.js",
|
|
106
102
|
"./api/*": "./api/*.js",
|
|
107
103
|
"./api": "./api/index.js",
|
|
108
104
|
"./models/*": "./models/*.js",
|
|
109
105
|
"./locales/*.json": "./locales/*.json",
|
|
106
|
+
"./branding/*": "./branding/*.js",
|
|
107
|
+
"./utils/*": "./utils/*.js",
|
|
108
|
+
"./utils/*.json": "./utils/*.json",
|
|
110
109
|
"./rest/*": "./rest/*.js",
|
|
111
110
|
"./rest": "./rest/index.js",
|
|
112
|
-
"./plugins/*": "./plugins/*.js",
|
|
113
|
-
"./commons/*": "./commons/*.js",
|
|
114
111
|
"./components/*": "./components/*.js",
|
|
115
|
-
"./
|
|
116
|
-
"./
|
|
112
|
+
"./commons/*": "./commons/*.js",
|
|
113
|
+
"./plugins/*": "./plugins/*.js",
|
|
114
|
+
"./tests/*": "./tests/*.js",
|
|
115
|
+
"./api/analytic/*": "./api/analytic/*.js",
|
|
116
|
+
"./api/analytic": "./api/analytic/index.js",
|
|
117
117
|
"./api/template/*": "./api/template/*.js",
|
|
118
118
|
"./api/template": "./api/template/index.js",
|
|
119
|
-
"./api/
|
|
120
|
-
"./api/
|
|
121
|
-
"./api/search/*": "./api/search/*.js",
|
|
122
|
-
"./api/search": "./api/search/index.js",
|
|
119
|
+
"./api/hit/*": "./api/hit/*.js",
|
|
120
|
+
"./api/hit": "./api/hit/index.js",
|
|
123
121
|
"./api/notebook/*": "./api/notebook/*.js",
|
|
124
122
|
"./api/notebook": "./api/notebook/index.js",
|
|
123
|
+
"./api/auth/*": "./api/auth/*.js",
|
|
124
|
+
"./api/auth": "./api/auth/index.js",
|
|
125
|
+
"./api/search/*": "./api/search/*.js",
|
|
126
|
+
"./api/search": "./api/search/index.js",
|
|
127
|
+
"./api/dossier/*": "./api/dossier/*.js",
|
|
128
|
+
"./api/dossier": "./api/dossier/index.js",
|
|
125
129
|
"./api/view/*": "./api/view/*.js",
|
|
126
130
|
"./api/view": "./api/view/index.js",
|
|
127
|
-
"./api/configs/*": "./api/configs/*.js",
|
|
128
|
-
"./api/configs": "./api/configs/index.js",
|
|
129
131
|
"./api/overview/*": "./api/overview/*.js",
|
|
130
132
|
"./api/overview": "./api/overview/index.js",
|
|
131
|
-
"./api/analytic/*": "./api/analytic/*.js",
|
|
132
|
-
"./api/analytic": "./api/analytic/index.js",
|
|
133
133
|
"./api/user/*": "./api/user/*.js",
|
|
134
134
|
"./api/user": "./api/user/index.js",
|
|
135
|
-
"./api/
|
|
136
|
-
"./api/
|
|
137
|
-
"./api/
|
|
138
|
-
"./api/
|
|
139
|
-
"./api/
|
|
140
|
-
"./api/
|
|
135
|
+
"./api/action/*": "./api/action/*.js",
|
|
136
|
+
"./api/action": "./api/action/index.js",
|
|
137
|
+
"./api/configs/*": "./api/configs/*.js",
|
|
138
|
+
"./api/configs": "./api/configs/index.js",
|
|
139
|
+
"./api/analytic/comments/*": "./api/analytic/comments/*.js",
|
|
140
|
+
"./api/analytic/comments": "./api/analytic/comments/index.js",
|
|
141
|
+
"./api/analytic/notebooks/*": "./api/analytic/notebooks/*.js",
|
|
142
|
+
"./api/analytic/notebooks": "./api/analytic/notebooks/index.js",
|
|
143
|
+
"./api/hit/comments/*": "./api/hit/comments/*.js",
|
|
144
|
+
"./api/hit/comments": "./api/hit/comments/index.js",
|
|
141
145
|
"./api/search/facet/*": "./api/search/facet/*.js",
|
|
142
146
|
"./api/search/facet": "./api/search/facet/index.js",
|
|
143
147
|
"./api/search/count/*": "./api/search/count/*.js",
|
|
144
148
|
"./api/search/count": "./api/search/count/index.js",
|
|
145
|
-
"./api/search/sigma/*": "./api/search/sigma/*.js",
|
|
146
149
|
"./api/search/fields/*": "./api/search/fields/*.js",
|
|
147
150
|
"./api/search/fields": "./api/search/fields/index.js",
|
|
151
|
+
"./api/search/eql/*": "./api/search/eql/*.js",
|
|
152
|
+
"./api/search/sigma/*": "./api/search/sigma/*.js",
|
|
153
|
+
"./api/search/grouped/*": "./api/search/grouped/*.js",
|
|
154
|
+
"./api/search/grouped": "./api/search/grouped/index.js",
|
|
148
155
|
"./api/search/histogram/*": "./api/search/histogram/*.js",
|
|
149
156
|
"./api/search/histogram": "./api/search/histogram/index.js",
|
|
150
|
-
"./api/search/eql/*": "./api/search/eql/*.js",
|
|
151
|
-
"./api/analytic/comments/*": "./api/analytic/comments/*.js",
|
|
152
|
-
"./api/analytic/comments": "./api/analytic/comments/index.js",
|
|
153
|
-
"./api/analytic/notebooks/*": "./api/analytic/notebooks/*.js",
|
|
154
|
-
"./api/analytic/notebooks": "./api/analytic/notebooks/index.js",
|
|
155
157
|
"./api/user/avatar/*": "./api/user/avatar/*.js",
|
|
156
158
|
"./api/user/avatar": "./api/user/avatar/index.js",
|
|
157
|
-
"./api/hit/comments/*": "./api/hit/comments/*.js",
|
|
158
|
-
"./api/hit/comments": "./api/hit/comments/index.js",
|
|
159
|
-
"./models/entities/*": "./models/entities/*.js",
|
|
160
159
|
"./models/socket/*": "./models/socket/*.js",
|
|
160
|
+
"./models/entities/*": "./models/entities/*.js",
|
|
161
161
|
"./models/entities/generated/*": "./models/entities/generated/*.js",
|
|
162
162
|
"./locales/en/*.json": "./locales/en/*.json",
|
|
163
163
|
"./locales/fr/*.json": "./locales/fr/*.json",
|
|
164
164
|
"./locales/en/help/*.json": "./locales/en/help/*.json",
|
|
165
165
|
"./locales/fr/help/*.json": "./locales/fr/help/*.json",
|
|
166
|
-
"./commons/components/*": "./commons/components/*.js",
|
|
167
|
-
"./commons/components/breadcrumbs/*": "./commons/components/breadcrumbs/*.js",
|
|
168
|
-
"./commons/components/utils/*": "./commons/components/utils/*.js",
|
|
169
|
-
"./commons/components/leftnav/*": "./commons/components/leftnav/*.js",
|
|
170
|
-
"./commons/components/search/*": "./commons/components/search/*.js",
|
|
171
|
-
"./commons/components/app/*": "./commons/components/app/*.js",
|
|
172
|
-
"./commons/components/notification/*": "./commons/components/notification/*.js",
|
|
173
|
-
"./commons/components/notification": "./commons/components/notification/index.js",
|
|
174
|
-
"./commons/components/display/*": "./commons/components/display/*.js",
|
|
175
|
-
"./commons/components/topnav/*": "./commons/components/topnav/*.js",
|
|
176
|
-
"./commons/components/pages/*": "./commons/components/pages/*.js",
|
|
177
|
-
"./commons/components/utils/hooks/*": "./commons/components/utils/hooks/*.js",
|
|
178
|
-
"./commons/components/app/hooks/*": "./commons/components/app/hooks/*.js",
|
|
179
|
-
"./commons/components/app/hooks": "./commons/components/app/hooks/index.js",
|
|
180
|
-
"./commons/components/app/providers/*": "./commons/components/app/providers/*.js",
|
|
181
|
-
"./commons/components/notification/elements/*": "./commons/components/notification/elements/*.js",
|
|
182
|
-
"./commons/components/notification/elements/item/*": "./commons/components/notification/elements/item/*.js",
|
|
183
|
-
"./commons/components/display/hooks/*": "./commons/components/display/hooks/*.js",
|
|
184
|
-
"./commons/components/pages/hooks/*": "./commons/components/pages/hooks/*.js",
|
|
185
|
-
"./components/logins/*": "./components/logins/*.js",
|
|
186
166
|
"./components/hooks/*": "./components/hooks/*.js",
|
|
187
167
|
"./components/app/*": "./components/app/*.js",
|
|
188
|
-
"./components/
|
|
168
|
+
"./components/logins/*": "./components/logins/*.js",
|
|
189
169
|
"./components/elements/*": "./components/elements/*.js",
|
|
190
|
-
"./components/
|
|
191
|
-
"./components/logins/auth/*": "./components/logins/auth/*.js",
|
|
170
|
+
"./components/routes/*": "./components/routes/*.js",
|
|
192
171
|
"./components/app/hooks/*": "./components/app/hooks/*.js",
|
|
193
|
-
"./components/app/drawers/*": "./components/app/drawers/*.js",
|
|
194
172
|
"./components/app/providers/*": "./components/app/providers/*.js",
|
|
195
|
-
"./components/
|
|
196
|
-
"./components/
|
|
197
|
-
"./components/
|
|
173
|
+
"./components/app/drawers/*": "./components/app/drawers/*.js",
|
|
174
|
+
"./components/logins/hooks/*": "./components/logins/hooks/*.js",
|
|
175
|
+
"./components/logins/auth/*": "./components/logins/auth/*.js",
|
|
176
|
+
"./components/elements/addons/*": "./components/elements/addons/*.js",
|
|
177
|
+
"./components/elements/hit/*": "./components/elements/hit/*.js",
|
|
178
|
+
"./components/elements/view/*": "./components/elements/view/*.js",
|
|
179
|
+
"./components/elements/display/*": "./components/elements/display/*.js",
|
|
180
|
+
"./components/elements/addons/buttons/*": "./components/elements/addons/buttons/*.js",
|
|
181
|
+
"./components/elements/addons/buttons": "./components/elements/addons/buttons/index.js",
|
|
182
|
+
"./components/elements/addons/search/*": "./components/elements/addons/search/*.js",
|
|
183
|
+
"./components/elements/addons/layout/*": "./components/elements/addons/layout/*.js",
|
|
184
|
+
"./components/elements/addons/lists/*": "./components/elements/addons/lists/*.js",
|
|
185
|
+
"./components/elements/addons/lists": "./components/elements/addons/lists/index.js",
|
|
186
|
+
"./components/elements/addons/search/phrase/*": "./components/elements/addons/search/phrase/*.js",
|
|
187
|
+
"./components/elements/addons/search/phrase": "./components/elements/addons/search/phrase/index.js",
|
|
188
|
+
"./components/elements/addons/search/phrase/word/*": "./components/elements/addons/search/phrase/word/*.js",
|
|
189
|
+
"./components/elements/addons/search/phrase/word/consumers/*": "./components/elements/addons/search/phrase/word/consumers/*.js",
|
|
190
|
+
"./components/elements/addons/layout/vsbox/*": "./components/elements/addons/layout/vsbox/*.js",
|
|
191
|
+
"./components/elements/addons/lists/hooks/*": "./components/elements/addons/lists/hooks/*.js",
|
|
192
|
+
"./components/elements/addons/lists/table/*": "./components/elements/addons/lists/table/*.js",
|
|
193
|
+
"./components/elements/addons/lists/table": "./components/elements/addons/lists/table/index.js",
|
|
194
|
+
"./components/elements/hit/aggregate/*": "./components/elements/hit/aggregate/*.js",
|
|
195
|
+
"./components/elements/hit/outlines/*": "./components/elements/hit/outlines/*.js",
|
|
196
|
+
"./components/elements/hit/related/*": "./components/elements/hit/related/*.js",
|
|
197
|
+
"./components/elements/hit/elements/*": "./components/elements/hit/elements/*.js",
|
|
198
|
+
"./components/elements/hit/actions/*": "./components/elements/hit/actions/*.js",
|
|
199
|
+
"./components/elements/hit/outlines/al/*": "./components/elements/hit/outlines/al/*.js",
|
|
200
|
+
"./components/elements/display/icons/*": "./components/elements/display/icons/*.js",
|
|
201
|
+
"./components/elements/display/modals/*": "./components/elements/display/modals/*.js",
|
|
202
|
+
"./components/elements/display/markdownPlugins/*.md": "./components/elements/display/markdownPlugins/*.md.js",
|
|
203
|
+
"./components/elements/display/json/*": "./components/elements/display/json/*.js",
|
|
204
|
+
"./components/elements/display/handlebars/*": "./components/elements/display/handlebars/*.js",
|
|
205
|
+
"./components/elements/display/features/*": "./components/elements/display/features/*.js",
|
|
206
|
+
"./components/elements/display/icons/svg/*": "./components/elements/display/icons/svg/*.js",
|
|
198
207
|
"./components/routes/admin/*": "./components/routes/admin/*.js",
|
|
199
|
-
"./components/routes/
|
|
208
|
+
"./components/routes/dossiers/*": "./components/routes/dossiers/*.js",
|
|
200
209
|
"./components/routes/advanced/*": "./components/routes/advanced/*.js",
|
|
201
|
-
"./components/routes/
|
|
210
|
+
"./components/routes/hits/*": "./components/routes/hits/*.js",
|
|
211
|
+
"./components/routes/settings/*": "./components/routes/settings/*.js",
|
|
202
212
|
"./components/routes/home/*": "./components/routes/home/*.js",
|
|
203
213
|
"./components/routes/home": "./components/routes/home/index.js",
|
|
204
|
-
"./components/routes/
|
|
205
|
-
"./components/routes/
|
|
206
|
-
"./components/routes/
|
|
214
|
+
"./components/routes/analytics/*": "./components/routes/analytics/*.js",
|
|
215
|
+
"./components/routes/help/*": "./components/routes/help/*.js",
|
|
216
|
+
"./components/routes/action/*": "./components/routes/action/*.js",
|
|
207
217
|
"./components/routes/views/*": "./components/routes/views/*.js",
|
|
208
|
-
"./components/routes/
|
|
209
|
-
"./components/routes/
|
|
210
|
-
"./components/routes/action/edit/*": "./components/routes/action/edit/*.js",
|
|
211
|
-
"./components/routes/help/markdown/*.md": "./components/routes/help/markdown/*.md.js",
|
|
212
|
-
"./components/routes/help/components/*": "./components/routes/help/components/*.js",
|
|
213
|
-
"./components/routes/help/markdown/en/*.md": "./components/routes/help/markdown/en/*.md.js",
|
|
214
|
-
"./components/routes/help/markdown/fr/*.md": "./components/routes/help/markdown/fr/*.md.js",
|
|
218
|
+
"./components/routes/overviews/*": "./components/routes/overviews/*.js",
|
|
219
|
+
"./components/routes/templates/*": "./components/routes/templates/*.js",
|
|
215
220
|
"./components/routes/admin/users/*": "./components/routes/admin/users/*.js",
|
|
216
221
|
"./components/routes/hits/search/*": "./components/routes/hits/search/*.js",
|
|
217
222
|
"./components/routes/hits/view/*": "./components/routes/hits/view/*.js",
|
|
218
223
|
"./components/routes/hits/search/grid/*": "./components/routes/hits/search/grid/*.js",
|
|
219
224
|
"./components/routes/hits/search/shared/*": "./components/routes/hits/search/shared/*.js",
|
|
220
225
|
"./components/routes/analytics/widgets/*": "./components/routes/analytics/widgets/*.js",
|
|
226
|
+
"./components/routes/help/components/*": "./components/routes/help/components/*.js",
|
|
227
|
+
"./components/routes/help/markdown/*.md": "./components/routes/help/markdown/*.md.js",
|
|
228
|
+
"./components/routes/help/markdown/en/*.md": "./components/routes/help/markdown/en/*.md.js",
|
|
229
|
+
"./components/routes/help/markdown/fr/*.md": "./components/routes/help/markdown/fr/*.md.js",
|
|
230
|
+
"./components/routes/action/view/*": "./components/routes/action/view/*.js",
|
|
231
|
+
"./components/routes/action/shared/*": "./components/routes/action/shared/*.js",
|
|
232
|
+
"./components/routes/action/edit/*": "./components/routes/action/edit/*.js",
|
|
221
233
|
"./components/routes/overviews/template/*": "./components/routes/overviews/template/*.js",
|
|
222
|
-
"./components
|
|
223
|
-
"./components/
|
|
224
|
-
"./components/
|
|
225
|
-
"./components/
|
|
226
|
-
"./components/
|
|
227
|
-
"./components/
|
|
228
|
-
"./components/
|
|
229
|
-
"./components/
|
|
230
|
-
"./components/
|
|
231
|
-
"./components/
|
|
232
|
-
"./components/
|
|
233
|
-
"./components/
|
|
234
|
-
"./components/
|
|
235
|
-
"./components/
|
|
236
|
-
"./components/
|
|
237
|
-
"./components/
|
|
238
|
-
"./components/
|
|
239
|
-
"./components/elements
|
|
240
|
-
"./components/elements/
|
|
241
|
-
"./components/elements/addons/search/*": "./components/elements/addons/search/*.js",
|
|
242
|
-
"./components/elements/addons/layout/*": "./components/elements/addons/layout/*.js",
|
|
243
|
-
"./components/elements/addons/buttons/*": "./components/elements/addons/buttons/*.js",
|
|
244
|
-
"./components/elements/addons/buttons": "./components/elements/addons/buttons/index.js",
|
|
245
|
-
"./components/elements/addons/lists/hooks/*": "./components/elements/addons/lists/hooks/*.js",
|
|
246
|
-
"./components/elements/addons/lists/table/*": "./components/elements/addons/lists/table/*.js",
|
|
247
|
-
"./components/elements/addons/lists/table": "./components/elements/addons/lists/table/index.js",
|
|
248
|
-
"./components/elements/addons/search/phrase/*": "./components/elements/addons/search/phrase/*.js",
|
|
249
|
-
"./components/elements/addons/search/phrase": "./components/elements/addons/search/phrase/index.js",
|
|
250
|
-
"./components/elements/addons/search/phrase/word/*": "./components/elements/addons/search/phrase/word/*.js",
|
|
251
|
-
"./components/elements/addons/search/phrase/word/consumers/*": "./components/elements/addons/search/phrase/word/consumers/*.js",
|
|
252
|
-
"./components/elements/addons/layout/vsbox/*": "./components/elements/addons/layout/vsbox/*.js"
|
|
234
|
+
"./commons/components/*": "./commons/components/*.js",
|
|
235
|
+
"./commons/components/utils/*": "./commons/components/utils/*.js",
|
|
236
|
+
"./commons/components/leftnav/*": "./commons/components/leftnav/*.js",
|
|
237
|
+
"./commons/components/pages/*": "./commons/components/pages/*.js",
|
|
238
|
+
"./commons/components/topnav/*": "./commons/components/topnav/*.js",
|
|
239
|
+
"./commons/components/app/*": "./commons/components/app/*.js",
|
|
240
|
+
"./commons/components/search/*": "./commons/components/search/*.js",
|
|
241
|
+
"./commons/components/breadcrumbs/*": "./commons/components/breadcrumbs/*.js",
|
|
242
|
+
"./commons/components/display/*": "./commons/components/display/*.js",
|
|
243
|
+
"./commons/components/notification/*": "./commons/components/notification/*.js",
|
|
244
|
+
"./commons/components/notification": "./commons/components/notification/index.js",
|
|
245
|
+
"./commons/components/utils/hooks/*": "./commons/components/utils/hooks/*.js",
|
|
246
|
+
"./commons/components/pages/hooks/*": "./commons/components/pages/hooks/*.js",
|
|
247
|
+
"./commons/components/app/hooks/*": "./commons/components/app/hooks/*.js",
|
|
248
|
+
"./commons/components/app/hooks": "./commons/components/app/hooks/index.js",
|
|
249
|
+
"./commons/components/app/providers/*": "./commons/components/app/providers/*.js",
|
|
250
|
+
"./commons/components/display/hooks/*": "./commons/components/display/hooks/*.js",
|
|
251
|
+
"./commons/components/notification/elements/*": "./commons/components/notification/elements/*.js",
|
|
252
|
+
"./commons/components/notification/elements/item/*": "./commons/components/notification/elements/item/*.js"
|
|
253
253
|
}
|
|
254
254
|
}
|
|
@@ -13,6 +13,7 @@ import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
|
13
13
|
import type React from 'react';
|
|
14
14
|
import type { PropsWithChildren } from 'react';
|
|
15
15
|
import type { IPlugin, PluginStore } from 'react-pluggable';
|
|
16
|
+
import type { MainMenuInsertOperation } from './store';
|
|
16
17
|
declare abstract class HowlerPlugin implements IPlugin {
|
|
17
18
|
abstract name: string;
|
|
18
19
|
abstract version: string;
|
|
@@ -27,7 +28,6 @@ declare abstract class HowlerPlugin implements IPlugin {
|
|
|
27
28
|
deactivate(): void;
|
|
28
29
|
addLead(format: string, form: (props: LeadFormProps) => React.ReactNode, renderer: (content: string, metadata: any, hit?: Hit) => React.ReactNode): void;
|
|
29
30
|
addPivot(format: string, form: (props: PivotFormProps) => React.ReactNode, renderer: (props: PivotLinkProps) => React.ReactNode): void;
|
|
30
|
-
addOperation(format: string, form: (props: CustomActionProps) => React.ReactNode, documentation: PluginDocumentation): void;
|
|
31
31
|
/**
|
|
32
32
|
* Adds a single menu item to the User Menu group under the Avatar Menu,
|
|
33
33
|
* items are added before the 'Settings' and 'Logout' menu items.
|
|
@@ -46,6 +46,58 @@ declare abstract class HowlerPlugin implements IPlugin {
|
|
|
46
46
|
* @param icon JSX Icon element, <Settings/> for example
|
|
47
47
|
*/
|
|
48
48
|
addAdminMenuItem(i18nKey: string, route: string, icon: JSX.Element): void;
|
|
49
|
+
/**
|
|
50
|
+
* Adds a single route to the system to load, items are added to the end of
|
|
51
|
+
* base routes defined.
|
|
52
|
+
*
|
|
53
|
+
* @param path Route path, should not start with /
|
|
54
|
+
* @param element Element the route directs to
|
|
55
|
+
* @param children Child routes if required
|
|
56
|
+
*/
|
|
57
|
+
addRoute(path: string, element: JSX.Element, children?: []): void;
|
|
58
|
+
/**
|
|
59
|
+
* Adds a sitemap entry to the sitemap table, this is used to populate
|
|
60
|
+
* information on the Breadcrumb component
|
|
61
|
+
*
|
|
62
|
+
* @param path The react router path to this route
|
|
63
|
+
* @param title The title/label to display in breadcrumbs for this route
|
|
64
|
+
* @param icon The icon component to show beside the title/label
|
|
65
|
+
* @param isRoot When true, indicates that the breadcrumbs will reset to this one path each time it is encountered
|
|
66
|
+
* @param isLeaf When true, indicates that this path does not aggregate in breadcrumbs, i.e. will be replaced by next path
|
|
67
|
+
* @param excluded When true, indicates to breadcrumbs component to not render this route
|
|
68
|
+
* @param breadcrumbs Static list of breadcrumb paths to be rendered for the given route
|
|
69
|
+
* @param textWidth The max width of the text when rendering the breadcrumb
|
|
70
|
+
*/
|
|
71
|
+
addSitemap(path: string, title: string, icon?: JSX.Element, isRoot?: boolean, isLeaf?: boolean, excluded?: boolean, breadcrumbs?: string[], textWidth?: number): void;
|
|
72
|
+
/**
|
|
73
|
+
* Adds a route as well as a simple sitemap entry with values derived from the path
|
|
74
|
+
*
|
|
75
|
+
* @param path Route path, should not start with /
|
|
76
|
+
* @param element Element the route directs to
|
|
77
|
+
* @param children Child routes if required
|
|
78
|
+
* @param title The title/label to display in breadcrumbs for this route
|
|
79
|
+
* @param icon The icon component to show beside the title/label
|
|
80
|
+
*/
|
|
81
|
+
addRouteAndSitemap(path: string, element: JSX.Element, title: string, icon?: JSX.Element, children?: []): void;
|
|
82
|
+
/**
|
|
83
|
+
* Adds a new menu item to the Main Menu
|
|
84
|
+
*
|
|
85
|
+
* @param operation Insert operation to perform
|
|
86
|
+
* @param targetId Reference Menu Id
|
|
87
|
+
* @param id Identifier for new menu entry
|
|
88
|
+
* @param i18nKey Translation key for new menu entry
|
|
89
|
+
* @param route Route for new menu entry
|
|
90
|
+
* @param icon Icon for new menu entry
|
|
91
|
+
*/
|
|
92
|
+
addMainMenuItem(operation: MainMenuInsertOperation, targetId: string, id: string, i18nKey: string, route: string, icon: JSX.Element): void;
|
|
93
|
+
/**
|
|
94
|
+
* Adds a divider to the main menu
|
|
95
|
+
*
|
|
96
|
+
* @param operation Insert operation to perform
|
|
97
|
+
* @param targetId Reference menu id
|
|
98
|
+
*/
|
|
99
|
+
addMainMenuDivider(operation: MainMenuInsertOperation, targetId: string): void;
|
|
100
|
+
addOperation(format: string, form: (props: CustomActionProps) => React.ReactNode, documentation: PluginDocumentation): void;
|
|
49
101
|
on(_event: string, _hit: Hit): any;
|
|
50
102
|
provider(): React.FC<PropsWithChildren<{}>> | null;
|
|
51
103
|
setup(): void;
|
package/plugins/HowlerPlugin.js
CHANGED
|
@@ -8,7 +8,16 @@ const INTERNAL_FUNCTIONS = [
|
|
|
8
8
|
'init',
|
|
9
9
|
'activate',
|
|
10
10
|
'deactivate',
|
|
11
|
-
'addLead'
|
|
11
|
+
'addLead',
|
|
12
|
+
'addPivot',
|
|
13
|
+
'addUserMenuItem',
|
|
14
|
+
'addAdminMenuItem',
|
|
15
|
+
'addRoute',
|
|
16
|
+
'addSitemap',
|
|
17
|
+
'addRouteAndSitemap',
|
|
18
|
+
'addMainMenuItem',
|
|
19
|
+
'addMainMenuDivider',
|
|
20
|
+
'addOperation'
|
|
12
21
|
];
|
|
13
22
|
class HowlerPlugin {
|
|
14
23
|
pluginStore;
|
|
@@ -59,19 +68,6 @@ class HowlerPlugin {
|
|
|
59
68
|
// eslint-disable-next-line no-console
|
|
60
69
|
console.debug(`Pivot format ${format} enabled for plugin ${this.getPluginName()}`);
|
|
61
70
|
}
|
|
62
|
-
addOperation(format, form, documentation) {
|
|
63
|
-
if (!howlerPluginStore.addOperation(format)) {
|
|
64
|
-
// eslint-disable-next-line no-console
|
|
65
|
-
console.error(`Operation ${format} already configured, not enabling for plugin ${this.getPluginName()}`);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
this.pluginStore.addFunction(`operation.${format}`, form);
|
|
69
|
-
this.functionsToRemove.push(`operation.${format}`);
|
|
70
|
-
this.pluginStore.addFunction(`operation.${format}.documentation`, () => documentation);
|
|
71
|
-
this.functionsToRemove.push(`operation.${format}.documentation`);
|
|
72
|
-
// eslint-disable-next-line no-console
|
|
73
|
-
console.debug(`Operation ${format} enabled for plugin ${this.getPluginName()}`);
|
|
74
|
-
}
|
|
75
71
|
/**
|
|
76
72
|
* Adds a single menu item to the User Menu group under the Avatar Menu,
|
|
77
73
|
* items are added before the 'Settings' and 'Logout' menu items.
|
|
@@ -102,6 +98,142 @@ class HowlerPlugin {
|
|
|
102
98
|
icon: icon
|
|
103
99
|
});
|
|
104
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Adds a single route to the system to load, items are added to the end of
|
|
103
|
+
* base routes defined.
|
|
104
|
+
*
|
|
105
|
+
* @param path Route path, should not start with /
|
|
106
|
+
* @param element Element the route directs to
|
|
107
|
+
* @param children Child routes if required
|
|
108
|
+
*/
|
|
109
|
+
addRoute(path, element, children) {
|
|
110
|
+
howlerPluginStore.addRoute({
|
|
111
|
+
path: path,
|
|
112
|
+
element: element,
|
|
113
|
+
children: children
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Adds a sitemap entry to the sitemap table, this is used to populate
|
|
118
|
+
* information on the Breadcrumb component
|
|
119
|
+
*
|
|
120
|
+
* @param path The react router path to this route
|
|
121
|
+
* @param title The title/label to display in breadcrumbs for this route
|
|
122
|
+
* @param icon The icon component to show beside the title/label
|
|
123
|
+
* @param isRoot When true, indicates that the breadcrumbs will reset to this one path each time it is encountered
|
|
124
|
+
* @param isLeaf When true, indicates that this path does not aggregate in breadcrumbs, i.e. will be replaced by next path
|
|
125
|
+
* @param excluded When true, indicates to breadcrumbs component to not render this route
|
|
126
|
+
* @param breadcrumbs Static list of breadcrumb paths to be rendered for the given route
|
|
127
|
+
* @param textWidth The max width of the text when rendering the breadcrumb
|
|
128
|
+
*/
|
|
129
|
+
addSitemap(path, title, icon, isRoot, isLeaf, excluded, breadcrumbs, textWidth) {
|
|
130
|
+
if (isRoot === isLeaf) {
|
|
131
|
+
throw new Error(`Sitemap '${path}' must define either isRoot or isLeaf as true`);
|
|
132
|
+
}
|
|
133
|
+
if (isRoot) {
|
|
134
|
+
if (breadcrumbs != null) {
|
|
135
|
+
breadcrumbs = null;
|
|
136
|
+
console.warn(`Sitemap '${path}' with isRoot should not contain breadcrumbs and have been removed`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
howlerPluginStore.addSitemap({
|
|
140
|
+
path: path,
|
|
141
|
+
title: title,
|
|
142
|
+
icon: icon,
|
|
143
|
+
isRoot: isRoot,
|
|
144
|
+
isLeaf: isLeaf,
|
|
145
|
+
excluded: excluded,
|
|
146
|
+
breadcrumbs: breadcrumbs,
|
|
147
|
+
textWidth: textWidth
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Adds a route as well as a simple sitemap entry with values derived from the path
|
|
152
|
+
*
|
|
153
|
+
* @param path Route path, should not start with /
|
|
154
|
+
* @param element Element the route directs to
|
|
155
|
+
* @param children Child routes if required
|
|
156
|
+
* @param title The title/label to display in breadcrumbs for this route
|
|
157
|
+
* @param icon The icon component to show beside the title/label
|
|
158
|
+
*/
|
|
159
|
+
addRouteAndSitemap(path, element, title, icon, children) {
|
|
160
|
+
this.addRoute(path, element, children);
|
|
161
|
+
const routeParts = path.split('/');
|
|
162
|
+
let isRoot = true;
|
|
163
|
+
let isLeaf = false;
|
|
164
|
+
let breadcrumbs = null;
|
|
165
|
+
if (routeParts.length > 1) {
|
|
166
|
+
// Set as leaf and not root
|
|
167
|
+
isRoot = false;
|
|
168
|
+
isLeaf = true;
|
|
169
|
+
// Attempt to auto build breadcrumbs
|
|
170
|
+
breadcrumbs = [];
|
|
171
|
+
for (let index = 0; index < routeParts.length - 1; index++) {
|
|
172
|
+
breadcrumbs.push(`/${routeParts[index]}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
this.addSitemap(`/${path}`, title, icon, isRoot, isLeaf, false, breadcrumbs);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Adds a new menu item to the Main Menu
|
|
179
|
+
*
|
|
180
|
+
* @param operation Insert operation to perform
|
|
181
|
+
* @param targetId Reference Menu Id
|
|
182
|
+
* @param id Identifier for new menu entry
|
|
183
|
+
* @param i18nKey Translation key for new menu entry
|
|
184
|
+
* @param route Route for new menu entry
|
|
185
|
+
* @param icon Icon for new menu entry
|
|
186
|
+
*/
|
|
187
|
+
addMainMenuItem(operation, targetId, id, i18nKey, route, icon) {
|
|
188
|
+
if (targetId === '') {
|
|
189
|
+
targetId = 'root';
|
|
190
|
+
}
|
|
191
|
+
howlerPluginStore.addMainMenuItem({
|
|
192
|
+
operation: operation,
|
|
193
|
+
targetId: targetId,
|
|
194
|
+
item: {
|
|
195
|
+
type: 'item',
|
|
196
|
+
element: {
|
|
197
|
+
id: id,
|
|
198
|
+
i18nKey: i18nKey,
|
|
199
|
+
route: route,
|
|
200
|
+
icon: icon
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Adds a divider to the main menu
|
|
207
|
+
*
|
|
208
|
+
* @param operation Insert operation to perform
|
|
209
|
+
* @param targetId Reference menu id
|
|
210
|
+
*/
|
|
211
|
+
addMainMenuDivider(operation, targetId) {
|
|
212
|
+
if (targetId === '') {
|
|
213
|
+
targetId = 'root';
|
|
214
|
+
}
|
|
215
|
+
howlerPluginStore.addMainMenuItem({
|
|
216
|
+
operation: operation,
|
|
217
|
+
targetId: targetId,
|
|
218
|
+
item: {
|
|
219
|
+
type: 'divider',
|
|
220
|
+
element: null
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
addOperation(format, form, documentation) {
|
|
225
|
+
if (!howlerPluginStore.addOperation(format)) {
|
|
226
|
+
// eslint-disable-next-line no-console
|
|
227
|
+
console.error(`Operation ${format} already configured, not enabling for plugin ${this.getPluginName()}`);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
this.pluginStore.addFunction(`operation.${format}`, form);
|
|
231
|
+
this.functionsToRemove.push(`operation.${format}`);
|
|
232
|
+
this.pluginStore.addFunction(`operation.${format}.documentation`, () => documentation);
|
|
233
|
+
this.functionsToRemove.push(`operation.${format}.documentation`);
|
|
234
|
+
// eslint-disable-next-line no-console
|
|
235
|
+
console.debug(`Operation ${format} enabled for plugin ${this.getPluginName()}`);
|
|
236
|
+
}
|
|
105
237
|
on(_event, _hit) {
|
|
106
238
|
return null;
|
|
107
239
|
}
|
package/plugins/store.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
2
2
|
import { Event } from 'react-pluggable';
|
|
3
3
|
import type HowlerPlugin from './HowlerPlugin';
|
|
4
|
+
import type { AppLeftNavElement } from '../commons/components/app/AppConfigs';
|
|
4
5
|
export declare class HitEvent extends Event {
|
|
5
6
|
hit: Hit;
|
|
6
7
|
constructor(type: string, hit: Hit);
|
|
7
8
|
}
|
|
9
|
+
export declare enum MainMenuInsertOperation {
|
|
10
|
+
Insert = "INSERT",
|
|
11
|
+
InsertAfter = "AFTER",
|
|
12
|
+
InsertBefore = "BEFORE"
|
|
13
|
+
}
|
|
8
14
|
declare class HowlerPluginStore {
|
|
9
15
|
private _pluginStore;
|
|
10
16
|
plugins: string[];
|
|
@@ -13,36 +19,46 @@ declare class HowlerPluginStore {
|
|
|
13
19
|
private _operations;
|
|
14
20
|
private _userMenuItems;
|
|
15
21
|
private _adminMenuItems;
|
|
22
|
+
private _mainMenuOperations;
|
|
23
|
+
private _routes;
|
|
24
|
+
private _sitemaps;
|
|
16
25
|
install(plugin: HowlerPlugin): void;
|
|
17
26
|
addLead(format: string): boolean;
|
|
18
27
|
addPivot(format: string): boolean;
|
|
19
|
-
addOperation(format: string): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Adds a single menu item to the User Menu group under the Avatar Menu,
|
|
22
|
-
* items are added before the 'Settings' and 'Logout' menu items.
|
|
23
|
-
*
|
|
24
|
-
* @param menuItem Menu Item {i18nKey, route, icon}
|
|
25
|
-
*/
|
|
26
28
|
addUserMenuItem(menuItem: {
|
|
27
29
|
i18nKey: string;
|
|
28
30
|
route: string;
|
|
29
31
|
icon: JSX.Element;
|
|
30
32
|
}): void;
|
|
31
|
-
/**
|
|
32
|
-
* Adds a single menu item to the Admin Menu group under the Avatar Menu,
|
|
33
|
-
* items are added to the end of the existing Admin menu items.
|
|
34
|
-
*
|
|
35
|
-
* @param menuItem Menu Item {i18nKey, route, icon}
|
|
36
|
-
*/
|
|
37
33
|
addAdminMenuItem(menuItem: {
|
|
38
34
|
i18nKey: string;
|
|
39
35
|
route: string;
|
|
40
36
|
icon: JSX.Element;
|
|
41
37
|
}): void;
|
|
38
|
+
addMainMenuItem(menuOperation: {
|
|
39
|
+
operation: string;
|
|
40
|
+
targetId: string;
|
|
41
|
+
item: AppLeftNavElement;
|
|
42
|
+
}): void;
|
|
43
|
+
addRoute(route: {
|
|
44
|
+
path: string;
|
|
45
|
+
element: JSX.Element;
|
|
46
|
+
children?: [];
|
|
47
|
+
}): void;
|
|
48
|
+
addSitemap(sitemap: {
|
|
49
|
+
path: string;
|
|
50
|
+
title: string;
|
|
51
|
+
icon?: JSX.Element;
|
|
52
|
+
isRoot?: boolean;
|
|
53
|
+
isLeaf?: boolean;
|
|
54
|
+
excluded?: boolean;
|
|
55
|
+
breadcrumbs?: string[];
|
|
56
|
+
textWidth?: number;
|
|
57
|
+
}): void;
|
|
58
|
+
addOperation(format: string): boolean;
|
|
42
59
|
get leadFormats(): string[];
|
|
43
60
|
get pivotFormats(): string[];
|
|
44
61
|
get operations(): string[];
|
|
45
|
-
get pluginStore(): import("react-pluggable").PluginStore;
|
|
46
62
|
get userMenuItems(): {
|
|
47
63
|
i18nKey: string;
|
|
48
64
|
route: string;
|
|
@@ -53,6 +69,27 @@ declare class HowlerPluginStore {
|
|
|
53
69
|
route: string;
|
|
54
70
|
icon: JSX.Element;
|
|
55
71
|
}[];
|
|
72
|
+
get mainMenuOperations(): {
|
|
73
|
+
operation: string;
|
|
74
|
+
targetId: string;
|
|
75
|
+
item: AppLeftNavElement;
|
|
76
|
+
}[];
|
|
77
|
+
get routes(): {
|
|
78
|
+
path: string;
|
|
79
|
+
element: JSX.Element;
|
|
80
|
+
children?: [];
|
|
81
|
+
}[];
|
|
82
|
+
get sitemaps(): {
|
|
83
|
+
path: string;
|
|
84
|
+
title: string;
|
|
85
|
+
icon?: JSX.Element;
|
|
86
|
+
isRoot?: boolean;
|
|
87
|
+
isLeaf?: boolean;
|
|
88
|
+
excluded?: boolean;
|
|
89
|
+
breadcrumbs?: string[];
|
|
90
|
+
textWidth?: number;
|
|
91
|
+
}[];
|
|
92
|
+
get pluginStore(): import("react-pluggable").PluginStore;
|
|
56
93
|
}
|
|
57
94
|
declare const howlerPluginStore: HowlerPluginStore;
|
|
58
95
|
export default howlerPluginStore;
|