@cccsaurora/howler-ui 2.18.0-dev.757 → 2.18.0-dev.758
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/api/index.d.ts +2 -0
- package/api/index.js +4 -2
- package/api/search/case.d.ts +4 -0
- package/api/search/case.js +8 -0
- package/api/search/facet/hit.d.ts +1 -3
- package/api/search/facet/index.d.ts +3 -1
- package/api/search/index.d.ts +2 -1
- package/api/search/index.js +2 -1
- package/api/v2/case/index.d.ts +8 -0
- package/api/v2/case/index.js +20 -0
- package/api/v2/case/items.d.ts +6 -0
- package/api/v2/case/items.js +18 -0
- package/api/v2/index.d.ts +4 -0
- package/api/v2/index.js +6 -0
- package/api/v2/search/facet.d.ts +3 -0
- package/api/v2/search/facet.js +12 -0
- package/api/v2/search/index.d.ts +5 -0
- package/api/v2/search/index.js +24 -0
- package/commons/components/leftnav/LeftNavDrawer.js +1 -1
- package/components/app/App.js +36 -8
- package/components/app/hooks/useMatchers.d.ts +1 -1
- package/components/app/hooks/useMatchers.js +23 -11
- package/components/app/hooks/useMatchers.test.js +22 -22
- package/components/app/hooks/useTitle.js +3 -3
- package/components/app/providers/FavouritesProvider.js +2 -2
- package/components/app/providers/ModalProvider.d.ts +1 -0
- package/components/app/providers/ParameterProvider.d.ts +9 -2
- package/components/app/providers/ParameterProvider.js +165 -240
- package/components/app/providers/ParameterProvider.test.js +346 -94
- package/components/app/providers/RecordProvider.d.ts +23 -0
- package/components/app/providers/{HitProvider.js → RecordProvider.js} +41 -41
- package/components/app/providers/{HitSearchProvider.d.ts → RecordSearchProvider.d.ts} +6 -6
- package/components/app/providers/{HitSearchProvider.js → RecordSearchProvider.js} +12 -17
- package/components/app/providers/{HitSearchProvider.test.js → RecordSearchProvider.test.js} +52 -71
- package/components/app/providers/UserListProvider.js +28 -8
- package/components/elements/ContextMenu.d.ts +56 -0
- package/components/elements/ContextMenu.js +109 -0
- package/components/elements/ContextMenu.test.js +215 -0
- package/components/{routes/overviews/OverviewEditor.js → elements/MarkdownEditor.js} +3 -3
- package/components/elements/ObjectDetails.d.ts +6 -0
- package/components/elements/{hit/HitDetails.js → ObjectDetails.js} +17 -17
- package/components/elements/PluginTypography.d.ts +2 -1
- package/components/elements/PluginTypography.js +3 -2
- package/components/elements/UserList.d.ts +5 -2
- package/components/elements/UserList.js +18 -8
- package/components/elements/addons/search/phrase/Phrase.js +1 -1
- package/components/elements/case/CaseCard.d.ts +12 -0
- package/components/elements/case/CaseCard.js +42 -0
- package/components/elements/case/CasePreview.d.ts +6 -0
- package/components/elements/case/CasePreview.js +17 -0
- package/components/elements/case/StatusIcon.d.ts +5 -0
- package/components/elements/case/StatusIcon.js +13 -0
- package/components/elements/display/ChipPopper.d.ts +1 -1
- package/components/elements/display/HowlerCard.js +1 -1
- package/components/elements/display/Modal.js +2 -0
- package/components/elements/hit/HitActions.js +4 -4
- package/components/elements/hit/HitBanner.d.ts +1 -0
- package/components/elements/hit/HitBanner.js +29 -49
- package/components/elements/hit/HitCard.d.ts +2 -0
- package/components/elements/hit/HitCard.js +7 -7
- package/components/elements/hit/HitLabels.js +2 -2
- package/components/elements/hit/HitOutline.d.ts +1 -0
- package/components/elements/hit/HitOutline.js +3 -3
- package/components/elements/hit/{HitQuickSearch.d.ts → HitPreview.d.ts} +3 -3
- package/components/elements/hit/{HitQuickSearch.js → HitPreview.js} +10 -4
- package/components/elements/hit/HitSummary.d.ts +2 -1
- package/components/elements/hit/HitSummary.js +6 -5
- package/components/elements/hit/aggregate/HitGraph.js +8 -8
- package/components/elements/hit/elements/AnalyticLink.d.ts +9 -0
- package/components/elements/hit/elements/AnalyticLink.js +22 -0
- package/components/elements/hit/outlines/DefaultOutline.js +1 -1
- package/components/elements/hit/related/RelatedRecords.js +63 -0
- package/components/elements/observable/ObservableCard.d.ts +6 -0
- package/components/elements/observable/ObservableCard.js +22 -0
- package/components/elements/observable/ObservablePreview.d.ts +6 -0
- package/components/elements/observable/ObservablePreview.js +12 -0
- package/components/elements/{hit/HitComments.d.ts → record/RecordComments.d.ts} +5 -4
- package/components/elements/{hit/HitComments.js → record/RecordComments.js} +29 -28
- package/components/{routes/hits/search/HitContextMenu.d.ts → elements/record/RecordContextMenu.d.ts} +3 -3
- package/components/elements/record/RecordContextMenu.js +256 -0
- package/components/elements/record/RecordContextMenu.test.d.ts +1 -0
- package/components/{routes/hits/search/HitContextMenu.test.js → elements/record/RecordContextMenu.test.js} +94 -39
- package/components/elements/record/RecordRelated.d.ts +7 -0
- package/components/elements/record/RecordRelated.js +34 -0
- package/components/elements/{hit/HitWorklog.d.ts → record/RecordWorklog.d.ts} +4 -3
- package/components/elements/{hit/HitWorklog.js → record/RecordWorklog.js} +15 -13
- package/components/elements/view/ViewTitle.d.ts +1 -0
- package/components/elements/view/ViewTitle.js +9 -2
- package/components/hooks/useHitActions.d.ts +1 -1
- package/components/hooks/useHitActions.js +4 -4
- package/components/hooks/useMyPreferences.js +10 -1
- package/components/hooks/useMySearch.js +2 -2
- package/components/hooks/useMySitemap.js +4 -1
- package/components/hooks/useMyTheme.js +9 -2
- package/components/hooks/{useHitSelection.d.ts → useRecordSelection.d.ts} +2 -2
- package/components/hooks/{useHitSelection.js → useRecordSelection.js} +12 -33
- package/components/hooks/useRelatedRecords.d.ts +13 -0
- package/components/hooks/useRelatedRecords.js +32 -0
- package/components/routes/action/edit/ActionEditor.js +2 -2
- package/components/routes/action/view/ActionSearch.js +1 -1
- package/components/routes/advanced/QueryBuilder.js +1 -1
- package/components/routes/advanced/QueryEditor.js +3 -3
- package/components/routes/advanced/historyCompletionProvider.js +3 -3
- package/components/routes/analytics/AnalyticDetails.js +2 -2
- package/components/routes/analytics/AnalyticSearch.js +1 -1
- package/components/routes/cases/CaseViewer.d.ts +2 -0
- package/components/routes/cases/CaseViewer.js +22 -0
- package/components/routes/cases/Cases.d.ts +2 -0
- package/components/routes/cases/Cases.js +101 -0
- package/components/routes/cases/constants.d.ts +5 -0
- package/components/routes/cases/constants.js +5 -0
- package/components/routes/cases/detail/AlertPanel.d.ts +6 -0
- package/components/routes/cases/detail/AlertPanel.js +33 -0
- package/components/routes/cases/detail/CaseAssets.d.ts +11 -0
- package/components/routes/cases/detail/CaseAssets.js +104 -0
- package/components/routes/cases/detail/CaseAssets.test.d.ts +1 -0
- package/components/routes/cases/detail/CaseAssets.test.js +167 -0
- package/components/routes/cases/detail/CaseDashboard.d.ts +7 -0
- package/components/routes/cases/detail/CaseDashboard.js +66 -0
- package/components/routes/cases/detail/CaseDetails.d.ts +6 -0
- package/components/routes/cases/detail/CaseDetails.js +61 -0
- package/components/routes/cases/detail/CaseOverview.d.ts +7 -0
- package/components/routes/cases/detail/CaseOverview.js +43 -0
- package/components/routes/cases/detail/CaseSidebar.d.ts +8 -0
- package/components/routes/cases/detail/CaseSidebar.js +107 -0
- package/components/routes/cases/detail/CaseSidebar.test.d.ts +1 -0
- package/components/routes/cases/detail/CaseSidebar.test.js +246 -0
- package/components/routes/cases/detail/CaseTask.d.ts +11 -0
- package/components/routes/cases/detail/CaseTask.js +57 -0
- package/components/routes/cases/detail/CaseTimeline.d.ts +12 -0
- package/components/routes/cases/detail/CaseTimeline.js +106 -0
- package/components/routes/cases/detail/CaseTimeline.test.d.ts +1 -0
- package/components/routes/cases/detail/CaseTimeline.test.js +227 -0
- package/components/routes/cases/detail/ItemPage.d.ts +6 -0
- package/components/routes/cases/detail/ItemPage.js +99 -0
- package/components/routes/cases/detail/RelatedCasePanel.d.ts +6 -0
- package/components/routes/cases/detail/RelatedCasePanel.js +34 -0
- package/components/routes/cases/detail/TaskPanel.d.ts +7 -0
- package/components/routes/cases/detail/TaskPanel.js +52 -0
- package/components/routes/cases/detail/aggregates/CaseAggregate.d.ts +11 -0
- package/components/routes/cases/detail/aggregates/CaseAggregate.js +24 -0
- package/components/routes/cases/detail/aggregates/SourceAggregate.d.ts +6 -0
- package/components/routes/cases/detail/aggregates/SourceAggregate.js +26 -0
- package/components/routes/cases/detail/assets/Asset.d.ts +14 -0
- package/components/routes/cases/detail/assets/Asset.js +12 -0
- package/components/routes/cases/detail/assets/Asset.test.d.ts +1 -0
- package/components/routes/cases/detail/assets/Asset.test.js +72 -0
- package/components/routes/cases/detail/sidebar/CaseFolder.d.ts +20 -0
- package/components/routes/cases/detail/sidebar/CaseFolder.js +83 -0
- package/components/routes/cases/detail/sidebar/CaseFolder.test.d.ts +1 -0
- package/components/routes/cases/detail/sidebar/CaseFolder.test.js +295 -0
- package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.d.ts +34 -0
- package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.js +103 -0
- package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.test.d.ts +1 -0
- package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.test.js +363 -0
- package/components/routes/cases/detail/sidebar/FolderEntry.d.ts +25 -0
- package/components/routes/cases/detail/sidebar/FolderEntry.js +88 -0
- package/components/routes/cases/detail/sidebar/FolderEntry.test.d.ts +1 -0
- package/components/routes/cases/detail/sidebar/FolderEntry.test.js +206 -0
- package/components/routes/cases/detail/sidebar/RootDropZone.d.ts +5 -0
- package/components/routes/cases/detail/sidebar/RootDropZone.js +33 -0
- package/components/routes/cases/detail/sidebar/types.d.ts +9 -0
- package/components/routes/cases/detail/sidebar/utils.d.ts +3 -0
- package/components/routes/cases/detail/sidebar/utils.js +29 -0
- package/components/routes/cases/detail/sidebar/utils.test.d.ts +1 -0
- package/components/routes/cases/detail/sidebar/utils.test.js +82 -0
- package/components/routes/cases/hooks/useCase.d.ts +13 -0
- package/components/routes/cases/hooks/useCase.js +51 -0
- package/components/routes/cases/modals/AddToCaseModal.d.ts +7 -0
- package/components/routes/cases/modals/AddToCaseModal.js +59 -0
- package/components/routes/cases/modals/AddToCaseModal.test.d.ts +1 -0
- package/components/routes/cases/modals/AddToCaseModal.test.js +313 -0
- package/components/routes/cases/modals/CaseRecordRow.d.ts +9 -0
- package/components/routes/cases/modals/CaseRecordRow.js +15 -0
- package/components/routes/cases/modals/CreateCaseModal.d.ts +7 -0
- package/components/routes/cases/modals/CreateCaseModal.js +55 -0
- package/components/routes/cases/modals/CreateCaseModal.test.d.ts +1 -0
- package/components/routes/cases/modals/CreateCaseModal.test.js +358 -0
- package/components/routes/cases/modals/RenameItemModal.d.ts +9 -0
- package/components/routes/cases/modals/RenameItemModal.js +48 -0
- package/components/routes/cases/modals/ResolveModal.d.ts +7 -0
- package/components/routes/cases/modals/ResolveModal.js +115 -0
- package/components/routes/cases/modals/ResolveModal.test.d.ts +1 -0
- package/components/routes/cases/modals/ResolveModal.test.js +384 -0
- package/components/routes/cases/modals/hooks.d.ts +7 -0
- package/components/routes/cases/modals/hooks.js +44 -0
- package/components/routes/cases/modals/types.d.ts +5 -0
- package/components/routes/dossiers/DossierEditor.js +2 -2
- package/components/routes/dossiers/DossierEditor.test.js +1 -1
- package/components/routes/help/ApiDocumentation.js +1 -1
- package/components/routes/help/HitBannerDocumentation.js +1 -0
- package/components/routes/help/HitDocumentation.js +1 -3
- package/components/routes/hits/search/InformationPane.d.ts +1 -0
- package/components/routes/hits/search/InformationPane.js +47 -60
- package/components/routes/hits/search/LayoutSettings.js +3 -3
- package/components/routes/hits/search/QuerySettings.js +2 -1
- package/components/routes/hits/search/QuerySettings.test.js +14 -9
- package/components/routes/hits/search/{HitBrowser.js → RecordBrowser.js} +9 -9
- package/components/routes/hits/search/{HitQuery.d.ts → RecordQuery.d.ts} +2 -2
- package/components/routes/hits/search/{HitQuery.js → RecordQuery.js} +6 -6
- package/components/routes/hits/search/SearchPane.js +26 -49
- package/components/routes/hits/search/ViewLink.js +3 -3
- package/components/routes/hits/search/ViewLink.test.js +8 -8
- package/components/routes/hits/search/grid/AddColumnModal.js +5 -4
- package/components/routes/hits/search/grid/EnhancedCell.d.ts +2 -1
- package/components/routes/hits/search/grid/EnhancedCell.js +2 -2
- package/components/routes/hits/search/grid/HitGrid.js +20 -18
- package/components/routes/hits/search/grid/{HitRow.d.ts → RecordRow.d.ts} +3 -2
- package/components/routes/hits/search/grid/{HitRow.js → RecordRow.js} +10 -8
- package/components/routes/hits/search/shared/IndexPicker.d.ts +2 -0
- package/components/routes/hits/search/shared/IndexPicker.js +20 -0
- package/components/routes/hits/view/HitViewer.js +12 -13
- package/components/routes/home/ViewCard.js +47 -41
- package/components/routes/observables/ObservableViewer.d.ts +7 -0
- package/components/routes/observables/ObservableViewer.js +27 -0
- package/components/routes/overviews/OverviewViewer.js +2 -2
- package/components/routes/views/ViewComposer.js +46 -19
- package/locales/en/translation.json +100 -3
- package/locales/fr/translation.json +98 -3
- package/models/WithMetadata.d.ts +2 -1
- package/models/entities/generated/AttachmentsFile.d.ts +12 -0
- package/models/entities/generated/Case.d.ts +28 -0
- package/models/entities/generated/DestinationOriginal.d.ts +19 -0
- package/models/entities/generated/EmailAttachment.d.ts +8 -0
- package/models/entities/generated/EmailParent.d.ts +19 -0
- package/models/entities/generated/Enrichments.d.ts +7 -0
- package/models/entities/generated/EnrichmentsIndicator.d.ts +21 -0
- package/models/entities/generated/Hit.d.ts +1 -0
- package/models/entities/generated/Howler.d.ts +0 -4
- package/models/entities/generated/HttpResponse.d.ts +11 -0
- package/models/entities/generated/Item.d.ts +9 -0
- package/models/entities/generated/Observable.d.ts +85 -0
- package/models/entities/generated/ObservableCloud.d.ts +20 -0
- package/models/entities/generated/ObservableDestination.d.ts +23 -0
- package/models/entities/generated/ObservableEmail.d.ts +30 -0
- package/models/entities/generated/ObservableFile.d.ts +36 -0
- package/models/entities/generated/ObservableHowler.d.ts +43 -0
- package/models/entities/generated/ObservableHttp.d.ts +11 -0
- package/models/entities/generated/ObservableObserver.d.ts +21 -0
- package/models/entities/generated/ObservableOrganization.d.ts +7 -0
- package/models/entities/generated/ObservableProcess.d.ts +34 -0
- package/models/entities/generated/ObservableSource.d.ts +23 -0
- package/models/entities/generated/ObservableThreat.d.ts +21 -0
- package/models/entities/generated/ObservableTls.d.ts +12 -0
- package/models/entities/generated/ObserverIngress.d.ts +9 -0
- package/models/entities/generated/Rule.d.ts +2 -10
- package/models/entities/generated/Task.d.ts +10 -0
- package/models/entities/generated/Threat.d.ts +2 -2
- package/models/entities/generated/{Enrichment.d.ts → ThreatEnrichment.d.ts} +1 -1
- package/models/entities/generated/View.d.ts +1 -0
- package/package.json +18 -1
- package/plugins/clue/components/ClueTypography.js +2 -2
- package/plugins/clue/utils.d.ts +2 -1
- package/tests/mocks.d.ts +11 -1
- package/tests/mocks.js +12 -7
- package/tests/server-handlers.js +6 -1
- package/tests/utils.d.ts +4 -0
- package/tests/utils.js +20 -0
- package/utils/constants.d.ts +3 -3
- package/utils/hitFunctions.d.ts +2 -1
- package/utils/hitFunctions.js +4 -4
- package/utils/typeUtils.d.ts +7 -0
- package/utils/typeUtils.js +27 -0
- package/utils/viewUtils.js +3 -0
- package/components/app/providers/HitProvider.d.ts +0 -22
- package/components/elements/display/icons/BundleButton.d.ts +0 -6
- package/components/elements/display/icons/BundleButton.js +0 -32
- package/components/elements/hit/HitRelated.d.ts +0 -6
- package/components/elements/hit/HitRelated.js +0 -7
- package/components/routes/help/BundleDocumentation.d.ts +0 -3
- package/components/routes/help/BundleDocumentation.js +0 -12
- package/components/routes/help/markdown/en/bundles.md.js +0 -1
- package/components/routes/help/markdown/fr/bundles.md.js +0 -1
- package/components/routes/hits/search/BundleParentMenu.d.ts +0 -6
- package/components/routes/hits/search/BundleParentMenu.js +0 -32
- package/components/routes/hits/search/BundleScroller.d.ts +0 -2
- package/components/routes/hits/search/BundleScroller.js +0 -6
- package/components/routes/hits/search/HitContextMenu.js +0 -227
- /package/components/app/providers/{HitSearchProvider.test.d.ts → RecordSearchProvider.test.d.ts} +0 -0
- /package/components/{routes/hits/search/HitContextMenu.test.d.ts → elements/ContextMenu.test.d.ts} +0 -0
- /package/components/{routes/overviews/OverviewEditor.d.ts → elements/MarkdownEditor.d.ts} +0 -0
- /package/components/elements/hit/{HitDetails.d.ts → related/RelatedRecords.d.ts} +0 -0
- /package/components/routes/hits/search/{HitBrowser.d.ts → RecordBrowser.d.ts} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { HowlerComment } from './HowlerComment';
|
|
2
|
+
import type { HowlerDossier } from './HowlerDossier';
|
|
3
|
+
import type { Incident } from './Incident';
|
|
4
|
+
import type { Labels } from './Labels';
|
|
5
|
+
import type { Link } from './Link';
|
|
6
|
+
import type { Log } from './Log';
|
|
7
|
+
import type { Outline } from './Outline';
|
|
8
|
+
import type { Votes } from './Votes';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
12
|
+
*/
|
|
13
|
+
export interface ObservableHowler {
|
|
14
|
+
analytic: string;
|
|
15
|
+
assessment?: string;
|
|
16
|
+
comment?: HowlerComment[];
|
|
17
|
+
confidence?: number;
|
|
18
|
+
data?: string[];
|
|
19
|
+
detection?: string;
|
|
20
|
+
dossier?: HowlerDossier[];
|
|
21
|
+
escalation?: string;
|
|
22
|
+
expiry?: string;
|
|
23
|
+
hash: string;
|
|
24
|
+
id: string;
|
|
25
|
+
incidents?: Incident[];
|
|
26
|
+
labels?: Labels;
|
|
27
|
+
links?: Link[];
|
|
28
|
+
log?: Log[];
|
|
29
|
+
mitigated?: string;
|
|
30
|
+
monitored?: string;
|
|
31
|
+
outline?: Outline;
|
|
32
|
+
rationale?: string;
|
|
33
|
+
related?: string[];
|
|
34
|
+
reliability?: number;
|
|
35
|
+
reported?: string;
|
|
36
|
+
score?: number;
|
|
37
|
+
scrutiny?: string;
|
|
38
|
+
severity?: number;
|
|
39
|
+
status?: string;
|
|
40
|
+
viewers?: string[];
|
|
41
|
+
volume?: number;
|
|
42
|
+
votes?: Votes;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HttpResponse } from './HttpResponse';
|
|
2
|
+
import type { Request } from './Request';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
6
|
+
*/
|
|
7
|
+
export interface ObservableHttp {
|
|
8
|
+
request?: Request;
|
|
9
|
+
response?: HttpResponse;
|
|
10
|
+
version?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Egress } from './Egress';
|
|
2
|
+
import type { Interface } from './Interface';
|
|
3
|
+
import type { ObserverIngress } from './ObserverIngress';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
7
|
+
*/
|
|
8
|
+
export interface ObservableObserver {
|
|
9
|
+
egress?: Egress;
|
|
10
|
+
hostname?: string;
|
|
11
|
+
ingress?: ObserverIngress;
|
|
12
|
+
interface?: Interface;
|
|
13
|
+
ip?: string[];
|
|
14
|
+
mac?: string[];
|
|
15
|
+
name?: string;
|
|
16
|
+
product?: string;
|
|
17
|
+
serial_number?: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
vendor?: string;
|
|
20
|
+
version?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CodeSignature } from './CodeSignature';
|
|
2
|
+
import type { EntryMeta } from './EntryMeta';
|
|
3
|
+
import type { Pe } from './Pe';
|
|
4
|
+
import type { ProcessHash } from './ProcessHash';
|
|
5
|
+
import type { ProcessParent } from './ProcessParent';
|
|
6
|
+
import type { ProcessUser } from './ProcessUser';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
10
|
+
*/
|
|
11
|
+
export interface ObservableProcess {
|
|
12
|
+
args?: string[];
|
|
13
|
+
args_count?: number;
|
|
14
|
+
code_signature?: CodeSignature;
|
|
15
|
+
command_line?: string;
|
|
16
|
+
end?: string;
|
|
17
|
+
entity_id?: string;
|
|
18
|
+
entry_meta?: EntryMeta;
|
|
19
|
+
env_vars?: { [index: string]: string };
|
|
20
|
+
executable?: string;
|
|
21
|
+
exit_code?: number;
|
|
22
|
+
hash?: ProcessHash;
|
|
23
|
+
interactive?: boolean;
|
|
24
|
+
name?: string;
|
|
25
|
+
parent?: ProcessParent;
|
|
26
|
+
pe?: Pe;
|
|
27
|
+
pid?: number;
|
|
28
|
+
same_as_process?: boolean;
|
|
29
|
+
start?: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
uptime?: number;
|
|
32
|
+
user?: ProcessUser;
|
|
33
|
+
working_directory?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AutonomousSystems } from './AutonomousSystems';
|
|
2
|
+
import type { Geo } from './Geo';
|
|
3
|
+
import type { Nat } from './Nat';
|
|
4
|
+
import type { SourceOriginal } from './SourceOriginal';
|
|
5
|
+
import type { User } from './User';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
9
|
+
*/
|
|
10
|
+
export interface ObservableSource {
|
|
11
|
+
address?: string;
|
|
12
|
+
autonomous_systems?: AutonomousSystems;
|
|
13
|
+
bytes?: number;
|
|
14
|
+
domain?: string;
|
|
15
|
+
geo?: Geo;
|
|
16
|
+
ip?: string;
|
|
17
|
+
mac?: string;
|
|
18
|
+
nat?: Nat;
|
|
19
|
+
original?: SourceOriginal;
|
|
20
|
+
packets?: number;
|
|
21
|
+
port?: number;
|
|
22
|
+
user?: User;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Feed } from './Feed';
|
|
2
|
+
import type { Software } from './Software';
|
|
3
|
+
import type { ThreatEnrichment } from './ThreatEnrichment';
|
|
4
|
+
import type { ThreatGroup } from './ThreatGroup';
|
|
5
|
+
import type { ThreatIndicator } from './ThreatIndicator';
|
|
6
|
+
import type { ThreatTactic } from './ThreatTactic';
|
|
7
|
+
import type { ThreatTechnique } from './ThreatTechnique';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
11
|
+
*/
|
|
12
|
+
export interface ObservableThreat {
|
|
13
|
+
enrichments?: ThreatEnrichment[];
|
|
14
|
+
feed?: Feed;
|
|
15
|
+
framework?: string;
|
|
16
|
+
group?: ThreatGroup;
|
|
17
|
+
indicator?: ThreatIndicator;
|
|
18
|
+
software?: Software;
|
|
19
|
+
tactic?: ThreatTactic;
|
|
20
|
+
technique?: ThreatTechnique;
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Client } from './Client';
|
|
2
|
+
import type { TlsServer } from './TlsServer';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
6
|
+
*/
|
|
7
|
+
export interface ObservableTls {
|
|
8
|
+
client?: Client;
|
|
9
|
+
server?: TlsServer;
|
|
10
|
+
version?: string;
|
|
11
|
+
version_protocol?: string;
|
|
12
|
+
}
|
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
3
3
|
*/
|
|
4
4
|
export interface Rule {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
description?: string;
|
|
8
|
-
id?: string;
|
|
9
|
-
license?: string;
|
|
10
|
-
name?: string;
|
|
11
|
-
reference?: string;
|
|
12
|
-
ruleset?: string;
|
|
13
|
-
uuid?: string;
|
|
14
|
-
version?: string;
|
|
5
|
+
destination?: string;
|
|
6
|
+
query?: string;
|
|
15
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Enrichment } from './Enrichment';
|
|
2
1
|
import type { Feed } from './Feed';
|
|
3
2
|
import type { Software } from './Software';
|
|
3
|
+
import type { ThreatEnrichment } from './ThreatEnrichment';
|
|
4
4
|
import type { ThreatGroup } from './ThreatGroup';
|
|
5
5
|
import type { ThreatIndicator } from './ThreatIndicator';
|
|
6
6
|
import type { ThreatTactic } from './ThreatTactic';
|
|
@@ -10,7 +10,7 @@ import type { ThreatTechnique } from './ThreatTechnique';
|
|
|
10
10
|
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
11
11
|
*/
|
|
12
12
|
export interface Threat {
|
|
13
|
-
enrichments?:
|
|
13
|
+
enrichments?: ThreatEnrichment[];
|
|
14
14
|
feed?: Feed;
|
|
15
15
|
framework?: string;
|
|
16
16
|
group?: ThreatGroup;
|
package/package.json
CHANGED
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"internal-slot": "1.0.7"
|
|
102
102
|
},
|
|
103
103
|
"type": "module",
|
|
104
|
-
"version": "2.18.0-dev.
|
|
104
|
+
"version": "2.18.0-dev.758",
|
|
105
105
|
"exports": {
|
|
106
106
|
"./i18n": "./i18n.js",
|
|
107
107
|
"./index.css": "./index.css",
|
|
@@ -148,9 +148,11 @@
|
|
|
148
148
|
"./components/routes/home": "./components/routes/home/index.js",
|
|
149
149
|
"./components/routes/dossiers/*": "./components/routes/dossiers/*.js",
|
|
150
150
|
"./components/routes/help/*": "./components/routes/help/*.js",
|
|
151
|
+
"./components/routes/observables/*": "./components/routes/observables/*.js",
|
|
151
152
|
"./components/routes/admin/*": "./components/routes/admin/*.js",
|
|
152
153
|
"./components/routes/action/*": "./components/routes/action/*.js",
|
|
153
154
|
"./components/routes/settings/*": "./components/routes/settings/*.js",
|
|
155
|
+
"./components/routes/cases/*": "./components/routes/cases/*.js",
|
|
154
156
|
"./components/routes/views/*": "./components/routes/views/*.js",
|
|
155
157
|
"./components/routes/overviews/*": "./components/routes/overviews/*.js",
|
|
156
158
|
"./components/routes/analytics/*": "./components/routes/analytics/*.js",
|
|
@@ -168,12 +170,21 @@
|
|
|
168
170
|
"./components/routes/action/shared/*": "./components/routes/action/shared/*.js",
|
|
169
171
|
"./components/routes/action/view/*": "./components/routes/action/view/*.js",
|
|
170
172
|
"./components/routes/action/view/markdown/*.md": "./components/routes/action/view/markdown/*.md.js",
|
|
173
|
+
"./components/routes/cases/modals/*": "./components/routes/cases/modals/*.js",
|
|
174
|
+
"./components/routes/cases/detail/*": "./components/routes/cases/detail/*.js",
|
|
175
|
+
"./components/routes/cases/hooks/*": "./components/routes/cases/hooks/*.js",
|
|
176
|
+
"./components/routes/cases/detail/assets/*": "./components/routes/cases/detail/assets/*.js",
|
|
177
|
+
"./components/routes/cases/detail/sidebar/*": "./components/routes/cases/detail/sidebar/*.js",
|
|
178
|
+
"./components/routes/cases/detail/aggregates/*": "./components/routes/cases/detail/aggregates/*.js",
|
|
171
179
|
"./components/routes/overviews/template/*": "./components/routes/overviews/template/*.js",
|
|
172
180
|
"./components/routes/analytics/widgets/*": "./components/routes/analytics/widgets/*.js",
|
|
173
181
|
"./components/logins/auth/*": "./components/logins/auth/*.js",
|
|
174
182
|
"./components/logins/hooks/*": "./components/logins/hooks/*.js",
|
|
175
183
|
"./components/elements/hit/*": "./components/elements/hit/*.js",
|
|
176
184
|
"./components/elements/addons/*": "./components/elements/addons/*.js",
|
|
185
|
+
"./components/elements/record/*": "./components/elements/record/*.js",
|
|
186
|
+
"./components/elements/observable/*": "./components/elements/observable/*.js",
|
|
187
|
+
"./components/elements/case/*": "./components/elements/case/*.js",
|
|
177
188
|
"./components/elements/view/*": "./components/elements/view/*.js",
|
|
178
189
|
"./components/elements/display/*": "./components/elements/display/*.js",
|
|
179
190
|
"./components/elements/hit/aggregate/*": "./components/elements/hit/aggregate/*.js",
|
|
@@ -224,6 +235,8 @@
|
|
|
224
235
|
"./api/template": "./api/template/index.js",
|
|
225
236
|
"./api/analytic/*": "./api/analytic/*.js",
|
|
226
237
|
"./api/analytic": "./api/analytic/index.js",
|
|
238
|
+
"./api/v2/*": "./api/v2/*.js",
|
|
239
|
+
"./api/v2": "./api/v2/index.js",
|
|
227
240
|
"./api/auth/*": "./api/auth/*.js",
|
|
228
241
|
"./api/auth": "./api/auth/index.js",
|
|
229
242
|
"./api/user/*": "./api/user/*.js",
|
|
@@ -244,6 +257,10 @@
|
|
|
244
257
|
"./api/analytic/comments": "./api/analytic/comments/index.js",
|
|
245
258
|
"./api/analytic/notebooks/*": "./api/analytic/notebooks/*.js",
|
|
246
259
|
"./api/analytic/notebooks": "./api/analytic/notebooks/index.js",
|
|
260
|
+
"./api/v2/case/*": "./api/v2/case/*.js",
|
|
261
|
+
"./api/v2/case": "./api/v2/case/index.js",
|
|
262
|
+
"./api/v2/search/*": "./api/v2/search/*.js",
|
|
263
|
+
"./api/v2/search": "./api/v2/search/index.js",
|
|
247
264
|
"./api/user/avatar/*": "./api/user/avatar/*.js",
|
|
248
265
|
"./api/user/avatar": "./api/user/avatar/index.js",
|
|
249
266
|
"./api/search/count/*": "./api/search/count/*.js",
|
|
@@ -3,8 +3,8 @@ import EnrichedTypography from '@cccsaurora/clue-ui/components/EnrichedTypograph
|
|
|
3
3
|
import { Typography } from '@mui/material';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { useType } from '../utils';
|
|
6
|
-
const ClueTypography = ({ children, value, context, field,
|
|
7
|
-
const type = useType(
|
|
6
|
+
const ClueTypography = ({ children, value, context, field, obj, ...props }) => {
|
|
7
|
+
const type = useType(obj, field, value);
|
|
8
8
|
if (!type) {
|
|
9
9
|
return _jsx(Typography, { ...props, children: children ?? value });
|
|
10
10
|
}
|
package/plugins/clue/utils.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
2
|
-
|
|
2
|
+
import type { Observable } from '@cccsaurora/howler-ui/models/entities/generated/Observable';
|
|
3
|
+
export declare const useType: (hit?: Hit | Observable, field?: string, value?: string) => any;
|
package/tests/mocks.d.ts
CHANGED
|
@@ -7,7 +7,17 @@ export declare const setupContextSelectorMock: () => void;
|
|
|
7
7
|
* Sets up a mock for react-router-dom with common defaults
|
|
8
8
|
* @param options - Override specific router behavior
|
|
9
9
|
*/
|
|
10
|
-
export declare const setupReactRouterMock: () =>
|
|
10
|
+
export declare const setupReactRouterMock: () => {
|
|
11
|
+
mockSearchParams: URLSearchParams;
|
|
12
|
+
mockSetParams: import("vitest").Mock<(...args: any[]) => any>;
|
|
13
|
+
mockLocation: {
|
|
14
|
+
pathname: string;
|
|
15
|
+
search: string;
|
|
16
|
+
};
|
|
17
|
+
mockParams: {
|
|
18
|
+
id: any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
11
21
|
/**
|
|
12
22
|
* Sets up a mock localStorage instance
|
|
13
23
|
*/
|
package/tests/mocks.js
CHANGED
|
@@ -31,15 +31,20 @@ export const setupReactRouterMock = () => {
|
|
|
31
31
|
const mockSearchParams = vi.hoisted(() => new URLSearchParams());
|
|
32
32
|
const mockSetParams = vi.hoisted(() => vi.fn());
|
|
33
33
|
beforeAll(() => {
|
|
34
|
-
vi.mock('react-router-dom', () =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
vi.mock('react-router-dom', async () => {
|
|
35
|
+
const actual = await vi.importActual('react-router-dom');
|
|
36
|
+
return {
|
|
37
|
+
...actual,
|
|
38
|
+
Link: forwardRef(({ to, children, ...props }, ref) => (_jsx("a", { ref: ref, href: to, ...props, children: children }))),
|
|
39
|
+
useLocation: vi.fn(() => mockLocation),
|
|
40
|
+
useParams: vi.fn(() => mockParams),
|
|
41
|
+
useSearchParams: vi.fn(() => [mockSearchParams, mockSetParams]),
|
|
42
|
+
useNavigate: () => vi.fn()
|
|
43
|
+
};
|
|
44
|
+
});
|
|
41
45
|
});
|
|
42
46
|
afterAll(() => vi.resetModules());
|
|
47
|
+
return { mockSearchParams, mockSetParams, mockLocation, mockParams };
|
|
43
48
|
};
|
|
44
49
|
/**
|
|
45
50
|
* Sets up a mock localStorage instance
|
package/tests/server-handlers.js
CHANGED
|
@@ -30,7 +30,12 @@ export const MOCK_RESPONSES = {
|
|
|
30
30
|
total: 1,
|
|
31
31
|
rows: 1
|
|
32
32
|
},
|
|
33
|
-
'/api/v1/analytic': [createMockAnalytic()]
|
|
33
|
+
'/api/v1/analytic': [createMockAnalytic()],
|
|
34
|
+
'/api/v2/search/hit,observable': {
|
|
35
|
+
items: [],
|
|
36
|
+
total: 0,
|
|
37
|
+
rows: 0
|
|
38
|
+
}
|
|
34
39
|
};
|
|
35
40
|
const handlers = [
|
|
36
41
|
...Object.entries(MOCK_RESPONSES).map(([path, data]) => http.all(path, async () => HttpResponse.json({ api_response: data }))),
|
package/tests/utils.d.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { Action } from '@cccsaurora/howler-ui/models/entities/generated/Action';
|
|
2
2
|
import type { Analytic } from '@cccsaurora/howler-ui/models/entities/generated/Analytic';
|
|
3
|
+
import type { Case } from '@cccsaurora/howler-ui/models/entities/generated/Case';
|
|
3
4
|
import type { Dossier } from '@cccsaurora/howler-ui/models/entities/generated/Dossier';
|
|
4
5
|
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
6
|
+
import type { Observable } from '@cccsaurora/howler-ui/models/entities/generated/Observable';
|
|
5
7
|
import type { Template } from '@cccsaurora/howler-ui/models/entities/generated/Template';
|
|
6
8
|
import type { View } from '@cccsaurora/howler-ui/models/entities/generated/View';
|
|
7
9
|
type RecursivePartial<T> = {
|
|
8
10
|
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];
|
|
9
11
|
};
|
|
10
12
|
export declare const createMockHit: (overrides?: RecursivePartial<Hit>) => Hit;
|
|
13
|
+
export declare const createMockObservable: (overrides?: RecursivePartial<Observable>) => Observable;
|
|
11
14
|
export declare const createMockAnalytic: (overrides?: Partial<Analytic>) => Analytic;
|
|
12
15
|
export declare const createMockTemplate: (overrides?: Partial<Template>) => Template;
|
|
13
16
|
export declare const createMockAction: (overrides?: Partial<Action>) => Action;
|
|
14
17
|
export declare const createMockView: (overrides?: Partial<View>) => View;
|
|
18
|
+
export declare const createMockCase: (overrides?: Partial<Case>) => Case;
|
|
15
19
|
export declare const createMockDossier: (overrides?: Partial<Dossier>) => Dossier;
|
|
16
20
|
export {};
|
package/tests/utils.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Mock data factories
|
|
2
2
|
export const createMockHit = (overrides) => ({
|
|
3
|
+
...overrides,
|
|
4
|
+
__index: 'hit',
|
|
3
5
|
howler: {
|
|
4
6
|
id: 'test-hit-1',
|
|
5
7
|
analytic: 'test-analytic',
|
|
@@ -14,6 +16,17 @@ export const createMockHit = (overrides) => ({
|
|
|
14
16
|
...overrides?.event
|
|
15
17
|
}
|
|
16
18
|
});
|
|
19
|
+
export const createMockObservable = (overrides) => ({
|
|
20
|
+
...overrides,
|
|
21
|
+
__index: 'observable',
|
|
22
|
+
howler: {
|
|
23
|
+
id: 'test-observable-1',
|
|
24
|
+
analytic: 'test-analytic',
|
|
25
|
+
detection: 'Test Detection',
|
|
26
|
+
hash: '',
|
|
27
|
+
...overrides?.howler
|
|
28
|
+
}
|
|
29
|
+
});
|
|
17
30
|
export const createMockAnalytic = (overrides) => ({
|
|
18
31
|
analytic_id: 'test-analytic-id',
|
|
19
32
|
name: 'test-analytic',
|
|
@@ -52,6 +65,13 @@ export const createMockView = (overrides) => ({
|
|
|
52
65
|
},
|
|
53
66
|
...overrides
|
|
54
67
|
});
|
|
68
|
+
export const createMockCase = (overrides) => ({
|
|
69
|
+
case_id: 'test-case-id',
|
|
70
|
+
title: 'Test Case',
|
|
71
|
+
summary: 'Test case summary',
|
|
72
|
+
items: [],
|
|
73
|
+
...overrides
|
|
74
|
+
});
|
|
55
75
|
// Helper function to create mock dossiers
|
|
56
76
|
export const createMockDossier = (overrides) => ({
|
|
57
77
|
dossier_id: 'test-dossier-id',
|
package/utils/constants.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export declare const VERSION: any;
|
|
|
5
5
|
export declare const MY_LOCAL_STORAGE_PREFIX = "howler.ui";
|
|
6
6
|
export declare const MY_SESSION_STORAGE_PREFIX = "howler.ui.cache";
|
|
7
7
|
export declare const ESCALATION_COLORS: {
|
|
8
|
-
alert:
|
|
9
|
-
evidence:
|
|
10
|
-
hit:
|
|
8
|
+
alert: "warning";
|
|
9
|
+
evidence: "error";
|
|
10
|
+
hit: "primary";
|
|
11
11
|
};
|
|
12
12
|
export declare const STATUS_COLORS: {
|
|
13
13
|
open: string;
|
package/utils/hitFunctions.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
2
|
-
|
|
2
|
+
import type { Observable } from '@cccsaurora/howler-ui/models/entities/generated/Observable';
|
|
3
|
+
export declare const getUserList: (record: Hit | Observable) => Set<string>;
|
package/utils/hitFunctions.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export const getUserList = (
|
|
1
|
+
export const getUserList = (record) => {
|
|
2
2
|
const ids = new Set();
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
if (record) {
|
|
4
|
+
record.howler?.log?.forEach(l => ids.add(l.user));
|
|
5
|
+
record.howler?.comment?.forEach(c => ids.add(c.user), ids);
|
|
6
6
|
}
|
|
7
7
|
return ids;
|
|
8
8
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Case } from '@cccsaurora/howler-ui/models/entities/generated/Case';
|
|
2
|
+
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
3
|
+
import type { Observable } from '@cccsaurora/howler-ui/models/entities/generated/Observable';
|
|
4
|
+
import type { WithMetadata } from '@cccsaurora/howler-ui/models/WithMetadata';
|
|
5
|
+
export declare const isHit: (obj: WithMetadata<any>) => obj is Hit;
|
|
6
|
+
export declare const isCase: (obj: WithMetadata<any>) => obj is Case;
|
|
7
|
+
export declare const isObservable: (obj: WithMetadata<any>) => obj is Observable;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const isHit = (obj) => {
|
|
2
|
+
if (!obj) {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
if (obj.__index === 'hit') {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
return false;
|
|
9
|
+
};
|
|
10
|
+
export const isCase = (obj) => {
|
|
11
|
+
if (!obj) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (obj.__index === 'case') {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
export const isObservable = (obj) => {
|
|
20
|
+
if (!obj) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (obj.__index === 'observable') {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
};
|
package/utils/viewUtils.js
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
2
|
-
import type { WithMetadata } from '@cccsaurora/howler-ui/models/WithMetadata';
|
|
3
|
-
import type { FC, PropsWithChildren } from 'react';
|
|
4
|
-
export interface HitContextType {
|
|
5
|
-
hits: {
|
|
6
|
-
[index: string]: Hit;
|
|
7
|
-
};
|
|
8
|
-
selectedHits: Hit[];
|
|
9
|
-
addHitToSelection: (id: string) => void;
|
|
10
|
-
removeHitFromSelection: (id: string) => void;
|
|
11
|
-
clearSelectedHits: (except?: string) => void;
|
|
12
|
-
loadHits: (hits: Hit[]) => void;
|
|
13
|
-
updateHit: (newHit: Hit) => void;
|
|
14
|
-
getHit: (id: string, force?: boolean) => Promise<WithMetadata<Hit>>;
|
|
15
|
-
}
|
|
16
|
-
export declare const HitContext: import("use-context-selector").Context<HitContextType>;
|
|
17
|
-
/**
|
|
18
|
-
* Central repository for storing individual hit data across the application. Allows efficient retrieval of hits across componenents.
|
|
19
|
-
*/
|
|
20
|
-
declare const HitProvider: FC<PropsWithChildren>;
|
|
21
|
-
export declare const useHitContextSelector: <Selected>(selector: (value: HitContextType) => Selected) => Selected;
|
|
22
|
-
export default HitProvider;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AccountTree } from '@mui/icons-material';
|
|
3
|
-
import { ListItemText, Menu, MenuItem, Typography } from '@mui/material';
|
|
4
|
-
import TuiIconButton from '@cccsaurora/howler-ui/components/elements/addons/buttons/CustomIconButton';
|
|
5
|
-
import { useCallback, useState } from 'react';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useNavigate } from 'react-router-dom';
|
|
8
|
-
const BundleButton = ({ ids, disabled = false }) => {
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
const navigate = useNavigate();
|
|
11
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
12
|
-
const onClick = useCallback((event) => {
|
|
13
|
-
if (ids.length === 1) {
|
|
14
|
-
navigate(`/bundles/${ids[0]}`);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
setAnchorEl(event.currentTarget);
|
|
18
|
-
}
|
|
19
|
-
}, [ids, navigate]);
|
|
20
|
-
const handleClose = useCallback(() => setAnchorEl(null), []);
|
|
21
|
-
return (_jsxs(_Fragment, { children: [_jsx(TuiIconButton, { size: "small", tooltip: t(`hit.panel.bundles.open${ids.length > 1 ? '' : '.prompt'}`), onClick: onClick, disabled: disabled, "aria-disabled": disabled, "aria-haspopup": "true", "aria-controls": anchorEl ? 'bundle-action-menu' : undefined, "aria-expanded": anchorEl ? 'true' : undefined, children: _jsx(AccountTree, {}) }), _jsx(Menu, { id: "bundle-action-menu", anchorEl: anchorEl, open: !!anchorEl, onClose: handleClose, MenuListProps: {
|
|
22
|
-
dense: true,
|
|
23
|
-
'aria-labelledby': `bundle-button`
|
|
24
|
-
}, anchorOrigin: {
|
|
25
|
-
vertical: 'bottom',
|
|
26
|
-
horizontal: 'right'
|
|
27
|
-
}, transformOrigin: {
|
|
28
|
-
vertical: 'top',
|
|
29
|
-
horizontal: 'right'
|
|
30
|
-
}, children: ids.map(id => (_jsx(MenuItem, { onClick: () => navigate(`/bundles/${id}`), children: _jsx(ListItemText, { primary: t('hit.panel.bundles.open.prompt'), secondary: _jsx(Typography, { variant: "caption", color: "text.secondary", children: id }) }) }, id))) })] }));
|
|
31
|
-
};
|
|
32
|
-
export default BundleButton;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Grid } from '@mui/material';
|
|
3
|
-
import RelatedLink from './related/RelatedLink';
|
|
4
|
-
const HitRelated = ({ hit }) => {
|
|
5
|
-
return (_jsx(Grid, { container: true, spacing: 1, pr: 2, children: hit?.howler.links?.map(l => (_jsx(Grid, { item: true, xs: 6, sm: 4, md: 3, children: _jsx(RelatedLink, { ...l }) }, l.title + l.href))) }));
|
|
6
|
-
};
|
|
7
|
-
export default HitRelated;
|