@elevasis/ui 2.73.0 → 2.74.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/api/index.js +3 -3
- package/dist/app/index.d.ts +58 -0
- package/dist/app/index.js +9 -10
- package/dist/auth/index.js +5 -6
- package/dist/charts/index.js +5 -6
- package/dist/chunk-2GIJBHZT.js +60 -0
- package/dist/{chunk-ETN3TTRT.js → chunk-2MRRDF32.js} +115 -8
- package/dist/chunk-3LOKYZJC.js +231 -0
- package/dist/chunk-3QHX4ZKV.js +224 -0
- package/dist/chunk-43LC6XAX.js +69 -0
- package/dist/chunk-4M2BSHVT.js +116 -0
- package/dist/{chunk-SWKAH2YM.js → chunk-4MXNHJTA.js} +63 -30
- package/dist/{chunk-LZT2H2MA.js → chunk-5A6KCFS5.js} +36 -43
- package/dist/{chunk-OCVSPAKM.js → chunk-6JN2TLV2.js} +1150 -4346
- package/dist/{chunk-JYBJMVNY.js → chunk-7ARBBELS.js} +1 -1
- package/dist/{chunk-AJOVWB47.js → chunk-7RJ7P6S6.js} +6 -3
- package/dist/chunk-ARAFQBNI.js +515 -0
- package/dist/{chunk-Z4ICFQXG.js → chunk-BA3AZJUR.js} +1 -1
- package/dist/chunk-BRTGCFBH.js +305 -0
- package/dist/{chunk-IGBPWD6S.js → chunk-CQPULKKL.js} +5 -3
- package/dist/chunk-CRA7WQZH.js +49 -0
- package/dist/{chunk-U2H3TIHD.js → chunk-DCQKTDIG.js} +2 -52
- package/dist/{chunk-3TS5U5BL.js → chunk-E6YGA5WH.js} +1 -1
- package/dist/chunk-FA7LMNQO.js +439 -0
- package/dist/chunk-FZSG6M6W.js +45 -0
- package/dist/chunk-GDOR57D7.js +165 -0
- package/dist/{chunk-CJ2232PQ.js → chunk-GO4XJ5D4.js} +1 -1
- package/dist/chunk-GPQQGQGT.js +645 -0
- package/dist/chunk-HYQOGRWG.js +54 -0
- package/dist/{chunk-LEPYXLJ2.js → chunk-LN4UW6S4.js} +1 -1
- package/dist/chunk-N6K2Q5BM.js +393 -0
- package/dist/{chunk-NHNTX6ZL.js → chunk-O32UQ26A.js} +3 -2
- package/dist/{chunk-M7WWRZ5Z.js → chunk-QFGNRKIE.js} +1 -78
- package/dist/{chunk-IBCEAVB2.js → chunk-R5UGIFYU.js} +41 -5
- package/dist/{chunk-5B2ZFO44.js → chunk-RFNJ2PTO.js} +1 -1
- package/dist/chunk-VM2OWOXL.js +24 -0
- package/dist/{chunk-ZDKPHFTH.js → chunk-W2QRBQQA.js} +5 -3
- package/dist/chunk-WDBNW44Z.js +49 -0
- package/dist/{chunk-4CW2C5BD.js → chunk-WZU3MCKI.js} +1 -1
- package/dist/chunk-YQQ5GRUR.js +21 -0
- package/dist/{chunk-PQ4B62HH.js → chunk-ZFA56VSR.js} +2 -2
- package/dist/{chunk-NI37YNRP.js → chunk-ZWI62BQ6.js} +7 -4
- package/dist/chunk-ZYNVCWDZ.js +286 -0
- package/dist/components/index.d.ts +187 -2
- package/dist/components/index.js +44 -34
- package/dist/components/navigation/index.js +6 -7
- package/dist/features/auth/index.d.ts +78 -2
- package/dist/features/auth/index.js +18 -9
- package/dist/features/clients/index.js +7 -7
- package/dist/features/content/index.d.ts +226 -5
- package/dist/features/content/index.js +263 -15
- package/dist/features/crm/index.d.ts +58 -0
- package/dist/features/crm/index.js +10 -8
- package/dist/features/dashboard/index.js +9 -8
- package/dist/features/delivery/index.d.ts +58 -0
- package/dist/features/delivery/index.js +23 -7
- package/dist/features/knowledge/index.js +5 -6
- package/dist/features/lead-gen/index.d.ts +9 -15
- package/dist/features/lead-gen/index.js +12 -8
- package/dist/features/monitoring/index.js +11 -9
- package/dist/features/monitoring/requests/index.js +8 -7
- package/dist/features/operations/index.js +15 -11
- package/dist/features/public-agent-chat/index.js +3 -1
- package/dist/features/settings/index.d.ts +58 -0
- package/dist/features/settings/index.js +9 -8
- package/dist/hooks/access/index.js +5 -6
- package/dist/hooks/delivery/index.d.ts +58 -0
- package/dist/hooks/delivery/index.js +3 -2
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +1 -1
- package/dist/hooks/published.d.ts +175 -3
- package/dist/hooks/published.js +22 -6
- package/dist/initialization/index.d.ts +58 -0
- package/dist/knowledge/index.js +167 -11
- package/dist/{knowledge-search-index-RZLIVWPJ.js → knowledge-search-index-6GQK55IQ.js} +1 -1
- package/dist/layout/index.js +8 -9
- package/dist/profile/index.d.ts +58 -0
- package/dist/provider/index.d.ts +77 -1
- package/dist/provider/index.js +5 -6
- package/dist/provider/published.d.ts +105 -1
- package/dist/provider/published.js +5 -6
- package/dist/test-utils/index.d.ts +16 -5
- package/dist/test-utils/index.js +17 -18
- package/dist/types/index.d.ts +59 -1
- package/dist/utils/index.d.ts +83 -3
- package/dist/utils/index.js +1 -1
- package/package.json +6 -5
- package/dist/chunk-6M6OLGQY.js +0 -36
- package/dist/chunk-MKH2KOAO.js +0 -39
- package/dist/hooks/index.css +0 -659
- package/dist/hooks/index.d.ts +0 -14073
- package/dist/hooks/index.js +0 -27
- package/dist/supabase/index.d.ts +0 -7118
- package/dist/supabase/index.js +0 -3
- package/dist/typeform/index.d.ts +0 -462
- package/dist/typeform/index.js +0 -2051
- package/dist/typeform/schemas.d.ts +0 -67
- package/dist/typeform/schemas.js +0 -2
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { GetNotificationsQuerySchema, MarkAsReadParamsSchema } from './chunk-VM2OWOXL.js';
|
|
2
|
+
import { useNotificationAdapter } from './chunk-6JN2TLV2.js';
|
|
3
|
+
import { getTimeRangeDates } from './chunk-Y6I3IC45.js';
|
|
4
|
+
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
5
|
+
import { useCallback, useState } from 'react';
|
|
6
|
+
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
7
|
+
|
|
8
|
+
function useErrorNotification() {
|
|
9
|
+
const adapter = useNotificationAdapter();
|
|
10
|
+
return useCallback(
|
|
11
|
+
(error) => {
|
|
12
|
+
adapter.apiError(error);
|
|
13
|
+
},
|
|
14
|
+
[adapter]
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function useActivityTrend(params = {}) {
|
|
18
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
19
|
+
return useQuery({
|
|
20
|
+
queryKey: ["activities", "trend", workOSOrganizationId, params],
|
|
21
|
+
queryFn: async () => {
|
|
22
|
+
const queryParams = new URLSearchParams();
|
|
23
|
+
if (params.activityType) queryParams.set("activityType", params.activityType);
|
|
24
|
+
if (params.entityType) queryParams.set("entityType", params.entityType);
|
|
25
|
+
if (params.entityId) queryParams.set("entityId", params.entityId);
|
|
26
|
+
if (params.startDate) queryParams.set("startDate", params.startDate);
|
|
27
|
+
if (params.endDate) queryParams.set("endDate", params.endDate);
|
|
28
|
+
const queryString = queryParams.toString();
|
|
29
|
+
const endpoint = `/activities/trend${queryString ? `?${queryString}` : ""}`;
|
|
30
|
+
const response = await apiRequest(endpoint);
|
|
31
|
+
return {
|
|
32
|
+
timestamps: response.timestamps.map((t) => new Date(t)),
|
|
33
|
+
total: response.total
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
enabled: isReady,
|
|
37
|
+
refetchInterval: 3e4,
|
|
38
|
+
staleTime: 0
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function useActivities(params = {}) {
|
|
42
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
43
|
+
return useQuery({
|
|
44
|
+
queryKey: ["activities", "list", workOSOrganizationId, params],
|
|
45
|
+
queryFn: async () => {
|
|
46
|
+
const queryParams = new URLSearchParams();
|
|
47
|
+
if (params.limit) queryParams.set("limit", params.limit.toString());
|
|
48
|
+
if (params.offset) queryParams.set("offset", params.offset.toString());
|
|
49
|
+
if (params.activityType) queryParams.set("activityType", params.activityType);
|
|
50
|
+
if (params.entityType) queryParams.set("entityType", params.entityType);
|
|
51
|
+
if (params.entityId) queryParams.set("entityId", params.entityId);
|
|
52
|
+
if (params.startDate) queryParams.set("startDate", params.startDate);
|
|
53
|
+
if (params.endDate) queryParams.set("endDate", params.endDate);
|
|
54
|
+
if (params.status && params.status !== "all") queryParams.set("status", params.status);
|
|
55
|
+
if (params.search && params.search.trim()) queryParams.set("search", params.search.trim());
|
|
56
|
+
const queryString = queryParams.toString();
|
|
57
|
+
const endpoint = `/activities${queryString ? `?${queryString}` : ""}`;
|
|
58
|
+
const response = await apiRequest(endpoint);
|
|
59
|
+
return {
|
|
60
|
+
activities: response.activities.map((activity) => ({
|
|
61
|
+
...activity,
|
|
62
|
+
occurredAt: new Date(activity.occurredAt),
|
|
63
|
+
createdAt: new Date(activity.createdAt)
|
|
64
|
+
})),
|
|
65
|
+
total: response.total
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
enabled: isReady,
|
|
69
|
+
refetchInterval: 3e4,
|
|
70
|
+
// 30s real-time polling
|
|
71
|
+
staleTime: 0
|
|
72
|
+
// Real-time data - always refetch on mount/org switch
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function useExecutionLogs(params = {}) {
|
|
76
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
77
|
+
return useQuery({
|
|
78
|
+
queryKey: ["monitoring", "execution-logs", workOSOrganizationId, params],
|
|
79
|
+
queryFn: async () => {
|
|
80
|
+
const queryParams = new URLSearchParams();
|
|
81
|
+
if (params.resourceId) queryParams.set("resourceId", params.resourceId);
|
|
82
|
+
if (params.status && params.status !== "all") queryParams.set("status", params.status);
|
|
83
|
+
if (params.resourceStatus && params.resourceStatus !== "all")
|
|
84
|
+
queryParams.set("resourceStatus", params.resourceStatus);
|
|
85
|
+
if (params.startDate !== void 0) queryParams.set("startDate", params.startDate.toString());
|
|
86
|
+
if (params.endDate !== void 0) queryParams.set("endDate", params.endDate.toString());
|
|
87
|
+
if (params.limit !== void 0) queryParams.set("limit", params.limit.toString());
|
|
88
|
+
if (params.offset !== void 0) queryParams.set("offset", params.offset.toString());
|
|
89
|
+
const queryString = queryParams.toString();
|
|
90
|
+
const endpoint = `/execution-engine/executions${queryString ? `?${queryString}` : ""}`;
|
|
91
|
+
return apiRequest(endpoint);
|
|
92
|
+
},
|
|
93
|
+
enabled: isReady,
|
|
94
|
+
refetchInterval: 3e4,
|
|
95
|
+
// 30s real-time polling
|
|
96
|
+
staleTime: 0
|
|
97
|
+
// Real-time data - always refetch on mount/org switch
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function useNotifications({ limit = 20, offset = 0 } = {}) {
|
|
101
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
102
|
+
return useQuery({
|
|
103
|
+
queryKey: ["notifications", workOSOrganizationId, { limit, offset }],
|
|
104
|
+
queryFn: async () => {
|
|
105
|
+
const params = GetNotificationsQuerySchema.parse({ limit, offset });
|
|
106
|
+
const response = await apiRequest(
|
|
107
|
+
`/notifications?limit=${params.limit}&offset=${params.offset}`
|
|
108
|
+
);
|
|
109
|
+
return response;
|
|
110
|
+
},
|
|
111
|
+
enabled: isReady
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function useCostSummary(timeRange) {
|
|
115
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
116
|
+
return useQuery({
|
|
117
|
+
queryKey: ["cost-analytics", "cost-summary", workOSOrganizationId, timeRange],
|
|
118
|
+
queryFn: async () => {
|
|
119
|
+
const { startDate, endDate } = getTimeRangeDates(timeRange);
|
|
120
|
+
return apiRequest(`/observability/cost-summary?startDate=${startDate}&endDate=${endDate}`);
|
|
121
|
+
},
|
|
122
|
+
enabled: isReady,
|
|
123
|
+
refetchInterval: 6e4
|
|
124
|
+
// 60s dashboard polling
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function useExecutionHealth({ timeRange }) {
|
|
128
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
129
|
+
return useQuery({
|
|
130
|
+
queryKey: ["monitoring", "execution-health", workOSOrganizationId, timeRange],
|
|
131
|
+
queryFn: async () => {
|
|
132
|
+
const { startDate, endDate } = getTimeRangeDates(timeRange);
|
|
133
|
+
return apiRequest(`/observability/dashboard?startDate=${startDate}&endDate=${endDate}`);
|
|
134
|
+
},
|
|
135
|
+
enabled: isReady,
|
|
136
|
+
refetchInterval: 6e4,
|
|
137
|
+
// 60s dashboard polling
|
|
138
|
+
staleTime: 3e4
|
|
139
|
+
// 30s monitoring stale time
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function useNotificationCount(args) {
|
|
143
|
+
const { notificationCount, notificationConnected, notificationError } = args;
|
|
144
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
145
|
+
const query = useQuery({
|
|
146
|
+
queryKey: ["notifications", "unread-count", workOSOrganizationId],
|
|
147
|
+
queryFn: async () => {
|
|
148
|
+
const response = await apiRequest("/notifications/unread-count");
|
|
149
|
+
return response.count;
|
|
150
|
+
},
|
|
151
|
+
enabled: isReady,
|
|
152
|
+
staleTime: Infinity
|
|
153
|
+
// SSE will keep it updated
|
|
154
|
+
});
|
|
155
|
+
return {
|
|
156
|
+
data: notificationCount !== null && notificationCount !== void 0 ? notificationCount : query.data,
|
|
157
|
+
isLoading: query.isLoading,
|
|
158
|
+
isError: query.isError,
|
|
159
|
+
error: query.error,
|
|
160
|
+
isSuccess: query.isSuccess,
|
|
161
|
+
status: query.status,
|
|
162
|
+
refetch: query.refetch,
|
|
163
|
+
sseConnected: notificationConnected,
|
|
164
|
+
sseError: notificationError
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function useMarkAsRead() {
|
|
168
|
+
const queryClient = useQueryClient();
|
|
169
|
+
const { apiRequest } = useElevasisServices();
|
|
170
|
+
const notify = useNotificationAdapter();
|
|
171
|
+
return useMutation({
|
|
172
|
+
mutationFn: async (notificationId) => {
|
|
173
|
+
MarkAsReadParamsSchema.parse({ id: notificationId });
|
|
174
|
+
await apiRequest(`/notifications/${notificationId}/read`, {
|
|
175
|
+
method: "PATCH"
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
onSuccess: () => {
|
|
179
|
+
queryClient.invalidateQueries({ queryKey: ["notifications"] });
|
|
180
|
+
},
|
|
181
|
+
onError: (error) => {
|
|
182
|
+
notify.apiError(error);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function useMarkAllAsRead() {
|
|
187
|
+
const queryClient = useQueryClient();
|
|
188
|
+
const { apiRequest } = useElevasisServices();
|
|
189
|
+
const notify = useNotificationAdapter();
|
|
190
|
+
return useMutation({
|
|
191
|
+
mutationFn: async () => {
|
|
192
|
+
await apiRequest("/notifications/mark-all-read", {
|
|
193
|
+
method: "PATCH"
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
onSuccess: () => {
|
|
197
|
+
queryClient.invalidateQueries({ queryKey: ["notifications"] });
|
|
198
|
+
},
|
|
199
|
+
onError: (error) => {
|
|
200
|
+
notify.apiError(error);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
function useSuccessNotification() {
|
|
205
|
+
const adapter = useNotificationAdapter();
|
|
206
|
+
return useCallback((title, message) => adapter.success(title, message), [adapter]);
|
|
207
|
+
}
|
|
208
|
+
function useWarningNotification() {
|
|
209
|
+
const adapter = useNotificationAdapter();
|
|
210
|
+
return useCallback((title, message) => adapter.warning(title, message), [adapter]);
|
|
211
|
+
}
|
|
212
|
+
function useBatchDelete(invalidateQueryKeys) {
|
|
213
|
+
const { apiRequest } = useElevasisServices();
|
|
214
|
+
const queryClient = useQueryClient();
|
|
215
|
+
const adapter = useNotificationAdapter();
|
|
216
|
+
return useMutation({
|
|
217
|
+
mutationFn: async (ids) => {
|
|
218
|
+
if (ids.length === 0) return;
|
|
219
|
+
const body = { ids };
|
|
220
|
+
await apiRequest("/notifications/batch", {
|
|
221
|
+
method: "DELETE",
|
|
222
|
+
body: JSON.stringify(body)
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
onSuccess: () => {
|
|
226
|
+
for (const key of invalidateQueryKeys) {
|
|
227
|
+
queryClient.invalidateQueries({ queryKey: key });
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
onError: (err) => {
|
|
231
|
+
adapter.apiError(err);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function useTestNotification() {
|
|
236
|
+
const queryClient = useQueryClient();
|
|
237
|
+
const { apiRequest } = useElevasisServices();
|
|
238
|
+
const adapter = useNotificationAdapter();
|
|
239
|
+
return useMutation({
|
|
240
|
+
mutationFn: async () => {
|
|
241
|
+
await apiRequest("/notifications/test", {
|
|
242
|
+
method: "POST"
|
|
243
|
+
});
|
|
244
|
+
},
|
|
245
|
+
onSuccess: () => {
|
|
246
|
+
queryClient.invalidateQueries({ queryKey: ["notifications"] });
|
|
247
|
+
},
|
|
248
|
+
onError: (error) => {
|
|
249
|
+
adapter.apiError(error);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
function useActivityFilters(timeRange) {
|
|
254
|
+
const [filters, setFilters] = useState({
|
|
255
|
+
activityType: "all",
|
|
256
|
+
status: "all"
|
|
257
|
+
});
|
|
258
|
+
const updateFilter = useCallback((key, value) => {
|
|
259
|
+
setFilters((prev) => ({ ...prev, [key]: value }));
|
|
260
|
+
}, []);
|
|
261
|
+
const resetFilters = useCallback(() => {
|
|
262
|
+
setFilters({
|
|
263
|
+
activityType: "all",
|
|
264
|
+
status: "all"
|
|
265
|
+
});
|
|
266
|
+
}, []);
|
|
267
|
+
const getApiParams = useCallback(() => {
|
|
268
|
+
const params = {};
|
|
269
|
+
if (filters.activityType && filters.activityType !== "all") {
|
|
270
|
+
params.activityType = filters.activityType;
|
|
271
|
+
}
|
|
272
|
+
const { startDate } = getTimeRangeDates(timeRange);
|
|
273
|
+
params.startDate = startDate;
|
|
274
|
+
if (filters.status && filters.status !== "all") {
|
|
275
|
+
params.status = filters.status;
|
|
276
|
+
}
|
|
277
|
+
if (filters.search?.trim()) {
|
|
278
|
+
params.search = filters.search.trim();
|
|
279
|
+
}
|
|
280
|
+
return params;
|
|
281
|
+
}, [filters, timeRange]);
|
|
282
|
+
return {
|
|
283
|
+
filters,
|
|
284
|
+
updateFilter,
|
|
285
|
+
resetFilters,
|
|
286
|
+
getApiParams
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
var DEFAULT_FILTERS = {
|
|
290
|
+
resourceId: void 0,
|
|
291
|
+
status: "all",
|
|
292
|
+
resourceStatus: "all"
|
|
293
|
+
};
|
|
294
|
+
function useExecutionLogsFilters(_timeRange) {
|
|
295
|
+
const [filters, setFilters] = useState(DEFAULT_FILTERS);
|
|
296
|
+
const updateFilter = useCallback((key, value) => {
|
|
297
|
+
setFilters((prev) => ({ ...prev, [key]: value }));
|
|
298
|
+
}, []);
|
|
299
|
+
const resetFilters = useCallback(() => {
|
|
300
|
+
setFilters(DEFAULT_FILTERS);
|
|
301
|
+
}, []);
|
|
302
|
+
return { filters, updateFilter, resetFilters };
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export { useActivities, useActivityFilters, useActivityTrend, useBatchDelete, useCostSummary, useErrorNotification, useExecutionHealth, useExecutionLogs, useExecutionLogsFilters, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications, useSuccessNotification, useTestNotification, useWarningNotification };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMarkAsRead, useExecutionLogsFilters, useExecutionLogs, useExecutionHealth, useCostSummary, useActivityFilters, useActivityTrend, useActivities, useNotifications, useMarkAllAsRead } from './chunk-BRTGCFBH.js';
|
|
2
|
+
import { useTimeRangeDates } from './chunk-YQQ5GRUR.js';
|
|
3
|
+
import { AppShellLoader } from './chunk-E6YGA5WH.js';
|
|
2
4
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
3
|
-
import { CenteredErrorState, StatsCardSkeleton, CyberAreaChart, TrendIndicator, DetailCardSkeleton, useResolveError, useResolveAllErrors, usePaginationState, useErrorDetails, EmptyState,
|
|
5
|
+
import { CenteredErrorState, StatsCardSkeleton, CyberAreaChart, TrendIndicator, DetailCardSkeleton, useResolveError, useResolveAllErrors, usePaginationState, useErrorDetails, EmptyState, PageTitleCaption, useErrorAnalysis, useErrorDetail, useResolveErrorsByExecution, useResources, CustomModal, JsonViewer, useCostTrends, useCostByModel, useCostBreakdown, CostTrendChart, ActivityTrendChart } from './chunk-6JN2TLV2.js';
|
|
4
6
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
5
7
|
import { formatDuration } from './chunk-BLXJEIQS.js';
|
|
6
|
-
import { PAGE_SIZE_DEFAULT } from './chunk-
|
|
8
|
+
import { PAGE_SIZE_DEFAULT } from './chunk-R5UGIFYU.js';
|
|
7
9
|
import { formatBucketTime, getTimeRangeDates } from './chunk-Y6I3IC45.js';
|
|
8
10
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
9
11
|
import { useState, useMemo, useCallback } from 'react';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { computeInterfaceReadiness, getSystem } from './chunk-R5UGIFYU.js';
|
|
2
|
+
|
|
3
|
+
// src/features/operations/systems/systemInterfaceReadiness.ts
|
|
4
|
+
function summarizeReadinessIssues(issues) {
|
|
5
|
+
return issues[0]?.message;
|
|
6
|
+
}
|
|
7
|
+
function getSystemApiInterfaceReadiness(model, systemPath, interfaceKey = "api") {
|
|
8
|
+
if (!model) {
|
|
9
|
+
const reason = `No Organization Model is available for "${systemPath}" System Interface readiness.`;
|
|
10
|
+
return {
|
|
11
|
+
systemPath,
|
|
12
|
+
interfaceKey,
|
|
13
|
+
declared: false,
|
|
14
|
+
ready: false,
|
|
15
|
+
reason,
|
|
16
|
+
issues: [{ family: "SYSTEM_INTERFACE_MISSING", code: "missing-organization-model", message: reason }]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const readiness = computeInterfaceReadiness(model, { systemPath, interfaceKey });
|
|
20
|
+
return {
|
|
21
|
+
systemPath,
|
|
22
|
+
interfaceKey,
|
|
23
|
+
readinessProfile: readiness.readinessProfile,
|
|
24
|
+
declared: getSystem(model, systemPath)?.apiInterface !== void 0,
|
|
25
|
+
ready: readiness.ready,
|
|
26
|
+
reason: summarizeReadinessIssues(readiness.issues),
|
|
27
|
+
issues: readiness.issues
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function collectSidebarSurfacesForSystem(nodes, systemPath, systemId, found) {
|
|
31
|
+
if (!nodes) return;
|
|
32
|
+
for (const node of Object.values(nodes)) {
|
|
33
|
+
if (node.type === "surface") {
|
|
34
|
+
const targetedSystems = node.targets?.systems ?? [];
|
|
35
|
+
if (targetedSystems.includes(systemPath) || targetedSystems.includes(systemId)) found.push(node);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
collectSidebarSurfacesForSystem(node.children, systemPath, systemId, found);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function findNavigationSurfaceForSystem(model, systemPath, systemId) {
|
|
42
|
+
if (!model?.navigation?.sidebar) return void 0;
|
|
43
|
+
const matches = [];
|
|
44
|
+
collectSidebarSurfacesForSystem(model.navigation.sidebar.primary, systemPath, systemId, matches);
|
|
45
|
+
collectSidebarSurfacesForSystem(model.navigation.sidebar.bottom, systemPath, systemId, matches);
|
|
46
|
+
return matches.sort((a, b) => (a.targets?.systems?.length ?? 0) - (b.targets?.systems?.length ?? 0))[0];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { findNavigationSurfaceForSystem, getSystemApiInterfaceReadiness };
|
|
@@ -1,57 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { showApiErrorNotification } from './chunk-HYQOGRWG.js';
|
|
2
2
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
3
3
|
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
4
|
-
import { notifications } from '@mantine/notifications';
|
|
5
4
|
|
|
6
|
-
var showInfoNotification = (message) => {
|
|
7
|
-
notifications.show({
|
|
8
|
-
title: "Info",
|
|
9
|
-
message,
|
|
10
|
-
autoClose: 5e3,
|
|
11
|
-
color: "blue",
|
|
12
|
-
position: "top-right"
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var showSuccessNotification = (message) => {
|
|
16
|
-
notifications.show({
|
|
17
|
-
title: "Action Successful",
|
|
18
|
-
message,
|
|
19
|
-
autoClose: 5e3,
|
|
20
|
-
color: "green",
|
|
21
|
-
position: "top-right"
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var showErrorNotification = (error) => {
|
|
25
|
-
if (error instanceof Error) {
|
|
26
|
-
error = error.message;
|
|
27
|
-
}
|
|
28
|
-
notifications.show({
|
|
29
|
-
title: "Action Failed",
|
|
30
|
-
message: error,
|
|
31
|
-
autoClose: 5e3,
|
|
32
|
-
color: "red",
|
|
33
|
-
position: "top-right"
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var showWarningNotification = (message) => {
|
|
37
|
-
notifications.show({
|
|
38
|
-
title: "Warning",
|
|
39
|
-
message,
|
|
40
|
-
autoClose: 5e3,
|
|
41
|
-
color: "orange",
|
|
42
|
-
position: "top-right"
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var showApiErrorNotification = (error) => {
|
|
46
|
-
const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
|
|
47
|
-
notifications.show({
|
|
48
|
-
title: getErrorTitle(code),
|
|
49
|
-
message: formatErrorMessage(message, requestId, fields, retryAfter),
|
|
50
|
-
autoClose: retryAfter ? retryAfter * 1e3 : 5e3,
|
|
51
|
-
color: "red",
|
|
52
|
-
position: "top-right"
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
5
|
var milestoneKeys = {
|
|
56
6
|
all: ["project-milestones"],
|
|
57
7
|
lists: () => [...milestoneKeys.all, "list"],
|
|
@@ -380,4 +330,4 @@ function useDeleteProject() {
|
|
|
380
330
|
});
|
|
381
331
|
}
|
|
382
332
|
|
|
383
|
-
export { milestoneKeys, noteKeys, projectKeys,
|
|
333
|
+
export { milestoneKeys, noteKeys, projectKeys, taskKeys, useCreateMilestone, useCreateNote, useCreateProject, useCreateTask, useDeleteMilestone, useDeleteProject, useDeleteTask, useMilestones, useProject, useProjectMilestones, useProjectNotes, useProjectTasks, useProjects, useTasks, useUpdateMilestone, useUpdateProject, useUpdateTask };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useAppearance } from './chunk-
|
|
1
|
+
import { useAppearance } from './chunk-6JN2TLV2.js';
|
|
2
2
|
import { topbarHeight } from './chunk-MISHPEJX.js';
|
|
3
3
|
import { Stack, Title, Button } from '@mantine/core';
|
|
4
4
|
import { IconAlertCircle } from '@tabler/icons-react';
|