@nestledjs/data-browser 0.1.18 → 0.1.21
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/lib/components/RelationFieldWrapper.js +10 -42
- package/lib/components/filters/DateRangeFilter.js +18 -66
- package/lib/components/filters/NumberRangeFilter.js +18 -66
- package/lib/components/filters/RelationComponents.js +37 -164
- package/lib/components/filters/RelationFilterField.js +16 -60
- package/lib/components/shared/AdminBreadcrumbs.js +15 -67
- package/lib/components/shared/AdminErrorStates.js +27 -127
- package/lib/components/shared/AdminStatusDisplay.js +13 -53
- package/lib/context/AdminDataContext.js +2 -6
- package/lib/layouts/AdminDataLayout.js +39 -219
- package/lib/pages/AdminDataCreatePage.js +63 -335
- package/lib/pages/AdminDataEditPage.js +111 -571
- package/lib/pages/AdminDataIndexPage.js +17 -68
- package/lib/pages/AdminDataListPage.js +153 -698
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useMemo, useEffect } from "react";
|
|
3
3
|
import { gql } from "@apollo/client";
|
|
4
4
|
import { useQuery, useMutation } from "@apollo/client/react";
|
|
@@ -66,124 +66,40 @@ function AdminDataEditPage() {
|
|
|
66
66
|
const model = validatedDataType ? findModelByName(validatedDataType) : null;
|
|
67
67
|
const shouldShowModelNotFound = validatedDataType && validatedId && !model;
|
|
68
68
|
if (shouldShowUnauthorized) {
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, this),
|
|
75
|
-
/* @__PURE__ */ jsxDEV("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Unauthorized" }, void 0, false, {
|
|
76
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
77
|
-
lineNumber: 121,
|
|
78
|
-
columnNumber: 15
|
|
79
|
-
}, this),
|
|
80
|
-
/* @__PURE__ */ jsxDEV("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: "Invalid data type, ID, or insufficient permissions." }, void 0, false, {
|
|
81
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
82
|
-
lineNumber: 122,
|
|
83
|
-
columnNumber: 15
|
|
84
|
-
}, this),
|
|
85
|
-
/* @__PURE__ */ jsxDEV("div", { className: "mt-6", children: /* @__PURE__ */ jsxDEV(
|
|
69
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center py-12", children: /* @__PURE__ */ jsx("div", { className: "mt-8 mx-auto w-full max-w-md", children: /* @__PURE__ */ jsx("div", { className: "bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
70
|
+
/* @__PURE__ */ jsx(ExclamationCircleIcon, { className: "mx-auto h-12 w-12 text-red-400" }),
|
|
71
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Unauthorized" }),
|
|
72
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: "Invalid data type, ID, or insufficient permissions." }),
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsx(
|
|
86
74
|
Link,
|
|
87
75
|
{
|
|
88
76
|
to: basePath,
|
|
89
77
|
className: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-web hover:bg-green-web-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web",
|
|
90
78
|
children: "Return to Data Browser"
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
96
|
-
lineNumber: 126,
|
|
97
|
-
columnNumber: 17
|
|
98
|
-
},
|
|
99
|
-
this
|
|
100
|
-
) }, void 0, false, {
|
|
101
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
102
|
-
lineNumber: 125,
|
|
103
|
-
columnNumber: 15
|
|
104
|
-
}, this)
|
|
105
|
-
] }, void 0, true, {
|
|
106
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
107
|
-
lineNumber: 119,
|
|
108
|
-
columnNumber: 13
|
|
109
|
-
}, this) }, void 0, false, {
|
|
110
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
111
|
-
lineNumber: 118,
|
|
112
|
-
columnNumber: 11
|
|
113
|
-
}, this) }, void 0, false, {
|
|
114
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
115
|
-
lineNumber: 117,
|
|
116
|
-
columnNumber: 9
|
|
117
|
-
}, this) }, void 0, false, {
|
|
118
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
119
|
-
lineNumber: 116,
|
|
120
|
-
columnNumber: 7
|
|
121
|
-
}, this);
|
|
79
|
+
}
|
|
80
|
+
) })
|
|
81
|
+
] }) }) }) });
|
|
122
82
|
}
|
|
123
83
|
if (shouldShowModelNotFound) {
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
columnNumber: 15
|
|
129
|
-
}, this),
|
|
130
|
-
/* @__PURE__ */ jsxDEV("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Model Not Found" }, void 0, false, {
|
|
131
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
132
|
-
lineNumber: 147,
|
|
133
|
-
columnNumber: 15
|
|
134
|
-
}, this),
|
|
135
|
-
/* @__PURE__ */ jsxDEV("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: [
|
|
84
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center py-12", children: /* @__PURE__ */ jsx("div", { className: "mt-8 mx-auto w-full max-w-md", children: /* @__PURE__ */ jsx("div", { className: "bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
85
|
+
/* @__PURE__ */ jsx(ExclamationCircleIcon, { className: "mx-auto h-12 w-12 text-yellow-400" }),
|
|
86
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Model Not Found" }),
|
|
87
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: [
|
|
136
88
|
'The data model for "',
|
|
137
89
|
validatedDataType,
|
|
138
90
|
'" could not be found.'
|
|
139
|
-
] },
|
|
140
|
-
|
|
141
|
-
lineNumber: 148,
|
|
142
|
-
columnNumber: 15
|
|
143
|
-
}, this),
|
|
144
|
-
/* @__PURE__ */ jsxDEV("div", { className: "mt-6", children: /* @__PURE__ */ jsxDEV(
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsx(
|
|
145
93
|
Link,
|
|
146
94
|
{
|
|
147
95
|
to: basePath,
|
|
148
96
|
className: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-web hover:bg-green-web-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web",
|
|
149
97
|
children: "Return to Data Browser"
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
{
|
|
154
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
155
|
-
lineNumber: 152,
|
|
156
|
-
columnNumber: 17
|
|
157
|
-
},
|
|
158
|
-
this
|
|
159
|
-
) }, void 0, false, {
|
|
160
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
161
|
-
lineNumber: 151,
|
|
162
|
-
columnNumber: 15
|
|
163
|
-
}, this)
|
|
164
|
-
] }, void 0, true, {
|
|
165
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
166
|
-
lineNumber: 145,
|
|
167
|
-
columnNumber: 13
|
|
168
|
-
}, this) }, void 0, false, {
|
|
169
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
170
|
-
lineNumber: 144,
|
|
171
|
-
columnNumber: 11
|
|
172
|
-
}, this) }, void 0, false, {
|
|
173
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
174
|
-
lineNumber: 143,
|
|
175
|
-
columnNumber: 9
|
|
176
|
-
}, this) }, void 0, false, {
|
|
177
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
178
|
-
lineNumber: 142,
|
|
179
|
-
columnNumber: 7
|
|
180
|
-
}, this);
|
|
98
|
+
}
|
|
99
|
+
) })
|
|
100
|
+
] }) }) }) });
|
|
181
101
|
}
|
|
182
|
-
return /* @__PURE__ */
|
|
183
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
184
|
-
lineNumber: 167,
|
|
185
|
-
columnNumber: 10
|
|
186
|
-
}, this);
|
|
102
|
+
return /* @__PURE__ */ jsx(AdminDataEditPageContent, { model, id: validatedId, basePath, formTheme });
|
|
187
103
|
}
|
|
188
104
|
function AdminDataEditPageContent({ model, id, basePath, formTheme }) {
|
|
189
105
|
const navigate = useNavigate();
|
|
@@ -279,231 +195,75 @@ function AdminDataEditPageContent({ model, id, basePath, formTheme }) {
|
|
|
279
195
|
}
|
|
280
196
|
}, [deleteState.status]);
|
|
281
197
|
if (!documents || !QUERY || !UPDATE_MUTATION || !DELETE_MUTATION) {
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}, this),
|
|
288
|
-
/* @__PURE__ */ jsxDEV("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "GraphQL Schema Error" }, void 0, false, {
|
|
289
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
290
|
-
lineNumber: 304,
|
|
291
|
-
columnNumber: 15
|
|
292
|
-
}, this),
|
|
293
|
-
/* @__PURE__ */ jsxDEV("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: "Unable to load GraphQL documents for this model. Please ensure the API server is running and the GraphQL schema is up to date." }, void 0, false, {
|
|
294
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
295
|
-
lineNumber: 305,
|
|
296
|
-
columnNumber: 15
|
|
297
|
-
}, this),
|
|
298
|
-
/* @__PURE__ */ jsxDEV("div", { className: "mt-6", children: /* @__PURE__ */ jsxDEV(
|
|
198
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center py-12", children: /* @__PURE__ */ jsx("div", { className: "mt-8 mx-auto w-full max-w-2xl", children: /* @__PURE__ */ jsx("div", { className: "bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
199
|
+
/* @__PURE__ */ jsx(ExclamationCircleIcon, { className: "mx-auto h-12 w-12 text-red-400" }),
|
|
200
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "GraphQL Schema Error" }),
|
|
201
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: "Unable to load GraphQL documents for this model. Please ensure the API server is running and the GraphQL schema is up to date." }),
|
|
202
|
+
/* @__PURE__ */ jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsx(
|
|
299
203
|
Link,
|
|
300
204
|
{
|
|
301
205
|
to: basePath,
|
|
302
206
|
className: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-web hover:bg-green-web-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web",
|
|
303
207
|
children: "Return to Data Browser"
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
{
|
|
308
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
309
|
-
lineNumber: 310,
|
|
310
|
-
columnNumber: 17
|
|
311
|
-
},
|
|
312
|
-
this
|
|
313
|
-
) }, void 0, false, {
|
|
314
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
315
|
-
lineNumber: 309,
|
|
316
|
-
columnNumber: 15
|
|
317
|
-
}, this)
|
|
318
|
-
] }, void 0, true, {
|
|
319
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
320
|
-
lineNumber: 302,
|
|
321
|
-
columnNumber: 13
|
|
322
|
-
}, this) }, void 0, false, {
|
|
323
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
324
|
-
lineNumber: 301,
|
|
325
|
-
columnNumber: 11
|
|
326
|
-
}, this) }, void 0, false, {
|
|
327
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
328
|
-
lineNumber: 300,
|
|
329
|
-
columnNumber: 9
|
|
330
|
-
}, this) }, void 0, false, {
|
|
331
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
332
|
-
lineNumber: 299,
|
|
333
|
-
columnNumber: 7
|
|
334
|
-
}, this);
|
|
208
|
+
}
|
|
209
|
+
) })
|
|
210
|
+
] }) }) }) });
|
|
335
211
|
}
|
|
336
212
|
if (error) {
|
|
337
|
-
return /* @__PURE__ */
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
/* @__PURE__ */ jsxDEV("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Error Loading Data" }, void 0, false, {
|
|
344
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
345
|
-
lineNumber: 332,
|
|
346
|
-
columnNumber: 15
|
|
347
|
-
}, this),
|
|
348
|
-
/* @__PURE__ */ jsxDEV("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: error.message }, void 0, false, {
|
|
349
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
350
|
-
lineNumber: 333,
|
|
351
|
-
columnNumber: 15
|
|
352
|
-
}, this),
|
|
353
|
-
/* @__PURE__ */ jsxDEV("div", { className: "mt-6 space-y-3", children: [
|
|
354
|
-
/* @__PURE__ */ jsxDEV(
|
|
213
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center py-12", children: /* @__PURE__ */ jsx("div", { className: "mt-8 mx-auto w-full max-w-md", children: /* @__PURE__ */ jsx("div", { className: "bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
214
|
+
/* @__PURE__ */ jsx(ExclamationCircleIcon, { className: "mx-auto h-12 w-12 text-red-400" }),
|
|
215
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Error Loading Data" }),
|
|
216
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: error.message }),
|
|
217
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-6 space-y-3", children: [
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
355
219
|
"button",
|
|
356
220
|
{
|
|
357
221
|
onClick: () => refetch(),
|
|
358
222
|
className: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-web hover:bg-green-web-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web",
|
|
359
223
|
children: "Try Again"
|
|
360
|
-
}
|
|
361
|
-
void 0,
|
|
362
|
-
false,
|
|
363
|
-
{
|
|
364
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
365
|
-
lineNumber: 335,
|
|
366
|
-
columnNumber: 17
|
|
367
|
-
},
|
|
368
|
-
this
|
|
224
|
+
}
|
|
369
225
|
),
|
|
370
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ jsx(
|
|
371
227
|
Link,
|
|
372
228
|
{
|
|
373
229
|
to: `${basePath}/${toKebabCase(model.pluralName)}`,
|
|
374
230
|
className: "w-full flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web",
|
|
375
231
|
children: "Back to List"
|
|
376
|
-
}
|
|
377
|
-
void 0,
|
|
378
|
-
false,
|
|
379
|
-
{
|
|
380
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
381
|
-
lineNumber: 341,
|
|
382
|
-
columnNumber: 17
|
|
383
|
-
},
|
|
384
|
-
this
|
|
232
|
+
}
|
|
385
233
|
)
|
|
386
|
-
] }
|
|
387
|
-
|
|
388
|
-
lineNumber: 334,
|
|
389
|
-
columnNumber: 15
|
|
390
|
-
}, this)
|
|
391
|
-
] }, void 0, true, {
|
|
392
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
393
|
-
lineNumber: 330,
|
|
394
|
-
columnNumber: 13
|
|
395
|
-
}, this) }, void 0, false, {
|
|
396
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
397
|
-
lineNumber: 329,
|
|
398
|
-
columnNumber: 11
|
|
399
|
-
}, this) }, void 0, false, {
|
|
400
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
401
|
-
lineNumber: 328,
|
|
402
|
-
columnNumber: 9
|
|
403
|
-
}, this) }, void 0, false, {
|
|
404
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
405
|
-
lineNumber: 327,
|
|
406
|
-
columnNumber: 7
|
|
407
|
-
}, this);
|
|
234
|
+
] })
|
|
235
|
+
] }) }) }) });
|
|
408
236
|
}
|
|
409
237
|
if (loading) {
|
|
410
|
-
return /* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
columnNumber: 15
|
|
415
|
-
}, this),
|
|
416
|
-
/* @__PURE__ */ jsxDEV("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Loading..." }, void 0, false, {
|
|
417
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
418
|
-
lineNumber: 363,
|
|
419
|
-
columnNumber: 15
|
|
420
|
-
}, this),
|
|
421
|
-
/* @__PURE__ */ jsxDEV("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: [
|
|
238
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center py-12", children: /* @__PURE__ */ jsx("div", { className: "mt-8 mx-auto w-full max-w-md", children: /* @__PURE__ */ jsx("div", { className: "bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
239
|
+
/* @__PURE__ */ jsx("div", { className: "mx-auto h-12 w-12 border-4 border-green-web border-t-transparent rounded-full animate-spin" }),
|
|
240
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Loading..." }),
|
|
241
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: [
|
|
422
242
|
"Loading ",
|
|
423
243
|
toReadableText(model.name),
|
|
424
244
|
" data..."
|
|
425
|
-
] }
|
|
426
|
-
|
|
427
|
-
lineNumber: 364,
|
|
428
|
-
columnNumber: 15
|
|
429
|
-
}, this)
|
|
430
|
-
] }, void 0, true, {
|
|
431
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
432
|
-
lineNumber: 361,
|
|
433
|
-
columnNumber: 13
|
|
434
|
-
}, this) }, void 0, false, {
|
|
435
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
436
|
-
lineNumber: 360,
|
|
437
|
-
columnNumber: 11
|
|
438
|
-
}, this) }, void 0, false, {
|
|
439
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
440
|
-
lineNumber: 359,
|
|
441
|
-
columnNumber: 9
|
|
442
|
-
}, this) }, void 0, false, {
|
|
443
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
444
|
-
lineNumber: 358,
|
|
445
|
-
columnNumber: 7
|
|
446
|
-
}, this);
|
|
245
|
+
] })
|
|
246
|
+
] }) }) }) });
|
|
447
247
|
}
|
|
448
248
|
const item = data == null ? void 0 : data[responseFieldName];
|
|
449
249
|
if (!item) {
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
columnNumber: 15
|
|
455
|
-
}, this),
|
|
456
|
-
/* @__PURE__ */ jsxDEV("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Not Found" }, void 0, false, {
|
|
457
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
458
|
-
lineNumber: 384,
|
|
459
|
-
columnNumber: 15
|
|
460
|
-
}, this),
|
|
461
|
-
/* @__PURE__ */ jsxDEV("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: [
|
|
250
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center py-12", children: /* @__PURE__ */ jsx("div", { className: "mt-8 mx-auto w-full max-w-md", children: /* @__PURE__ */ jsx("div", { className: "bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
251
|
+
/* @__PURE__ */ jsx(ExclamationCircleIcon, { className: "mx-auto h-12 w-12 text-yellow-400" }),
|
|
252
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-medium text-gray-900 dark:text-gray-100", children: "Not Found" }),
|
|
253
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400", children: [
|
|
462
254
|
"The ",
|
|
463
255
|
toReadableText(model.name),
|
|
464
256
|
" you're looking for doesn't exist or has been deleted."
|
|
465
|
-
] },
|
|
466
|
-
|
|
467
|
-
lineNumber: 385,
|
|
468
|
-
columnNumber: 15
|
|
469
|
-
}, this),
|
|
470
|
-
/* @__PURE__ */ jsxDEV("div", { className: "mt-6", children: /* @__PURE__ */ jsxDEV(
|
|
257
|
+
] }),
|
|
258
|
+
/* @__PURE__ */ jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsx(
|
|
471
259
|
Link,
|
|
472
260
|
{
|
|
473
261
|
to: `${basePath}/${toKebabCase(model.pluralName)}`,
|
|
474
262
|
className: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-web hover:bg-green-web-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web",
|
|
475
263
|
children: "Back to List"
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
{
|
|
480
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
481
|
-
lineNumber: 390,
|
|
482
|
-
columnNumber: 17
|
|
483
|
-
},
|
|
484
|
-
this
|
|
485
|
-
) }, void 0, false, {
|
|
486
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
487
|
-
lineNumber: 389,
|
|
488
|
-
columnNumber: 15
|
|
489
|
-
}, this)
|
|
490
|
-
] }, void 0, true, {
|
|
491
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
492
|
-
lineNumber: 382,
|
|
493
|
-
columnNumber: 13
|
|
494
|
-
}, this) }, void 0, false, {
|
|
495
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
496
|
-
lineNumber: 381,
|
|
497
|
-
columnNumber: 11
|
|
498
|
-
}, this) }, void 0, false, {
|
|
499
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
500
|
-
lineNumber: 380,
|
|
501
|
-
columnNumber: 9
|
|
502
|
-
}, this) }, void 0, false, {
|
|
503
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
504
|
-
lineNumber: 379,
|
|
505
|
-
columnNumber: 7
|
|
506
|
-
}, this);
|
|
264
|
+
}
|
|
265
|
+
) })
|
|
266
|
+
] }) }) }) });
|
|
507
267
|
}
|
|
508
268
|
const formFields = buildFormFields(sdk, model, "update", item, submissionState.status === "loading", basePath, databaseModels);
|
|
509
269
|
const initialValues = {};
|
|
@@ -638,325 +398,129 @@ function AdminDataEditPageContent({ model, id, basePath, formTheme }) {
|
|
|
638
398
|
});
|
|
639
399
|
}
|
|
640
400
|
};
|
|
641
|
-
return /* @__PURE__ */
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
-
/* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
columnNumber: 17
|
|
648
|
-
}, this) }, void 0, false, {
|
|
649
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
650
|
-
lineNumber: 596,
|
|
651
|
-
columnNumber: 15
|
|
652
|
-
}, this),
|
|
653
|
-
/* @__PURE__ */ jsxDEV("li", { children: /* @__PURE__ */ jsxDEV("div", { className: "flex items-center", children: [
|
|
654
|
-
/* @__PURE__ */ jsxDEV(
|
|
401
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
402
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-8", children: [
|
|
403
|
+
/* @__PURE__ */ jsx("nav", { className: "flex mb-6", "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsxs("ol", { className: "flex items-center space-x-4", children: [
|
|
404
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: basePath, className: "text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400", children: "Data Browser" }) }),
|
|
405
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
406
|
+
/* @__PURE__ */ jsx(
|
|
655
407
|
"svg",
|
|
656
408
|
{
|
|
657
409
|
className: "flex-shrink-0 h-5 w-5 text-gray-300 dark:text-gray-600",
|
|
658
410
|
fill: "currentColor",
|
|
659
411
|
viewBox: "0 0 20 20",
|
|
660
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */ jsx(
|
|
661
413
|
"path",
|
|
662
414
|
{
|
|
663
415
|
fillRule: "evenodd",
|
|
664
416
|
d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 111.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
|
|
665
417
|
clipRule: "evenodd"
|
|
666
|
-
}
|
|
667
|
-
void 0,
|
|
668
|
-
false,
|
|
669
|
-
{
|
|
670
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
671
|
-
lineNumber: 608,
|
|
672
|
-
columnNumber: 21
|
|
673
|
-
},
|
|
674
|
-
this
|
|
418
|
+
}
|
|
675
419
|
)
|
|
676
|
-
}
|
|
677
|
-
void 0,
|
|
678
|
-
false,
|
|
679
|
-
{
|
|
680
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
681
|
-
lineNumber: 603,
|
|
682
|
-
columnNumber: 19
|
|
683
|
-
},
|
|
684
|
-
this
|
|
420
|
+
}
|
|
685
421
|
),
|
|
686
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ jsx(
|
|
687
423
|
Link,
|
|
688
424
|
{
|
|
689
425
|
to: `${basePath}/${toKebabCase(model.pluralName)}`,
|
|
690
426
|
className: "ml-4 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",
|
|
691
427
|
children: toReadableText(model.pluralName)
|
|
692
|
-
}
|
|
693
|
-
void 0,
|
|
694
|
-
false,
|
|
695
|
-
{
|
|
696
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
697
|
-
lineNumber: 614,
|
|
698
|
-
columnNumber: 19
|
|
699
|
-
},
|
|
700
|
-
this
|
|
428
|
+
}
|
|
701
429
|
)
|
|
702
|
-
] }
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
columnNumber: 17
|
|
706
|
-
}, this) }, void 0, false, {
|
|
707
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
708
|
-
lineNumber: 601,
|
|
709
|
-
columnNumber: 15
|
|
710
|
-
}, this),
|
|
711
|
-
/* @__PURE__ */ jsxDEV("li", { children: /* @__PURE__ */ jsxDEV("div", { className: "flex items-center", children: [
|
|
712
|
-
/* @__PURE__ */ jsxDEV(
|
|
430
|
+
] }) }),
|
|
431
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
432
|
+
/* @__PURE__ */ jsx(
|
|
713
433
|
"svg",
|
|
714
434
|
{
|
|
715
435
|
className: "flex-shrink-0 h-5 w-5 text-gray-300 dark:text-gray-600",
|
|
716
436
|
fill: "currentColor",
|
|
717
437
|
viewBox: "0 0 20 20",
|
|
718
|
-
children: /* @__PURE__ */
|
|
438
|
+
children: /* @__PURE__ */ jsx(
|
|
719
439
|
"path",
|
|
720
440
|
{
|
|
721
441
|
fillRule: "evenodd",
|
|
722
442
|
d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 111.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
|
|
723
443
|
clipRule: "evenodd"
|
|
724
|
-
}
|
|
725
|
-
void 0,
|
|
726
|
-
false,
|
|
727
|
-
{
|
|
728
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
729
|
-
lineNumber: 629,
|
|
730
|
-
columnNumber: 21
|
|
731
|
-
},
|
|
732
|
-
this
|
|
444
|
+
}
|
|
733
445
|
)
|
|
734
|
-
}
|
|
735
|
-
void 0,
|
|
736
|
-
false,
|
|
737
|
-
{
|
|
738
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
739
|
-
lineNumber: 624,
|
|
740
|
-
columnNumber: 19
|
|
741
|
-
},
|
|
742
|
-
this
|
|
446
|
+
}
|
|
743
447
|
),
|
|
744
|
-
/* @__PURE__ */
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
] }, void 0, true, {
|
|
750
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
751
|
-
lineNumber: 623,
|
|
752
|
-
columnNumber: 17
|
|
753
|
-
}, this) }, void 0, false, {
|
|
754
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
755
|
-
lineNumber: 622,
|
|
756
|
-
columnNumber: 15
|
|
757
|
-
}, this)
|
|
758
|
-
] }, void 0, true, {
|
|
759
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
760
|
-
lineNumber: 595,
|
|
761
|
-
columnNumber: 13
|
|
762
|
-
}, this) }, void 0, false, {
|
|
763
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
764
|
-
lineNumber: 594,
|
|
765
|
-
columnNumber: 11
|
|
766
|
-
}, this),
|
|
767
|
-
/* @__PURE__ */ jsxDEV("div", { className: "flex items-center justify-between", children: [
|
|
768
|
-
/* @__PURE__ */ jsxDEV("h1", { className: "text-3xl font-bold text-gray-900 dark:text-gray-100", children: [
|
|
448
|
+
/* @__PURE__ */ jsx("span", { className: "ml-4 text-gray-500 dark:text-gray-400", children: "Edit" })
|
|
449
|
+
] }) })
|
|
450
|
+
] }) }),
|
|
451
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
452
|
+
/* @__PURE__ */ jsxs("h1", { className: "text-3xl font-bold text-gray-900 dark:text-gray-100", children: [
|
|
769
453
|
"Edit ",
|
|
770
454
|
toReadableText(model.name)
|
|
771
|
-
] },
|
|
772
|
-
|
|
773
|
-
lineNumber: 641,
|
|
774
|
-
columnNumber: 13
|
|
775
|
-
}, this),
|
|
776
|
-
/* @__PURE__ */ jsxDEV(
|
|
455
|
+
] }),
|
|
456
|
+
/* @__PURE__ */ jsxs(
|
|
777
457
|
"button",
|
|
778
458
|
{
|
|
779
459
|
onClick: () => setShowDeleteConfirm(true),
|
|
780
460
|
disabled: deleteState.status === "loading",
|
|
781
461
|
className: "inline-flex items-center px-3 py-2 border border-red-300 shadow-sm text-sm leading-4 font-medium rounded-md text-red-700 bg-white hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
782
462
|
children: [
|
|
783
|
-
/* @__PURE__ */
|
|
784
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
785
|
-
lineNumber: 647,
|
|
786
|
-
columnNumber: 15
|
|
787
|
-
}, this),
|
|
463
|
+
/* @__PURE__ */ jsx(TrashIcon, { className: "h-4 w-4 mr-2" }),
|
|
788
464
|
"Delete"
|
|
789
465
|
]
|
|
790
|
-
}
|
|
791
|
-
void 0,
|
|
792
|
-
true,
|
|
793
|
-
{
|
|
794
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
795
|
-
lineNumber: 642,
|
|
796
|
-
columnNumber: 13
|
|
797
|
-
},
|
|
798
|
-
this
|
|
466
|
+
}
|
|
799
467
|
)
|
|
800
|
-
] }
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
lineNumber: 593,
|
|
808
|
-
columnNumber: 7
|
|
809
|
-
}, this),
|
|
810
|
-
showDeleteConfirm && /* @__PURE__ */ jsxDEV("div", { className: "fixed inset-0 bg-gray-600 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-75 overflow-y-auto h-full w-full z-50 flex items-center justify-center", children: /* @__PURE__ */ jsxDEV("div", { className: "bg-white dark:bg-gray-800 p-6 rounded-lg shadow-xl max-w-md w-full mx-4", children: [
|
|
811
|
-
/* @__PURE__ */ jsxDEV("div", { className: "flex items-center", children: [
|
|
812
|
-
/* @__PURE__ */ jsxDEV("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxDEV(ExclamationCircleIcon, { className: "h-6 w-6 text-red-600" }, void 0, false, {
|
|
813
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
814
|
-
lineNumber: 659,
|
|
815
|
-
columnNumber: 19
|
|
816
|
-
}, this) }, void 0, false, {
|
|
817
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
818
|
-
lineNumber: 658,
|
|
819
|
-
columnNumber: 17
|
|
820
|
-
}, this),
|
|
821
|
-
/* @__PURE__ */ jsxDEV("div", { className: "ml-3", children: [
|
|
822
|
-
/* @__PURE__ */ jsxDEV("h3", { className: "text-lg font-medium text-gray-900 dark:text-gray-100", children: [
|
|
468
|
+
] })
|
|
469
|
+
] }),
|
|
470
|
+
showDeleteConfirm && /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-gray-600 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-75 overflow-y-auto h-full w-full z-50 flex items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "bg-white dark:bg-gray-800 p-6 rounded-lg shadow-xl max-w-md w-full mx-4", children: [
|
|
471
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
472
|
+
/* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx(ExclamationCircleIcon, { className: "h-6 w-6 text-red-600" }) }),
|
|
473
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-3", children: [
|
|
474
|
+
/* @__PURE__ */ jsxs("h3", { className: "text-lg font-medium text-gray-900 dark:text-gray-100", children: [
|
|
823
475
|
"Delete ",
|
|
824
476
|
toReadableText(model.name)
|
|
825
|
-
] },
|
|
826
|
-
|
|
827
|
-
lineNumber: 662,
|
|
828
|
-
columnNumber: 19
|
|
829
|
-
}, this),
|
|
830
|
-
/* @__PURE__ */ jsxDEV("div", { className: "mt-2", children: /* @__PURE__ */ jsxDEV("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
477
|
+
] }),
|
|
478
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
831
479
|
"Are you sure you want to delete this",
|
|
832
480
|
" ",
|
|
833
481
|
toReadableText(model.name).toLowerCase(),
|
|
834
482
|
"? This action cannot be undone."
|
|
835
|
-
] }
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
841
|
-
lineNumber: 665,
|
|
842
|
-
columnNumber: 19
|
|
843
|
-
}, this)
|
|
844
|
-
] }, void 0, true, {
|
|
845
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
846
|
-
lineNumber: 661,
|
|
847
|
-
columnNumber: 17
|
|
848
|
-
}, this)
|
|
849
|
-
] }, void 0, true, {
|
|
850
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
851
|
-
lineNumber: 657,
|
|
852
|
-
columnNumber: 15
|
|
853
|
-
}, this),
|
|
854
|
-
/* @__PURE__ */ jsxDEV("div", { className: "mt-5 sm:mt-4 sm:flex sm:flex-row-reverse", children: [
|
|
855
|
-
/* @__PURE__ */ jsxDEV(
|
|
483
|
+
] }) })
|
|
484
|
+
] })
|
|
485
|
+
] }),
|
|
486
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-5 sm:mt-4 sm:flex sm:flex-row-reverse", children: [
|
|
487
|
+
/* @__PURE__ */ jsx(
|
|
856
488
|
"button",
|
|
857
489
|
{
|
|
858
490
|
onClick: handleDelete,
|
|
859
491
|
disabled: deleteState.status === "loading",
|
|
860
492
|
className: "w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",
|
|
861
493
|
children: deleteState.status === "loading" ? "Deleting..." : "Delete"
|
|
862
|
-
}
|
|
863
|
-
void 0,
|
|
864
|
-
false,
|
|
865
|
-
{
|
|
866
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
867
|
-
lineNumber: 674,
|
|
868
|
-
columnNumber: 17
|
|
869
|
-
},
|
|
870
|
-
this
|
|
494
|
+
}
|
|
871
495
|
),
|
|
872
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ jsx(
|
|
873
497
|
"button",
|
|
874
498
|
{
|
|
875
499
|
onClick: () => setShowDeleteConfirm(false),
|
|
876
500
|
disabled: deleteState.status === "loading",
|
|
877
501
|
className: "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web sm:mt-0 sm:w-auto sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",
|
|
878
502
|
children: "Cancel"
|
|
879
|
-
}
|
|
880
|
-
void 0,
|
|
881
|
-
false,
|
|
882
|
-
{
|
|
883
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
884
|
-
lineNumber: 681,
|
|
885
|
-
columnNumber: 17
|
|
886
|
-
},
|
|
887
|
-
this
|
|
503
|
+
}
|
|
888
504
|
)
|
|
889
|
-
] }
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
columnNumber: 15
|
|
893
|
-
}, this)
|
|
894
|
-
] }, void 0, true, {
|
|
895
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
896
|
-
lineNumber: 656,
|
|
897
|
-
columnNumber: 13
|
|
898
|
-
}, this) }, void 0, false, {
|
|
899
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
900
|
-
lineNumber: 655,
|
|
901
|
-
columnNumber: 11
|
|
902
|
-
}, this),
|
|
903
|
-
(submissionState.status !== "idle" || deleteState.status !== "idle") && /* @__PURE__ */ jsxDEV(
|
|
505
|
+
] })
|
|
506
|
+
] }) }),
|
|
507
|
+
(submissionState.status !== "idle" || deleteState.status !== "idle") && /* @__PURE__ */ jsx(
|
|
904
508
|
"div",
|
|
905
509
|
{
|
|
906
510
|
className: `mb-6 rounded-md p-4 ${submissionState.status === "success" || deleteState.status === "success" ? "bg-green-50 border border-green-200" : submissionState.status === "error" || deleteState.status === "error" ? "bg-red-50 border border-red-200" : "bg-blue-50 border border-blue-200"}`,
|
|
907
|
-
children: /* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
|
|
910
|
-
lineNumber: 707,
|
|
911
|
-
columnNumber: 19
|
|
912
|
-
}, this) : submissionState.status === "error" || deleteState.status === "error" ? /* @__PURE__ */ jsxDEV(ExclamationCircleIcon, { className: "h-5 w-5 text-red-400" }, void 0, false, {
|
|
913
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
914
|
-
lineNumber: 709,
|
|
915
|
-
columnNumber: 19
|
|
916
|
-
}, this) : /* @__PURE__ */ jsxDEV("div", { className: "h-5 w-5 border-2 border-blue-400 border-t-transparent rounded-full animate-spin" }, void 0, false, {
|
|
917
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
918
|
-
lineNumber: 711,
|
|
919
|
-
columnNumber: 19
|
|
920
|
-
}, this) }, void 0, false, {
|
|
921
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
922
|
-
lineNumber: 705,
|
|
923
|
-
columnNumber: 15
|
|
924
|
-
}, this),
|
|
925
|
-
/* @__PURE__ */ jsxDEV("div", { className: "ml-3", children: /* @__PURE__ */ jsxDEV(
|
|
511
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
512
|
+
/* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: submissionState.status === "success" || deleteState.status === "success" ? /* @__PURE__ */ jsx(CheckCircleIcon, { className: "h-5 w-5 text-green-400" }) : submissionState.status === "error" || deleteState.status === "error" ? /* @__PURE__ */ jsx(ExclamationCircleIcon, { className: "h-5 w-5 text-red-400" }) : /* @__PURE__ */ jsx("div", { className: "h-5 w-5 border-2 border-blue-400 border-t-transparent rounded-full animate-spin" }) }),
|
|
513
|
+
/* @__PURE__ */ jsx("div", { className: "ml-3", children: /* @__PURE__ */ jsx(
|
|
926
514
|
"p",
|
|
927
515
|
{
|
|
928
516
|
className: `text-sm font-medium ${submissionState.status === "success" || deleteState.status === "success" ? "text-green-800" : submissionState.status === "error" || deleteState.status === "error" ? "text-red-800" : "text-blue-800"}`,
|
|
929
517
|
children: submissionState.status === "loading" ? `Updating ${toReadableText(model.name)}...` : deleteState.status === "loading" ? `Deleting ${toReadableText(model.name)}...` : submissionState.message || deleteState.message
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
935
|
-
lineNumber: 715,
|
|
936
|
-
columnNumber: 17
|
|
937
|
-
},
|
|
938
|
-
this
|
|
939
|
-
) }, void 0, false, {
|
|
940
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
941
|
-
lineNumber: 714,
|
|
942
|
-
columnNumber: 15
|
|
943
|
-
}, this)
|
|
944
|
-
] }, void 0, true, {
|
|
945
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
946
|
-
lineNumber: 704,
|
|
947
|
-
columnNumber: 13
|
|
948
|
-
}, this)
|
|
949
|
-
},
|
|
950
|
-
void 0,
|
|
951
|
-
false,
|
|
952
|
-
{
|
|
953
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
954
|
-
lineNumber: 695,
|
|
955
|
-
columnNumber: 11
|
|
956
|
-
},
|
|
957
|
-
this
|
|
518
|
+
}
|
|
519
|
+
) })
|
|
520
|
+
] })
|
|
521
|
+
}
|
|
958
522
|
),
|
|
959
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ jsx("div", { className: "bg-white dark:bg-gray-800 shadow-sm rounded-lg", children: /* @__PURE__ */ jsx("div", { className: "px-6 py-8", children: /* @__PURE__ */ jsx(
|
|
960
524
|
Form,
|
|
961
525
|
{
|
|
962
526
|
id: `edit-${model.name.toLowerCase()}-form`,
|
|
@@ -965,36 +529,12 @@ function AdminDataEditPageContent({ model, id, basePath, formTheme }) {
|
|
|
965
529
|
disabled: submissionState.status === "loading" || deleteState.status === "loading",
|
|
966
530
|
defaultValues: initialValues,
|
|
967
531
|
theme: formTheme
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
{
|
|
972
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
973
|
-
lineNumber: 738,
|
|
974
|
-
columnNumber: 13
|
|
975
|
-
},
|
|
976
|
-
this
|
|
977
|
-
) }, void 0, false, {
|
|
978
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
979
|
-
lineNumber: 737,
|
|
980
|
-
columnNumber: 11
|
|
981
|
-
}, this) }, void 0, false, {
|
|
982
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
983
|
-
lineNumber: 736,
|
|
984
|
-
columnNumber: 9
|
|
985
|
-
}, this)
|
|
986
|
-
] }, void 0, true, {
|
|
987
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
988
|
-
lineNumber: 591,
|
|
989
|
-
columnNumber: 5
|
|
990
|
-
}, this);
|
|
532
|
+
}
|
|
533
|
+
) }) })
|
|
534
|
+
] });
|
|
991
535
|
}
|
|
992
536
|
function AdminDataEditErrorBoundary({ error }) {
|
|
993
|
-
return /* @__PURE__ */
|
|
994
|
-
fileName: "/Users/justinhandley/IdeaProjects/nestled_template/libs/data-browser/src/lib/pages/AdminDataEditPage.tsx",
|
|
995
|
-
lineNumber: 753,
|
|
996
|
-
columnNumber: 10
|
|
997
|
-
}, this);
|
|
537
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { error });
|
|
998
538
|
}
|
|
999
539
|
export {
|
|
1000
540
|
AdminDataEditErrorBoundary,
|