@solidxai/core-ui 0.1.20 → 0.1.21-beta.0
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/dist/components/common/FileReaderExt.d.ts.map +1 -1
- package/dist/components/common/FileReaderExt.js +22 -11
- package/dist/components/common/FileReaderExt.js.map +1 -1
- package/dist/components/common/FileReaderExt.tsx +27 -14
- package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
- package/dist/components/common/SocialMediaLogin.js +1 -1
- package/dist/components/common/SocialMediaLogin.js.map +1 -1
- package/dist/components/common/SocialMediaLogin.tsx +50 -19
- package/dist/components/common/solid-export.css +75 -0
- package/dist/components/core/common/SolidGenericImport/SolidImport.module.css +71 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +14 -0
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +13 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +3 -3
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +3 -3
- package/dist/components/core/form/fields/SolidMediaSingleField.js +2 -2
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +2 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +2 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +4 -4
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +3 -3
- package/dist/components/core/solid-agent/SolidAgentChat.d.ts +3 -1
- package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.js +150 -22
- package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.tsx +76 -15
- package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts +2 -0
- package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentEmbedded.js +4 -4
- package/dist/components/core/solid-agent/SolidAgentEmbedded.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentEmbedded.tsx +7 -1
- package/dist/components/core/solid-agent/SolidAgentHost.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentHost.js +79 -1
- package/dist/components/core/solid-agent/SolidAgentHost.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentHost.tsx +69 -2
- package/dist/components/core/solid-agent/agentEvents.d.ts.map +1 -1
- package/dist/components/core/solid-agent/agentEvents.js +1 -3
- package/dist/components/core/solid-agent/agentEvents.js.map +1 -1
- package/dist/components/core/solid-agent/agentEvents.ts +5 -3
- package/dist/components/core/solid-agent/client/agentPublicEvents.d.ts +88 -0
- package/dist/components/core/solid-agent/client/agentPublicEvents.d.ts.map +1 -0
- package/dist/components/core/solid-agent/client/agentPublicEvents.js +26 -0
- package/dist/components/core/solid-agent/client/agentPublicEvents.js.map +1 -0
- package/dist/components/core/solid-agent/client/agentPublicEvents.ts +66 -0
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts +18 -3
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.js +173 -31
- package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.ts +126 -16
- package/dist/components/core/solid-agent/client/agentSocket.d.ts +3 -0
- package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.js +19 -1
- package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.ts +11 -1
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.d.ts +9 -0
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.d.ts.map +1 -0
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.js +53 -0
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.js.map +1 -0
- package/dist/components/core/solid-agent/client/beforeUserMessageSend.ts +26 -0
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.d.ts.map +1 -1
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js +4 -3
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js.map +1 -1
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx +4 -2
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts +29 -0
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js +45 -2
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.ts +49 -2
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.d.ts +1 -0
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.d.ts.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.js +2 -1
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.js.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedSamples.ts +15 -1
- package/dist/components/core/solid-agent/types.d.ts +13 -0
- package/dist/components/core/solid-agent/types.d.ts.map +1 -1
- package/dist/components/core/solid-agent/types.js.map +1 -1
- package/dist/components/core/solid-agent/types.ts +8 -0
- package/dist/components/core/solid-agent/useAgentChat.d.ts +1 -1
- package/dist/components/core/solid-agent/useAgentChat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/useAgentChat.js +7 -4
- package/dist/components/core/solid-agent/useAgentChat.js.map +1 -1
- package/dist/components/core/solid-agent/useAgentChat.ts +9 -5
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js +12 -4
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.tsx +18 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.d.ts +4 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.js +30 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.tsx +41 -0
- package/dist/components/core/solid-agent/widgets/solidChatWidgets.module.css +39 -0
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.js +3 -2
- package/dist/components/shad-cn-ui/SolidCodeEditor.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.tsx +3 -0
- package/dist/helpers/adminViewRefresh.d.ts +13 -0
- package/dist/helpers/adminViewRefresh.d.ts.map +1 -0
- package/dist/helpers/adminViewRefresh.js +14 -0
- package/dist/helpers/adminViewRefresh.js.map +1 -0
- package/dist/helpers/adminViewRefresh.ts +26 -0
- package/dist/helpers/eventBus.d.ts +1 -0
- package/dist/helpers/eventBus.d.ts.map +1 -1
- package/dist/helpers/eventBus.js +1 -0
- package/dist/helpers/eventBus.js.map +1 -1
- package/dist/helpers/eventBus.ts +1 -0
- package/dist/helpers/fileTypeIcon.d.ts.map +1 -1
- package/dist/helpers/fileTypeIcon.js +4 -1
- package/dist/helpers/fileTypeIcon.js.map +1 -1
- package/dist/helpers/fileTypeIcon.tsx +15 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +2 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +2 -0
- package/dist/helpers/routePaths.d.ts +13 -0
- package/dist/helpers/routePaths.d.ts.map +1 -1
- package/dist/helpers/routePaths.js +39 -0
- package/dist/helpers/routePaths.js.map +1 -1
- package/dist/helpers/routePaths.ts +48 -0
- package/dist/redux/features/agentSlice.d.ts +2 -1
- package/dist/redux/features/agentSlice.d.ts.map +1 -1
- package/dist/redux/features/agentSlice.js +2 -2
- package/dist/redux/features/agentSlice.js.map +1 -1
- package/dist/redux/features/agentSlice.ts +8 -3
- package/dist/resources/solid-custom.css +42 -0
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/pages/admin/core/AgentHubModuleField.css +15 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.d.ts +22 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.js +42 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.js.map +1 -0
- package/dist/routes/pages/admin/core/AgentHubModuleField.tsx +54 -0
- package/dist/routes/pages/admin/core/AgentHubTagsField.d.ts +3 -1
- package/dist/routes/pages/admin/core/AgentHubTagsField.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentHubTagsField.js +3 -3
- package/dist/routes/pages/admin/core/AgentHubTagsField.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentHubTagsField.tsx +7 -3
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +37 -29
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +12 -6
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +22 -15
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +17 -7
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +21 -15
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +16 -9
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js +149 -37
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.tsx +283 -73
- package/dist/routes/pages/admin/core/CardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.js +9 -1
- package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.tsx +9 -1
- package/dist/routes/pages/admin/core/KanbanPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js +9 -1
- package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.tsx +9 -1
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +10 -1
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +10 -1
- package/dist/routes/pages/admin/core/TreePage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.js +9 -1
- package/dist/routes/pages/admin/core/TreePage.js.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.tsx +9 -1
- package/dist/routes/pages/embed/AgentEmbedPage.d.ts.map +1 -1
- package/dist/routes/pages/embed/AgentEmbedPage.js +67 -4
- package/dist/routes/pages/embed/AgentEmbedPage.js.map +1 -1
- package/dist/routes/pages/embed/AgentEmbedPage.tsx +61 -4
- package/package.json +1 -1
|
@@ -1,96 +1,306 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import qs from 'qs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Loader2 } from 'lucide-react';
|
|
4
|
+
import { SolidAutocomplete } from '../../../../components/shad-cn-ui/SolidAutocomplete';
|
|
5
|
+
import { Column, SolidDataTable } from '../../../../components/core/list/SolidDataTable';
|
|
6
|
+
import { useLazyGetModelsQuery } from '../../../../redux/api/modelApi';
|
|
7
|
+
import { createSolidEntityApi } from '../../../../redux/api/solidEntityApi';
|
|
5
8
|
import { useGetArchivedChatterMessagesQuery, useLazyGetArchivedChatterMessageQuery } from '../../../../redux/api/solidChatterMessageApi';
|
|
6
9
|
|
|
7
|
-
const
|
|
8
|
-
|
|
10
|
+
const DEFAULT_PAGE_SIZE = 25;
|
|
11
|
+
const PAGE_SIZE_OPTIONS = [10, 25, 50, 100];
|
|
12
|
+
const MESSAGE_TYPES = [
|
|
13
|
+
{ label: 'All types', value: '' },
|
|
14
|
+
{ label: 'Audit', value: 'audit' },
|
|
15
|
+
{ label: 'Custom', value: 'custom' },
|
|
16
|
+
];
|
|
17
|
+
const MESSAGE_SUBTYPES = [
|
|
18
|
+
{ label: 'All subtypes', value: '' },
|
|
19
|
+
{ label: 'Audit insert', value: 'audit_insert' },
|
|
20
|
+
{ label: 'Audit update', value: 'audit_update' },
|
|
21
|
+
{ label: 'Audit delete', value: 'audit_delete' },
|
|
22
|
+
{ label: 'Custom', value: 'custom' },
|
|
23
|
+
{ label: 'Note', value: 'note' },
|
|
24
|
+
{ label: 'Task', value: 'task' },
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
type AutocompleteOption = { label: string; value: string | number };
|
|
28
|
+
type ArchiveFilters = {
|
|
29
|
+
entity: AutocompleteOption | null;
|
|
30
|
+
entityId: string;
|
|
31
|
+
messageType: string;
|
|
32
|
+
messageSubType: string;
|
|
33
|
+
user: AutocompleteOption | null;
|
|
34
|
+
from: string;
|
|
35
|
+
to: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const userApi = createSolidEntityApi('User');
|
|
39
|
+
|
|
40
|
+
const buildQueryString = (query: Record<string, unknown>) =>
|
|
41
|
+
qs.stringify(query, { encodeValuesOnly: true });
|
|
42
|
+
|
|
43
|
+
function toLocalDateBoundary(value: string, endOfDay = false): string {
|
|
44
|
+
const date = new Date(`${value}T${endOfDay ? '23:59:59.999' : '00:00:00'}`);
|
|
45
|
+
return date.toISOString();
|
|
46
|
+
}
|
|
9
47
|
|
|
10
48
|
export function ArchivedChatterMessagesPage() {
|
|
11
|
-
const [filters, setFilters] = React.useState<
|
|
12
|
-
|
|
49
|
+
const [filters, setFilters] = React.useState<ArchiveFilters>({
|
|
50
|
+
entity: null,
|
|
51
|
+
entityId: '',
|
|
52
|
+
messageType: '',
|
|
53
|
+
messageSubType: '',
|
|
54
|
+
user: null,
|
|
55
|
+
from: '',
|
|
56
|
+
to: '',
|
|
57
|
+
});
|
|
58
|
+
const [first, setFirst] = React.useState(0);
|
|
59
|
+
const [rows, setRows] = React.useState(DEFAULT_PAGE_SIZE);
|
|
13
60
|
const [selectedId, setSelectedId] = React.useState<number | null>(null);
|
|
61
|
+
const [modelOptions, setModelOptions] = React.useState<AutocompleteOption[]>([]);
|
|
62
|
+
const [userOptions, setUserOptions] = React.useState<AutocompleteOption[]>([]);
|
|
14
63
|
|
|
15
|
-
const
|
|
16
|
-
|
|
64
|
+
const [getModels, { data: modelsData }] = useLazyGetModelsQuery();
|
|
65
|
+
const [getUsers] = userApi.useLazyGetSolidEntitiesQuery();
|
|
66
|
+
const {
|
|
67
|
+
data,
|
|
68
|
+
isLoading,
|
|
69
|
+
isError,
|
|
70
|
+
} = useGetArchivedChatterMessagesQuery(React.useMemo(() => {
|
|
71
|
+
const query: Record<string, unknown> = {
|
|
72
|
+
limit: rows,
|
|
73
|
+
offset: first,
|
|
74
|
+
sort: ['createdAt:DESC'],
|
|
75
|
+
};
|
|
17
76
|
const where: Record<string, any> = {};
|
|
18
|
-
if (filters.
|
|
19
|
-
if (filters.entityId.trim() && Number.isFinite(Number(filters.entityId)))
|
|
77
|
+
if (filters.entity?.value) where.coModelName = { $eq: filters.entity.value };
|
|
78
|
+
if (filters.entityId.trim() && Number.isFinite(Number(filters.entityId))) {
|
|
79
|
+
where.coModelEntityId = { $eq: Number(filters.entityId) };
|
|
80
|
+
}
|
|
20
81
|
if (filters.messageType) where.messageType = { $eq: filters.messageType };
|
|
21
|
-
if (filters.messageSubType
|
|
22
|
-
if (filters.user
|
|
82
|
+
if (filters.messageSubType) where.messageSubType = { $eq: filters.messageSubType };
|
|
83
|
+
if (filters.user?.value) where.user = { id: { $eq: filters.user.value } };
|
|
23
84
|
if (filters.from || filters.to) {
|
|
24
85
|
where.createdAt = {};
|
|
25
|
-
if (filters.from) where.createdAt.$gte =
|
|
26
|
-
if (filters.to) where.createdAt.$lte =
|
|
86
|
+
if (filters.from) where.createdAt.$gte = toLocalDateBoundary(filters.from);
|
|
87
|
+
if (filters.to) where.createdAt.$lte = toLocalDateBoundary(filters.to, true);
|
|
27
88
|
}
|
|
28
89
|
if (Object.keys(where).length) query.filters = where;
|
|
29
|
-
query
|
|
30
|
-
|
|
31
|
-
}, [filters, offset]);
|
|
90
|
+
return buildQueryString(query);
|
|
91
|
+
}, [filters, first, rows]));
|
|
32
92
|
|
|
33
|
-
const {
|
|
34
|
-
const [fetchOne, { data: detailData, isFetching: detailLoading }] = useLazyGetArchivedChatterMessageQuery();
|
|
93
|
+
const [fetchOne, { currentData: detailData, isFetching: detailLoading }] = useLazyGetArchivedChatterMessageQuery();
|
|
35
94
|
const records = data?.records ?? [];
|
|
36
95
|
const meta = data?.meta ?? {};
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
getModels('offset=0&limit=1000&sort[0]=displayName%3AASC');
|
|
98
|
+
}, [getModels]);
|
|
99
|
+
|
|
100
|
+
React.useEffect(() => {
|
|
101
|
+
const options = (modelsData?.records ?? [])
|
|
102
|
+
.filter((model: any) => model?.singularName)
|
|
103
|
+
.map((model: any) => ({
|
|
104
|
+
label: model.displayName && model.displayName !== model.singularName
|
|
105
|
+
? `${model.displayName} (${model.singularName})`
|
|
106
|
+
: model.singularName,
|
|
107
|
+
value: model.singularName,
|
|
108
|
+
}));
|
|
109
|
+
setModelOptions(options);
|
|
110
|
+
}, [modelsData]);
|
|
111
|
+
|
|
112
|
+
const updateFilter = <K extends keyof ArchiveFilters>(key: K, value: ArchiveFilters[K]) => {
|
|
113
|
+
setFirst(0);
|
|
114
|
+
setFilters(current => ({ ...current, [key]: value }));
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const completeModels = ({ query }: { query: string }) => {
|
|
118
|
+
const normalizedQuery = query.trim().toLocaleLowerCase();
|
|
119
|
+
setModelOptions((modelsData?.records ?? [])
|
|
120
|
+
.filter((model: any) => model?.singularName)
|
|
121
|
+
.filter((model: any) => !normalizedQuery ||
|
|
122
|
+
`${model.displayName ?? ''} ${model.singularName}`.toLocaleLowerCase().includes(normalizedQuery))
|
|
123
|
+
.slice(0, 25)
|
|
124
|
+
.map((model: any) => ({
|
|
125
|
+
label: model.displayName && model.displayName !== model.singularName
|
|
126
|
+
? `${model.displayName} (${model.singularName})`
|
|
127
|
+
: model.singularName,
|
|
128
|
+
value: model.singularName,
|
|
129
|
+
})));
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const completeUsers = async ({ query }: { query: string }) => {
|
|
133
|
+
const queryString = buildQueryString({
|
|
134
|
+
offset: 0,
|
|
135
|
+
limit: 10,
|
|
136
|
+
sort: ['fullName:ASC'],
|
|
137
|
+
filters: query.trim() ? { fullName: { $containsi: query.trim() } } : {},
|
|
138
|
+
});
|
|
139
|
+
const response = await getUsers(queryString);
|
|
140
|
+
const users = response.data?.records ?? [];
|
|
141
|
+
setUserOptions(users.map((user: any) => ({
|
|
142
|
+
label: user.fullName || user.username || `User ${user.id}`,
|
|
143
|
+
value: user.id,
|
|
144
|
+
})));
|
|
145
|
+
};
|
|
37
146
|
|
|
38
|
-
const openRecord =
|
|
147
|
+
const openRecord = (id: number) => {
|
|
39
148
|
setSelectedId(id);
|
|
40
|
-
|
|
149
|
+
void fetchOne(id);
|
|
41
150
|
};
|
|
151
|
+
|
|
42
152
|
const selected = detailData?.record;
|
|
153
|
+
const emptyMessage = isLoading
|
|
154
|
+
? <span className="inline-flex items-center justify-center gap-2"><Loader2 className="animate-spin" size={16} />Loading archived messages…</span>
|
|
155
|
+
: isError
|
|
156
|
+
? <span role="alert" className="text-red-600">Unable to load archived messages. Check the archive store connection and try again.</span>
|
|
157
|
+
: 'No archived messages found';
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<div className="page-parent-wrapper solid-list-page-wrapper flex h-full min-h-0 overflow-hidden">
|
|
161
|
+
<div className="solid-list-content flex min-w-0 flex-grow-1 flex-col">
|
|
162
|
+
<div className="solid-list-surface flex min-h-0 flex-1 flex-col">
|
|
163
|
+
<div className="page-header solid-list-toolbar flex-col">
|
|
164
|
+
<section className="solid-list-toolbar-left grid w-full grid-cols-1 items-end gap-3 sm:grid-cols-2 xl:grid-cols-7" aria-label="Archived message filters">
|
|
165
|
+
<label className="flex min-w-0 flex-col gap-1 text-sm">
|
|
166
|
+
Entity
|
|
167
|
+
<SolidAutocomplete
|
|
168
|
+
dropdown
|
|
169
|
+
forceSelection
|
|
170
|
+
field="label"
|
|
171
|
+
value={filters.entity}
|
|
172
|
+
suggestions={modelOptions}
|
|
173
|
+
completeMethod={completeModels}
|
|
174
|
+
onChange={(event) => updateFilter('entity', event.value)}
|
|
175
|
+
placeholder="All entities"
|
|
176
|
+
className="w-full solid-standard-autocomplete"
|
|
177
|
+
inputClassName="w-full solid-filter-compact-control"
|
|
178
|
+
emptyMessage="No models found"
|
|
179
|
+
/>
|
|
180
|
+
</label>
|
|
181
|
+
<label className="flex min-w-0 flex-col gap-1 text-sm">
|
|
182
|
+
Entity ID
|
|
183
|
+
<input
|
|
184
|
+
className="solid-input w-full solid-filter-compact-control"
|
|
185
|
+
type="text"
|
|
186
|
+
value={filters.entityId}
|
|
187
|
+
onChange={(event) => updateFilter('entityId', event.target.value)}
|
|
188
|
+
placeholder="Any entity ID"
|
|
189
|
+
/>
|
|
190
|
+
</label>
|
|
191
|
+
<label className="flex min-w-0 flex-col gap-1 text-sm">
|
|
192
|
+
Message type
|
|
193
|
+
<select className="solid-input w-full solid-filter-compact-control" value={filters.messageType} onChange={(event) => updateFilter('messageType', event.target.value)}>
|
|
194
|
+
{MESSAGE_TYPES.map(option => <option key={option.value || 'all'} value={option.value}>{option.label}</option>)}
|
|
195
|
+
</select>
|
|
196
|
+
</label>
|
|
197
|
+
<label className="flex min-w-0 flex-col gap-1 text-sm">
|
|
198
|
+
Message subtype
|
|
199
|
+
<select className="solid-input w-full solid-filter-compact-control" value={filters.messageSubType} onChange={(event) => updateFilter('messageSubType', event.target.value)}>
|
|
200
|
+
{MESSAGE_SUBTYPES.map(option => <option key={option.value || 'all'} value={option.value}>{option.label}</option>)}
|
|
201
|
+
</select>
|
|
202
|
+
</label>
|
|
203
|
+
<label className="flex min-w-0 flex-col gap-1 text-sm">
|
|
204
|
+
Changed by
|
|
205
|
+
<SolidAutocomplete
|
|
206
|
+
dropdown
|
|
207
|
+
forceSelection
|
|
208
|
+
field="label"
|
|
209
|
+
value={filters.user}
|
|
210
|
+
suggestions={userOptions}
|
|
211
|
+
completeMethod={completeUsers}
|
|
212
|
+
onChange={(event) => updateFilter('user', event.value)}
|
|
213
|
+
placeholder="Any user"
|
|
214
|
+
className="w-full solid-standard-autocomplete"
|
|
215
|
+
inputClassName="w-full solid-filter-compact-control"
|
|
216
|
+
emptyMessage="No users found"
|
|
217
|
+
/>
|
|
218
|
+
</label>
|
|
219
|
+
<label className="flex min-w-0 flex-col gap-1 text-sm">
|
|
220
|
+
From
|
|
221
|
+
<input className="solid-input w-full solid-filter-compact-control" type="date" value={filters.from} onChange={(event) => updateFilter('from', event.target.value)} />
|
|
222
|
+
</label>
|
|
223
|
+
<label className="flex min-w-0 flex-col gap-1 text-sm">
|
|
224
|
+
To
|
|
225
|
+
<input className="solid-input w-full solid-filter-compact-control" type="date" value={filters.to} onChange={(event) => updateFilter('to', event.target.value)} />
|
|
226
|
+
</label>
|
|
227
|
+
</section>
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
{data?.available === false ? (
|
|
231
|
+
<section className="m-4 rounded-md border border-border/60 bg-background p-6 text-center" role="status">
|
|
232
|
+
<h2 className="m-0 text-base font-semibold">Chatter archival is not enabled</h2>
|
|
233
|
+
<p className="mb-0 mt-2 text-sm text-muted-foreground">Configure and register an IChatterMessageArchive provider in the consuming project to archive and browse messages.</p>
|
|
234
|
+
</section>
|
|
235
|
+
) : (
|
|
236
|
+
<>
|
|
237
|
+
<div className="solid-datatable-wrapper solid-list-table-area min-h-0 flex-1 overflow-hidden">
|
|
238
|
+
<SolidDataTable
|
|
239
|
+
value={records}
|
|
240
|
+
dataKey="id"
|
|
241
|
+
rows={rows}
|
|
242
|
+
first={first}
|
|
243
|
+
totalRecords={meta.totalRecords ?? records.length}
|
|
244
|
+
rowsPerPageOptions={PAGE_SIZE_OPTIONS}
|
|
245
|
+
onPage={(event) => {
|
|
246
|
+
setFirst(event.first);
|
|
247
|
+
setRows(event.rows);
|
|
248
|
+
}}
|
|
249
|
+
emptyMessage={emptyMessage}
|
|
250
|
+
viewportHeight="100%"
|
|
251
|
+
rowClassName={() => 'cursor-pointer'}
|
|
252
|
+
onRowClick={(event) => openRecord(event.data.id)}
|
|
253
|
+
currentPageReportTemplate="{first} - {last} of {totalRecords}"
|
|
254
|
+
>
|
|
255
|
+
<Column header="Date" body={(message: any) => message.createdAt ? new Date(message.createdAt).toLocaleString() : '—'} />
|
|
256
|
+
<Column header="Entity" body={(message: any) => message.modelDisplayName || message.coModelName || '—'} />
|
|
257
|
+
<Column header="Entity ID" body={(message: any) => message.coModelEntityId ?? '—'} />
|
|
258
|
+
<Column header="Type" body={(message: any) => message.messageType || '—'} />
|
|
259
|
+
<Column header="Subtype" body={(message: any) => message.messageSubType || '—'} />
|
|
260
|
+
<Column header="Changed by" body={(message: any) => message.user?.fullName || 'System'} />
|
|
261
|
+
<Column header="Message" body={(message: any) => <span className="line-clamp-2 min-w-48">{message.messageBody || 'View message details'}</span>} />
|
|
262
|
+
</SolidDataTable>
|
|
263
|
+
</div>
|
|
264
|
+
</>
|
|
265
|
+
)}
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
43
268
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<div className="flex gap-2"><SolidButton variant="outline" disabled={offset === 0 || isFetching} onClick={() => setOffset(Math.max(0, offset - PAGE_SIZE))}><ChevronLeft size={16} />Previous</SolidButton><SolidButton variant="outline" disabled={records.length < PAGE_SIZE || isFetching} onClick={() => setOffset(offset + PAGE_SIZE)}>Next<ChevronRight size={16} /></SolidButton></div>
|
|
82
|
-
</footer>
|
|
83
|
-
</>}
|
|
84
|
-
|
|
85
|
-
{selectedId !== null && <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4" role="presentation" onClick={() => setSelectedId(null)}>
|
|
86
|
-
<section role="dialog" aria-modal="true" aria-label="Archived chatter message" className="max-h-[85vh] w-full max-w-3xl overflow-auto rounded-lg bg-background p-6 shadow-xl" onClick={e => e.stopPropagation()}>
|
|
87
|
-
<div className="mb-4 flex items-start justify-between"><h2 className="m-0 text-xl font-semibold">Archived message #{selectedId}</h2><button type="button" className="rounded px-2 py-1 hover:bg-muted" onClick={() => setSelectedId(null)}>Close</button></div>
|
|
88
|
-
{detailLoading ? <p>Loading message…</p> : selected ? <>
|
|
89
|
-
<dl className="grid grid-cols-2 gap-3 text-sm"><dt>Entity</dt><dd>{selected.modelDisplayName || selected.coModelName}</dd><dt>Entity ID</dt><dd>{selected.coModelEntityId}</dd><dt>Date</dt><dd>{selected.createdAt ? new Date(selected.createdAt).toLocaleString() : '—'}</dd><dt>User</dt><dd>{selected.user?.fullName || 'System'}</dd><dt>Subtype</dt><dd>{selected.messageSubType}</dd></dl>
|
|
90
|
-
<h3 className="mt-5 text-base font-semibold">Message</h3><pre className="whitespace-pre-wrap break-words rounded bg-muted p-3 text-sm">{selected.messageBody || ''}</pre>
|
|
91
|
-
{!!selected.chatterMessageDetails?.length && <><h3 className="mt-5 text-base font-semibold">Change details</h3><div className="overflow-x-auto"><table className="w-full text-left text-sm"><thead><tr><th className="p-2">Field</th><th className="p-2">Previous</th><th className="p-2">Current</th></tr></thead><tbody>{selected.chatterMessageDetails.map((detail: any, index: number) => <tr className="border-t" key={detail.id ?? index}><td className="p-2">{detail.fieldDisplayName || detail.fieldName}</td><td className="p-2">{detail.oldValueDisplay ?? detail.oldValue ?? '—'}</td><td className="p-2">{detail.newValueDisplay ?? detail.newValue ?? '—'}</td></tr>)}</tbody></table></div></>}
|
|
92
|
-
</> : <p role="alert">Could not load this archived message.</p>}
|
|
93
|
-
</section>
|
|
94
|
-
</div>}
|
|
95
|
-
</main>;
|
|
269
|
+
{selectedId !== null && (
|
|
270
|
+
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4" role="presentation" onClick={() => setSelectedId(null)}>
|
|
271
|
+
<section role="dialog" aria-modal="true" aria-label="Archived chatter message" className="max-h-[85vh] w-full max-w-3xl overflow-auto rounded-lg bg-background p-6 shadow-xl" onClick={event => event.stopPropagation()}>
|
|
272
|
+
<div className="mb-4 flex items-start justify-between">
|
|
273
|
+
<h2 className="m-0 text-xl font-semibold">Archived message #{selectedId}</h2>
|
|
274
|
+
<button type="button" className="rounded px-2 py-1 hover:bg-muted" onClick={() => setSelectedId(null)}>Close</button>
|
|
275
|
+
</div>
|
|
276
|
+
{detailLoading ? <p>Loading message…</p> : selected ? <>
|
|
277
|
+
<dl className="grid grid-cols-2 gap-3 text-sm">
|
|
278
|
+
<dt>Entity</dt><dd>{selected.modelDisplayName || selected.coModelName}</dd>
|
|
279
|
+
<dt>Entity ID</dt><dd>{selected.coModelEntityId}</dd>
|
|
280
|
+
<dt>Date</dt><dd>{selected.createdAt ? new Date(selected.createdAt).toLocaleString() : '—'}</dd>
|
|
281
|
+
<dt>Changed by</dt><dd>{selected.user?.fullName || 'System'}</dd>
|
|
282
|
+
<dt>Type</dt><dd>{selected.messageType}</dd>
|
|
283
|
+
<dt>Subtype</dt><dd>{selected.messageSubType}</dd>
|
|
284
|
+
</dl>
|
|
285
|
+
<h3 className="mt-5 text-base font-semibold">Message</h3>
|
|
286
|
+
<pre className="whitespace-pre-wrap break-words rounded bg-muted p-3 text-sm">{selected.messageBody || ''}</pre>
|
|
287
|
+
{!!selected.chatterMessageDetails?.length && <>
|
|
288
|
+
<h3 className="mt-5 text-base font-semibold">Change details</h3>
|
|
289
|
+
<div className="overflow-x-auto">
|
|
290
|
+
<table className="w-full text-left text-sm">
|
|
291
|
+
<thead><tr><th className="p-2">Field</th><th className="p-2">Previous</th><th className="p-2">Current</th></tr></thead>
|
|
292
|
+
<tbody>{selected.chatterMessageDetails.map((detail: any, index: number) => <tr className="border-t" key={detail.id ?? index}>
|
|
293
|
+
<td className="p-2">{detail.fieldDisplayName || detail.fieldName}</td>
|
|
294
|
+
<td className="p-2">{detail.oldValueDisplay ?? detail.oldValue ?? '—'}</td>
|
|
295
|
+
<td className="p-2">{detail.newValueDisplay ?? detail.newValue ?? '—'}</td>
|
|
296
|
+
</tr>)}</tbody>
|
|
297
|
+
</table>
|
|
298
|
+
</div>
|
|
299
|
+
</>}
|
|
300
|
+
</> : <p role="alert">Could not load this archived message.</p>}
|
|
301
|
+
</section>
|
|
302
|
+
</div>
|
|
303
|
+
)}
|
|
304
|
+
</div>
|
|
305
|
+
);
|
|
96
306
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/CardPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CardPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/CardPage.tsx"],"names":[],"mappings":"AAYA,wBAAgB,QAAQ,4CAiCvB"}
|
|
@@ -14,10 +14,12 @@ import { camelCase } from "lodash";
|
|
|
14
14
|
import { useCallback, useEffect } from "react";
|
|
15
15
|
import { useParams } from "react-router-dom";
|
|
16
16
|
import { SolidCardView } from "../../../../components/core/card/SolidCardView";
|
|
17
|
-
import { registerCardView, unregisterCardView } from "../../../../components/core/card/cardViewRegistry";
|
|
17
|
+
import { getCardView, registerCardView, unregisterCardView } from "../../../../components/core/card/cardViewRegistry";
|
|
18
18
|
import { storeCurrentModelViewContext } from "../../../../helpers/modelViewPersistence";
|
|
19
19
|
import { usePathname } from "../../../../hooks/usePathname";
|
|
20
20
|
import { useSearchParams } from "../../../../hooks/useSearchParams";
|
|
21
|
+
import { isMatchingAdminViewRefresh, ADMIN_VIEW_REFRESH_REQUESTED } from "../../../../helpers/adminViewRefresh";
|
|
22
|
+
import { eventBus } from "../../../../helpers/eventBus";
|
|
21
23
|
export function CardPage() {
|
|
22
24
|
var params = useParams();
|
|
23
25
|
var pathname = usePathname();
|
|
@@ -41,6 +43,12 @@ export function CardPage() {
|
|
|
41
43
|
var currentUrl = search ? "".concat(pathname, "?").concat(search) : pathname;
|
|
42
44
|
storeCurrentModelViewContext(currentUrl);
|
|
43
45
|
}, [pathname, search]);
|
|
46
|
+
useEffect(function () { return eventBus.on(ADMIN_VIEW_REFRESH_REQUESTED, function (request) {
|
|
47
|
+
var _a;
|
|
48
|
+
if (isMatchingAdminViewRefresh(request, { moduleName: moduleName, modelName: modelName, viewName: "card" })) {
|
|
49
|
+
(_a = getCardView(cardId)) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
50
|
+
}
|
|
51
|
+
}); }, [cardId, moduleName, modelName]);
|
|
44
52
|
return _jsx(SolidCardView, __assign({ ref: setCardRef }, params, { embeded: false, moduleName: moduleName, modelName: modelName }), cardId);
|
|
45
53
|
}
|
|
46
54
|
//# sourceMappingURL=CardPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/CardPage.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"CardPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/CardPage.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,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AM,EAAE,MAAM,CAAC,CAAC;YACjC,OAAO;SACR;QACD,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,SAAS,CAAC;QACR,IAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,UAAG,QAAQ,cAAI,MAAM,CAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC/D,4BAA4B,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAEvB,SAAS,CAAC,cAAM,OAAA,QAAQ,CAAC,EAAE,CAA0B,4BAA4B,EAAE,UAAC,OAAO;;QACzF,IAAI,0BAA0B,CAAC,OAAO,EAAE,EAAE,UAAU,YAAA,EAAE,SAAS,WAAA,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE;YACpF,MAAA,WAAW,CAAC,MAAM,CAAC,0CAAE,OAAO,EAAE,CAAC;SAChC;IACH,CAAC,CAAC,EAJc,CAId,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAErC,OAAO,KAAC,aAAa,aAAC,GAAG,EAAE,UAAU,IAAmB,MAAM,IAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,KAAhF,MAAM,CAA8E,CAAC;AACnI,CAAC","sourcesContent":["import { camelCase } from \"lodash\";\nimport { useCallback, useEffect } from \"react\";\nimport { useParams } from \"react-router-dom\";\nimport { SolidCardView } from \"../../../../components/core/card/SolidCardView\";\nimport type { SolidCardViewHandle } from \"../../../../components/core/card/SolidCardView\";\nimport { getCardView, registerCardView, unregisterCardView } from \"../../../../components/core/card/cardViewRegistry\";\nimport { storeCurrentModelViewContext } from \"../../../../helpers/modelViewPersistence\";\nimport { usePathname } from \"../../../../hooks/usePathname\";\nimport { useSearchParams } from \"../../../../hooks/useSearchParams\";\nimport { isMatchingAdminViewRefresh, ADMIN_VIEW_REFRESH_REQUESTED, type AdminViewRefreshRequest } from \"../../../../helpers/adminViewRefresh\";\nimport { eventBus } from \"../../../../helpers/eventBus\";\n\nexport function CardPage() {\n const params = useParams();\n const pathname = usePathname();\n const searchParams = useSearchParams();\n const search = searchParams.toString();\n const moduleName = params.moduleName || \"\";\n const modelName = params.modelName ? camelCase(params.modelName) : \"\";\n const menuItemId = searchParams.get(\"menuItemId\") || \"\";\n const menuItemName = searchParams.get(\"menuItemName\") || \"\";\n const actionId = searchParams.get(\"actionId\") || \"\";\n const actionName = searchParams.get(\"actionName\") || \"\";\n const cardId = `page:${moduleName}:${modelName}:${menuItemId}:${menuItemName}:${actionId}:${actionName}`;\n\n const setCardRef = useCallback((handle: SolidCardViewHandle | null) => {\n if (handle) {\n registerCardView(cardId, handle);\n return;\n }\n unregisterCardView(cardId);\n }, [cardId]);\n\n useEffect(() => {\n const currentUrl = search ? `${pathname}?${search}` : pathname;\n storeCurrentModelViewContext(currentUrl);\n }, [pathname, search]);\n\n useEffect(() => eventBus.on<AdminViewRefreshRequest>(ADMIN_VIEW_REFRESH_REQUESTED, (request) => {\n if (isMatchingAdminViewRefresh(request, { moduleName, modelName, viewName: \"card\" })) {\n getCardView(cardId)?.refresh();\n }\n }), [cardId, moduleName, modelName]);\n\n return <SolidCardView ref={setCardRef} key={cardId} {...params} embeded={false} moduleName={moduleName} modelName={modelName} />;\n}\n"]}
|
|
@@ -3,10 +3,12 @@ import { useCallback, useEffect } from "react";
|
|
|
3
3
|
import { useParams } from "react-router-dom";
|
|
4
4
|
import { SolidCardView } from "../../../../components/core/card/SolidCardView";
|
|
5
5
|
import type { SolidCardViewHandle } from "../../../../components/core/card/SolidCardView";
|
|
6
|
-
import { registerCardView, unregisterCardView } from "../../../../components/core/card/cardViewRegistry";
|
|
6
|
+
import { getCardView, registerCardView, unregisterCardView } from "../../../../components/core/card/cardViewRegistry";
|
|
7
7
|
import { storeCurrentModelViewContext } from "../../../../helpers/modelViewPersistence";
|
|
8
8
|
import { usePathname } from "../../../../hooks/usePathname";
|
|
9
9
|
import { useSearchParams } from "../../../../hooks/useSearchParams";
|
|
10
|
+
import { isMatchingAdminViewRefresh, ADMIN_VIEW_REFRESH_REQUESTED, type AdminViewRefreshRequest } from "../../../../helpers/adminViewRefresh";
|
|
11
|
+
import { eventBus } from "../../../../helpers/eventBus";
|
|
10
12
|
|
|
11
13
|
export function CardPage() {
|
|
12
14
|
const params = useParams();
|
|
@@ -34,5 +36,11 @@ export function CardPage() {
|
|
|
34
36
|
storeCurrentModelViewContext(currentUrl);
|
|
35
37
|
}, [pathname, search]);
|
|
36
38
|
|
|
39
|
+
useEffect(() => eventBus.on<AdminViewRefreshRequest>(ADMIN_VIEW_REFRESH_REQUESTED, (request) => {
|
|
40
|
+
if (isMatchingAdminViewRefresh(request, { moduleName, modelName, viewName: "card" })) {
|
|
41
|
+
getCardView(cardId)?.refresh();
|
|
42
|
+
}
|
|
43
|
+
}), [cardId, moduleName, modelName]);
|
|
44
|
+
|
|
37
45
|
return <SolidCardView ref={setCardRef} key={cardId} {...params} embeded={false} moduleName={moduleName} modelName={modelName} />;
|
|
38
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/KanbanPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KanbanPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/KanbanPage.tsx"],"names":[],"mappings":"AAYA,wBAAgB,UAAU,4CAiCzB"}
|
|
@@ -11,13 +11,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { SolidKanbanView } from "../../../../components/core/kanban/SolidKanbanView";
|
|
14
|
-
import { registerKanbanView, unregisterKanbanView } from "../../../../components/core/kanban/kanbanViewRegistry";
|
|
14
|
+
import { getKanbanView, registerKanbanView, unregisterKanbanView } from "../../../../components/core/kanban/kanbanViewRegistry";
|
|
15
15
|
import { camelCase } from "lodash";
|
|
16
16
|
import { useCallback, useEffect } from "react";
|
|
17
17
|
import { useParams } from "react-router-dom";
|
|
18
18
|
import { storeCurrentModelViewContext } from "../../../../helpers/modelViewPersistence";
|
|
19
19
|
import { usePathname } from "../../../../hooks/usePathname";
|
|
20
20
|
import { useSearchParams } from "../../../../hooks/useSearchParams";
|
|
21
|
+
import { isMatchingAdminViewRefresh, ADMIN_VIEW_REFRESH_REQUESTED } from "../../../../helpers/adminViewRefresh";
|
|
22
|
+
import { eventBus } from "../../../../helpers/eventBus";
|
|
21
23
|
export function KanbanPage() {
|
|
22
24
|
var params = useParams();
|
|
23
25
|
var pathname = usePathname();
|
|
@@ -41,6 +43,12 @@ export function KanbanPage() {
|
|
|
41
43
|
var currentUrl = search ? "".concat(pathname, "?").concat(search) : pathname;
|
|
42
44
|
storeCurrentModelViewContext(currentUrl);
|
|
43
45
|
}, [pathname, search]);
|
|
46
|
+
useEffect(function () { return eventBus.on(ADMIN_VIEW_REFRESH_REQUESTED, function (request) {
|
|
47
|
+
var _a;
|
|
48
|
+
if (isMatchingAdminViewRefresh(request, { moduleName: moduleName, modelName: modelName, viewName: "kanban" })) {
|
|
49
|
+
(_a = getKanbanView(kanbanId)) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
50
|
+
}
|
|
51
|
+
}); }, [kanbanId, moduleName, modelName]);
|
|
44
52
|
return _jsx(SolidKanbanView, __assign({ ref: setKanbanRef }, params, { embeded: false, moduleName: moduleName, modelName: modelName }), kanbanId);
|
|
45
53
|
}
|
|
46
54
|
//# sourceMappingURL=KanbanPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/KanbanPage.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,eAAe,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E,YAAY,IAAqB,MAAM,IAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,KAAlF,QAAQ,CAA8E,CAAC;AACzI,CAAC","sourcesContent":["import { SolidKanbanView } from \"../../../../components/core/kanban/SolidKanbanView\";\nimport type { SolidKanbanViewHandle } from \"../../../../components/core/kanban/SolidKanbanView\";\nimport { getKanbanView, registerKanbanView, unregisterKanbanView } from \"../../../../components/core/kanban/kanbanViewRegistry\";\nimport { camelCase } from \"lodash\";\nimport { useCallback, useEffect } from \"react\";\nimport { useParams } from \"react-router-dom\";\nimport { storeCurrentModelViewContext } from \"../../../../helpers/modelViewPersistence\";\nimport { usePathname } from \"../../../../hooks/usePathname\";\nimport { useSearchParams } from \"../../../../hooks/useSearchParams\";\nimport { isMatchingAdminViewRefresh, ADMIN_VIEW_REFRESH_REQUESTED, type AdminViewRefreshRequest } from \"../../../../helpers/adminViewRefresh\";\nimport { eventBus } from \"../../../../helpers/eventBus\";\n\nexport function KanbanPage() {\n const params = useParams();\n const pathname = usePathname();\n const searchParams = useSearchParams();\n const search = searchParams.toString();\n const moduleName = params.moduleName || \"\";\n const modelName = params.modelName ? camelCase(params.modelName) : \"\";\n const menuItemId = searchParams.get(\"menuItemId\") || \"\";\n const menuItemName = searchParams.get(\"menuItemName\") || \"\";\n const actionId = searchParams.get(\"actionId\") || \"\";\n const actionName = searchParams.get(\"actionName\") || \"\";\n const kanbanId = `page:${moduleName}:${modelName}:${menuItemId}:${menuItemName}:${actionId}:${actionName}`;\n\n const setKanbanRef = useCallback((handle: SolidKanbanViewHandle | null) => {\n if (handle) {\n registerKanbanView(kanbanId, handle);\n return;\n }\n unregisterKanbanView(kanbanId);\n }, [kanbanId]);\n\n useEffect(() => {\n const currentUrl = search ? `${pathname}?${search}` : pathname;\n storeCurrentModelViewContext(currentUrl);\n }, [pathname, search]);\n\n useEffect(() => eventBus.on<AdminViewRefreshRequest>(ADMIN_VIEW_REFRESH_REQUESTED, (request) => {\n if (isMatchingAdminViewRefresh(request, { moduleName, modelName, viewName: \"kanban\" })) {\n getKanbanView(kanbanId)?.refresh();\n }\n }), [kanbanId, moduleName, modelName]);\n\n return <SolidKanbanView ref={setKanbanRef} key={kanbanId} {...params} embeded={false} moduleName={moduleName} modelName={modelName} />;\n}\n"]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { SolidKanbanView } from "../../../../components/core/kanban/SolidKanbanView";
|
|
2
2
|
import type { SolidKanbanViewHandle } from "../../../../components/core/kanban/SolidKanbanView";
|
|
3
|
-
import { registerKanbanView, unregisterKanbanView } from "../../../../components/core/kanban/kanbanViewRegistry";
|
|
3
|
+
import { getKanbanView, registerKanbanView, unregisterKanbanView } from "../../../../components/core/kanban/kanbanViewRegistry";
|
|
4
4
|
import { camelCase } from "lodash";
|
|
5
5
|
import { useCallback, useEffect } from "react";
|
|
6
6
|
import { useParams } from "react-router-dom";
|
|
7
7
|
import { storeCurrentModelViewContext } from "../../../../helpers/modelViewPersistence";
|
|
8
8
|
import { usePathname } from "../../../../hooks/usePathname";
|
|
9
9
|
import { useSearchParams } from "../../../../hooks/useSearchParams";
|
|
10
|
+
import { isMatchingAdminViewRefresh, ADMIN_VIEW_REFRESH_REQUESTED, type AdminViewRefreshRequest } from "../../../../helpers/adminViewRefresh";
|
|
11
|
+
import { eventBus } from "../../../../helpers/eventBus";
|
|
10
12
|
|
|
11
13
|
export function KanbanPage() {
|
|
12
14
|
const params = useParams();
|
|
@@ -34,5 +36,11 @@ export function KanbanPage() {
|
|
|
34
36
|
storeCurrentModelViewContext(currentUrl);
|
|
35
37
|
}, [pathname, search]);
|
|
36
38
|
|
|
39
|
+
useEffect(() => eventBus.on<AdminViewRefreshRequest>(ADMIN_VIEW_REFRESH_REQUESTED, (request) => {
|
|
40
|
+
if (isMatchingAdminViewRefresh(request, { moduleName, modelName, viewName: "kanban" })) {
|
|
41
|
+
getKanbanView(kanbanId)?.refresh();
|
|
42
|
+
}
|
|
43
|
+
}), [kanbanId, moduleName, modelName]);
|
|
44
|
+
|
|
37
45
|
return <SolidKanbanView ref={setKanbanRef} key={kanbanId} {...params} embeded={false} moduleName={moduleName} modelName={modelName} />;
|
|
38
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/ListPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/ListPage.tsx"],"names":[],"mappings":"AAYA,wBAAgB,QAAQ,4CA4CvB"}
|
|
@@ -14,10 +14,12 @@ import { SolidListView } from "../../../../components/core/list/SolidListView";
|
|
|
14
14
|
import { camelCase } from "lodash";
|
|
15
15
|
import { useCallback, useEffect } from "react";
|
|
16
16
|
import { useParams, useSearchParams } from "react-router-dom";
|
|
17
|
-
import { registerListView, unregisterListView } from "../../../../components/core/list/listViewRegistry";
|
|
17
|
+
import { getListView, registerListView, unregisterListView } from "../../../../components/core/list/listViewRegistry";
|
|
18
18
|
import { usePathname } from "../../../../hooks/usePathname";
|
|
19
19
|
import { useRouter } from "../../../../hooks/useRouter";
|
|
20
20
|
import { resolveRetainedModelViewRoute, storeCurrentModelViewContext } from "../../../../helpers/modelViewPersistence";
|
|
21
|
+
import { isMatchingAdminViewRefresh, ADMIN_VIEW_REFRESH_REQUESTED } from "../../../../helpers/adminViewRefresh";
|
|
22
|
+
import { eventBus } from "../../../../helpers/eventBus";
|
|
21
23
|
export function ListPage() {
|
|
22
24
|
var params = useParams();
|
|
23
25
|
var searchParams = useSearchParams()[0];
|
|
@@ -47,6 +49,13 @@ export function ListPage() {
|
|
|
47
49
|
}
|
|
48
50
|
storeCurrentModelViewContext(currentUrl);
|
|
49
51
|
}, [pathname, search]);
|
|
52
|
+
useEffect(function () { return eventBus.on(ADMIN_VIEW_REFRESH_REQUESTED, function (request) {
|
|
53
|
+
var _a;
|
|
54
|
+
if (isMatchingAdminViewRefresh(request, { moduleName: moduleName, modelName: modelName, viewName: "list" })) {
|
|
55
|
+
// The registered handle is the page's active list view; its refresh retains current filters.
|
|
56
|
+
(_a = getListView(listId)) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
57
|
+
}
|
|
58
|
+
}); }, [listId, moduleName, modelName]);
|
|
50
59
|
return _jsx(SolidListView, __assign({ ref: setListRef }, params, { embeded: false, moduleName: moduleName, modelName: modelName }), listId);
|
|
51
60
|
}
|
|
52
61
|
//# sourceMappingURL=ListPage.js.map
|