@headless-adminapp/fluent 0.0.17-alpha.28 → 0.0.17-alpha.29

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.
@@ -44,8 +44,8 @@ function SectionContainer({ section }) {
44
44
  return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelPosition: section.labelPosition, required: attribute.required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(Control, { attribute: attribute, name: control.attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur, errorMessage: errorMessage, isError: isError, disabled: readonly, label: label, placeholder: label, allowNavigation: true, allowNewRecord: true, fileServiceContext: {
45
45
  type: 'entity-form',
46
46
  recordId,
47
- logicalName: control.attributeName,
48
- schemaLogicalName: schema.logicalName,
47
+ attributeName: control.attributeName,
48
+ logicalName: schema.logicalName,
49
49
  } }) }));
50
50
  } }, control.attributeName) }, control.attributeName));
51
51
  }
@@ -18,6 +18,7 @@ const icons_1 = require("@headless-adminapp/icons");
18
18
  const react_query_1 = require("@tanstack/react-query");
19
19
  const react_1 = require("react");
20
20
  function useAttachmentSelector({ fileService, fileServiceContext, location, onChange, }) {
21
+ const openErrorDialog = (0, hooks_1.useOpenErrorDialog)();
21
22
  const { isPending, mutate: handleFile } = (0, react_query_1.useMutation)({
22
23
  mutationFn: (file) => __awaiter(this, void 0, void 0, function* () {
23
24
  if (location === 'local') {
@@ -33,6 +34,13 @@ function useAttachmentSelector({ fileService, fileServiceContext, location, onCh
33
34
  onSuccess: (fileObject) => {
34
35
  onChange === null || onChange === void 0 ? void 0 : onChange(fileObject);
35
36
  },
37
+ onError: (error) => {
38
+ console.error(error);
39
+ openErrorDialog({
40
+ title: 'Failed to upload file',
41
+ text: error.message,
42
+ });
43
+ },
36
44
  });
37
45
  const selectFile = (accept) => {
38
46
  const input = document.createElement('input');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "0.0.17-alpha.28",
3
+ "version": "0.0.17-alpha.29",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -47,5 +47,5 @@
47
47
  "uuid": "11.0.3",
48
48
  "yup": "^1.4.0"
49
49
  },
50
- "gitHead": "e25bcf7611efad55ef448866d149ff5e5d19cd64"
50
+ "gitHead": "85977e78c12fe81f708b974c32c8089e9184f553"
51
51
  }