adminforth 2.4.0-next.70 → 2.4.0-next.72
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/commands/createCustomComponent/configLoader.js +3 -0
- package/dist/spa/src/App.vue +3 -3
- package/dist/spa/src/types/Back.ts +5 -5
- package/dist/spa/src/views/CreateView.vue +1 -1
- package/dist/spa/src/views/EditView.vue +1 -1
- package/dist/spa/src/views/ResourceParent.vue +1 -1
- package/dist/types/Back.d.ts +5 -5
- package/package.json +1 -1
|
@@ -2,7 +2,10 @@ import fs from 'fs/promises';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import jiti from 'jiti';
|
|
5
|
+
import dotenv from "dotenv";
|
|
5
6
|
|
|
7
|
+
dotenv.config({ path: '.env.local', override: true });
|
|
8
|
+
dotenv.config({ path: '.env', override: true });
|
|
6
9
|
|
|
7
10
|
export async function loadAdminForthConfig() {
|
|
8
11
|
const configFileName = 'index.ts';
|
package/dist/spa/src/App.vue
CHANGED
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
aria-label="Sidebar"
|
|
78
78
|
>
|
|
79
79
|
<div class="h-full px-3 pb-4 overflow-y-auto bg-lightSidebar dark:bg-darkSidebar border-r border-lightSidebarBorder dark:border-darkSidebarBorder">
|
|
80
|
-
<div class="flex ms-2 m-4">
|
|
81
|
-
<img :src="loadFile(coreStore.config?.brandLogo || '@/assets/logo.svg')" :alt="`${ coreStore.config?.brandName } Logo`" class="h-8 me-3" />
|
|
80
|
+
<div class="af-logo-title-wrapper flex ms-2 m-4">
|
|
81
|
+
<img :src="loadFile(coreStore.config?.brandLogo || '@/assets/logo.svg')" :alt="`${ coreStore.config?.brandName } Logo`" class="af-logo h-8 me-3" />
|
|
82
82
|
<span
|
|
83
83
|
v-if="coreStore.config?.showBrandNameInSidebar"
|
|
84
|
-
class="self-center text-lightNavbarText-size font-semibold sm:text-lightNavbarText-size whitespace-nowrap dark:text-darkSidebarText text-lightSidebarText"
|
|
84
|
+
class="af-title self-center text-lightNavbarText-size font-semibold sm:text-lightNavbarText-size whitespace-nowrap dark:text-darkSidebarText text-lightSidebarText"
|
|
85
85
|
>
|
|
86
86
|
{{ coreStore.config?.brandName }}
|
|
87
87
|
</span>
|
|
@@ -1346,13 +1346,13 @@ export interface AdminForthResource extends Omit<AdminForthResourceInput, 'optio
|
|
|
1346
1346
|
},
|
|
1347
1347
|
create?: {
|
|
1348
1348
|
/**
|
|
1349
|
-
* Should return ok: true to continue saving pipeline and allow creating record in database, and ok: false to interrupt pipeline and prevent record creation.
|
|
1350
|
-
* If you need to show error on UI, set error:
|
|
1349
|
+
* Should return `ok: true` to continue saving pipeline and allow creating record in database, and `ok: false` to interrupt pipeline and prevent record creation.
|
|
1350
|
+
* If you need to show error on UI, set `error: \<error message\>` in response.
|
|
1351
1351
|
*
|
|
1352
1352
|
* Typical use-cases:
|
|
1353
|
-
* - Create record by custom code (return
|
|
1354
|
-
* - Validate record before saving to database and interrupt execution if validation failed (return `{ok: false, error: <validation error>}`), though `allowedActions.create` should be preferred in most cases
|
|
1355
|
-
* - fill-in adminUser as creator of record (set record.<some field> = x; return {ok: true})
|
|
1353
|
+
* - Create record by custom code (return `{ ok: false, newRecordId: <id of created record from custom code> }`)
|
|
1354
|
+
* - Validate record before saving to database and interrupt execution if validation failed (return `{ ok: false, error: <validation error> }`), though `allowedActions.create` should be preferred in most cases
|
|
1355
|
+
* - fill-in adminUser as creator of record (set `record.<some field> = x; return \{ ok: true \}`)
|
|
1356
1356
|
* - Attach additional data to record before saving to database (mostly fillOnCreate should be used instead)
|
|
1357
1357
|
*/
|
|
1358
1358
|
beforeSave?: Array<BeforeCreateSaveFunction>,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :key="`${$route?.params.resourceId}---${$route?.params.primaryKey}`" class="p-4 flex"
|
|
2
|
+
<div :key="`${$route?.params.resourceId}---${$route?.params.primaryKey}`" class="af-resource-parent p-4 flex"
|
|
3
3
|
:class="limitHeightToPage ? 'h-[calc(100dvh-3.5rem)]': undefined"
|
|
4
4
|
>
|
|
5
5
|
<RouterView/>
|
package/dist/types/Back.d.ts
CHANGED
|
@@ -1191,13 +1191,13 @@ export interface AdminForthResource extends Omit<AdminForthResourceInput, 'optio
|
|
|
1191
1191
|
};
|
|
1192
1192
|
create?: {
|
|
1193
1193
|
/**
|
|
1194
|
-
* Should return ok: true to continue saving pipeline and allow creating record in database, and ok: false to interrupt pipeline and prevent record creation.
|
|
1195
|
-
* If you need to show error on UI, set error:
|
|
1194
|
+
* Should return `ok: true` to continue saving pipeline and allow creating record in database, and `ok: false` to interrupt pipeline and prevent record creation.
|
|
1195
|
+
* If you need to show error on UI, set `error: \<error message\>` in response.
|
|
1196
1196
|
*
|
|
1197
1197
|
* Typical use-cases:
|
|
1198
|
-
* - Create record by custom code (return
|
|
1199
|
-
* - Validate record before saving to database and interrupt execution if validation failed (return `{ok: false, error: <validation error>}`), though `allowedActions.create` should be preferred in most cases
|
|
1200
|
-
* - fill-in adminUser as creator of record (set record.<some field> = x; return {ok: true})
|
|
1198
|
+
* - Create record by custom code (return `{ ok: false, newRecordId: <id of created record from custom code> }`)
|
|
1199
|
+
* - Validate record before saving to database and interrupt execution if validation failed (return `{ ok: false, error: <validation error> }`), though `allowedActions.create` should be preferred in most cases
|
|
1200
|
+
* - fill-in adminUser as creator of record (set `record.<some field> = x; return \{ ok: true \}`)
|
|
1201
1201
|
* - Attach additional data to record before saving to database (mostly fillOnCreate should be used instead)
|
|
1202
1202
|
*/
|
|
1203
1203
|
beforeSave?: Array<BeforeCreateSaveFunction>;
|