@antscorp/antsomi-ui 1.3.5-beta.455 → 1.3.5-beta.456

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.
@@ -17,7 +17,10 @@ export const ShareAccess = (props) => {
17
17
  useDeepCompareEffect(() => {
18
18
  if (!accessInfo)
19
19
  return;
20
- dispatch(updateObjAccessInfo(formattedAccessInfo(accessInfo)));
20
+ dispatch(updateObjAccessInfo({
21
+ updated: formattedAccessInfo(accessInfo),
22
+ triggerOut: false,
23
+ }));
21
24
  }, [accessInfo]);
22
25
  return (React.createElement(ShareAccessStateContext.Provider, { value: Object.assign(Object.assign({}, state), { excludeUserAccess, accessUserId: userId, accessUserPermission: userPermission }) },
23
26
  React.createElement(ShareAccessDispatchContext.Provider, { value: dispatch },
@@ -3,9 +3,15 @@ export declare const TYPES: {
3
3
  readonly UPDATE_OBJECT_ACCESS_INFO: "UPDATE_OBJECT_ACCESS_INFO";
4
4
  readonly UPDATE_MODAL_TRANSTER_OWNERSHIP: "UPDATE_MODAL_TRANSTER_OWNERSHIP";
5
5
  };
6
- export declare const updateObjAccessInfo: (objectAccessInfo: ObjectAccessInfo) => {
6
+ export declare const updateObjAccessInfo: (payload: {
7
+ updated: ObjectAccessInfo;
8
+ triggerOut?: boolean;
9
+ }) => {
7
10
  type: "UPDATE_OBJECT_ACCESS_INFO";
8
- payload: ObjectAccessInfo;
11
+ payload: {
12
+ updated: ObjectAccessInfo;
13
+ triggerOut?: boolean | undefined;
14
+ };
9
15
  };
10
16
  export declare const updateModalTransferOwnership: (modalState: Partial<ShareAccessState['modalTransferOwnership']>) => {
11
17
  type: "UPDATE_MODAL_TRANSTER_OWNERSHIP";
@@ -2,9 +2,9 @@ export const TYPES = {
2
2
  UPDATE_OBJECT_ACCESS_INFO: 'UPDATE_OBJECT_ACCESS_INFO',
3
3
  UPDATE_MODAL_TRANSTER_OWNERSHIP: 'UPDATE_MODAL_TRANSTER_OWNERSHIP',
4
4
  };
5
- export const updateObjAccessInfo = (objectAccessInfo) => ({
5
+ export const updateObjAccessInfo = (payload) => ({
6
6
  type: TYPES.UPDATE_OBJECT_ACCESS_INFO,
7
- payload: objectAccessInfo,
7
+ payload,
8
8
  });
9
9
  export const updateModalTransferOwnership = (modalState) => ({
10
10
  type: TYPES.UPDATE_MODAL_TRANSTER_OWNERSHIP,
@@ -22,7 +22,7 @@ export const GeneralAccess = ({ generalAccessSettings }) => {
22
22
  draft.publicRole = PUBLIC_ROLE.ONLY_VIEWER;
23
23
  }
24
24
  });
25
- dispatch(updateObjAccessInfo(updated));
25
+ dispatch(updateObjAccessInfo({ updated }));
26
26
  };
27
27
  const handleChangePublicRole = (value) => {
28
28
  if (!accessInfo || !dispatch || !allowEdit)
@@ -30,7 +30,7 @@ export const GeneralAccess = ({ generalAccessSettings }) => {
30
30
  const updated = produce(accessInfo, draft => {
31
31
  draft.publicRole = value;
32
32
  });
33
- dispatch(updateObjAccessInfo(updated));
33
+ dispatch(updateObjAccessInfo({ updated }));
34
34
  };
35
35
  const renderDescription = () => {
36
36
  let description = 'Only people with access can open this item';
@@ -33,7 +33,7 @@ export const ModalTransferOwnership = () => {
33
33
  draft.ownerId = userToOwnerShipId;
34
34
  });
35
35
  if (needUpdate) {
36
- dispatch(updateObjAccessInfo(updated));
36
+ dispatch(updateObjAccessInfo({ updated }));
37
37
  }
38
38
  handleClose();
39
39
  };
@@ -60,7 +60,7 @@ export const PeopleAccess = (props) => {
60
60
  });
61
61
  if (!needDispatchUpdate)
62
62
  return;
63
- dispatch(updateObjAccessInfo(updated));
63
+ dispatch(updateObjAccessInfo({ updated }));
64
64
  };
65
65
  const renderActionItems = (actions) => {
66
66
  let hasDivider = false;
@@ -66,7 +66,7 @@ export const SearchUser = (props) => {
66
66
  const newUser = Object.assign({ userId: user.user_id, fullName: user.full_name, email: user.email, avatar: user.avatar }, defaultViewerProps);
67
67
  draft.listAccess.push(newUser);
68
68
  });
69
- dispatch(updateObjAccessInfo(updated));
69
+ dispatch(updateObjAccessInfo({ updated }));
70
70
  setUsers([]);
71
71
  };
72
72
  if (!allowEdit)
@@ -4,9 +4,10 @@ import { mappingOutData } from './utils';
4
4
  export const shareAccessReducer = (onChange) => (state, action) => produce(state, draft => {
5
5
  switch (action.type) {
6
6
  case TYPES.UPDATE_OBJECT_ACCESS_INFO: {
7
- draft.accessInfo = action.payload;
8
- if (onChange) {
9
- onChange(mappingOutData(action.payload));
7
+ const { updated, triggerOut = true } = action.payload;
8
+ draft.accessInfo = updated;
9
+ if (onChange && triggerOut) {
10
+ onChange(mappingOutData(action.payload.updated));
10
11
  }
11
12
  break;
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.455",
3
+ "version": "1.3.5-beta.456",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",