awing-library 2.1.2-dev.553 → 2.1.2-dev.554

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.
@@ -9,7 +9,7 @@ var __webpack_modules__ = {
9
9
  "AWING/DataInput": function(module) {
10
10
  module.exports = __WEBPACK_EXTERNAL_MODULE__DataInput_index_js_c7933a4f__;
11
11
  },
12
- "../helper": function(module) {
12
+ "AWING/helper": function(module) {
13
13
  module.exports = __WEBPACK_EXTERNAL_MODULE__helper_js_663c9e82__;
14
14
  }
15
15
  };
@@ -92,9 +92,9 @@ jest.mock('@mui/material', ()=>({
92
92
  })
93
93
  }));
94
94
  const mockInputFactory = __webpack_require__("AWING/DataInput")["default"];
95
- const mockCalculateValue = __webpack_require__("../helper").calculateValue;
96
- const mockConvertFormulaToBinaryTree = __webpack_require__("../helper").convertFormulaToBinaryTree;
97
- const mockReplaceFieldsValue = __webpack_require__("../helper").replaceFieldsValue;
95
+ const mockCalculateValue = __webpack_require__("AWING/helper").calculateValue;
96
+ const mockConvertFormulaToBinaryTree = __webpack_require__("AWING/helper").convertFormulaToBinaryTree;
97
+ const mockReplaceFieldsValue = __webpack_require__("AWING/helper").replaceFieldsValue;
98
98
  describe('DataForm Component', ()=>{
99
99
  const mockFields = [
100
100
  {
@@ -1 +1 @@
1
- {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/AWING/DirectoryPermission/AddOrEdit/Container.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,SAAS,CAAC;AAEvE,QAAA,MAAM,mBAAmB,UAAW,cAAc,4CAiTjD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/AWING/DirectoryPermission/AddOrEdit/Container.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,SAAS,CAAC;AAEvE,QAAA,MAAM,mBAAmB,UAAW,cAAc,4CAgTjD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -30,16 +30,17 @@ const AddOrEditPermission = (props)=>{
30
30
  const setSchemas = useSetAtom(schemasState);
31
31
  const { authenType, authenValue } = getAuthenValueAndType(authenTypeValue ?? '', AUTHEN_PATH_SEPARATION);
32
32
  const currentEditPermission = listPermission?.find((p)=>p.authenType === authenType && p.authenValue === authenValue);
33
+ const defaultPermission = {
34
+ schemaId: null,
35
+ permissions: [],
36
+ workflowStateIds: []
37
+ };
33
38
  const [readyForSubmit, setReadyForSubmit] = useState(false);
34
39
  const [confirmExit, setConfirmExit] = useState(false);
35
40
  const [authenPermissions, setAuthenPermissions] = useState([]);
36
41
  const [explicitMatrixPermissions, setExplicitMatrixPermissions] = useState([]);
37
42
  const [explicitPermissions, setExplicitPermissions] = useState([
38
- {
39
- schemaId: null,
40
- permissions: [],
41
- workflowStateIds: []
42
- }
43
+ defaultPermission
43
44
  ]);
44
45
  const [schemasByWorkspace, setSchemasByWorkspace] = useState([]);
45
46
  const [currentPermission, setCurrentPermission] = useState(getDefaultCurrentPermission('Role'));
@@ -172,15 +173,16 @@ const AddOrEditPermission = (props)=>{
172
173
  objectTypeCodeSelected
173
174
  ]);
174
175
  useEffect(()=>{
175
- if (schemasFiltered.length) setExplicitPermissions((prev)=>{
176
- const isDefaultState = 1 === prev.length && prev[0]?.schemaId == null;
177
- if (!isDefaultState) return prev;
176
+ schemasFiltered.length ? setExplicitPermissions((prev)=>{
177
+ if (!isCreate) return prev;
178
178
  return schemasFiltered.map((s)=>({
179
179
  schemaId: s.id,
180
180
  permissions: [],
181
181
  workflowStateIds: []
182
182
  }));
183
- });
183
+ }) : setExplicitPermissions([
184
+ defaultPermission
185
+ ]);
184
186
  setSchemas(schemasFiltered);
185
187
  }, [
186
188
  schemasFiltered
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.553",
3
+ "version": "2.1.2-dev.554",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {