awing-library 2.1.2-dev.569 → 2.1.2-dev.570

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CreateOrEdit.d.ts","sourceRoot":"","sources":["../../../../src/Features/NOTIFICATION/Template/CreateOrEdit.tsx"],"names":[],"mappings":"AAgBA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAqKnC"}
1
+ {"version":3,"file":"CreateOrEdit.d.ts","sourceRoot":"","sources":["../../../../src/Features/NOTIFICATION/Template/CreateOrEdit.tsx"],"names":[],"mappings":"AAeA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAkJnC"}
@@ -3,7 +3,6 @@ import { Science } from "@mui/icons-material";
3
3
  import { Button } from "@mui/material";
4
4
  import { CircularProgress, DataForm } from "../../../AWING/index.js";
5
5
  import { ClassicDrawer } from "../../../Commons/Components/index.js";
6
- import { useAppHelper } from "../../../Context/hooks.js";
7
6
  import TestingTool from "../components/TestingTool/index.js";
8
7
  import { omit } from "lodash";
9
8
  import { useEffect, useState } from "react";
@@ -18,11 +17,9 @@ function CreateOrEdit() {
18
17
  const { mode, templateId } = useGetComponentInfo();
19
18
  const { services } = useGetContext();
20
19
  const [openTestingTool, setOpenTestingTool] = useState(false);
21
- const { snackbar } = useAppHelper();
22
20
  const [template, setTemplate] = useState({});
23
21
  const [loadingTemplate, setLoadingTemplate] = useState(false);
24
22
  const [loadingCreate, setLoadingCreate] = useState(false);
25
- const [loadingUpdate, setLoadingUpdate] = useState(false);
26
23
  useEffect(()=>{
27
24
  if (templateId && services) {
28
25
  setLoadingTemplate(true);
@@ -39,17 +36,12 @@ function CreateOrEdit() {
39
36
  const { testingDataInput, templateInput, confirmExit, handleTestingChanged, handleChangeContent, handleChangeField, readyForSubmit, readyForTesting } = useTemplate(mode, template, templateId);
40
37
  const fieldPermissions = useTemplatePermissions(mode, template ?? {});
41
38
  const fields = useTemplateFields(mode, templateInput, fieldPermissions, template);
42
- const isShowingDrawerUI = loadingUpdate || loadingTemplate;
39
+ const isShowingDrawerUI = loadingTemplate;
43
40
  const handleSubmit = async ()=>{
44
41
  if (services && mode === FormMode.CREATE) {
45
42
  setLoadingCreate(true);
46
43
  return await services.createTemplate({
47
44
  input: omit(templateInput, 'dataSource')
48
- }).then(()=>{
49
- setLoadingCreate(false);
50
- snackbar('success');
51
- }).catch((error)=>{
52
- snackbar('error', error?.message);
53
45
  });
54
46
  }
55
47
  if (services && templateId) {
@@ -59,16 +51,10 @@ function CreateOrEdit() {
59
51
  'dataSource'
60
52
  ];
61
53
  const input = omit(templateInput, excludeFields);
62
- setLoadingUpdate(true);
63
54
  return await services.updateTemplate({
64
55
  id: templateId,
65
56
  input,
66
57
  versionId: template?.versionId
67
- }).then(()=>{
68
- setLoadingUpdate(false);
69
- snackbar('success');
70
- }).catch((error)=>{
71
- snackbar('error', error?.message);
72
58
  });
73
59
  }
74
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.569",
3
+ "version": "2.1.2-dev.570",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {