@cccsaurora/howler-ui 2.13.0-dev.96 → 2.13.1

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.
Files changed (118) hide show
  1. package/api/hit/index.d.ts +1 -1
  2. package/api/hit/index.js +6 -2
  3. package/api/search/index.d.ts +1 -0
  4. package/api/view/index.d.ts +1 -1
  5. package/api/view/index.js +2 -2
  6. package/commons/components/notification/elements/item/NotificationItemDate.js +2 -2
  7. package/commons/components/utils/hooks/useEnv.d.ts +1 -1
  8. package/components/app/App.js +1 -3
  9. package/components/app/drawers/ApiKeyDrawer.js +4 -4
  10. package/components/app/hooks/useMatchers.d.ts +9 -0
  11. package/components/app/hooks/useMatchers.js +82 -0
  12. package/components/app/hooks/useMatchers.test.d.ts +1 -0
  13. package/components/app/hooks/useMatchers.test.js +237 -0
  14. package/components/app/hooks/useTitle.js +5 -4
  15. package/components/app/providers/AnalyticProvider.d.ts +0 -4
  16. package/components/app/providers/AnalyticProvider.js +1 -44
  17. package/components/app/providers/ApiConfigProvider.js +2 -1
  18. package/components/app/providers/HitProvider.d.ts +2 -1
  19. package/components/app/providers/HitProvider.js +8 -2
  20. package/components/app/providers/HitSearchProvider.d.ts +2 -1
  21. package/components/app/providers/HitSearchProvider.js +2 -1
  22. package/components/app/providers/SocketProvider.js +1 -1
  23. package/components/app/providers/ViewProvider.d.ts +1 -1
  24. package/components/app/providers/ViewProvider.js +3 -3
  25. package/components/app/providers/ViewProvider.test.d.ts +1 -0
  26. package/components/app/providers/ViewProvider.test.js +150 -0
  27. package/components/elements/display/ActionButton.d.ts +8 -0
  28. package/components/elements/display/ActionButton.js +18 -0
  29. package/components/elements/display/handlebars/helpers.js +17 -2
  30. package/components/elements/display/json/JSONViewer.d.ts +2 -0
  31. package/components/elements/display/json/JSONViewer.js +6 -13
  32. package/components/elements/hit/HitActions.js +4 -6
  33. package/components/elements/hit/HitBanner.js +13 -5
  34. package/components/elements/hit/HitCard.js +0 -5
  35. package/components/elements/hit/HitComments.js +5 -4
  36. package/components/elements/hit/HitOutline.d.ts +2 -2
  37. package/components/elements/hit/HitOutline.js +11 -21
  38. package/components/elements/hit/HitOverview.js +7 -4
  39. package/components/elements/hit/HitSummary.d.ts +2 -1
  40. package/components/elements/hit/HitSummary.js +8 -7
  41. package/components/elements/hit/aggregate/HitGraph.d.ts +1 -1
  42. package/components/elements/hit/aggregate/HitGraph.js +7 -7
  43. package/components/elements/hit/elements/HitTimestamp.js +8 -8
  44. package/components/elements/hit/related/PivotLink.js +11 -5
  45. package/components/elements/hit/related/RelatedIcon.d.ts +8 -0
  46. package/components/elements/hit/related/RelatedIcon.js +32 -0
  47. package/components/elements/hit/related/RelatedLink.js +4 -25
  48. package/components/hooks/useMyChart.d.ts +1 -1
  49. package/components/hooks/useMyChart.js +1 -1
  50. package/components/routes/advanced/QueryBuilder.js +47 -11
  51. package/components/routes/advanced/QueryEditor.js +8 -13
  52. package/components/routes/analytics/AnalyticOverview.d.ts +1 -1
  53. package/components/routes/analytics/AnalyticOverview.js +1 -1
  54. package/components/routes/analytics/AnalyticOverviews.d.ts +1 -1
  55. package/components/routes/analytics/AnalyticOverviews.js +1 -1
  56. package/components/routes/analytics/AnalyticSearch.js +14 -2
  57. package/components/routes/analytics/AnalyticTemplates.d.ts +1 -1
  58. package/components/routes/analytics/AnalyticTemplates.js +10 -7
  59. package/components/routes/analytics/RuleView.d.ts +1 -1
  60. package/components/routes/analytics/RuleView.js +1 -1
  61. package/components/routes/analytics/TriageSettings.d.ts +1 -1
  62. package/components/routes/analytics/TriageSettings.js +1 -1
  63. package/components/routes/analytics/widgets/Assessment.d.ts +1 -1
  64. package/components/routes/analytics/widgets/Assessment.js +1 -1
  65. package/components/routes/analytics/widgets/Created.d.ts +1 -1
  66. package/components/routes/analytics/widgets/Created.js +1 -1
  67. package/components/routes/analytics/widgets/Detection.d.ts +1 -1
  68. package/components/routes/analytics/widgets/Detection.js +1 -1
  69. package/components/routes/analytics/widgets/Escalation.d.ts +1 -1
  70. package/components/routes/analytics/widgets/Escalation.js +1 -1
  71. package/components/routes/analytics/widgets/Stacked.d.ts +1 -1
  72. package/components/routes/analytics/widgets/Stacked.js +1 -1
  73. package/components/routes/analytics/widgets/Status.d.ts +1 -1
  74. package/components/routes/analytics/widgets/Status.js +1 -1
  75. package/components/routes/help/SearchDocumentation.js +2 -1
  76. package/components/routes/help/TemplateDocumentation.js +5 -5
  77. package/components/routes/hits/search/HitBrowser.js +2 -2
  78. package/components/routes/hits/search/HitContextMenu.js +6 -7
  79. package/components/routes/hits/search/HitQuery.js +2 -1
  80. package/components/routes/hits/search/InformationPane.js +75 -78
  81. package/components/routes/hits/search/SearchPane.js +3 -9
  82. package/components/routes/hits/search/grid/AddColumnModal.js +10 -5
  83. package/components/routes/hits/search/grid/HitGrid.js +6 -5
  84. package/components/routes/hits/search/shared/CustomSpan.js +6 -6
  85. package/components/routes/hits/view/HitViewer.js +18 -26
  86. package/components/routes/home/index.js +4 -4
  87. package/components/routes/overviews/OverviewViewer.js +33 -31
  88. package/components/routes/settings/SecuritySection.js +2 -2
  89. package/components/routes/templates/TemplateViewer.js +27 -36
  90. package/components/routes/templates/Templates.js +4 -11
  91. package/components/routes/views/ViewComposer.js +8 -1
  92. package/components/routes/views/Views.js +25 -9
  93. package/index.js +7 -0
  94. package/locales/en/help/search.json +17 -0
  95. package/locales/en/translation.json +12 -3
  96. package/locales/fr/help/search.json +17 -0
  97. package/locales/fr/translation.json +12 -4
  98. package/models/WithMetadata.d.ts +10 -0
  99. package/models/WithMetadata.js +1 -0
  100. package/models/entities/generated/ApiType.d.ts +7 -0
  101. package/package.json +112 -111
  102. package/plugins/borealis/components/BorealisTypography.js +4 -2
  103. package/setupTests.d.ts +1 -0
  104. package/setupTests.js +12 -0
  105. package/tests/MockLocalStorage.d.ts +5 -0
  106. package/tests/MockLocalStorage.js +44 -0
  107. package/tests/server-handlers.d.ts +5 -0
  108. package/tests/server-handlers.js +97 -0
  109. package/tests/server.d.ts +3 -0
  110. package/tests/server.js +5 -0
  111. package/utils/constants.js +2 -2
  112. package/utils/stringUtils.d.ts +1 -0
  113. package/utils/stringUtils.js +9 -0
  114. package/utils/utils.js +3 -3
  115. package/components/app/providers/DossierProvider.d.ts +0 -16
  116. package/components/app/providers/DossierProvider.js +0 -82
  117. package/components/app/providers/TemplateProvider.d.ts +0 -14
  118. package/components/app/providers/TemplateProvider.js +0 -103
package/package.json CHANGED
@@ -27,14 +27,15 @@
27
27
  "@mui/x-date-pickers": "^7.29.4",
28
28
  "ajv": "^8.17.1",
29
29
  "ajv-i18n": "^4.2.0",
30
- "axios": "^1.10.0",
30
+ "axios": "^1.11.0",
31
31
  "axios-retry": "^3.9.1",
32
32
  "borealis-ui": "0.11.0",
33
33
  "chart.js": "^4.5.0",
34
- "chartjs-adapter-moment": "^1.0.1",
34
+ "chartjs-adapter-dayjs-4": "^1.0.4",
35
35
  "chartjs-plugin-zoom": "^2.2.0",
36
36
  "clsx": "^2.1.1",
37
37
  "csstype": "^3.1.3",
38
+ "dayjs": "^1.11.13",
38
39
  "dompurify": "^3.2.6",
39
40
  "express": "^4.21.2",
40
41
  "flat": "^6.0.1",
@@ -46,8 +47,7 @@
46
47
  "json2mq": "^0.2.0",
47
48
  "lodash-es": "^4.17.21",
48
49
  "md5": "^2.3.0",
49
- "mermaid": "^11.8.1",
50
- "moment": "^2.30.1",
50
+ "mermaid": "^11.10.0",
51
51
  "monaco-editor": "^0.49.0",
52
52
  "notistack": "^3.0.2",
53
53
  "react": "^18.3.1",
@@ -96,162 +96,163 @@
96
96
  "internal-slot": "1.0.7"
97
97
  },
98
98
  "type": "module",
99
- "version": "2.13.0-dev.96",
99
+ "version": "2.13.1",
100
100
  "exports": {
101
101
  "./i18n": "./i18n.js",
102
102
  "./index.css": "./index.css",
103
- "./models/*": "./models/*.js",
104
- "./branding/*": "./branding/*.js",
105
- "./commons/*": "./commons/*.js",
106
103
  "./utils/*": "./utils/*.js",
107
104
  "./utils/*.json": "./utils/*.json",
108
- "./rest/*": "./rest/*.js",
109
- "./rest": "./rest/index.js",
110
- "./components/*": "./components/*.js",
111
- "./plugins/*": "./plugins/*.js",
105
+ "./locales/*.json": "./locales/*.json",
106
+ "./commons/*": "./commons/*.js",
112
107
  "./api/*": "./api/*.js",
113
108
  "./api": "./api/index.js",
114
- "./locales/*.json": "./locales/*.json",
115
- "./models/socket/*": "./models/socket/*.js",
116
- "./models/entities/*": "./models/entities/*.js",
117
- "./models/entities/generated/*": "./models/entities/generated/*.js",
109
+ "./tests/*": "./tests/*.js",
110
+ "./plugins/*": "./plugins/*.js",
111
+ "./branding/*": "./branding/*.js",
112
+ "./components/*": "./components/*.js",
113
+ "./rest/*": "./rest/*.js",
114
+ "./rest": "./rest/index.js",
115
+ "./models/*": "./models/*.js",
116
+ "./locales/fr/*.json": "./locales/fr/*.json",
117
+ "./locales/en/*.json": "./locales/en/*.json",
118
+ "./locales/fr/help/*.json": "./locales/fr/help/*.json",
119
+ "./locales/en/help/*.json": "./locales/en/help/*.json",
118
120
  "./commons/components/*": "./commons/components/*.js",
119
- "./commons/components/notification/*": "./commons/components/notification/*.js",
120
- "./commons/components/notification": "./commons/components/notification/index.js",
121
- "./commons/components/search/*": "./commons/components/search/*.js",
122
- "./commons/components/display/*": "./commons/components/display/*.js",
123
- "./commons/components/breadcrumbs/*": "./commons/components/breadcrumbs/*.js",
124
- "./commons/components/app/*": "./commons/components/app/*.js",
125
121
  "./commons/components/utils/*": "./commons/components/utils/*.js",
126
122
  "./commons/components/topnav/*": "./commons/components/topnav/*.js",
123
+ "./commons/components/app/*": "./commons/components/app/*.js",
124
+ "./commons/components/display/*": "./commons/components/display/*.js",
125
+ "./commons/components/breadcrumbs/*": "./commons/components/breadcrumbs/*.js",
126
+ "./commons/components/search/*": "./commons/components/search/*.js",
127
127
  "./commons/components/pages/*": "./commons/components/pages/*.js",
128
+ "./commons/components/notification/*": "./commons/components/notification/*.js",
129
+ "./commons/components/notification": "./commons/components/notification/index.js",
128
130
  "./commons/components/leftnav/*": "./commons/components/leftnav/*.js",
129
- "./commons/components/notification/elements/*": "./commons/components/notification/elements/*.js",
130
- "./commons/components/notification/elements/item/*": "./commons/components/notification/elements/item/*.js",
131
- "./commons/components/display/hooks/*": "./commons/components/display/hooks/*.js",
131
+ "./commons/components/utils/hooks/*": "./commons/components/utils/hooks/*.js",
132
+ "./commons/components/app/providers/*": "./commons/components/app/providers/*.js",
132
133
  "./commons/components/app/hooks/*": "./commons/components/app/hooks/*.js",
133
134
  "./commons/components/app/hooks": "./commons/components/app/hooks/index.js",
134
- "./commons/components/app/providers/*": "./commons/components/app/providers/*.js",
135
- "./commons/components/utils/hooks/*": "./commons/components/utils/hooks/*.js",
135
+ "./commons/components/display/hooks/*": "./commons/components/display/hooks/*.js",
136
136
  "./commons/components/pages/hooks/*": "./commons/components/pages/hooks/*.js",
137
- "./components/hooks/*": "./components/hooks/*.js",
138
- "./components/elements/*": "./components/elements/*.js",
137
+ "./commons/components/notification/elements/*": "./commons/components/notification/elements/*.js",
138
+ "./commons/components/notification/elements/item/*": "./commons/components/notification/elements/item/*.js",
139
+ "./api/template/*": "./api/template/*.js",
140
+ "./api/template": "./api/template/index.js",
141
+ "./api/action/*": "./api/action/*.js",
142
+ "./api/action": "./api/action/index.js",
143
+ "./api/user/*": "./api/user/*.js",
144
+ "./api/user": "./api/user/index.js",
145
+ "./api/hit/*": "./api/hit/*.js",
146
+ "./api/hit": "./api/hit/index.js",
147
+ "./api/configs/*": "./api/configs/*.js",
148
+ "./api/configs": "./api/configs/index.js",
149
+ "./api/auth/*": "./api/auth/*.js",
150
+ "./api/auth": "./api/auth/index.js",
151
+ "./api/search/*": "./api/search/*.js",
152
+ "./api/search": "./api/search/index.js",
153
+ "./api/analytic/*": "./api/analytic/*.js",
154
+ "./api/analytic": "./api/analytic/index.js",
155
+ "./api/notebook/*": "./api/notebook/*.js",
156
+ "./api/notebook": "./api/notebook/index.js",
157
+ "./api/view/*": "./api/view/*.js",
158
+ "./api/view": "./api/view/index.js",
159
+ "./api/dossier/*": "./api/dossier/*.js",
160
+ "./api/dossier": "./api/dossier/index.js",
161
+ "./api/overview/*": "./api/overview/*.js",
162
+ "./api/overview": "./api/overview/index.js",
163
+ "./api/user/avatar/*": "./api/user/avatar/*.js",
164
+ "./api/user/avatar": "./api/user/avatar/index.js",
165
+ "./api/hit/comments/*": "./api/hit/comments/*.js",
166
+ "./api/hit/comments": "./api/hit/comments/index.js",
167
+ "./api/search/grouped/*": "./api/search/grouped/*.js",
168
+ "./api/search/grouped": "./api/search/grouped/index.js",
169
+ "./api/search/fields/*": "./api/search/fields/*.js",
170
+ "./api/search/fields": "./api/search/fields/index.js",
171
+ "./api/search/eql/*": "./api/search/eql/*.js",
172
+ "./api/search/facet/*": "./api/search/facet/*.js",
173
+ "./api/search/facet": "./api/search/facet/index.js",
174
+ "./api/search/count/*": "./api/search/count/*.js",
175
+ "./api/search/count": "./api/search/count/index.js",
176
+ "./api/search/histogram/*": "./api/search/histogram/*.js",
177
+ "./api/search/histogram": "./api/search/histogram/index.js",
178
+ "./api/search/sigma/*": "./api/search/sigma/*.js",
179
+ "./api/analytic/notebooks/*": "./api/analytic/notebooks/*.js",
180
+ "./api/analytic/notebooks": "./api/analytic/notebooks/index.js",
181
+ "./api/analytic/comments/*": "./api/analytic/comments/*.js",
182
+ "./api/analytic/comments": "./api/analytic/comments/index.js",
183
+ "./plugins/borealis/*": "./plugins/borealis/*.js",
184
+ "./plugins/borealis": "./plugins/borealis/index.js",
185
+ "./plugins/borealis/locales/*": "./plugins/borealis/locales/*.js",
186
+ "./plugins/borealis/components/*": "./plugins/borealis/components/*.js",
139
187
  "./components/app/*": "./components/app/*.js",
188
+ "./components/elements/*": "./components/elements/*.js",
140
189
  "./components/routes/*": "./components/routes/*.js",
141
190
  "./components/logins/*": "./components/logins/*.js",
191
+ "./components/hooks/*": "./components/hooks/*.js",
192
+ "./components/app/providers/*": "./components/app/providers/*.js",
193
+ "./components/app/hooks/*": "./components/app/hooks/*.js",
194
+ "./components/app/drawers/*": "./components/app/drawers/*.js",
142
195
  "./components/elements/display/*": "./components/elements/display/*.js",
196
+ "./components/elements/hit/*": "./components/elements/hit/*.js",
143
197
  "./components/elements/view/*": "./components/elements/view/*.js",
144
198
  "./components/elements/addons/*": "./components/elements/addons/*.js",
145
- "./components/elements/hit/*": "./components/elements/hit/*.js",
146
- "./components/elements/display/handlebars/*": "./components/elements/display/handlebars/*.js",
147
- "./components/elements/display/features/*": "./components/elements/display/features/*.js",
148
- "./components/elements/display/json/*": "./components/elements/display/json/*.js",
199
+ "./components/elements/display/markdownPlugins/*.md": "./components/elements/display/markdownPlugins/*.md.js",
149
200
  "./components/elements/display/modals/*": "./components/elements/display/modals/*.js",
201
+ "./components/elements/display/features/*": "./components/elements/display/features/*.js",
150
202
  "./components/elements/display/icons/*": "./components/elements/display/icons/*.js",
151
- "./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",
152
205
  "./components/elements/display/icons/svg/*": "./components/elements/display/icons/svg/*.js",
153
- "./components/elements/addons/search/*": "./components/elements/addons/search/*.js",
206
+ "./components/elements/hit/elements/*": "./components/elements/hit/elements/*.js",
207
+ "./components/elements/hit/outlines/*": "./components/elements/hit/outlines/*.js",
208
+ "./components/elements/hit/related/*": "./components/elements/hit/related/*.js",
209
+ "./components/elements/hit/aggregate/*": "./components/elements/hit/aggregate/*.js",
210
+ "./components/elements/hit/actions/*": "./components/elements/hit/actions/*.js",
211
+ "./components/elements/hit/outlines/al/*": "./components/elements/hit/outlines/al/*.js",
154
212
  "./components/elements/addons/buttons/*": "./components/elements/addons/buttons/*.js",
155
213
  "./components/elements/addons/buttons": "./components/elements/addons/buttons/index.js",
156
214
  "./components/elements/addons/layout/*": "./components/elements/addons/layout/*.js",
215
+ "./components/elements/addons/search/*": "./components/elements/addons/search/*.js",
157
216
  "./components/elements/addons/lists/*": "./components/elements/addons/lists/*.js",
158
217
  "./components/elements/addons/lists": "./components/elements/addons/lists/index.js",
218
+ "./components/elements/addons/layout/vsbox/*": "./components/elements/addons/layout/vsbox/*.js",
159
219
  "./components/elements/addons/search/phrase/*": "./components/elements/addons/search/phrase/*.js",
160
220
  "./components/elements/addons/search/phrase": "./components/elements/addons/search/phrase/index.js",
161
221
  "./components/elements/addons/search/phrase/word/*": "./components/elements/addons/search/phrase/word/*.js",
162
222
  "./components/elements/addons/search/phrase/word/consumers/*": "./components/elements/addons/search/phrase/word/consumers/*.js",
163
- "./components/elements/addons/layout/vsbox/*": "./components/elements/addons/layout/vsbox/*.js",
164
223
  "./components/elements/addons/lists/hooks/*": "./components/elements/addons/lists/hooks/*.js",
165
224
  "./components/elements/addons/lists/table/*": "./components/elements/addons/lists/table/*.js",
166
225
  "./components/elements/addons/lists/table": "./components/elements/addons/lists/table/index.js",
167
- "./components/elements/hit/aggregate/*": "./components/elements/hit/aggregate/*.js",
168
- "./components/elements/hit/actions/*": "./components/elements/hit/actions/*.js",
169
- "./components/elements/hit/related/*": "./components/elements/hit/related/*.js",
170
- "./components/elements/hit/elements/*": "./components/elements/hit/elements/*.js",
171
- "./components/elements/hit/outlines/*": "./components/elements/hit/outlines/*.js",
172
- "./components/elements/hit/outlines/al/*": "./components/elements/hit/outlines/al/*.js",
173
- "./components/app/hooks/*": "./components/app/hooks/*.js",
174
- "./components/app/drawers/*": "./components/app/drawers/*.js",
175
- "./components/app/providers/*": "./components/app/providers/*.js",
176
- "./components/routes/home/*": "./components/routes/home/*.js",
177
- "./components/routes/home": "./components/routes/home/index.js",
178
- "./components/routes/dossiers/*": "./components/routes/dossiers/*.js",
179
226
  "./components/routes/views/*": "./components/routes/views/*.js",
227
+ "./components/routes/dossiers/*": "./components/routes/dossiers/*.js",
180
228
  "./components/routes/action/*": "./components/routes/action/*.js",
181
- "./components/routes/overviews/*": "./components/routes/overviews/*.js",
182
229
  "./components/routes/admin/*": "./components/routes/admin/*.js",
183
- "./components/routes/settings/*": "./components/routes/settings/*.js",
184
- "./components/routes/help/*": "./components/routes/help/*.js",
185
230
  "./components/routes/hits/*": "./components/routes/hits/*.js",
186
- "./components/routes/analytics/*": "./components/routes/analytics/*.js",
231
+ "./components/routes/settings/*": "./components/routes/settings/*.js",
232
+ "./components/routes/home/*": "./components/routes/home/*.js",
233
+ "./components/routes/home": "./components/routes/home/index.js",
234
+ "./components/routes/overviews/*": "./components/routes/overviews/*.js",
187
235
  "./components/routes/advanced/*": "./components/routes/advanced/*.js",
236
+ "./components/routes/analytics/*": "./components/routes/analytics/*.js",
188
237
  "./components/routes/templates/*": "./components/routes/templates/*.js",
189
- "./components/routes/action/view/*": "./components/routes/action/view/*.js",
238
+ "./components/routes/help/*": "./components/routes/help/*.js",
190
239
  "./components/routes/action/shared/*": "./components/routes/action/shared/*.js",
240
+ "./components/routes/action/view/*": "./components/routes/action/view/*.js",
191
241
  "./components/routes/action/edit/*": "./components/routes/action/edit/*.js",
192
242
  "./components/routes/admin/users/*": "./components/routes/admin/users/*.js",
193
- "./components/routes/help/components/*": "./components/routes/help/components/*.js",
194
- "./components/routes/help/markdown/*.md": "./components/routes/help/markdown/*.md.js",
195
- "./components/routes/help/markdown/en/*.md": "./components/routes/help/markdown/en/*.md.js",
196
- "./components/routes/help/markdown/fr/*.md": "./components/routes/help/markdown/fr/*.md.js",
197
243
  "./components/routes/hits/search/*": "./components/routes/hits/search/*.js",
198
244
  "./components/routes/hits/view/*": "./components/routes/hits/view/*.js",
199
- "./components/routes/hits/search/grid/*": "./components/routes/hits/search/grid/*.js",
200
245
  "./components/routes/hits/search/shared/*": "./components/routes/hits/search/shared/*.js",
246
+ "./components/routes/hits/search/grid/*": "./components/routes/hits/search/grid/*.js",
201
247
  "./components/routes/analytics/widgets/*": "./components/routes/analytics/widgets/*.js",
202
- "./components/logins/hooks/*": "./components/logins/hooks/*.js",
248
+ "./components/routes/help/markdown/*.md": "./components/routes/help/markdown/*.md.js",
249
+ "./components/routes/help/components/*": "./components/routes/help/components/*.js",
250
+ "./components/routes/help/markdown/fr/*.md": "./components/routes/help/markdown/fr/*.md.js",
251
+ "./components/routes/help/markdown/en/*.md": "./components/routes/help/markdown/en/*.md.js",
203
252
  "./components/logins/auth/*": "./components/logins/auth/*.js",
204
- "./plugins/borealis/*": "./plugins/borealis/*.js",
205
- "./plugins/borealis": "./plugins/borealis/index.js",
206
- "./plugins/borealis/components/*": "./plugins/borealis/components/*.js",
207
- "./plugins/borealis/locales/*": "./plugins/borealis/locales/*.js",
208
- "./api/search/*": "./api/search/*.js",
209
- "./api/search": "./api/search/index.js",
210
- "./api/analytic/*": "./api/analytic/*.js",
211
- "./api/analytic": "./api/analytic/index.js",
212
- "./api/auth/*": "./api/auth/*.js",
213
- "./api/auth": "./api/auth/index.js",
214
- "./api/template/*": "./api/template/*.js",
215
- "./api/template": "./api/template/index.js",
216
- "./api/view/*": "./api/view/*.js",
217
- "./api/view": "./api/view/index.js",
218
- "./api/action/*": "./api/action/*.js",
219
- "./api/action": "./api/action/index.js",
220
- "./api/user/*": "./api/user/*.js",
221
- "./api/user": "./api/user/index.js",
222
- "./api/overview/*": "./api/overview/*.js",
223
- "./api/overview": "./api/overview/index.js",
224
- "./api/configs/*": "./api/configs/*.js",
225
- "./api/configs": "./api/configs/index.js",
226
- "./api/dossier/*": "./api/dossier/*.js",
227
- "./api/dossier": "./api/dossier/index.js",
228
- "./api/hit/*": "./api/hit/*.js",
229
- "./api/hit": "./api/hit/index.js",
230
- "./api/notebook/*": "./api/notebook/*.js",
231
- "./api/notebook": "./api/notebook/index.js",
232
- "./api/search/grouped/*": "./api/search/grouped/*.js",
233
- "./api/search/grouped": "./api/search/grouped/index.js",
234
- "./api/search/sigma/*": "./api/search/sigma/*.js",
235
- "./api/search/histogram/*": "./api/search/histogram/*.js",
236
- "./api/search/histogram": "./api/search/histogram/index.js",
237
- "./api/search/eql/*": "./api/search/eql/*.js",
238
- "./api/search/facet/*": "./api/search/facet/*.js",
239
- "./api/search/facet": "./api/search/facet/index.js",
240
- "./api/search/fields/*": "./api/search/fields/*.js",
241
- "./api/search/fields": "./api/search/fields/index.js",
242
- "./api/search/count/*": "./api/search/count/*.js",
243
- "./api/search/count": "./api/search/count/index.js",
244
- "./api/analytic/notebooks/*": "./api/analytic/notebooks/*.js",
245
- "./api/analytic/notebooks": "./api/analytic/notebooks/index.js",
246
- "./api/analytic/comments/*": "./api/analytic/comments/*.js",
247
- "./api/analytic/comments": "./api/analytic/comments/index.js",
248
- "./api/user/avatar/*": "./api/user/avatar/*.js",
249
- "./api/user/avatar": "./api/user/avatar/index.js",
250
- "./api/hit/comments/*": "./api/hit/comments/*.js",
251
- "./api/hit/comments": "./api/hit/comments/index.js",
252
- "./locales/en/*.json": "./locales/en/*.json",
253
- "./locales/fr/*.json": "./locales/fr/*.json",
254
- "./locales/en/help/*.json": "./locales/en/help/*.json",
255
- "./locales/fr/help/*.json": "./locales/fr/help/*.json"
253
+ "./components/logins/hooks/*": "./components/logins/hooks/*.js",
254
+ "./models/entities/*": "./models/entities/*.js",
255
+ "./models/socket/*": "./models/socket/*.js",
256
+ "./models/entities/generated/*": "./models/entities/generated/*.js"
256
257
  }
257
258
  }
@@ -1,10 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Typography } from '@mui/material';
3
3
  import { EnrichedTypography, useBorealisEnrichSelector } from 'borealis-ui';
4
- import { memo } from 'react';
4
+ import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
5
+ import { memo, useContext } from 'react';
5
6
  const BorealisTypography = ({ children, value, context, ...props }) => {
6
7
  const guessType = useBorealisEnrichSelector(ctx => ctx.guessType);
7
- const type = guessType(value);
8
+ const { config } = useContext(ApiConfigContext);
9
+ const type = config?.configuration?.mapping?.[value] ?? guessType(value);
8
10
  if (!type) {
9
11
  return _jsx(Typography, { ...props, children: children });
10
12
  }
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/vitest';
package/setupTests.js ADDED
@@ -0,0 +1,12 @@
1
+ /// <reference types="vitest" />
2
+ import * as matchers from '@testing-library/jest-dom/matchers';
3
+ import '@testing-library/jest-dom/vitest';
4
+ import { configure } from '@testing-library/react';
5
+ import { server } from '@cccsaurora/howler-ui/tests/server';
6
+ // Extend vitest with the dom matchers from jest-dom.
7
+ expect.extend(matchers);
8
+ // tell React Testing Library to look for id as the testId.
9
+ configure({ testIdAttribute: 'id' });
10
+ beforeAll(() => server.listen());
11
+ afterEach(() => server.resetHandlers());
12
+ afterAll(() => server.close());
@@ -0,0 +1,5 @@
1
+ export default class MockLocalStorage {
2
+ constructor();
3
+ get length(): number;
4
+ get __STORE__(): this;
5
+ }
@@ -0,0 +1,44 @@
1
+ export default class MockLocalStorage {
2
+ constructor() {
3
+ Object.defineProperty(this, 'getItem', {
4
+ enumerable: false,
5
+ value: vi.fn(key => (this[key] !== undefined ? this[key] : null))
6
+ });
7
+ Object.defineProperty(this, 'setItem', {
8
+ enumerable: false,
9
+ // not mentioned in the spec, but we must always coerce to a string
10
+ value: vi.fn((key, val) => {
11
+ this[key] = `${val}`;
12
+ })
13
+ });
14
+ Object.defineProperty(this, 'removeItem', {
15
+ enumerable: false,
16
+ value: vi.fn(key => {
17
+ delete this[key];
18
+ })
19
+ });
20
+ Object.defineProperty(this, 'clear', {
21
+ enumerable: false,
22
+ value: vi.fn(() => {
23
+ Object.keys(this).map(key => delete this[key]);
24
+ })
25
+ });
26
+ Object.defineProperty(this, 'toString', {
27
+ enumerable: false,
28
+ value: vi.fn(() => {
29
+ return '[object Storage]';
30
+ })
31
+ });
32
+ Object.defineProperty(this, 'key', {
33
+ enumerable: false,
34
+ value: vi.fn(idx => Object.keys(this)[idx] || null)
35
+ });
36
+ } // end constructor
37
+ get length() {
38
+ return Object.keys(this).length;
39
+ }
40
+ // for backwards compatibility
41
+ get __STORE__() {
42
+ return this;
43
+ }
44
+ }
@@ -0,0 +1,5 @@
1
+ export declare const MOCK_RESPONSES: {
2
+ [path: string]: any;
3
+ };
4
+ declare const handlers: import("msw").HttpHandler[];
5
+ export { handlers };
@@ -0,0 +1,97 @@
1
+ import { http, HttpResponse } from 'msw';
2
+ export const MOCK_RESPONSES = {
3
+ '/api/v1/view/example_view_id': {
4
+ owner: 'user',
5
+ settings: {
6
+ advance_on_triage: false
7
+ },
8
+ view_id: 'example_view_id',
9
+ query: 'howler.id:*',
10
+ sort: 'event.created desc',
11
+ title: 'Example View',
12
+ type: 'personal',
13
+ span: 'date.range.1.month'
14
+ },
15
+ '/api/v1/search/view': {
16
+ items: [
17
+ {
18
+ owner: 'user',
19
+ settings: {
20
+ advance_on_triage: false
21
+ },
22
+ view_id: 'searched_view_id',
23
+ query: 'howler.id:searched',
24
+ sort: 'event.created desc',
25
+ title: 'Searched View',
26
+ type: 'personal',
27
+ span: 'date.range.1.month'
28
+ }
29
+ ],
30
+ total: 1,
31
+ rows: 1
32
+ },
33
+ '/api/v1/view/new_view_id': {
34
+ owner: 'user',
35
+ settings: {
36
+ advance_on_triage: false
37
+ },
38
+ view_id: 'new_view_id',
39
+ query: 'howler.id:new',
40
+ sort: 'event.created desc',
41
+ title: 'New View',
42
+ type: 'personal',
43
+ span: 'date.range.1.month'
44
+ },
45
+ '/api/v1/view/:view_id/favourite': { success: true }
46
+ };
47
+ const handlers = [
48
+ ...Object.entries(MOCK_RESPONSES).map(([path, data]) => http.all(path, async () => HttpResponse.json({ api_response: data }))),
49
+ http.post('/api/v1/view', async () => HttpResponse.json({
50
+ api_response: {
51
+ owner: 'user',
52
+ settings: {
53
+ advance_on_triage: false
54
+ },
55
+ view_id: 'example_created_view',
56
+ query: 'howler.id:*',
57
+ sort: 'event.created desc',
58
+ title: 'Example View',
59
+ type: 'personal',
60
+ span: 'date.range.1.month'
61
+ }
62
+ }, { status: 201 })),
63
+ http.delete('/api/v1/view/:view_id', async () => HttpResponse.json({
64
+ api_response: {
65
+ success: true
66
+ }
67
+ }, { status: 204 })),
68
+ http.get('/api/v1/view', async () => HttpResponse.json({
69
+ api_response: [
70
+ {
71
+ owner: 'user',
72
+ settings: {
73
+ advance_on_triage: false
74
+ },
75
+ view_id: 'example_view_id',
76
+ query: 'howler.id:*',
77
+ sort: 'event.created desc',
78
+ title: 'Example View',
79
+ type: 'personal',
80
+ span: 'date.range.1.month'
81
+ },
82
+ {
83
+ owner: 'user',
84
+ settings: {
85
+ advance_on_triage: true
86
+ },
87
+ view_id: 'another_view_id',
88
+ query: 'howler.status:open',
89
+ sort: 'event.created asc',
90
+ title: 'Another View',
91
+ type: 'global',
92
+ span: 'date.range.1.week'
93
+ }
94
+ ]
95
+ }))
96
+ ];
97
+ export { handlers };
@@ -0,0 +1,3 @@
1
+ import { http } from 'msw';
2
+ declare const server: import("msw/node").SetupServerApi;
3
+ export { http, server };
@@ -0,0 +1,5 @@
1
+ import { http } from 'msw';
2
+ import { setupServer } from 'msw/node';
3
+ import { handlers } from './server-handlers';
4
+ const server = setupServer(...handlers);
5
+ export { http, server };
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { LocalPolice, MoodBad, NewReleases, PsychologyAlt, Star, Timeline } from '@mui/icons-material';
3
3
  import { blue, grey, indigo, orange, pink, red, teal, yellow } from '@mui/material/colors';
4
- import moment from 'moment';
4
+ import dayjs from 'dayjs';
5
5
  export const HOWLER_API = import.meta.env.VITE_API;
6
6
  export const LOCAL = HOWLER_API === 'MOCK';
7
7
  export const VERSION = import.meta.env.VITE_VERSION;
@@ -66,7 +66,7 @@ export var StorageKey;
66
66
  export const MOCK_SEARCH_QUERY_STORE = `${MY_LOCAL_STORAGE_PREFIX}.${StorageKey.MOCK_SEARCH_QUERY_STORE}`;
67
67
  export const MOCK_FAVOURITES_STORE = `${MY_LOCAL_STORAGE_PREFIX}.${StorageKey.MOCK_FAVOURITES_STORE}`;
68
68
  export const VALID_ACTION_TRIGGERS = ['create', 'promote', 'demote'];
69
- const CURRENT_TIME = moment();
69
+ const CURRENT_TIME = dayjs();
70
70
  export const minutes = [CURRENT_TIME.get('minute'), CURRENT_TIME.add(30, 'minute').get('minute')].sort();
71
71
  export const hours = [
72
72
  CURRENT_TIME.get('hour'),
@@ -5,3 +5,4 @@ export declare const safeFieldValueURI: (data: string | number | boolean) => str
5
5
  export declare const sanitizeLuceneQuery: (query: string) => string;
6
6
  export declare const safeStringPropertyCompare: (propertyPath: string) => (a: unknown, b: unknown) => any;
7
7
  export declare const sanitizeMultilineLucene: (query: string) => string;
8
+ export declare const validateRegex: (regex: string) => boolean;
@@ -36,3 +36,12 @@ export const safeStringPropertyCompare = (propertyPath) => {
36
36
  export const sanitizeMultilineLucene = (query) => {
37
37
  return query.replace(/#.+/g, '').replace(/\n{2,}/, '\n');
38
38
  };
39
+ export const validateRegex = (regex) => {
40
+ try {
41
+ new RegExp(regex);
42
+ return true;
43
+ }
44
+ catch {
45
+ return false;
46
+ }
47
+ };
package/utils/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as colors from '@mui/material/colors';
2
+ import dayjs from 'dayjs';
2
3
  import { flatten, unflatten } from 'flat';
3
4
  import { isArray, isEmpty, isNil, isObject, isPlainObject } from 'lodash-es';
4
- import moment from 'moment';
5
5
  export const bytesToSize = (bytes) => {
6
6
  const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
7
7
  if (bytes === 0 || bytes === null)
@@ -39,7 +39,7 @@ export const formatDate = (date) => {
39
39
  if (!date) {
40
40
  return '?';
41
41
  }
42
- return moment(date).utc().format(DATE_FORMAT);
42
+ return dayjs(date).utc().format(DATE_FORMAT);
43
43
  };
44
44
  export const compareTimestamp = (a, b) => {
45
45
  return (new Date(a).getTime() - new Date(b).getTime()) / 1000;
@@ -48,7 +48,7 @@ export const twitterShort = (date) => {
48
48
  if (!date || date === '?') {
49
49
  return '?';
50
50
  }
51
- return moment(date).fromNow();
51
+ return dayjs(date).fromNow();
52
52
  };
53
53
  export const hashCode = (s) => s.split('').reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);
54
54
  export const stringToColor = (string) => {
@@ -1,16 +0,0 @@
1
- import type { Dossier } from '@cccsaurora/howler-ui/models/entities/generated/Dossier';
2
- import { type FC, type PropsWithChildren } from 'react';
3
- export interface DossierContextType {
4
- ready: boolean;
5
- dossiers: Dossier[];
6
- fetchDossiers: (force?: boolean) => Promise<void>;
7
- addDossier: (v: Dossier) => Promise<Dossier>;
8
- editDossier: (dossier: Dossier) => Promise<Dossier>;
9
- removeDossier: (id: string) => Promise<void>;
10
- getCurrentDossiers: () => Dossier[];
11
- getMatchingDossiers: (id: string) => Promise<Dossier[]>;
12
- }
13
- export declare const DossierContext: import("use-context-selector").Context<DossierContextType>;
14
- declare const DossierProvider: FC<PropsWithChildren>;
15
- export declare const useDossierContextSelector: <Selected>(selector: (value: DossierContextType) => Selected) => Selected;
16
- export default DossierProvider;