@blaze-cms/plugin-data-ui 0.127.0 → 0.127.3

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/components/EntityDataListing/EntityDataListing.js +4 -4
  3. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  4. package/lib/components/EntityDataListing/index.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/Entity.js +166 -172
  6. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  7. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +26 -28
  9. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  11. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  12. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +77 -83
  13. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  14. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  15. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +40 -42
  16. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  17. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +31 -33
  18. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  19. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  20. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  21. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  22. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +40 -42
  23. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  24. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  25. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +43 -45
  26. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  27. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  28. package/lib/components/EntityManager/EntityManager.js +65 -69
  29. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  30. package/lib/components/EntityManager/index.js.map +1 -1
  31. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  32. package/lib/components/EntityManager/utils/entity.js +10 -12
  33. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  34. package/lib/components/EntityManager/utils/entityAvailableActions.js +62 -66
  35. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  36. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  37. package/lib/components/EntityManager/utils/query.js.map +1 -1
  38. package/lib/components/ListingTable/ListingTable.js +121 -129
  39. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  40. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  41. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  42. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  43. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  44. package/lib/components/ListingTable/index.js.map +1 -1
  45. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  46. package/lib/components/ListingTable/service/index.js +17 -19
  47. package/lib/components/ListingTable/service/index.js.map +1 -1
  48. package/lib/components/Tabs/index.js.map +1 -1
  49. package/lib/constants.js.map +1 -1
  50. package/lib/index.js +56 -60
  51. package/lib/index.js.map +1 -1
  52. package/lib/utils/add-content-menu-items.js +25 -27
  53. package/lib/utils/add-content-menu-items.js.map +1 -1
  54. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  55. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  56. package/lib/utils/build-listing-query.js.map +1 -1
  57. package/lib/utils/build-update-data-query.js.map +1 -1
  58. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  59. package/lib/utils/get-default-query-params.js.map +1 -1
  60. package/lib/utils/hoc/withContext.js.map +1 -1
  61. package/lib/utils/hooks/useToggle.js.map +1 -1
  62. package/lib/utils/index.js.map +1 -1
  63. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  64. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  65. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  66. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  67. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  68. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  69. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  70. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  71. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  72. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  73. package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
  74. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  75. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  76. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  77. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  78. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  79. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
  80. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  81. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  82. package/lib-es/components/Tabs/index.js.map +1 -1
  83. package/lib-es/index.js.map +1 -1
  84. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  85. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  86. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  87. package/lib-es/utils/build-listing-query.js.map +1 -1
  88. package/lib-es/utils/build-update-data-query.js.map +1 -1
  89. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  90. package/lib-es/utils/get-default-query-params.js.map +1 -1
  91. package/lib-es/utils/hoc/withContext.js.map +1 -1
  92. package/lib-es/utils/hooks/useToggle.js.map +1 -1
  93. package/package.json +3 -3
@@ -17,48 +17,46 @@ var submit = /*#__PURE__*/function () {
17
17
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref, addToast) {
18
18
  var entitySchema, parsedFormValues, client, setEntityData, setIsSaveButtonAvailable, setSaveButtonText, history, setIsNewEntity, mutation, _yield$client$mutate, createdEntityResult, updatePathname;
19
19
  return _regenerator["default"].wrap(function _callee$(_context) {
20
- while (1) {
21
- switch (_context.prev = _context.next) {
22
- case 0:
23
- entitySchema = _ref.entitySchema, parsedFormValues = _ref.parsedFormValues, client = _ref.client, setEntityData = _ref.setEntityData, setIsSaveButtonAvailable = _ref.setIsSaveButtonAvailable, setSaveButtonText = _ref.setSaveButtonText, history = _ref.history, setIsNewEntity = _ref.setIsNewEntity;
24
- mutation = (0, _buildCreateEntityMutation["default"])(entitySchema);
25
- _context.prev = 2;
26
- setIsSaveButtonAvailable(false);
27
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saving);
28
- _context.next = 7;
29
- return client.mutate({
30
- mutation: mutation,
31
- variables: {
32
- input: parsedFormValues
33
- }
34
- });
35
- case 7:
36
- _yield$client$mutate = _context.sent;
37
- createdEntityResult = _yield$client$mutate.data.createdEntity;
38
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saved);
39
- setEntityData(createdEntityResult.result);
40
- setIsNewEntity(false);
41
- updatePathname = history.location.pathname.replace('create', 'update');
42
- history.push("".concat(updatePathname, "/").concat(createdEntityResult.result.id));
43
- addToast("Created", {
44
- appearance: 'success',
45
- autoDismiss: true
46
- });
47
- _context.next = 22;
48
- break;
49
- case 17:
50
- _context.prev = 17;
51
- _context.t0 = _context["catch"](2);
52
- setIsSaveButtonAvailable(true);
53
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
54
- addToast(_context.t0.message, {
55
- appearance: 'error',
56
- autoDismiss: true
57
- });
58
- case 22:
59
- case "end":
60
- return _context.stop();
61
- }
20
+ while (1) switch (_context.prev = _context.next) {
21
+ case 0:
22
+ entitySchema = _ref.entitySchema, parsedFormValues = _ref.parsedFormValues, client = _ref.client, setEntityData = _ref.setEntityData, setIsSaveButtonAvailable = _ref.setIsSaveButtonAvailable, setSaveButtonText = _ref.setSaveButtonText, history = _ref.history, setIsNewEntity = _ref.setIsNewEntity;
23
+ mutation = (0, _buildCreateEntityMutation["default"])(entitySchema);
24
+ _context.prev = 2;
25
+ setIsSaveButtonAvailable(false);
26
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saving);
27
+ _context.next = 7;
28
+ return client.mutate({
29
+ mutation: mutation,
30
+ variables: {
31
+ input: parsedFormValues
32
+ }
33
+ });
34
+ case 7:
35
+ _yield$client$mutate = _context.sent;
36
+ createdEntityResult = _yield$client$mutate.data.createdEntity;
37
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saved);
38
+ setEntityData(createdEntityResult.result);
39
+ setIsNewEntity(false);
40
+ updatePathname = history.location.pathname.replace('create', 'update');
41
+ history.push("".concat(updatePathname, "/").concat(createdEntityResult.result.id));
42
+ addToast("Created", {
43
+ appearance: 'success',
44
+ autoDismiss: true
45
+ });
46
+ _context.next = 22;
47
+ break;
48
+ case 17:
49
+ _context.prev = 17;
50
+ _context.t0 = _context["catch"](2);
51
+ setIsSaveButtonAvailable(true);
52
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
53
+ addToast(_context.t0.message, {
54
+ appearance: 'error',
55
+ autoDismiss: true
56
+ });
57
+ case 22:
58
+ case "end":
59
+ return _context.stop();
62
60
  }
63
61
  }, _callee, null, [[2, 17]]);
64
62
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"submit.js","names":["submit","addToast","entitySchema","parsedFormValues","client","setEntityData","setIsSaveButtonAvailable","setSaveButtonText","history","setIsNewEntity","mutation","buildCreateEntityMutation","SAVE_BUTTON_TEXTS","saving","mutate","variables","input","createdEntityResult","data","createdEntity","saved","result","updatePathname","location","pathname","replace","push","id","appearance","autoDismiss","save","message"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/submit.js"],"sourcesContent":["import buildCreateEntityMutation from '../../../../../utils/build-create-entity-mutation';\nimport { SAVE_BUTTON_TEXTS } from '../../../../../constants';\n\nconst submit = async (\n {\n entitySchema,\n parsedFormValues,\n client,\n setEntityData,\n setIsSaveButtonAvailable,\n setSaveButtonText,\n history,\n setIsNewEntity\n },\n addToast\n) => {\n const mutation = buildCreateEntityMutation(entitySchema);\n\n try {\n setIsSaveButtonAvailable(false);\n setSaveButtonText(SAVE_BUTTON_TEXTS.saving);\n const {\n data: { createdEntity: createdEntityResult }\n } = await client.mutate({\n mutation,\n variables: { input: parsedFormValues }\n });\n\n setSaveButtonText(SAVE_BUTTON_TEXTS.saved);\n setEntityData(createdEntityResult.result);\n setIsNewEntity(false);\n\n const updatePathname = history.location.pathname.replace('create', 'update');\n history.push(`${updatePathname}/${createdEntityResult.result.id}`);\n addToast(`Created`, {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AAEA,IAAMA,MAAM;EAAA,0FAAG,uBAWbC,QAAQ;IAAA;IAAA;MAAA;QAAA;UAAA;YATNC,YAAY,QAAZA,YAAY,EACZC,gBAAgB,QAAhBA,gBAAgB,EAChBC,MAAM,QAANA,MAAM,EACNC,aAAa,QAAbA,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interopRequireDefault","require","_constants","submit","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","addToast","entitySchema","parsedFormValues","client","setEntityData","setIsSaveButtonAvailable","setSaveButtonText","history","setIsNewEntity","mutation","_yield$client$mutate","createdEntityResult","updatePathname","wrap","_callee$","_context","prev","next","buildCreateEntityMutation","SAVE_BUTTON_TEXTS","saving","mutate","variables","input","sent","data","createdEntity","saved","result","location","pathname","replace","push","concat","id","appearance","autoDismiss","t0","save","message","stop","_x","_x2","apply","arguments","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/submit.js"],"sourcesContent":["import buildCreateEntityMutation from '../../../../../utils/build-create-entity-mutation';\nimport { SAVE_BUTTON_TEXTS } from '../../../../../constants';\n\nconst submit = async (\n {\n entitySchema,\n parsedFormValues,\n client,\n setEntityData,\n setIsSaveButtonAvailable,\n setSaveButtonText,\n history,\n setIsNewEntity\n },\n addToast\n) => {\n const mutation = buildCreateEntityMutation(entitySchema);\n\n try {\n setIsSaveButtonAvailable(false);\n setSaveButtonText(SAVE_BUTTON_TEXTS.saving);\n const {\n data: { createdEntity: createdEntityResult }\n } = await client.mutate({\n mutation,\n variables: { input: parsedFormValues }\n });\n\n setSaveButtonText(SAVE_BUTTON_TEXTS.saved);\n setEntityData(createdEntityResult.result);\n setIsNewEntity(false);\n\n const updatePathname = history.location.pathname.replace('create', 'update');\n history.push(`${updatePathname}/${createdEntityResult.result.id}`);\n addToast(`Created`, {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAME,MAAM;EAAA,IAAAC,KAAA,OAAAC,kBAAA,2BAAAC,YAA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C,KAAK,CAAC;UAEfI,cAAc,GAAGL,OAAO,CAACsB,QAAQ,CAACC,QAAQ,CAACC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;UAC5ExB,OAAO,CAACyB,IAAI,IAAAC,MAAA,CAAIrB,cAAc,OAAAqB,MAAA,CAAItB,mBAAmB,CAACiB,MAAM,CAACM,EAAE,EAAG;UAClElC,QAAQ,YAAY;YAClBmC,UAAU,EAAE,SAAS;YACrBC,WAAW,EAAE;UACf,CAAC,CAAC;UAACrB,QAAA,CAAAE,IAAA;UAAA;QAAA;UAAAF,QAAA,CAAAC,IAAA;UAAAD,QAAA,CAAAsB,EAAA,GAAAtB,QAAA;UAEHV,wBAAwB,CAAC,IAAI,CAAC;UAC9BC,iBAAiB,CAACa,4BAAiB,CAACmB,IAAI,CAAC;UACzCtC,QAAQ,CAACe,QAAA,CAAAsB,EAAA,CAAME,OAAO,EAAE;YACtBJ,UAAU,EAAE,OAAO;YACnBC,WAAW,EAAE;UACf,CAAC,CAAC;QAAC;QAAA;UAAA,OAAArB,QAAA,CAAAyB,IAAA;MAAA;IAAA,GAAA1C,OAAA;EAAA,CAEN;EAAA,gBA3CKL,MAAMA,CAAAgD,EAAA,EAAAC,GAAA;IAAA,OAAAhD,KAAA,CAAAiD,KAAA,OAAAC,SAAA;EAAA;AAAA,GA2CX;AAACC,OAAA,CAAApD,MAAA,GAAAA,MAAA"}
@@ -13,40 +13,38 @@ var submit = /*#__PURE__*/function () {
13
13
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref, addToast) {
14
14
  var entitySchema, parsedFormValues, client, mutation, id;
15
15
  return _regenerator["default"].wrap(function _callee$(_context) {
16
- while (1) {
17
- switch (_context.prev = _context.next) {
18
- case 0:
19
- entitySchema = _ref.entitySchema, parsedFormValues = _ref.parsedFormValues, client = _ref.client;
20
- mutation = (0, _buildDeleteEntityMutation["default"])(entitySchema);
21
- id = parsedFormValues.id;
22
- _context.prev = 3;
23
- _context.next = 6;
24
- return client.mutate({
25
- mutation: mutation,
26
- variables: {
27
- input: {
28
- id: id
29
- }
16
+ while (1) switch (_context.prev = _context.next) {
17
+ case 0:
18
+ entitySchema = _ref.entitySchema, parsedFormValues = _ref.parsedFormValues, client = _ref.client;
19
+ mutation = (0, _buildDeleteEntityMutation["default"])(entitySchema);
20
+ id = parsedFormValues.id;
21
+ _context.prev = 3;
22
+ _context.next = 6;
23
+ return client.mutate({
24
+ mutation: mutation,
25
+ variables: {
26
+ input: {
27
+ id: id
30
28
  }
31
- });
32
- case 6:
33
- addToast('Deleted', {
34
- appearance: 'success',
35
- autoDismiss: true
36
- });
37
- _context.next = 12;
38
- break;
39
- case 9:
40
- _context.prev = 9;
41
- _context.t0 = _context["catch"](3);
42
- addToast(_context.t0.message, {
43
- appearance: 'error',
44
- autoDismiss: true
45
- });
46
- case 12:
47
- case "end":
48
- return _context.stop();
49
- }
29
+ }
30
+ });
31
+ case 6:
32
+ addToast('Deleted', {
33
+ appearance: 'success',
34
+ autoDismiss: true
35
+ });
36
+ _context.next = 12;
37
+ break;
38
+ case 9:
39
+ _context.prev = 9;
40
+ _context.t0 = _context["catch"](3);
41
+ addToast(_context.t0.message, {
42
+ appearance: 'error',
43
+ autoDismiss: true
44
+ });
45
+ case 12:
46
+ case "end":
47
+ return _context.stop();
50
48
  }
51
49
  }, _callee, null, [[3, 9]]);
52
50
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"delete.js","names":["submit","addToast","entitySchema","parsedFormValues","client","mutation","buildDeleteEntityMutation","id","mutate","variables","input","appearance","autoDismiss","message"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/delete.js"],"sourcesContent":["import buildDeleteEntityMutation from '../../../../../utils/build-delete-entity-mutation';\n\nconst submit = async ({ entitySchema, parsedFormValues, client }, addToast) => {\n const mutation = buildDeleteEntityMutation(entitySchema);\n const { id } = parsedFormValues;\n\n try {\n await client.mutate({\n mutation,\n variables: { input: { id } }\n });\n addToast('Deleted', {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;;;;AAAA;AAEA,IAAMA,MAAM;EAAA,0FAAG,uBAAmDC,QAAQ;IAAA;IAAA;MAAA;QAAA;UAAA;YAAlDC,YAAY,QAAZA,YAAY,EAAEC,gBAAgB,QAAhBA,gBAAgB,EAAEC,MAAM,QAANA,MAAM;YACtDC,QAAQ,GAAG,IAAAC,qCAAyB,EAACJ,YAAY,CAAC;YAChDK,EAAE,GAAKJ,gBAAgB,CAAvBI,EAAE;YAAA;YAAA;YAAA,OAGFH,MAAM,CAACI,MAAM,CAAC;cAClBH,QAAQ,EAARA,QAAQ;cACRI,SAAS,EAAE;gBAAEC,KAAK,EAAE;kBAAEH,EAAE,EAAFA;gBAAG;cAAE;YAC7B,CAAC,CAAC;UAAA;YACFN,QAAQ,CAAC,SAAS,EAAE;cAClBU,UAAU,EAAE,SAAS;cACrBC,WAAW,EAAE;YACf,CAAC,CAAC;YAAC;YAAA;UAAA;YAAA;YAAA;YAEHX,QAAQ,CAAC,YAAMY,OAAO,EAAE;cACtBF,UAAU,EAAE,OAAO;cACnBC,WAAW,EAAE;YACf,CAAC,CAAC;UAAC;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAEN;EAAA,gBAnBKZ,MAAM;IAAA;EAAA;AAAA,GAmBX;AAAC"}
1
+ {"version":3,"file":"delete.js","names":["_buildDeleteEntityMutation","_interopRequireDefault","require","submit","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","addToast","entitySchema","parsedFormValues","client","mutation","id","wrap","_callee$","_context","prev","next","buildDeleteEntityMutation","mutate","variables","input","appearance","autoDismiss","t0","message","stop","_x","_x2","apply","arguments","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/delete.js"],"sourcesContent":["import buildDeleteEntityMutation from '../../../../../utils/build-delete-entity-mutation';\n\nconst submit = async ({ entitySchema, parsedFormValues, client }, addToast) => {\n const mutation = buildDeleteEntityMutation(entitySchema);\n const { id } = parsedFormValues;\n\n try {\n await client.mutate({\n mutation,\n variables: { input: { id } }\n });\n addToast('Deleted', {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAMC,MAAM;EAAA,IAAAC,KAAA,OAAAC,kBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAAG,SAAAC,QAAAC,IAAA,EAAmDC,QAAQ;IAAA,IAAAC,YAAA,EAAAC,gBAAA,EAAAC,MAAA,EAAAC,QAAA,EAAAC,EAAA;IAAA,OAAAT,YAAA,YAAAU,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAlDT,YAAY,GAAAF,IAAA,CAAZE,YAAY,EAAEC,gBAAgB,GAAAH,IAAA,CAAhBG,gBAAgB,EAAEC,MAAM,GAAAJ,IAAA,CAANI,MAAM;UACtDC,QAAQ,GAAG,IAAAO,qCAAyB,EAACV,YAAY,CAAC;UAChDI,EAAE,GAAKH,gBAAgB,CAAvBG,EAAE;UAAAG,QAAA,CAAAC,IAAA;UAAAD,QAAA,CAAAE,IAAA;UAAA,OAGFP,MAAM,CAACS,MAAM,CAAC;YAClBR,QAAQ,EAARA,QAAQ;YACRS,SAAS,EAAE;cAAEC,KAAK,EAAE;gBAAET,EAAE,EAAFA;cAAG;YAAE;UAC7B,CAAC,CAAC;QAAA;UACFL,QAAQ,CAAC,SAAS,EAAE;YAClBe,UAAU,EAAE,SAAS;YACrBC,WAAW,EAAE;UACf,CAAC,CAAC;UAACR,QAAA,CAAAE,IAAA;UAAA;QAAA;UAAAF,QAAA,CAAAC,IAAA;UAAAD,QAAA,CAAAS,EAAA,GAAAT,QAAA;UAEHR,QAAQ,CAACQ,QAAA,CAAAS,EAAA,CAAMC,OAAO,EAAE;YACtBH,UAAU,EAAE,OAAO;YACnBC,WAAW,EAAE;UACf,CAAC,CAAC;QAAC;QAAA;UAAA,OAAAR,QAAA,CAAAW,IAAA;MAAA;IAAA,GAAArB,OAAA;EAAA,CAEN;EAAA,gBAnBKL,MAAMA,CAAA2B,EAAA,EAAAC,GAAA;IAAA,OAAA3B,KAAA,CAAA4B,KAAA,OAAAC,SAAA;EAAA;AAAA,GAmBX;AAACC,OAAA,CAAA/B,MAAA,GAAAA,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/index.js"],"sourcesContent":["import { submit } from './delete';\n\nexport default { submit };\n"],"mappings":";;;;;;;AAAA;AAAkC,eAEnB;EAAEA,MAAM,EAANA;AAAO,CAAC;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_delete","require","_default","submit","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/index.js"],"sourcesContent":["import { submit } from './delete';\n\nexport default { submit };\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAkC,IAAAC,QAAA,GAEnB;EAAEC,MAAM,EAANA;AAAO,CAAC;AAAAC,OAAA,cAAAF,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["availableActions","create","createActions","update","updateActions","shared","sharedActions","deleteActions"],"sources":["../../../../../src/components/EntityManager/Entity/actions-handlers/index.js"],"sourcesContent":["import createActions from './create';\nimport updateActions from './update';\nimport sharedActions from './shared';\nimport deleteActions from './delete';\n\nconst availableActions = {\n create: createActions,\n update: updateActions,\n shared: sharedActions,\n delete: deleteActions\n};\n\nexport default availableActions;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AAEA,IAAMA,gBAAgB,GAAG;EACvBC,MAAM,EAAEC,kBAAa;EACrBC,MAAM,EAAEC,kBAAa;EACrBC,MAAM,EAAEC,kBAAa;EACrB,UAAQC;AACV,CAAC;AAAC,eAEaP,gBAAgB;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_create","_interopRequireDefault","require","_update","_shared","_delete","availableActions","create","createActions","update","updateActions","shared","sharedActions","deleteActions","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/actions-handlers/index.js"],"sourcesContent":["import createActions from './create';\nimport updateActions from './update';\nimport sharedActions from './shared';\nimport deleteActions from './delete';\n\nconst availableActions = {\n create: createActions,\n update: updateActions,\n shared: sharedActions,\n delete: deleteActions\n};\n\nexport default availableActions;\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAMI,gBAAgB,GAAG;EACvBC,MAAM,EAAEC,kBAAa;EACrBC,MAAM,EAAEC,kBAAa;EACrBC,MAAM,EAAEC,kBAAa;EACrB,UAAQC;AACV,CAAC;AAAC,IAAAC,QAAA,GAEaR,gBAAgB;AAAAS,OAAA,cAAAD,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["triggerPublish"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/index.js"],"sourcesContent":["import { triggerPublish } from './publish';\n\nexport default { triggerPublish };\n"],"mappings":";;;;;;;AAAA;AAA2C,eAE5B;EAAEA,cAAc,EAAdA;AAAe,CAAC;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_publish","require","_default","triggerPublish","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/index.js"],"sourcesContent":["import { triggerPublish } from './publish';\n\nexport default { triggerPublish };\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAA2C,IAAAC,QAAA,GAE5B;EAAEC,cAAc,EAAdA;AAAe,CAAC;AAAAC,OAAA,cAAAF,QAAA"}
@@ -15,49 +15,47 @@ var triggerPublish = /*#__PURE__*/function () {
15
15
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref, addToast) {
16
16
  var entityData, client, setEntityIsPublish, entitySchema, _ref$textContent, textContent, refetchRecord, actionType, entityIsPublishedSwitch, mutation;
17
17
  return _regenerator["default"].wrap(function _callee$(_context) {
18
- while (1) {
19
- switch (_context.prev = _context.next) {
20
- case 0:
21
- entityData = _ref.entityData, client = _ref.client, setEntityIsPublish = _ref.setEntityIsPublish, entitySchema = _ref.entitySchema, _ref$textContent = _ref.textContent, textContent = _ref$textContent === void 0 ? '' : _ref$textContent, refetchRecord = _ref.refetchRecord;
22
- if (Object.keys(entityData).length) {
23
- _context.next = 4;
24
- break;
25
- }
26
- addToast(_constants.SAVE_BEFORE_PUBLISH_MESSAGE, {
27
- appearance: 'info',
28
- autoDismiss: true
29
- });
30
- return _context.abrupt("return");
31
- case 4:
32
- actionType = textContent.toLowerCase();
33
- entityIsPublishedSwitch = "".concat(actionType, "ed");
34
- mutation = (0, _utils.buildUpdatePublishUnpublishMutation)(entitySchema, entityData.id, actionType);
35
- _context.prev = 7;
36
- _context.next = 10;
37
- return client.mutate({
38
- mutation: mutation
39
- });
40
- case 10:
41
- addToast("".concat(textContent, "ed"), {
42
- appearance: 'success',
43
- autoDismiss: true
44
- });
45
- _context.next = 16;
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ entityData = _ref.entityData, client = _ref.client, setEntityIsPublish = _ref.setEntityIsPublish, entitySchema = _ref.entitySchema, _ref$textContent = _ref.textContent, textContent = _ref$textContent === void 0 ? '' : _ref$textContent, refetchRecord = _ref.refetchRecord;
21
+ if (Object.keys(entityData).length) {
22
+ _context.next = 4;
46
23
  break;
47
- case 13:
48
- _context.prev = 13;
49
- _context.t0 = _context["catch"](7);
50
- addToast(_context.t0.message, {
51
- appearance: 'error',
52
- autoDismiss: true
53
- });
54
- case 16:
55
- setEntityIsPublish(entityIsPublishedSwitch);
56
- refetchRecord(true);
57
- case 18:
58
- case "end":
59
- return _context.stop();
60
- }
24
+ }
25
+ addToast(_constants.SAVE_BEFORE_PUBLISH_MESSAGE, {
26
+ appearance: 'info',
27
+ autoDismiss: true
28
+ });
29
+ return _context.abrupt("return");
30
+ case 4:
31
+ actionType = textContent.toLowerCase();
32
+ entityIsPublishedSwitch = "".concat(actionType, "ed");
33
+ mutation = (0, _utils.buildUpdatePublishUnpublishMutation)(entitySchema, entityData.id, actionType);
34
+ _context.prev = 7;
35
+ _context.next = 10;
36
+ return client.mutate({
37
+ mutation: mutation
38
+ });
39
+ case 10:
40
+ addToast("".concat(textContent, "ed"), {
41
+ appearance: 'success',
42
+ autoDismiss: true
43
+ });
44
+ _context.next = 16;
45
+ break;
46
+ case 13:
47
+ _context.prev = 13;
48
+ _context.t0 = _context["catch"](7);
49
+ addToast(_context.t0.message, {
50
+ appearance: 'error',
51
+ autoDismiss: true
52
+ });
53
+ case 16:
54
+ setEntityIsPublish(entityIsPublishedSwitch);
55
+ refetchRecord(true);
56
+ case 18:
57
+ case "end":
58
+ return _context.stop();
61
59
  }
62
60
  }, _callee, null, [[7, 13]]);
63
61
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"publish.js","names":["triggerPublish","addToast","entityData","client","setEntityIsPublish","entitySchema","textContent","refetchRecord","Object","keys","length","SAVE_BEFORE_PUBLISH_MESSAGE","appearance","autoDismiss","actionType","toLowerCase","entityIsPublishedSwitch","mutation","buildUpdatePublishUnpublishMutation","id","mutate","message"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/publish.js"],"sourcesContent":["import { buildUpdatePublishUnpublishMutation } from '../../../../../utils';\nimport { SAVE_BEFORE_PUBLISH_MESSAGE } from '../../../../../constants';\n\nconst triggerPublish = async (\n { entityData, client, setEntityIsPublish, entitySchema, textContent = '', refetchRecord },\n addToast\n) => {\n if (!Object.keys(entityData).length) {\n addToast(SAVE_BEFORE_PUBLISH_MESSAGE, {\n appearance: 'info',\n autoDismiss: true\n });\n return;\n }\n const actionType = textContent.toLowerCase();\n const entityIsPublishedSwitch = `${actionType}ed`;\n const mutation = buildUpdatePublishUnpublishMutation(entitySchema, entityData.id, actionType);\n\n try {\n await client.mutate({\n mutation\n });\n addToast(`${textContent}ed`, {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n\n setEntityIsPublish(entityIsPublishedSwitch);\n refetchRecord(true);\n};\n\nexport { triggerPublish };\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA,IAAMA,cAAc;EAAA,0FAAG,uBAErBC,QAAQ;IAAA;IAAA;MAAA;QAAA;UAAA;YADNC,UAAU,QAAVA,UAAU,EAAEC,MAAM,QAANA,MAAM,EAAEC,kBAAkB,QAAlBA,kBAAkB,EAAEC,YAAY,QAAZA,YAAY,0BAAEC,WAAW,EAAXA,WAAW,iCAAG,EAAE,qBAAEC,aAAa,QAAbA,aAAa;YAAA,IAGlFC,MAAM,CAACC,IAAI,CAACP,UAAU,CAAC,CAACQ,MAAM;cAAA;cAAA;YAAA;YACjCT,QAAQ,CAACU,sCAA2B,EAAE;cACpCC,UAAU,EAAE,MAAM;cAClBC,WAAW,EAAE;YACf,CAAC,CAAC;YAAC;UAAA;YAGCC,UAAU,GAAGR,WAAW,CAACS,WAAW,EAAE;YACtCC,uBAAuB,aAAMF,UAAU;YACvCG,QAAQ,GAAG,IAAAC,0CAAmC,EAACb,YAAY,EAAEH,UAAU,CAACiB,EAAE,EAAEL,UAAU,CAAC;YAAA;YAAA;YAAA,OAGrFX,MAAM,CAACiB,MAAM,CAAC;cAClBH,QAAQ,EAARA;YACF,CAAC,CAAC;UAAA;YACFhB,QAAQ,WAAIK,WAAW,SAAM;cAC3BM,UAAU,EAAE,SAAS;cACrBC,WAAW,EAAE;YACf,CAAC,CAAC;YAAC;YAAA;UAAA;YAAA;YAAA;YAEHZ,QAAQ,CAAC,YAAMoB,OAAO,EAAE;cACtBT,UAAU,EAAE,OAAO;cACnBC,WAAW,EAAE;YACf,CAAC,CAAC;UAAC;YAGLT,kBAAkB,CAACY,uBAAuB,CAAC;YAC3CT,aAAa,CAAC,IAAI,CAAC;UAAC;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACrB;EAAA,gBAhCKP,cAAc;IAAA;EAAA;AAAA,GAgCnB;AAAC"}
1
+ {"version":3,"file":"publish.js","names":["_utils","require","_constants","triggerPublish","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","addToast","entityData","client","setEntityIsPublish","entitySchema","_ref$textContent","textContent","refetchRecord","actionType","entityIsPublishedSwitch","mutation","wrap","_callee$","_context","prev","next","Object","keys","length","SAVE_BEFORE_PUBLISH_MESSAGE","appearance","autoDismiss","abrupt","toLowerCase","concat","buildUpdatePublishUnpublishMutation","id","mutate","t0","message","stop","_x","_x2","apply","arguments","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/publish.js"],"sourcesContent":["import { buildUpdatePublishUnpublishMutation } from '../../../../../utils';\nimport { SAVE_BEFORE_PUBLISH_MESSAGE } from '../../../../../constants';\n\nconst triggerPublish = async (\n { entityData, client, setEntityIsPublish, entitySchema, textContent = '', refetchRecord },\n addToast\n) => {\n if (!Object.keys(entityData).length) {\n addToast(SAVE_BEFORE_PUBLISH_MESSAGE, {\n appearance: 'info',\n autoDismiss: true\n });\n return;\n }\n const actionType = textContent.toLowerCase();\n const entityIsPublishedSwitch = `${actionType}ed`;\n const mutation = buildUpdatePublishUnpublishMutation(entitySchema, entityData.id, actionType);\n\n try {\n await client.mutate({\n mutation\n });\n addToast(`${textContent}ed`, {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });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ACyB,EAAE,EAAElB,UAAU,CAAC;UAAAK,QAAA,CAAAC,IAAA;UAAAD,QAAA,CAAAE,IAAA;UAAA,OAGrFb,MAAM,CAACyB,MAAM,CAAC;YAClBjB,QAAQ,EAARA;UACF,CAAC,CAAC;QAAA;UACFV,QAAQ,IAAAwB,MAAA,CAAIlB,WAAW,SAAM;YAC3Bc,UAAU,EAAE,SAAS;YACrBC,WAAW,EAAE;UACf,CAAC,CAAC;UAACR,QAAA,CAAAE,IAAA;UAAA;QAAA;UAAAF,QAAA,CAAAC,IAAA;UAAAD,QAAA,CAAAe,EAAA,GAAAf,QAAA;UAEHb,QAAQ,CAACa,QAAA,CAAAe,EAAA,CAAMC,OAAO,EAAE;YACtBT,UAAU,EAAE,OAAO;YACnBC,WAAW,EAAE;UACf,CAAC,CAAC;QAAC;UAGLlB,kBAAkB,CAACM,uBAAuB,CAAC;UAC3CF,aAAa,CAAC,IAAI,CAAC;QAAC;QAAA;UAAA,OAAAM,QAAA,CAAAiB,IAAA;MAAA;IAAA,GAAAhC,OAAA;EAAA,CACrB;EAAA,gBAhCKL,cAAcA,CAAAsC,EAAA,EAAAC,GAAA;IAAA,OAAAtC,KAAA,CAAAuC,KAAA,OAAAC,SAAA;EAAA;AAAA,GAgCnB;AAACC,OAAA,CAAA1C,cAAA,GAAAA,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/update/index.js"],"sourcesContent":["import { submit } from './submit';\n\nexport default { submit };\n"],"mappings":";;;;;;;AAAA;AAAkC,eAEnB;EAAEA,MAAM,EAANA;AAAO,CAAC;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_submit","require","_default","submit","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/update/index.js"],"sourcesContent":["import { submit } from './submit';\n\nexport default { submit };\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAkC,IAAAC,QAAA,GAEnB;EAAEC,MAAM,EAANA;AAAO,CAAC;AAAAC,OAAA,cAAAF,QAAA"}
@@ -26,51 +26,49 @@ var submit = /*#__PURE__*/function () {
26
26
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref, addToast) {
27
27
  var entitySchema, entityData, parsedFormValues, client, setIsSaveButtonAvailable, setSaveButtonText, setNewUpdatedDate, newUpdatedDate, handleUpdateFormData, mutation, _yield$client$mutate, data, updatedDate;
28
28
  return _regenerator["default"].wrap(function _callee$(_context) {
29
- while (1) {
30
- switch (_context.prev = _context.next) {
31
- case 0:
32
- entitySchema = _ref.entitySchema, entityData = _ref.entityData, parsedFormValues = _ref.parsedFormValues, client = _ref.client, setIsSaveButtonAvailable = _ref.setIsSaveButtonAvailable, setSaveButtonText = _ref.setSaveButtonText, setNewUpdatedDate = _ref.setNewUpdatedDate, newUpdatedDate = _ref.newUpdatedDate, handleUpdateFormData = _ref.handleUpdateFormData;
33
- mutation = (0, _buildUpdateDataQuery["default"])(entitySchema);
34
- _context.prev = 2;
35
- setIsSaveButtonAvailable(false);
36
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saving);
37
- _context.next = 7;
38
- return client.mutate({
39
- mutation: mutation,
40
- variables: {
41
- input: _objectSpread(_objectSpread({
42
- id: entityData.id
43
- }, parsedFormValues), {}, {
44
- updated: newUpdatedDate || entityData.updated
45
- })
46
- }
47
- });
48
- case 7:
49
- _yield$client$mutate = _context.sent;
50
- data = _yield$client$mutate.data;
51
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saved);
52
- updatedDate = data && data.updateEntity && data.updateEntity.result && data.updateEntity.result.updated;
53
- setNewUpdatedDate(updatedDate);
54
- addToast('Updated', {
55
- appearance: _constants.SUCCESS,
56
- autoDismiss: true
57
- });
58
- handleUpdateFormData();
59
- return _context.abrupt("return", _constants.SUCCESS);
60
- case 17:
61
- _context.prev = 17;
62
- _context.t0 = _context["catch"](2);
63
- setIsSaveButtonAvailable(true);
64
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
65
- addToast(_context.t0.message, {
66
- appearance: _constants.ERROR,
67
- autoDismiss: true
68
- });
69
- return _context.abrupt("return", _constants.ERROR);
70
- case 23:
71
- case "end":
72
- return _context.stop();
73
- }
29
+ while (1) switch (_context.prev = _context.next) {
30
+ case 0:
31
+ entitySchema = _ref.entitySchema, entityData = _ref.entityData, parsedFormValues = _ref.parsedFormValues, client = _ref.client, setIsSaveButtonAvailable = _ref.setIsSaveButtonAvailable, setSaveButtonText = _ref.setSaveButtonText, setNewUpdatedDate = _ref.setNewUpdatedDate, newUpdatedDate = _ref.newUpdatedDate, handleUpdateFormData = _ref.handleUpdateFormData;
32
+ mutation = (0, _buildUpdateDataQuery["default"])(entitySchema);
33
+ _context.prev = 2;
34
+ setIsSaveButtonAvailable(false);
35
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saving);
36
+ _context.next = 7;
37
+ return client.mutate({
38
+ mutation: mutation,
39
+ variables: {
40
+ input: _objectSpread(_objectSpread({
41
+ id: entityData.id
42
+ }, parsedFormValues), {}, {
43
+ updated: newUpdatedDate || entityData.updated
44
+ })
45
+ }
46
+ });
47
+ case 7:
48
+ _yield$client$mutate = _context.sent;
49
+ data = _yield$client$mutate.data;
50
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saved);
51
+ updatedDate = data && data.updateEntity && data.updateEntity.result && data.updateEntity.result.updated;
52
+ setNewUpdatedDate(updatedDate);
53
+ addToast('Updated', {
54
+ appearance: _constants.SUCCESS,
55
+ autoDismiss: true
56
+ });
57
+ handleUpdateFormData();
58
+ return _context.abrupt("return", _constants.SUCCESS);
59
+ case 17:
60
+ _context.prev = 17;
61
+ _context.t0 = _context["catch"](2);
62
+ setIsSaveButtonAvailable(true);
63
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
64
+ addToast(_context.t0.message, {
65
+ appearance: _constants.ERROR,
66
+ autoDismiss: true
67
+ });
68
+ return _context.abrupt("return", _constants.ERROR);
69
+ case 23:
70
+ case "end":
71
+ return _context.stop();
74
72
  }
75
73
  }, _callee, null, [[2, 17]]);
76
74
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"submit.js","names":["submit","addToast","entitySchema","entityData","parsedFormValues","client","setIsSaveButtonAvailable","setSaveButtonText","setNewUpdatedDate","newUpdatedDate","handleUpdateFormData","mutation","buildUpdateDataQuery","SAVE_BUTTON_TEXTS","saving","mutate","variables","input","id","updated","data","saved","updatedDate","updateEntity","result","appearance","SUCCESS","autoDismiss","save","message","ERROR"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/update/submit.js"],"sourcesContent":["import buildUpdateDataQuery from '../../../../../utils/build-update-data-query';\nimport { ERROR, SUCCESS, SAVE_BUTTON_TEXTS } from '../../../../../constants';\n\nconst submit = async (\n {\n entitySchema,\n entityData,\n parsedFormValues,\n client,\n setIsSaveButtonAvailable,\n setSaveButtonText,\n setNewUpdatedDate,\n newUpdatedDate,\n handleUpdateFormData\n },\n addToast\n) => {\n const mutation = buildUpdateDataQuery(entitySchema);\n\n try {\n setIsSaveButtonAvailable(false);\n setSaveButtonText(SAVE_BUTTON_TEXTS.saving);\n const { data } = await client.mutate({\n mutation,\n variables: {\n input: {\n id: entityData.id,\n ...parsedFormValues,\n updated: newUpdatedDate || entityData.updated\n }\n }\n });\n setSaveButtonText(SAVE_BUTTON_TEXTS.saved);\n const updatedDate =\n data && data.updateEntity && data.updateEntity.result && data.updateEntity.result.updated;\n\n setNewUpdatedDate(updatedDate);\n\n addToast('Updated', {\n appearance: SUCCESS,\n autoDismiss: true\n });\n handleUpdateFormData();\n return SUCCESS;\n } catch (error) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n addToast(error.message, {\n appearance: ERROR,\n autoDismiss: true\n });\n return ERROR;\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;A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AAI,CAAC;YACzC3B,QAAQ,CAAC,YAAM4B,OAAO,EAAE;cACtBJ,UAAU,EAAEK,gBAAK;cACjBH,WAAW,EAAE;YACf,CAAC,CAAC;YAAC,iCACIG,gBAAK;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAEf;EAAA,gBAlDK9B,MAAM;IAAA;EAAA;AAAA,GAkDX;AAAC"}
1
+ {"version":3,"file":"submit.js","names":["_buildUpdateDataQuery","_interopRequireDefault","require","_constants","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","submit","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","addToast","entitySchema","entityData","parsedFormValues","client","setIsSaveButtonAvailable","setSaveButtonText","setNewUpdatedDate","newUpdatedDate","handleUpdateFormData","mutation","_yield$client$mutate","data","updatedDate","wrap","_callee$","_context","prev","next","buildUpdateDataQuery","SAVE_BUTTON_TEXTS","saving","mutate","variables","input","id","updated","sent","saved","updateEntity","result","appearance","SUCCESS","autoDismiss","abrupt","t0","save","message","ERROR","stop","_x","_x2","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/update/submit.js"],"sourcesContent":["import buildUpdateDataQuery from '../../../../../utils/build-update-data-query';\nimport { ERROR, SUCCESS, SAVE_BUTTON_TEXTS } from '../../../../../constants';\n\nconst submit = async (\n {\n entitySchema,\n entityData,\n parsedFormValues,\n client,\n setIsSaveButtonAvailable,\n setSaveButtonText,\n setNewUpdatedDate,\n newUpdatedDate,\n handleUpdateFormData\n },\n addToast\n) => {\n const mutation = buildUpdateDataQuery(entitySchema);\n\n try {\n setIsSaveButtonAvailable(false);\n setSaveButtonText(SAVE_BUTTON_TEXTS.saving);\n const { data } = await client.mutate({\n mutation,\n variables: {\n input: {\n id: entityData.id,\n ...parsedFormValues,\n updated: newUpdatedDate || entityData.updated\n }\n }\n });\n setSaveButtonText(SAVE_BUTTON_TEXTS.saved);\n const updatedDate =\n data && data.updateEntity && data.updateEntity.result && data.updateEntity.result.updated;\n\n setNewUpdatedDate(updatedDate);\n\n addToast('Updated', {\n appearance: SUCCESS,\n autoDismiss: true\n });\n handleUpdateFormData();\n return SUCCESS;\n } catch (error) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n addToast(error.message, {\n appearance: ERROR,\n autoDismiss: true\n });\n return ERROR;\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAA6E,SAAAE,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OAAA,WAAAC,GAAA,QAAAC,gBAAA,aAAAP,MAAA,EAAAM,GAAA,EAAAF,MAAA,CAAAE,GAAA,SAAAhB,MAAA,CAAAkB,yBAAA,GAAAlB,MAAA,CAAAmB,gBAAA,CAAAT,M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IAAA,OAAA/C,KAAA,CAAAd,KAAA,OAAAI,SAAA;EAAA;AAAA,GAkDX;AAAC0D,OAAA,CAAAjD,MAAA,GAAAA,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Entity"],"sources":["../../../../src/components/EntityManager/Entity/index.js"],"sourcesContent":["import Entity from './Entity';\n\nexport default Entity;\n"],"mappings":";;;;;;;;AAAA;AAA8B,eAEfA,kBAAM;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_Entity","_interopRequireDefault","require","_default","Entity","exports"],"sources":["../../../../src/components/EntityManager/Entity/index.js"],"sourcesContent":["import Entity from './Entity';\n\nexport default Entity;\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8B,IAAAC,QAAA,GAEfC,kBAAM;AAAAC,OAAA,cAAAF,QAAA"}