@elevasis/ui 1.24.3 → 1.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts/index.js +2 -2
- package/dist/{chunk-H3MU3WTM.js → chunk-7JJCGPYD.js} +2 -2
- package/dist/{chunk-TQBM3OEW.js → chunk-BS4J2LAW.js} +1 -1
- package/dist/{chunk-JR2C4XAN.js → chunk-CYXZHBP4.js} +202 -295
- package/dist/{chunk-ZDKC3V7C.js → chunk-EFPFPCP2.js} +57 -58
- package/dist/{chunk-OH74INP2.js → chunk-FEZZ3IDU.js} +434 -314
- package/dist/{chunk-JTUX5FDC.js → chunk-FURGQSSG.js} +374 -2
- package/dist/{chunk-IAZT3VO6.js → chunk-G25YWGUL.js} +4 -1
- package/dist/{chunk-QDO6NF2I.js → chunk-GQCQDCLJ.js} +380 -63
- package/dist/{chunk-CTF6FS2M.js → chunk-L3GVDMCA.js} +211 -1
- package/dist/{chunk-BGTZFEKR.js → chunk-LHNPRLSA.js} +6 -252
- package/dist/{chunk-VMMNFRAO.js → chunk-QNABH7YG.js} +3 -3
- package/dist/{chunk-WY5IJI37.js → chunk-QUL3XRLS.js} +3 -3
- package/dist/{chunk-TML32XBW.js → chunk-RMPXGBNI.js} +2 -2
- package/dist/{chunk-UG5565XQ.js → chunk-US4JUSI3.js} +3 -3
- package/dist/components/index.d.ts +3005 -192
- package/dist/components/index.js +1541 -26
- package/dist/features/auth/index.d.ts +108 -9
- package/dist/features/dashboard/index.js +8 -8
- package/dist/features/monitoring/index.js +9 -9
- package/dist/features/operations/index.d.ts +8 -2
- package/dist/features/operations/index.js +53 -56
- package/dist/features/settings/index.d.ts +108 -9
- package/dist/features/settings/index.js +28 -11
- package/dist/hooks/index.d.ts +3279 -185
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/published.d.ts +345 -11
- package/dist/hooks/published.js +4 -4
- package/dist/index.d.ts +3285 -187
- package/dist/index.js +6 -6
- package/dist/initialization/index.d.ts +108 -9
- package/dist/layout/index.d.ts +60 -3
- package/dist/layout/index.js +2 -2
- package/dist/profile/index.d.ts +108 -9
- package/dist/provider/index.d.ts +6 -2
- package/dist/provider/index.js +3 -3
- package/dist/provider/published.d.ts +6 -2
- package/dist/supabase/index.d.ts +210 -18
- package/dist/theme/index.d.ts +6 -2
- package/dist/theme/index.js +3 -3
- package/dist/types/index.d.ts +143 -10
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { CredentialNameSchema, UuidSchema, useErrorNotification, showApiErrorNotification } from './chunk-
|
|
1
|
+
import { CredentialNameSchema, UuidSchema, useErrorNotification, showApiErrorNotification } from './chunk-GQCQDCLJ.js';
|
|
2
|
+
import { useSupabase } from './chunk-NJJ3NQ7B.js';
|
|
2
3
|
import { getTimeRangeDates } from './chunk-LXHZYSMQ.js';
|
|
3
4
|
import { useNotificationAdapter } from './chunk-R7WLWGPO.js';
|
|
4
5
|
import { GC_TIME_SHORT, STALE_TIME_MONITORING, GC_TIME_MEDIUM, STALE_TIME_DEFAULT } from './chunk-IOKL7BKE.js';
|
|
6
|
+
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
5
7
|
import { useElevasisServices } from './chunk-QEPXAWE2.js';
|
|
6
8
|
import { z } from 'zod';
|
|
7
9
|
import { create } from 'zustand';
|
|
@@ -60,6 +62,11 @@ var ListMembershipsQuerySchema = z.object({
|
|
|
60
62
|
message: "Either userId or organizationId must be provided"
|
|
61
63
|
}
|
|
62
64
|
);
|
|
65
|
+
|
|
66
|
+
// ../core/src/supabase/helpers.ts
|
|
67
|
+
function sanitizePostgrestValue(value) {
|
|
68
|
+
return value.replace(/[,()]/g, "");
|
|
69
|
+
}
|
|
63
70
|
var CredentialTypeSchema = z.enum(["oauth", "api-key", "webhook-secret", "api-key-secret"]);
|
|
64
71
|
var CredentialValueSchema = z.record(z.string(), z.unknown()).refine((val) => Object.keys(val).length > 0, { message: "Credential value must not be empty" }).refine((val) => Object.keys(val).length <= 50, { message: "Credential value has too many keys (max 50)" }).refine(
|
|
65
72
|
(val) => {
|
|
@@ -1040,5 +1047,370 @@ function useUpdateWebhookEndpoint() {
|
|
|
1040
1047
|
}
|
|
1041
1048
|
});
|
|
1042
1049
|
}
|
|
1050
|
+
var projectKeys = {
|
|
1051
|
+
all: ["projects"],
|
|
1052
|
+
lists: () => [...projectKeys.all, "list"],
|
|
1053
|
+
list: (orgId, filters) => [...projectKeys.all, "list", orgId, filters],
|
|
1054
|
+
details: () => [...projectKeys.all, "detail"],
|
|
1055
|
+
detail: (id) => [...projectKeys.all, "detail", id]
|
|
1056
|
+
};
|
|
1057
|
+
function useProjects(filters = {}) {
|
|
1058
|
+
const supabase = useSupabase();
|
|
1059
|
+
const { currentSupabaseOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
|
|
1060
|
+
const isReady = !!currentSupabaseOrganizationId && !isInitializing && !isOrgRefreshing;
|
|
1061
|
+
return useQuery({
|
|
1062
|
+
queryKey: projectKeys.list(currentSupabaseOrganizationId, filters),
|
|
1063
|
+
queryFn: async () => {
|
|
1064
|
+
if (!currentSupabaseOrganizationId) {
|
|
1065
|
+
return [];
|
|
1066
|
+
}
|
|
1067
|
+
let query = supabase.from("prj_projects").select("*").eq("organization_id", currentSupabaseOrganizationId);
|
|
1068
|
+
if (filters.status) {
|
|
1069
|
+
query = query.eq("status", filters.status);
|
|
1070
|
+
}
|
|
1071
|
+
if (filters.kind) {
|
|
1072
|
+
query = query.eq("kind", filters.kind);
|
|
1073
|
+
}
|
|
1074
|
+
if (filters.companyId) {
|
|
1075
|
+
query = query.eq("company_id", filters.companyId);
|
|
1076
|
+
}
|
|
1077
|
+
if (filters.search) {
|
|
1078
|
+
const search = sanitizePostgrestValue(filters.search);
|
|
1079
|
+
query = query.ilike("name", `%${search}%`);
|
|
1080
|
+
}
|
|
1081
|
+
query = query.order("created_at", { ascending: false });
|
|
1082
|
+
const { data: projects, error: projectsError } = await query;
|
|
1083
|
+
if (projectsError) throw projectsError;
|
|
1084
|
+
const { data: milestones, error: milestonesError } = await supabase.from("prj_milestones").select("project_id, status").eq("organization_id", currentSupabaseOrganizationId);
|
|
1085
|
+
if (milestonesError) throw milestonesError;
|
|
1086
|
+
const { data: tasks, error: tasksError } = await supabase.from("prj_tasks").select("project_id, status").eq("organization_id", currentSupabaseOrganizationId);
|
|
1087
|
+
if (tasksError) throw tasksError;
|
|
1088
|
+
const milestoneCountMap = /* @__PURE__ */ new Map();
|
|
1089
|
+
const completedMilestoneCountMap = /* @__PURE__ */ new Map();
|
|
1090
|
+
for (const milestone of milestones || []) {
|
|
1091
|
+
milestoneCountMap.set(milestone.project_id, (milestoneCountMap.get(milestone.project_id) || 0) + 1);
|
|
1092
|
+
if (milestone.status === "completed") {
|
|
1093
|
+
completedMilestoneCountMap.set(
|
|
1094
|
+
milestone.project_id,
|
|
1095
|
+
(completedMilestoneCountMap.get(milestone.project_id) || 0) + 1
|
|
1096
|
+
);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
const taskCountMap = /* @__PURE__ */ new Map();
|
|
1100
|
+
const completedTaskCountMap = /* @__PURE__ */ new Map();
|
|
1101
|
+
for (const task of tasks || []) {
|
|
1102
|
+
taskCountMap.set(task.project_id, (taskCountMap.get(task.project_id) || 0) + 1);
|
|
1103
|
+
if (task.status === "approved") {
|
|
1104
|
+
completedTaskCountMap.set(task.project_id, (completedTaskCountMap.get(task.project_id) || 0) + 1);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
return (projects || []).map((project) => ({
|
|
1108
|
+
...project,
|
|
1109
|
+
milestoneCount: milestoneCountMap.get(project.id) || 0,
|
|
1110
|
+
taskCount: taskCountMap.get(project.id) || 0,
|
|
1111
|
+
completedMilestones: completedMilestoneCountMap.get(project.id) || 0,
|
|
1112
|
+
completedTasks: completedTaskCountMap.get(project.id) || 0
|
|
1113
|
+
}));
|
|
1114
|
+
},
|
|
1115
|
+
enabled: isReady
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
function useProject(id) {
|
|
1119
|
+
const supabase = useSupabase();
|
|
1120
|
+
const { currentSupabaseOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
|
|
1121
|
+
const isReady = !!currentSupabaseOrganizationId && !isInitializing && !isOrgRefreshing;
|
|
1122
|
+
return useQuery({
|
|
1123
|
+
queryKey: [...projectKeys.detail(id), currentSupabaseOrganizationId],
|
|
1124
|
+
queryFn: async () => {
|
|
1125
|
+
if (!currentSupabaseOrganizationId || !id) {
|
|
1126
|
+
return null;
|
|
1127
|
+
}
|
|
1128
|
+
const { data, error } = await supabase.from("prj_projects").select(
|
|
1129
|
+
`
|
|
1130
|
+
*,
|
|
1131
|
+
milestones:prj_milestones(*),
|
|
1132
|
+
tasks:prj_tasks(*),
|
|
1133
|
+
company:acq_companies(id, name, domain)
|
|
1134
|
+
`
|
|
1135
|
+
).eq("id", id).eq("organization_id", currentSupabaseOrganizationId).order("sequence", { ascending: true, referencedTable: "prj_milestones" }).order("created_at", { ascending: false, referencedTable: "prj_tasks" }).single();
|
|
1136
|
+
if (error) {
|
|
1137
|
+
if (error.code === "PGRST116") return null;
|
|
1138
|
+
throw error;
|
|
1139
|
+
}
|
|
1140
|
+
return data;
|
|
1141
|
+
},
|
|
1142
|
+
enabled: isReady && !!id
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
function useCreateProject() {
|
|
1146
|
+
const supabase = useSupabase();
|
|
1147
|
+
const queryClient = useQueryClient();
|
|
1148
|
+
const { currentSupabaseOrganizationId } = useOrganization();
|
|
1149
|
+
return useMutation({
|
|
1150
|
+
mutationFn: async (params) => {
|
|
1151
|
+
if (!currentSupabaseOrganizationId) {
|
|
1152
|
+
throw new Error("No organization selected");
|
|
1153
|
+
}
|
|
1154
|
+
const insert = {
|
|
1155
|
+
...params,
|
|
1156
|
+
organization_id: currentSupabaseOrganizationId
|
|
1157
|
+
};
|
|
1158
|
+
const { data, error } = await supabase.from("prj_projects").insert(insert).select().single();
|
|
1159
|
+
if (error) throw error;
|
|
1160
|
+
return data;
|
|
1161
|
+
},
|
|
1162
|
+
onSuccess: () => {
|
|
1163
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1164
|
+
},
|
|
1165
|
+
onError: (error) => {
|
|
1166
|
+
showApiErrorNotification(error);
|
|
1167
|
+
}
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
function useUpdateProject() {
|
|
1171
|
+
const supabase = useSupabase();
|
|
1172
|
+
const queryClient = useQueryClient();
|
|
1173
|
+
return useMutation({
|
|
1174
|
+
mutationFn: async (params) => {
|
|
1175
|
+
const { data, error } = await supabase.from("prj_projects").update(params.updates).eq("id", params.id).select().single();
|
|
1176
|
+
if (error) throw error;
|
|
1177
|
+
return data;
|
|
1178
|
+
},
|
|
1179
|
+
onSuccess: (data) => {
|
|
1180
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1181
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.id) });
|
|
1182
|
+
},
|
|
1183
|
+
onError: (error) => {
|
|
1184
|
+
showApiErrorNotification(error);
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
function useDeleteProject() {
|
|
1189
|
+
const supabase = useSupabase();
|
|
1190
|
+
const queryClient = useQueryClient();
|
|
1191
|
+
return useMutation({
|
|
1192
|
+
mutationFn: async (id) => {
|
|
1193
|
+
const { error } = await supabase.from("prj_projects").delete().eq("id", id);
|
|
1194
|
+
if (error) throw error;
|
|
1195
|
+
},
|
|
1196
|
+
onSuccess: () => {
|
|
1197
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1198
|
+
},
|
|
1199
|
+
onError: (error) => {
|
|
1200
|
+
showApiErrorNotification(error);
|
|
1201
|
+
}
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
var milestoneKeys = {
|
|
1205
|
+
all: ["project-milestones"],
|
|
1206
|
+
lists: () => [...milestoneKeys.all, "list"],
|
|
1207
|
+
list: (orgId, filters) => [...milestoneKeys.all, "list", orgId, filters],
|
|
1208
|
+
details: () => [...milestoneKeys.all, "detail"],
|
|
1209
|
+
detail: (id) => [...milestoneKeys.all, "detail", id]
|
|
1210
|
+
};
|
|
1211
|
+
function useMilestones(filters = {}) {
|
|
1212
|
+
const supabase = useSupabase();
|
|
1213
|
+
const { currentSupabaseOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
|
|
1214
|
+
const isReady = !!currentSupabaseOrganizationId && !isInitializing && !isOrgRefreshing;
|
|
1215
|
+
return useQuery({
|
|
1216
|
+
queryKey: milestoneKeys.list(currentSupabaseOrganizationId, filters),
|
|
1217
|
+
queryFn: async () => {
|
|
1218
|
+
if (!currentSupabaseOrganizationId) {
|
|
1219
|
+
return [];
|
|
1220
|
+
}
|
|
1221
|
+
let query = supabase.from("prj_milestones").select("*").eq("organization_id", currentSupabaseOrganizationId);
|
|
1222
|
+
if (filters.projectId) {
|
|
1223
|
+
query = query.eq("project_id", filters.projectId);
|
|
1224
|
+
}
|
|
1225
|
+
if (filters.status) {
|
|
1226
|
+
query = query.eq("status", filters.status);
|
|
1227
|
+
}
|
|
1228
|
+
query = query.order("sequence", { ascending: true });
|
|
1229
|
+
const { data, error } = await query;
|
|
1230
|
+
if (error) throw error;
|
|
1231
|
+
return data || [];
|
|
1232
|
+
},
|
|
1233
|
+
enabled: isReady
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
function useCreateMilestone() {
|
|
1237
|
+
const supabase = useSupabase();
|
|
1238
|
+
const queryClient = useQueryClient();
|
|
1239
|
+
const { currentSupabaseOrganizationId } = useOrganization();
|
|
1240
|
+
return useMutation({
|
|
1241
|
+
mutationFn: async (params) => {
|
|
1242
|
+
if (!currentSupabaseOrganizationId) {
|
|
1243
|
+
throw new Error("No organization selected");
|
|
1244
|
+
}
|
|
1245
|
+
const insert = {
|
|
1246
|
+
...params,
|
|
1247
|
+
organization_id: currentSupabaseOrganizationId
|
|
1248
|
+
};
|
|
1249
|
+
const { data, error } = await supabase.from("prj_milestones").insert(insert).select().single();
|
|
1250
|
+
if (error) throw error;
|
|
1251
|
+
return data;
|
|
1252
|
+
},
|
|
1253
|
+
onSuccess: (data) => {
|
|
1254
|
+
queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
|
|
1255
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1256
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
|
|
1257
|
+
},
|
|
1258
|
+
onError: (error) => {
|
|
1259
|
+
showApiErrorNotification(error);
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
function useUpdateMilestone() {
|
|
1264
|
+
const supabase = useSupabase();
|
|
1265
|
+
const queryClient = useQueryClient();
|
|
1266
|
+
return useMutation({
|
|
1267
|
+
mutationFn: async (params) => {
|
|
1268
|
+
const { data, error } = await supabase.from("prj_milestones").update(params.updates).eq("id", params.id).select().single();
|
|
1269
|
+
if (error) throw error;
|
|
1270
|
+
return data;
|
|
1271
|
+
},
|
|
1272
|
+
onSuccess: (data) => {
|
|
1273
|
+
queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
|
|
1274
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1275
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
|
|
1276
|
+
},
|
|
1277
|
+
onError: (error) => {
|
|
1278
|
+
showApiErrorNotification(error);
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
function useDeleteMilestone() {
|
|
1283
|
+
const supabase = useSupabase();
|
|
1284
|
+
const queryClient = useQueryClient();
|
|
1285
|
+
return useMutation({
|
|
1286
|
+
mutationFn: async (params) => {
|
|
1287
|
+
const { error } = await supabase.from("prj_milestones").delete().eq("id", params.id);
|
|
1288
|
+
if (error) throw error;
|
|
1289
|
+
},
|
|
1290
|
+
onSuccess: (_, params) => {
|
|
1291
|
+
queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
|
|
1292
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1293
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.detail(params.projectId) });
|
|
1294
|
+
},
|
|
1295
|
+
onError: (error) => {
|
|
1296
|
+
showApiErrorNotification(error);
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
var taskKeys = {
|
|
1301
|
+
all: ["project-tasks"],
|
|
1302
|
+
lists: () => [...taskKeys.all, "list"],
|
|
1303
|
+
list: (orgId, filters) => [...taskKeys.all, "list", orgId, filters],
|
|
1304
|
+
details: () => [...taskKeys.all, "detail"],
|
|
1305
|
+
detail: (id) => [...taskKeys.all, "detail", id]
|
|
1306
|
+
};
|
|
1307
|
+
function useTasks(filters = {}) {
|
|
1308
|
+
const supabase = useSupabase();
|
|
1309
|
+
const { currentSupabaseOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
|
|
1310
|
+
const isReady = !!currentSupabaseOrganizationId && !isInitializing && !isOrgRefreshing;
|
|
1311
|
+
return useQuery({
|
|
1312
|
+
queryKey: taskKeys.list(currentSupabaseOrganizationId, filters),
|
|
1313
|
+
queryFn: async () => {
|
|
1314
|
+
if (!currentSupabaseOrganizationId) {
|
|
1315
|
+
return [];
|
|
1316
|
+
}
|
|
1317
|
+
let query = supabase.from("prj_tasks").select("*").eq("organization_id", currentSupabaseOrganizationId);
|
|
1318
|
+
if (filters.projectId) {
|
|
1319
|
+
query = query.eq("project_id", filters.projectId);
|
|
1320
|
+
}
|
|
1321
|
+
if (filters.milestoneId) {
|
|
1322
|
+
query = query.eq("milestone_id", filters.milestoneId);
|
|
1323
|
+
}
|
|
1324
|
+
if (filters.status) {
|
|
1325
|
+
query = query.eq("status", filters.status);
|
|
1326
|
+
}
|
|
1327
|
+
if (filters.type) {
|
|
1328
|
+
query = query.eq("type", filters.type);
|
|
1329
|
+
}
|
|
1330
|
+
query = query.order("created_at", { ascending: false });
|
|
1331
|
+
const { data, error } = await query;
|
|
1332
|
+
if (error) throw error;
|
|
1333
|
+
return data || [];
|
|
1334
|
+
},
|
|
1335
|
+
enabled: isReady
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
function useDeleteTask() {
|
|
1339
|
+
const supabase = useSupabase();
|
|
1340
|
+
const queryClient = useQueryClient();
|
|
1341
|
+
return useMutation({
|
|
1342
|
+
mutationFn: async (params) => {
|
|
1343
|
+
const { error } = await supabase.from("prj_tasks").delete().eq("id", params.id);
|
|
1344
|
+
if (error) throw error;
|
|
1345
|
+
},
|
|
1346
|
+
onSuccess: (_, params) => {
|
|
1347
|
+
queryClient.invalidateQueries({ queryKey: taskKeys.all });
|
|
1348
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1349
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.detail(params.projectId) });
|
|
1350
|
+
},
|
|
1351
|
+
onError: (error) => {
|
|
1352
|
+
showApiErrorNotification(error);
|
|
1353
|
+
}
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
var noteKeys = {
|
|
1357
|
+
all: ["project-notes"],
|
|
1358
|
+
lists: () => [...noteKeys.all, "list"],
|
|
1359
|
+
list: (orgId, filters) => [...noteKeys.all, "list", orgId, filters],
|
|
1360
|
+
details: () => [...noteKeys.all, "detail"],
|
|
1361
|
+
detail: (id) => [...noteKeys.all, "detail", id]
|
|
1362
|
+
};
|
|
1363
|
+
function useProjectNotes(filters = {}) {
|
|
1364
|
+
const supabase = useSupabase();
|
|
1365
|
+
const { currentSupabaseOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
|
|
1366
|
+
const isReady = !!currentSupabaseOrganizationId && !isInitializing && !isOrgRefreshing;
|
|
1367
|
+
return useQuery({
|
|
1368
|
+
queryKey: noteKeys.list(currentSupabaseOrganizationId, filters),
|
|
1369
|
+
queryFn: async () => {
|
|
1370
|
+
if (!currentSupabaseOrganizationId) {
|
|
1371
|
+
return [];
|
|
1372
|
+
}
|
|
1373
|
+
let query = supabase.from("prj_notes").select("*").eq("organization_id", currentSupabaseOrganizationId);
|
|
1374
|
+
if (filters.projectId) {
|
|
1375
|
+
query = query.eq("project_id", filters.projectId);
|
|
1376
|
+
}
|
|
1377
|
+
if (filters.type) {
|
|
1378
|
+
query = query.eq("type", filters.type);
|
|
1379
|
+
}
|
|
1380
|
+
query = query.order("occurred_at", { ascending: false });
|
|
1381
|
+
const { data, error } = await query;
|
|
1382
|
+
if (error) throw error;
|
|
1383
|
+
return data || [];
|
|
1384
|
+
},
|
|
1385
|
+
enabled: isReady
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
function useCreateNote() {
|
|
1389
|
+
const supabase = useSupabase();
|
|
1390
|
+
const queryClient = useQueryClient();
|
|
1391
|
+
const { currentSupabaseOrganizationId } = useOrganization();
|
|
1392
|
+
return useMutation({
|
|
1393
|
+
mutationFn: async (params) => {
|
|
1394
|
+
if (!currentSupabaseOrganizationId) {
|
|
1395
|
+
throw new Error("No organization selected");
|
|
1396
|
+
}
|
|
1397
|
+
const insert = {
|
|
1398
|
+
...params,
|
|
1399
|
+
organization_id: currentSupabaseOrganizationId
|
|
1400
|
+
};
|
|
1401
|
+
const { data, error } = await supabase.from("prj_notes").insert(insert).select().single();
|
|
1402
|
+
if (error) throw error;
|
|
1403
|
+
return data;
|
|
1404
|
+
},
|
|
1405
|
+
onSuccess: (data) => {
|
|
1406
|
+
queryClient.invalidateQueries({ queryKey: noteKeys.all });
|
|
1407
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1408
|
+
queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
|
|
1409
|
+
},
|
|
1410
|
+
onError: (error) => {
|
|
1411
|
+
showApiErrorNotification(error);
|
|
1412
|
+
}
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1043
1415
|
|
|
1044
|
-
export { ApiKeyService, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OrganizationMembershipService, WebhookEndpointService, filterByDomainFilters, transformMembershipToTableRow, useActivateDeployment, useActivityFilters, useCommandViewDomainFilters, useCreateApiKey, useCreateCredential, useCreateWebhookEndpoint, useCredentials, useDeactivateDeployment, useDeactivateMembership, useDeleteApiKey, useDeleteCredential, useDeleteDeployment, useDeleteWebhookEndpoint, useExecutionLogsFilters, useListApiKeys, useListDeployments, useListWebhookEndpoints, useOrganizationMembers, useReactivateMembership, useResourceSearch, useResourcesDomainFilters, useStatusFilter, useTimeRangeDates, useUpdateApiKey, useUpdateCredential, useUpdateMemberConfig, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources };
|
|
1416
|
+
export { ApiKeyService, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OrganizationMembershipService, WebhookEndpointService, filterByDomainFilters, milestoneKeys, noteKeys, projectKeys, taskKeys, transformMembershipToTableRow, useActivateDeployment, useActivityFilters, useCommandViewDomainFilters, useCreateApiKey, useCreateCredential, useCreateMilestone, useCreateNote, useCreateProject, useCreateWebhookEndpoint, useCredentials, useDeactivateDeployment, useDeactivateMembership, useDeleteApiKey, useDeleteCredential, useDeleteDeployment, useDeleteMilestone, useDeleteProject, useDeleteTask, useDeleteWebhookEndpoint, useExecutionLogsFilters, useListApiKeys, useListDeployments, useListWebhookEndpoints, useMilestones, useOrganizationMembers, useProject, useProjectNotes, useProjects, useReactivateMembership, useResourceSearch, useResourcesDomainFilters, useStatusFilter, useTasks, useTimeRangeDates, useUpdateApiKey, useUpdateCredential, useUpdateMemberConfig, useUpdateMilestone, useUpdateProject, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources };
|
|
@@ -195,6 +195,9 @@ function APIErrorAlert({
|
|
|
195
195
|
] })
|
|
196
196
|
] });
|
|
197
197
|
}
|
|
198
|
+
function CenteredErrorState({ error, title, h = 300, py }) {
|
|
199
|
+
return /* @__PURE__ */ jsx(Center, { h, py, children: /* @__PURE__ */ jsx(APIErrorAlert, { error, title }) });
|
|
200
|
+
}
|
|
198
201
|
|
|
199
202
|
// src/components/display/StatCard.module.css.js
|
|
200
203
|
var StatCard_module_css_default = { "heroCard": "heroCard", "iconRing": "iconRing", "iconRingSm": "iconRingSm", "heroValue": "heroValue", "heroValueSm": "heroValueSm", "heroLabel": "heroLabel", "heroLabelSm": "heroLabelSm" };
|
|
@@ -712,4 +715,4 @@ function ActivityTimeline({ activities }) {
|
|
|
712
715
|
}) }) });
|
|
713
716
|
}
|
|
714
717
|
|
|
715
|
-
export { APIErrorAlert, ActivityTimeline, CardHeader, CollapsibleSection, ContextViewer, CustomSelector, DetailCardSkeleton, EmptyState, GlowDot, JsonViewer, ListSkeleton, PageNotFound, PageTitleCaption, ResourceCard, StatCard, StatCardSkeleton, StatsCardSkeleton, StatusBadge, TabCountBadge, TimeRangeSelector, TrendIndicator, catalogItemToResourceDefinition };
|
|
718
|
+
export { APIErrorAlert, ActivityTimeline, CardHeader, CenteredErrorState, CollapsibleSection, ContextViewer, CustomSelector, DetailCardSkeleton, EmptyState, GlowDot, JsonViewer, ListSkeleton, PageNotFound, PageTitleCaption, ResourceCard, StatCard, StatCardSkeleton, StatsCardSkeleton, StatusBadge, TabCountBadge, TimeRangeSelector, TrendIndicator, catalogItemToResourceDefinition };
|