awing-library 2.1.2-dev.520 → 2.1.2-dev.521

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":"AddOrEdit.d.ts","sourceRoot":"","sources":["../../../../src/Features/SYSTEM/Sharing/AddOrEdit.tsx"],"names":[],"mappings":"AAyBA,MAAM,CAAC,OAAO,UAAU,MAAM,4CA2P7B"}
1
+ {"version":3,"file":"AddOrEdit.d.ts","sourceRoot":"","sources":["../../../../src/Features/SYSTEM/Sharing/AddOrEdit.tsx"],"names":[],"mappings":"AAyBA,MAAM,CAAC,OAAO,UAAU,MAAM,4CA0P7B"}
@@ -9,7 +9,7 @@ import ClassicDrawer from "../../../Commons/Components/ClassicDrawer.js";
9
9
  import { useParams } from "react-router";
10
10
  import { useAtom } from "jotai";
11
11
  import { getDifferent } from "../../../Utils/getDifferent.js";
12
- import { WorkspaceOptionsState, WorkspacesState, confirmExitState } from "./Atoms.js";
12
+ import { WorkspacesState, confirmExitState } from "./Atoms.js";
13
13
  import TargetWorkspace from "./component/TargetWorkspace.js";
14
14
  import WorkspaceSharingInformation from "./component/WorkspaceSharingInformation.js";
15
15
  import Context from "./Context.js";
@@ -22,7 +22,6 @@ function Create() {
22
22
  const isCreate = isUndefined(id);
23
23
  const workspaceSharingId = isCreate ? -1 : toNumber(id);
24
24
  const [workspaces, setWorkspaces] = useAtom(WorkspacesState);
25
- const [workspaceOptions] = useAtom(WorkspaceOptionsState);
26
25
  const [confirmExit, setConfirmExit] = useAtom(confirmExitState);
27
26
  const [tabValue, setTabValue] = useState('1');
28
27
  const [filterParams, setFilterParams] = useState([]);
@@ -145,10 +144,11 @@ function Create() {
145
144
  workspaces
146
145
  ]);
147
146
  useEffect(()=>{
148
- const currentWorkspaces = getWorkspacesConfigByFilter(workspaces, workspaceOptions, filterParams);
147
+ const currentWorkspaces = getWorkspacesConfigByFilter(workspaces, filterParams, schemaParams);
149
148
  setWorkspaces(currentWorkspaces);
150
149
  }, [
151
- filterParams
150
+ filterParams,
151
+ schemaParams
152
152
  ]);
153
153
  const handleCloseDrawer = ()=>{
154
154
  setWorkspaces([]);
@@ -30,7 +30,7 @@ export declare const getDefaultValues: (key: string, obj?: WorkspaceOption & {
30
30
  id: number;
31
31
  }[];
32
32
  }) => string | undefined;
33
- export declare const getWorkspacesConfigByFilter: (workspaces: SharingWorkspace[], workspaceOptions: WorkspaceOption[], filterParams: string[]) => {
33
+ export declare const getWorkspacesConfigByFilter: (workspaces: SharingWorkspace[], filterParams: string[], schemaParams: string[]) => {
34
34
  sharingWorkspaceConfigs: Configuration[];
35
35
  __typename?: "SharingWorkspace";
36
36
  id?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../../src/Features/SYSTEM/Sharing/Utils.ts"],"names":[],"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gBAAgB,QAAS,MAAM,QAAQ,eAAe,GAAG;IAAE,SAAS,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,uBAcrG,CAAC;AAEF,eAAO,MAAM,2BAA2B,eACxB,gBAAgB,EAAE,gBAChB,MAAM,EAAE,gBACR,MAAM,EAAE;;;;;;;GA0DzB,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,yCACK,CAAC"}
@@ -211,10 +211,10 @@ const getDefaultValues = (key, obj)=>{
211
211
  return;
212
212
  }
213
213
  };
214
- const getWorkspacesConfigByFilter = (workspaces, workspaceOptions, filterParams)=>lodash.map(lodash.cloneDeep(workspaces), (w)=>{
214
+ const getWorkspacesConfigByFilter = (workspaces, filterParams, schemaParams)=>lodash.map(lodash.cloneDeep(workspaces), (w)=>{
215
215
  const nConfigs = [];
216
216
  const restFilter = [];
217
- const currentWorkspace = lodash.find(workspaceOptions, (o)=>`${o.id}` === `${w.targetWorkspaceId}`);
217
+ const restSchema = [];
218
218
  lodash.each(w.sharingWorkspaceConfigs, (c)=>{
219
219
  if (c?.paramType === SharingConfigParamType.Filter) {
220
220
  if (lodash.includes(getLowerCase(filterParams), c?.paramName?.toLowerCase())) {
@@ -228,21 +228,34 @@ const getWorkspacesConfigByFilter = (workspaces, workspaceOptions, filterParams)
228
228
  });
229
229
  }
230
230
  }
231
- } else if (c) nConfigs.push({
232
- id: c.id,
233
- paramName: c?.paramName ?? '',
234
- paramValue: c.paramValue,
235
- paramType: c.paramType
236
- });
231
+ } else if (lodash.includes(getLowerCase(schemaParams), c?.paramName?.toLowerCase())) {
232
+ if (c) {
233
+ restSchema.push(c?.paramName ?? '');
234
+ nConfigs.push({
235
+ id: c.id,
236
+ paramName: c?.paramName ?? '',
237
+ paramValue: c.paramValue,
238
+ paramType: c.paramType
239
+ });
240
+ }
241
+ }
237
242
  });
238
243
  lodash.each(lodash.difference(getLowerCase(filterParams), getLowerCase(restFilter)), (r)=>{
239
244
  nConfigs.push({
240
245
  id: generateUniqueId(),
241
246
  paramName: filterParams[lodash.findIndex(getLowerCase(filterParams), (f)=>f === r)],
242
- paramValue: getDefaultValues(r, currentWorkspace),
247
+ paramValue: getDefaultValues(r, w.targetWorkspace),
243
248
  paramType: SharingConfigParamType.Filter
244
249
  });
245
250
  });
251
+ lodash.each(lodash.difference(getLowerCase(schemaParams), getLowerCase(restSchema)), (r)=>{
252
+ nConfigs.push({
253
+ id: generateUniqueId(),
254
+ paramName: schemaParams[lodash.findIndex(getLowerCase(schemaParams), (f)=>f === r)],
255
+ paramValue: getDefaultValues(r, w.targetWorkspace),
256
+ paramType: SharingConfigParamType.Schema
257
+ });
258
+ });
246
259
  return {
247
260
  ...w,
248
261
  sharingWorkspaceConfigs: nConfigs
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceSharingConfig.d.ts","sourceRoot":"","sources":["../../../../../src/Features/SYSTEM/Sharing/component/WorkspaceSharingConfig.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA0B,kBAAkB,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInH,MAAM,MAAM,2BAA2B,GAAG;IACtC,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,0BAA0B,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAClD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,CAAC,MAAM,EAAE;QAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,aAAa,EAAE,CAAC;KACnC,KAAK,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CAyPhF"}
1
+ {"version":3,"file":"WorkspaceSharingConfig.d.ts","sourceRoot":"","sources":["../../../../../src/Features/SYSTEM/Sharing/component/WorkspaceSharingConfig.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA0B,kBAAkB,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInH,MAAM,MAAM,2BAA2B,GAAG;IACtC,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,0BAA0B,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAClD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,CAAC,MAAM,EAAE;QAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,aAAa,EAAE,CAAC;KACnC,KAAK,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CA+OhF"}
@@ -29,9 +29,6 @@ function WorkspaceSharingConfig(props) {
29
29
  if (configId) {
30
30
  const currentWorkspace = find(workspaces, (w)=>`${w.id}` === `${configId}`);
31
31
  if (!currentWorkspace) return;
32
- const currentWorkspaceByOption = {
33
- id: currentWorkspace.targetWorkspaceId
34
- };
35
32
  const pushedFilter = [];
36
33
  const pushedSchema = [];
37
34
  const crFilter = currentWorkspace?.sharingWorkspaceConfigs?.filter((i)=>{
@@ -51,13 +48,13 @@ function WorkspaceSharingConfig(props) {
51
48
  const restFilter = map(difference(filter, pushedFilter), (i)=>({
52
49
  id: generateUniqueId(),
53
50
  paramName: i,
54
- paramValue: getDefaultValues(i, currentWorkspaceByOption),
51
+ paramValue: getDefaultValues(i, currentWorkspace.targetWorkspace),
55
52
  paramType: SharingConfigParamType.Filter
56
53
  }));
57
54
  const restSchema = map(difference(schema, pushedSchema), (i)=>({
58
55
  id: generateUniqueId(),
59
56
  paramName: i,
60
- paramValue: getDefaultValues(i, currentWorkspaceByOption),
57
+ paramValue: getDefaultValues(i, currentWorkspace.targetWorkspace),
61
58
  paramType: SharingConfigParamType.Schema
62
59
  }));
63
60
  setConfigurations({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.520",
3
+ "version": "2.1.2-dev.521",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {