adminforth 1.3.53 → 1.3.54-next.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/index.js CHANGED
@@ -137,6 +137,15 @@ class AdminForth {
137
137
  }
138
138
  getUserByPk(pk) {
139
139
  return __awaiter(this, void 0, void 0, function* () {
140
+ // if database discovery is not done, throw
141
+ if (this.statuses.dbDiscover !== 'done') {
142
+ if (this.statuses.dbDiscover === 'running') {
143
+ throw new Error('Database discovery is running. You can\'t use data API while database discovery is not finished.\n' +
144
+ 'Consider moving your code to a place where it will be executed after database discovery is already done (after await admin.discoverDatabases())');
145
+ }
146
+ throw new Error('Database discovery is not yet started. You can\'t use data API before database discovery is done. \n' +
147
+ 'Call admin.discoverDatabases() first and await it before using data API');
148
+ }
140
149
  const resource = this.config.resources.find((res) => res.resourceId === this.config.auth.usersResourceId);
141
150
  if (!resource) {
142
151
  const similar = suggestIfTypo(this.config.resources.map((res) => res.resourceId), this.config.auth.usersResourceId);
package/index.ts CHANGED
@@ -197,6 +197,16 @@ class AdminForth implements IAdminForth {
197
197
  }
198
198
 
199
199
  async getUserByPk(pk: string) {
200
+ // if database discovery is not done, throw
201
+ if (this.statuses.dbDiscover !== 'done') {
202
+ if (this.statuses.dbDiscover === 'running') {
203
+ throw new Error('Database discovery is running. You can\'t use data API while database discovery is not finished.\n'+
204
+ 'Consider moving your code to a place where it will be executed after database discovery is already done (after await admin.discoverDatabases())');
205
+ }
206
+ throw new Error('Database discovery is not yet started. You can\'t use data API before database discovery is done. \n'+
207
+ 'Call admin.discoverDatabases() first and await it before using data API');
208
+ }
209
+
200
210
  const resource = this.config.resources.find((res) => res.resourceId === this.config.auth.usersResourceId);
201
211
  if (!resource) {
202
212
  const similar = suggestIfTypo(this.config.resources.map((res) => res.resourceId), this.config.auth.usersResourceId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.3.53",
3
+ "version": "1.3.54-next.1",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div class="relative">
3
3
  <component
4
+ v-if="!loading"
4
5
  v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.beforeBreadcrumbs || []"
5
6
  :is="getCustomComponent(c)"
6
7
  :meta="c.meta"
@@ -103,6 +104,7 @@
103
104
  </div>
104
105
 
105
106
  <component
107
+ v-if="!loading"
106
108
  v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.bottom || []"
107
109
  :is="getCustomComponent(c)"
108
110
  :meta="c.meta"