@headless-adminapp/app 0.0.17-alpha.35 → 0.0.17-alpha.39

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.
@@ -40,7 +40,7 @@ function useLoadFormGridPage(logicalName, formId) {
40
40
  loading: false,
41
41
  error: true,
42
42
  title: 'Schema not found',
43
- message: 'The schema was not found',
43
+ message: `The schema "${logicalName}" was not found`,
44
44
  };
45
45
  }
46
46
  if (!form) {
@@ -15,7 +15,7 @@ function useLoadMainGridPage(logicalName, viewId) {
15
15
  loading: false,
16
16
  error: true,
17
17
  title: 'Schema not found',
18
- message: 'The schema was not found',
18
+ message: `The schema "${logicalName}" was not found`,
19
19
  };
20
20
  }
21
21
  if (!view) {
@@ -1,2 +1,2 @@
1
1
  import { SchemaAttributes } from '@headless-adminapp/core/schema';
2
- export declare function useSchema<S extends SchemaAttributes = SchemaAttributes>(logicalName: string): import("@headless-adminapp/core/schema").Schema<S>;
2
+ export declare function useSchema<S extends SchemaAttributes = SchemaAttributes>(logicalName: string): import("@headless-adminapp/core/schema").Schema<S> | null;
@@ -4,5 +4,8 @@ exports.useSchema = useSchema;
4
4
  const useMetadata_1 = require("./useMetadata");
5
5
  function useSchema(logicalName) {
6
6
  const { schemaStore } = (0, useMetadata_1.useMetadata)();
7
+ if (!schemaStore.hasSchema(logicalName)) {
8
+ return null;
9
+ }
7
10
  return schemaStore.getSchema(logicalName);
8
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/app",
3
- "version": "0.0.17-alpha.35",
3
+ "version": "0.0.17-alpha.39",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -39,5 +39,5 @@
39
39
  "react-hook-form": "7.52.2",
40
40
  "yup": "^1.4.0"
41
41
  },
42
- "gitHead": "2250994fad501c28490b8167c7fca8141323e2b3"
42
+ "gitHead": "2bfa7d267f5fa6beb476fda508c43661444dc894"
43
43
  }
@@ -19,7 +19,7 @@ const defaultCurrency = 'USD';
19
19
  const defaultCurrencySign = 'accounting';
20
20
  const defaultCurrencyDisplay = 'symbol';
21
21
  function getAttributeFormattedValue(attribute, value, options) {
22
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
22
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
23
23
  if (value === null || value === undefined) {
24
24
  return null;
25
25
  }
@@ -91,6 +91,8 @@ function getAttributeFormattedValue(attribute, value, options) {
91
91
  }).format(value);
92
92
  case 'number':
93
93
  return new Intl.NumberFormat(locale).format(value);
94
+ case 'attachment':
95
+ return (_k = value === null || value === void 0 ? void 0 : value.url) !== null && _k !== void 0 ? _k : null;
94
96
  default:
95
97
  return typeof value === 'object'
96
98
  ? JSON.stringify(value)