adminforth 1.2.85 → 1.2.87

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.
@@ -149,7 +149,8 @@ export default class ConfigValidator {
149
149
  };
150
150
  }
151
151
  res.resourceId = res.resourceId || res.table;
152
- res.label = res.label || res.table.charAt(0).toUpperCase() + res.table.slice(1);
152
+ // as fallback value, capitalize and then replace _ with space
153
+ res.label = res.label || res.resourceId.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase());
153
154
  if (!res.dataSource) {
154
155
  errors.push(`Resource "${res.resourceId}" is missing dataSource`);
155
156
  }
@@ -162,7 +162,8 @@ export default class ConfigValidator implements IConfigValidator {
162
162
 
163
163
 
164
164
  res.resourceId = res.resourceId || res.table;
165
- res.label = res.label || res.table.charAt(0).toUpperCase() + res.table.slice(1);
165
+ // as fallback value, capitalize and then replace _ with space
166
+ res.label = res.label || res.resourceId.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase());
166
167
  if (!res.dataSource) {
167
168
  errors.push(`Resource "${res.resourceId}" is missing dataSource`);
168
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.2.85",
3
+ "version": "1.2.87",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",