adminforth 1.0.71 → 1.0.73
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.
|
@@ -227,7 +227,11 @@ class PostgresConnector {
|
|
|
227
227
|
const limitOffset = `LIMIT $${totalCounter} OFFSET $${totalCounter + 1}`;
|
|
228
228
|
const d = [...filterValues, limit, offset];
|
|
229
229
|
const orderBy = sort.length ? `ORDER BY ${sort.map((s) => `${s.field} ${this.SortDirectionsMap[s.direction]}`).join(', ')}` : '';
|
|
230
|
-
const
|
|
230
|
+
const selectQuery = `SELECT ${columns} FROM ${tableName} ${where} ${orderBy} ${limitOffset}`;
|
|
231
|
+
if (process.env.HEAVY_DEBUG) {
|
|
232
|
+
console.log('🗨️ PG selectQuery:', selectQuery, 'params:', d);
|
|
233
|
+
}
|
|
234
|
+
const stmt = await this.db.query(selectQuery, d);
|
|
231
235
|
const rows = stmt.rows;
|
|
232
236
|
|
|
233
237
|
const total = (await this.db.query(`SELECT COUNT(*) FROM ${tableName} ${where}`, filterValues)).rows[0].count;
|
|
@@ -230,7 +230,11 @@ class PostgresConnector {
|
|
|
230
230
|
const limitOffset = `LIMIT $${totalCounter} OFFSET $${totalCounter + 1}`;
|
|
231
231
|
const d = [...filterValues, limit, offset];
|
|
232
232
|
const orderBy = sort.length ? `ORDER BY ${sort.map((s) => `${s.field} ${this.SortDirectionsMap[s.direction]}`).join(', ')}` : '';
|
|
233
|
-
const
|
|
233
|
+
const selectQuery = `SELECT ${columns} FROM ${tableName} ${where} ${orderBy} ${limitOffset}`;
|
|
234
|
+
if (process.env.HEAVY_DEBUG) {
|
|
235
|
+
console.log('🗨️ PG selectQuery:', selectQuery, 'params:', d);
|
|
236
|
+
}
|
|
237
|
+
const stmt = yield this.db.query(selectQuery, d);
|
|
234
238
|
const rows = stmt.rows;
|
|
235
239
|
const total = (yield this.db.query(`SELECT COUNT(*) FROM ${tableName} ${where}`, filterValues)).rows[0].count;
|
|
236
240
|
// run all fields via getFieldValue
|
package/dist/index.js
CHANGED
|
@@ -98,7 +98,7 @@ class AdminForth {
|
|
|
98
98
|
}
|
|
99
99
|
if (this.config.resources) {
|
|
100
100
|
this.config.resources.forEach((res) => {
|
|
101
|
-
var _b, _c;
|
|
101
|
+
var _b, _c, _d;
|
|
102
102
|
if (!res.table) {
|
|
103
103
|
errors.push(`Resource "${res.dataSource}" is missing table`);
|
|
104
104
|
}
|
|
@@ -167,12 +167,12 @@ class AdminForth {
|
|
|
167
167
|
errors.push(`Resource "${res.resourceId}" bulkActions must be an array`);
|
|
168
168
|
bulkActions = [];
|
|
169
169
|
}
|
|
170
|
-
if (((_c = res.options) === null || _c === void 0 ? void 0 : _c.
|
|
170
|
+
if (((_d = (_c = res.options) === null || _c === void 0 ? void 0 : _c.allowedActions) === null || _d === void 0 ? void 0 : _d.delete) && !bulkActions.find((action) => action.label === 'Delete checked')) {
|
|
171
171
|
bulkActions.push({
|
|
172
172
|
label: `Delete checked`,
|
|
173
173
|
state: 'danger',
|
|
174
174
|
icon: 'flowbite:trash-bin-outline',
|
|
175
|
-
action: (
|
|
175
|
+
action: (_e) => __awaiter(this, [_e], void 0, function* ({ selectedIds }) {
|
|
176
176
|
const connector = this.connectors[res.dataSource];
|
|
177
177
|
yield Promise.all(selectedIds.map((recordId) => __awaiter(this, void 0, void 0, function* () {
|
|
178
178
|
yield connector.deleteRecord({ resource: res, recordId });
|
|
@@ -343,6 +343,7 @@ class AdminForth {
|
|
|
343
343
|
method: 'POST',
|
|
344
344
|
path: '/login',
|
|
345
345
|
handler: (_b) => __awaiter(this, [_b], void 0, function* ({ body, response }) {
|
|
346
|
+
var _c;
|
|
346
347
|
const INVALID_MESSAGE = 'Invalid username or password';
|
|
347
348
|
const { username, password } = body;
|
|
348
349
|
let token;
|
|
@@ -355,7 +356,7 @@ class AdminForth {
|
|
|
355
356
|
throw new Error('No config.auth defined');
|
|
356
357
|
}
|
|
357
358
|
const userResource = this.config.resources.find((res) => res.resourceId === this.config.auth.resourceId);
|
|
358
|
-
const userRecord = yield this.connectors[userResource.dataSource].getData({
|
|
359
|
+
const userRecord = (_c = (yield this.connectors[userResource.dataSource].getData({
|
|
359
360
|
resource: userResource,
|
|
360
361
|
filters: [
|
|
361
362
|
{ field: this.config.auth.usernameField, operator: AdminForthFilterOperators.EQ, value: username },
|
|
@@ -363,7 +364,7 @@ class AdminForth {
|
|
|
363
364
|
limit: 1,
|
|
364
365
|
offset: 0,
|
|
365
366
|
sort: [],
|
|
366
|
-
}).data[0];
|
|
367
|
+
})).data) === null || _c === void 0 ? void 0 : _c[0];
|
|
367
368
|
if (!userRecord) {
|
|
368
369
|
return { error: 'User not found' };
|
|
369
370
|
}
|
|
@@ -387,7 +388,7 @@ class AdminForth {
|
|
|
387
388
|
noAuth: true,
|
|
388
389
|
method: 'POST',
|
|
389
390
|
path: '/logout',
|
|
390
|
-
handler: (
|
|
391
|
+
handler: (_d) => __awaiter(this, [_d], void 0, function* ({ response }) {
|
|
391
392
|
response.setHeader('Set-Cookie', `adminforth_jwt=; Path=${this.config.baseUrl || '/'}; HttpOnly; SameSite=Strict; Expires=Thu, 01 Jan 1970 00:00:00 GMT`);
|
|
392
393
|
return { ok: true };
|
|
393
394
|
}),
|
|
@@ -396,8 +397,8 @@ class AdminForth {
|
|
|
396
397
|
noAuth: true,
|
|
397
398
|
method: 'GET',
|
|
398
399
|
path: '/get_public_config',
|
|
399
|
-
handler: (
|
|
400
|
-
var
|
|
400
|
+
handler: (_e) => __awaiter(this, [_e], void 0, function* ({ body }) {
|
|
401
|
+
var _f;
|
|
401
402
|
// find resource
|
|
402
403
|
if (!this.config.auth) {
|
|
403
404
|
throw new Error('No config.auth defined');
|
|
@@ -409,15 +410,15 @@ class AdminForth {
|
|
|
409
410
|
brandName: this.config.customization.brandName,
|
|
410
411
|
usernameFieldName: usernameColumn.label,
|
|
411
412
|
loginBackgroundImage: this.config.auth.loginBackgroundImage,
|
|
412
|
-
title: (
|
|
413
|
+
title: (_f = this.config.customization) === null || _f === void 0 ? void 0 : _f.title,
|
|
413
414
|
};
|
|
414
415
|
}),
|
|
415
416
|
});
|
|
416
417
|
server.endpoint({
|
|
417
418
|
method: 'GET',
|
|
418
419
|
path: '/get_base_config',
|
|
419
|
-
handler: (
|
|
420
|
-
var
|
|
420
|
+
handler: (_g) => __awaiter(this, [_g], void 0, function* ({ input, adminUser, cookies }) {
|
|
421
|
+
var _h, _j;
|
|
421
422
|
const cookieParsed = this.auth.verify(cookies['adminforth_jwt']);
|
|
422
423
|
let username = '';
|
|
423
424
|
let userFullName = '';
|
|
@@ -459,7 +460,8 @@ class AdminForth {
|
|
|
459
460
|
deleteConfirmation: this.config.deleteConfirmation,
|
|
460
461
|
auth: this.config.auth,
|
|
461
462
|
usernameField: this.config.auth.usernameField,
|
|
462
|
-
title: (
|
|
463
|
+
title: (_h = this.config.customization) === null || _h === void 0 ? void 0 : _h.title,
|
|
464
|
+
emtyFieldPlaceholder: (_j = this.config.customization) === null || _j === void 0 ? void 0 : _j.emtyFieldPlaceholder,
|
|
463
465
|
},
|
|
464
466
|
adminUser,
|
|
465
467
|
version: ADMINFORTH_VERSION,
|
|
@@ -469,7 +471,7 @@ class AdminForth {
|
|
|
469
471
|
server.endpoint({
|
|
470
472
|
method: 'POST',
|
|
471
473
|
path: '/get_resource_columns',
|
|
472
|
-
handler: (
|
|
474
|
+
handler: (_k) => __awaiter(this, [_k], void 0, function* ({ body }) {
|
|
473
475
|
const { resourceId } = body;
|
|
474
476
|
if (!this.statuses.dbDiscover) {
|
|
475
477
|
return { error: 'Database discovery not started' };
|
|
@@ -488,8 +490,8 @@ class AdminForth {
|
|
|
488
490
|
server.endpoint({
|
|
489
491
|
method: 'POST',
|
|
490
492
|
path: '/get_resource_data',
|
|
491
|
-
handler: (
|
|
492
|
-
var
|
|
493
|
+
handler: (_l) => __awaiter(this, [_l], void 0, function* ({ body, adminUser }) {
|
|
494
|
+
var _m, _o, _p, _q;
|
|
493
495
|
const { resourceId, source } = body;
|
|
494
496
|
if (['show', 'list'].includes(source) === false) {
|
|
495
497
|
return { error: 'Invalid source, should be list or show' };
|
|
@@ -504,7 +506,7 @@ class AdminForth {
|
|
|
504
506
|
if (!resource) {
|
|
505
507
|
return { error: `Resource ${resourceId} not found` };
|
|
506
508
|
}
|
|
507
|
-
for (const hook of getFunctionList((
|
|
509
|
+
for (const hook of getFunctionList((_o = (_m = resource.hooks) === null || _m === void 0 ? void 0 : _m[source]) === null || _o === void 0 ? void 0 : _o.beforeDatasourceRequest)) {
|
|
508
510
|
const resp = yield hook({ resource, query: body, adminUser });
|
|
509
511
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
510
512
|
throw new Error(`Hook must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -571,7 +573,7 @@ class AdminForth {
|
|
|
571
573
|
item[col.name] = targetDataMap[item[col.name]];
|
|
572
574
|
});
|
|
573
575
|
})));
|
|
574
|
-
for (const hook of getFunctionList((
|
|
576
|
+
for (const hook of getFunctionList((_q = (_p = resource.hooks) === null || _p === void 0 ? void 0 : _p[source]) === null || _q === void 0 ? void 0 : _q.afterDatasourceResponse)) {
|
|
575
577
|
const resp = yield hook({ resource, response: data.data, adminUser });
|
|
576
578
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
577
579
|
throw new Error(`Hook must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -597,8 +599,8 @@ class AdminForth {
|
|
|
597
599
|
server.endpoint({
|
|
598
600
|
method: 'POST',
|
|
599
601
|
path: '/get_resource_foreign_data',
|
|
600
|
-
handler: (
|
|
601
|
-
var
|
|
602
|
+
handler: (_r) => __awaiter(this, [_r], void 0, function* ({ body, adminUser }) {
|
|
603
|
+
var _s, _t, _u, _v;
|
|
602
604
|
const { resourceId, column } = body;
|
|
603
605
|
if (!this.statuses.dbDiscover) {
|
|
604
606
|
return { error: 'Database discovery not started' };
|
|
@@ -619,7 +621,7 @@ class AdminForth {
|
|
|
619
621
|
}
|
|
620
622
|
const targetResourceId = columnConfig.foreignResource.resourceId;
|
|
621
623
|
const targetResource = this.config.resources.find((res) => res.resourceId == targetResourceId);
|
|
622
|
-
for (const hook of getFunctionList((
|
|
624
|
+
for (const hook of getFunctionList((_t = (_s = columnConfig.foreignResource.hooks) === null || _s === void 0 ? void 0 : _s.dropdownList) === null || _t === void 0 ? void 0 : _t.beforeDatasourceRequest)) {
|
|
623
625
|
const resp = yield hook({ query: body, adminUser });
|
|
624
626
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
625
627
|
throw new Error(`Hook must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -648,7 +650,7 @@ class AdminForth {
|
|
|
648
650
|
const response = {
|
|
649
651
|
items
|
|
650
652
|
};
|
|
651
|
-
for (const hook of getFunctionList((
|
|
653
|
+
for (const hook of getFunctionList((_v = (_u = columnConfig.foreignResource.hooks) === null || _u === void 0 ? void 0 : _u.dropdownList) === null || _v === void 0 ? void 0 : _v.afterDatasourceResponse)) {
|
|
652
654
|
const resp = yield hook({ response, adminUser });
|
|
653
655
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
654
656
|
throw new Error(`Hook must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -663,7 +665,7 @@ class AdminForth {
|
|
|
663
665
|
server.endpoint({
|
|
664
666
|
method: 'POST',
|
|
665
667
|
path: '/get_min_max_for_columns',
|
|
666
|
-
handler: (
|
|
668
|
+
handler: (_w) => __awaiter(this, [_w], void 0, function* ({ body }) {
|
|
667
669
|
const { resourceId } = body;
|
|
668
670
|
if (!this.statuses.dbDiscover) {
|
|
669
671
|
return { error: 'Database discovery not started' };
|
|
@@ -692,8 +694,8 @@ class AdminForth {
|
|
|
692
694
|
server.endpoint({
|
|
693
695
|
method: 'POST',
|
|
694
696
|
path: '/create_record',
|
|
695
|
-
handler: (
|
|
696
|
-
var
|
|
697
|
+
handler: (_x) => __awaiter(this, [_x], void 0, function* ({ body, adminUser }) {
|
|
698
|
+
var _y, _z, _0, _1, _2;
|
|
697
699
|
console.log('create_record', body, this.config.resources);
|
|
698
700
|
const resource = this.config.resources.find((res) => res.resourceId == body['resourceId']);
|
|
699
701
|
if (!resource) {
|
|
@@ -701,7 +703,7 @@ class AdminForth {
|
|
|
701
703
|
}
|
|
702
704
|
const record = body['record'];
|
|
703
705
|
// execute hook if needed
|
|
704
|
-
for (const hook of getFunctionList((
|
|
706
|
+
for (const hook of getFunctionList((_z = (_y = resource.hooks) === null || _y === void 0 ? void 0 : _y.create) === null || _z === void 0 ? void 0 : _z.beforeSave)) {
|
|
705
707
|
const resp = yield hook({ resource, record, adminUser });
|
|
706
708
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
707
709
|
throw new Error(`Hook beforeSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -718,7 +720,7 @@ class AdminForth {
|
|
|
718
720
|
});
|
|
719
721
|
}
|
|
720
722
|
}
|
|
721
|
-
if (((
|
|
723
|
+
if (((_0 = column.required) === null || _0 === void 0 ? void 0 : _0.create) && body['record'][column.name] === undefined) {
|
|
722
724
|
return { error: `Column '${column.name}' is required` };
|
|
723
725
|
}
|
|
724
726
|
if (column.isUnique) {
|
|
@@ -743,7 +745,7 @@ class AdminForth {
|
|
|
743
745
|
const connector = this.connectors[resource.dataSource];
|
|
744
746
|
yield connector.createRecord({ resource, record });
|
|
745
747
|
// execute hook if needed
|
|
746
|
-
for (const hook of getFunctionList((
|
|
748
|
+
for (const hook of getFunctionList((_2 = (_1 = resource.hooks) === null || _1 === void 0 ? void 0 : _1.create) === null || _2 === void 0 ? void 0 : _2.afterSave)) {
|
|
747
749
|
const resp = yield hook({ resource, record, adminUser });
|
|
748
750
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
749
751
|
throw new Error(`Hook afterSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -760,8 +762,8 @@ class AdminForth {
|
|
|
760
762
|
server.endpoint({
|
|
761
763
|
method: 'POST',
|
|
762
764
|
path: '/update_record',
|
|
763
|
-
handler: (
|
|
764
|
-
var
|
|
765
|
+
handler: (_3) => __awaiter(this, [_3], void 0, function* ({ body, adminUser }) {
|
|
766
|
+
var _4, _5, _6, _7;
|
|
765
767
|
const resource = this.config.resources.find((res) => res.resourceId == body['resourceId']);
|
|
766
768
|
if (!resource) {
|
|
767
769
|
return { error: `Resource '${body['resourceId']}' not found` };
|
|
@@ -775,7 +777,7 @@ class AdminForth {
|
|
|
775
777
|
}
|
|
776
778
|
const record = body['record'];
|
|
777
779
|
// execute hook if needed
|
|
778
|
-
for (const hook of getFunctionList((
|
|
780
|
+
for (const hook of getFunctionList((_5 = (_4 = resource.hooks) === null || _4 === void 0 ? void 0 : _4.edit) === null || _5 === void 0 ? void 0 : _5.beforeSave)) {
|
|
779
781
|
const resp = yield hook({ resource, record, adminUser });
|
|
780
782
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
781
783
|
throw new Error(`Hook beforeSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -803,7 +805,7 @@ class AdminForth {
|
|
|
803
805
|
yield connector.updateRecord({ resource, recordId, record, newValues });
|
|
804
806
|
}
|
|
805
807
|
// execute hook if needed
|
|
806
|
-
for (const hook of getFunctionList((
|
|
808
|
+
for (const hook of getFunctionList((_7 = (_6 = resource.hooks) === null || _6 === void 0 ? void 0 : _6.edit) === null || _7 === void 0 ? void 0 : _7.afterSave)) {
|
|
807
809
|
const resp = yield hook({ resource, record, adminUser });
|
|
808
810
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
809
811
|
throw new Error(`Hook afterSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -820,15 +822,15 @@ class AdminForth {
|
|
|
820
822
|
server.endpoint({
|
|
821
823
|
method: 'POST',
|
|
822
824
|
path: '/delete_record',
|
|
823
|
-
handler: (
|
|
824
|
-
var
|
|
825
|
+
handler: (_8) => __awaiter(this, [_8], void 0, function* ({ body, adminUser }) {
|
|
826
|
+
var _9, _10, _11, _12;
|
|
825
827
|
const resource = this.config.resources.find((res) => res.resourceId == body['resourceId']);
|
|
826
828
|
const record = yield this.connectors[resource.dataSource].getRecordByPrimaryKey(resource, body['primaryKey']);
|
|
827
829
|
if (!resource) {
|
|
828
830
|
return { error: `Resource '${body['resourceId']}' not found` };
|
|
829
831
|
}
|
|
830
832
|
// execute hook if needed
|
|
831
|
-
for (const hook of getFunctionList((
|
|
833
|
+
for (const hook of getFunctionList((_10 = (_9 = resource.hooks) === null || _9 === void 0 ? void 0 : _9.delete) === null || _10 === void 0 ? void 0 : _10.beforeSave)) {
|
|
832
834
|
const resp = yield hook({ resource, record, adminUser });
|
|
833
835
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
834
836
|
throw new Error(`Hook beforeSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -840,7 +842,7 @@ class AdminForth {
|
|
|
840
842
|
const connector = this.connectors[resource.dataSource];
|
|
841
843
|
yield connector.deleteRecord({ resource, recordId: body['primaryKey'] });
|
|
842
844
|
// execute hook if needed
|
|
843
|
-
for (const hook of getFunctionList((
|
|
845
|
+
for (const hook of getFunctionList((_12 = (_11 = resource.hooks) === null || _11 === void 0 ? void 0 : _11.delete) === null || _12 === void 0 ? void 0 : _12.afterSave)) {
|
|
844
846
|
const resp = yield hook({ resource, record, adminUser });
|
|
845
847
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
846
848
|
throw new Error(`Hook afterSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -857,7 +859,7 @@ class AdminForth {
|
|
|
857
859
|
server.endpoint({
|
|
858
860
|
method: 'POST',
|
|
859
861
|
path: '/start_bulk_action',
|
|
860
|
-
handler: (
|
|
862
|
+
handler: (_13) => __awaiter(this, [_13], void 0, function* ({ body }) {
|
|
861
863
|
const { resourceId, actionId, recordIds } = body;
|
|
862
864
|
const resource = this.config.resources.find((res) => res.resourceId == resourceId);
|
|
863
865
|
if (!resource) {
|
|
@@ -205,8 +205,8 @@
|
|
|
205
205
|
:row="row"
|
|
206
206
|
/>
|
|
207
207
|
</td>
|
|
208
|
-
<td class="
|
|
209
|
-
|
|
208
|
+
<td class=" items-center px-6 py-4">
|
|
209
|
+
<div class="flex">
|
|
210
210
|
<RouterLink
|
|
211
211
|
:to="{ name: 'resource-show', params: { resourceId: $route.params.resourceId, primaryKey: row._primaryKeyValue } }"
|
|
212
212
|
class="font-medium text-blue-600 dark:text-blue-500 hover:underline"
|
|
@@ -251,6 +251,7 @@
|
|
|
251
251
|
Delete
|
|
252
252
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
253
253
|
</div>
|
|
254
|
+
</div>
|
|
254
255
|
</td>
|
|
255
256
|
</tr>
|
|
256
257
|
</tbody>
|
package/index.ts
CHANGED
|
@@ -206,7 +206,7 @@ class AdminForth {
|
|
|
206
206
|
errors.push(`Resource "${res.resourceId}" bulkActions must be an array`);
|
|
207
207
|
bulkActions = [];
|
|
208
208
|
}
|
|
209
|
-
if(res.options?.
|
|
209
|
+
if(res.options?.allowedActions?.delete && !bulkActions.find((action) => action.label === 'Delete checked')){
|
|
210
210
|
bulkActions.push({
|
|
211
211
|
label: `Delete checked`,
|
|
212
212
|
state: 'danger',
|
|
@@ -422,15 +422,17 @@ class AdminForth {
|
|
|
422
422
|
throw new Error('No config.auth defined');
|
|
423
423
|
}
|
|
424
424
|
const userResource = this.config.resources.find((res) => res.resourceId === this.config.auth.resourceId);
|
|
425
|
-
const userRecord =
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
425
|
+
const userRecord = (
|
|
426
|
+
await this.connectors[userResource.dataSource].getData({
|
|
427
|
+
resource: userResource,
|
|
428
|
+
filters: [
|
|
429
|
+
{ field: this.config.auth.usernameField, operator: AdminForthFilterOperators.EQ, value: username },
|
|
430
|
+
],
|
|
431
|
+
limit: 1,
|
|
432
|
+
offset: 0,
|
|
433
|
+
sort: [],
|
|
434
|
+
})
|
|
435
|
+
).data?.[0];
|
|
434
436
|
|
|
435
437
|
if (!userRecord) {
|
|
436
438
|
return { error: 'User not found' };
|
|
@@ -532,6 +534,7 @@ class AdminForth {
|
|
|
532
534
|
auth: this.config.auth,
|
|
533
535
|
usernameField: this.config.auth.usernameField,
|
|
534
536
|
title: this.config.customization?.title,
|
|
537
|
+
emtyFieldPlaceholder: this.config.customization?.emtyFieldPlaceholder,
|
|
535
538
|
},
|
|
536
539
|
adminUser,
|
|
537
540
|
version: ADMINFORTH_VERSION,
|
package/package.json
CHANGED
|
@@ -205,8 +205,8 @@
|
|
|
205
205
|
:row="row"
|
|
206
206
|
/>
|
|
207
207
|
</td>
|
|
208
|
-
<td class="
|
|
209
|
-
|
|
208
|
+
<td class=" items-center px-6 py-4">
|
|
209
|
+
<div class="flex">
|
|
210
210
|
<RouterLink
|
|
211
211
|
:to="{ name: 'resource-show', params: { resourceId: $route.params.resourceId, primaryKey: row._primaryKeyValue } }"
|
|
212
212
|
class="font-medium text-blue-600 dark:text-blue-500 hover:underline"
|
|
@@ -251,6 +251,7 @@
|
|
|
251
251
|
Delete
|
|
252
252
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
253
253
|
</div>
|
|
254
|
+
</div>
|
|
254
255
|
</td>
|
|
255
256
|
</tr>
|
|
256
257
|
</tbody>
|
|
@@ -81,7 +81,6 @@ export type AdminForthResource = {
|
|
|
81
81
|
id?: string,
|
|
82
82
|
}>,
|
|
83
83
|
allowedActions?: AllowedActions,
|
|
84
|
-
allowDelete?: boolean,
|
|
85
84
|
listPageSize?: number,
|
|
86
85
|
},
|
|
87
86
|
}
|
|
@@ -115,6 +114,12 @@ export type AdminForthConfig = {
|
|
|
115
114
|
datesFormat?: string,
|
|
116
115
|
title?: string,
|
|
117
116
|
brandLogo?: string,
|
|
117
|
+
emtyFieldPlaceholder?: {
|
|
118
|
+
show?: string,
|
|
119
|
+
list?: string,
|
|
120
|
+
create?: string,
|
|
121
|
+
edit?: string,
|
|
122
|
+
},
|
|
118
123
|
},
|
|
119
124
|
baseUrl?: string,
|
|
120
125
|
|