@antscorp/antsomi-ui 1.8.1 → 1.8.2
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.
|
@@ -18,12 +18,20 @@ import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
|
18
18
|
import styled from 'styled-components';
|
|
19
19
|
const StyledIframe = styled.iframe `
|
|
20
20
|
border: none;
|
|
21
|
+
opacity: 0;
|
|
21
22
|
`;
|
|
22
23
|
export const Iframe = props => {
|
|
23
|
-
const { children, className } = props, restProps = __rest(props, ["children", "className"]);
|
|
24
|
+
const { children, className, src, srcDoc } = props, restProps = __rest(props, ["children", "className", "src", "srcDoc"]);
|
|
24
25
|
// Ref
|
|
25
26
|
const iframeRef = useRef(null);
|
|
26
27
|
// Effects
|
|
28
|
+
useEffect(() =>
|
|
29
|
+
// Handle hide iframe until iframe is loaded
|
|
30
|
+
() => {
|
|
31
|
+
if (iframeRef.current) {
|
|
32
|
+
iframeRef.current.style.opacity = '0';
|
|
33
|
+
}
|
|
34
|
+
}, [src, srcDoc]);
|
|
27
35
|
useEffect(() => {
|
|
28
36
|
const iframe = iframeRef.current;
|
|
29
37
|
const handleLoad = () => {
|
|
@@ -46,8 +54,9 @@ export const Iframe = props => {
|
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
56
|
`;
|
|
49
|
-
if (iframeDoc) {
|
|
57
|
+
if (iframeDoc && iframeRef.current) {
|
|
50
58
|
iframeDoc.head.appendChild(style);
|
|
59
|
+
iframeRef.current.style.opacity = '1';
|
|
51
60
|
}
|
|
52
61
|
};
|
|
53
62
|
if (iframe) {
|
|
@@ -59,5 +68,5 @@ export const Iframe = props => {
|
|
|
59
68
|
}
|
|
60
69
|
};
|
|
61
70
|
}, []);
|
|
62
|
-
return (React.createElement(StyledIframe, Object.assign({}, restProps, { className: clsx('antsomi-iframe', className), ref: iframeRef })));
|
|
71
|
+
return (React.createElement(StyledIframe, Object.assign({}, restProps, { src: src, srcDoc: srcDoc, className: clsx('antsomi-iframe', className), ref: iframeRef })));
|
|
63
72
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MENU_CODE, APP_ROLE_SCOPE, MENU_PERMISSIONS
|
|
1
|
+
import { MENU_CODE, APP_ROLE_SCOPE, MENU_PERMISSIONS } from '../constants';
|
|
2
2
|
import { isEmpty } from 'lodash';
|
|
3
|
+
import { MAP_MENU_TO_PARENT_APP_CODE } from '../../../organism/LeftMenu/constants';
|
|
3
4
|
const EDIT_ROLE = new Set(['CREATE', 'UPDATE', 'DELETE']);
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
@@ -51,7 +52,7 @@ export const checkingRoleScope = (args) => {
|
|
|
51
52
|
return isOK;
|
|
52
53
|
};
|
|
53
54
|
export const hasSelectAccountPermission = (args) => {
|
|
54
|
-
const { activeItemPath, flattenPermissionList, menuListPermission
|
|
55
|
+
const { activeItemPath, flattenPermissionList, menuListPermission } = args;
|
|
55
56
|
if (isEmpty(activeItemPath))
|
|
56
57
|
return false;
|
|
57
58
|
let roleScope = false;
|
|
@@ -74,20 +75,10 @@ export const hasSelectAccountPermission = (args) => {
|
|
|
74
75
|
}
|
|
75
76
|
const menuPermission = (() => {
|
|
76
77
|
var _a;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
case 'SQL_WORKSPACE':
|
|
82
|
-
return 'APP_ANTALYSER';
|
|
83
|
-
default:
|
|
84
|
-
return appItem === null || appItem === void 0 ? void 0 : appItem.permission_code;
|
|
85
|
-
}
|
|
86
|
-
})();
|
|
87
|
-
const parentMenu = menuListPermission === null || menuListPermission === void 0 ? void 0 : menuListPermission.find(item => item.app_code === appPermission);
|
|
88
|
-
return (_a = parentMenu === null || parentMenu === void 0 ? void 0 : parentMenu.childs) === null || _a === void 0 ? void 0 : _a.find(item => item.menu_code === permissionCode);
|
|
89
|
-
}
|
|
90
|
-
return;
|
|
78
|
+
const parentAppCode = MAP_MENU_TO_PARENT_APP_CODE[activeItem.menu_item_code];
|
|
79
|
+
if (parentAppCode) {
|
|
80
|
+
const parentMenu = menuListPermission === null || menuListPermission === void 0 ? void 0 : menuListPermission.find(item => item.app_code === parentAppCode);
|
|
81
|
+
return (_a = parentMenu === null || parentMenu === void 0 ? void 0 : parentMenu.childs) === null || _a === void 0 ? void 0 : _a.find(item => item.menu_code === permissionCode);
|
|
91
82
|
}
|
|
92
83
|
return flattenPermissionList === null || flattenPermissionList === void 0 ? void 0 : flattenPermissionList.find(item => permissionCode === item.menu_code);
|
|
93
84
|
})();
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
### Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
|
4
|
-
|
|
5
|
-
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
|
-
|
|
7
|
-
#### [v1.7.6](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.7.6..v2.0.22)
|
|
8
|
-
|
|
9
|
-
- chore: update storybook version [`d13f194`](https://bitbucket.org/git-vn/at.packages.frontend/commits/d13f19462c2fe117934df7fe2e09fd0aa95a0167)
|
|
10
|
-
- feat: update input width when in view [`f27b982`](https://bitbucket.org/git-vn/at.packages.frontend/commits/f27b982a4427c414a1b5d5538641516a3d35aa6e)
|
|
11
|
-
- chore: update datatable components [`d38cf96`](https://bitbucket.org/git-vn/at.packages.frontend/commits/d38cf9687b2a6fd03396247d04c6ef37a6b030f1)
|
|
12
|
-
|
|
13
|
-
### [v2.0.22](https://bitbucket.org/git-vn/at.packages.frontend/compare/v2.0.22..v1.7.5)
|
|
14
|
-
|
|
15
|
-
> 19 January 2023
|
|
16
|
-
|
|
17
|
-
#### [v1.7.5](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.7.5..v1.7.4)
|
|
18
|
-
|
|
19
|
-
> 11 July 2024
|
|
20
|
-
|
|
21
|
-
- feat(compoents): add component AccountProfile [`e504187`](https://bitbucket.org/git-vn/at.packages.frontend/commits/e5041873fa3236acf35312801754240a7542b8dd)
|
|
22
|
-
- chore(component): remove unuse common folder [`5123bac`](https://bitbucket.org/git-vn/at.packages.frontend/commits/5123bac8005db98661ca48c500aab56ac42b1feb)
|
|
23
|
-
- chore: update formatFitlerValue for useTablisting hook [`2b173a0`](https://bitbucket.org/git-vn/at.packages.frontend/commits/2b173a02ab8fb24a8cd3b6d1c8403c111e831eb4)
|
|
24
|
-
|
|
25
|
-
#### [v1.7.4](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.7.4..v1.3.5-beta.446)
|
|
26
|
-
|
|
27
|
-
> 5 July 2024
|
|
28
|
-
|
|
29
|
-
- chore: update storybook version [`d13f194`](https://bitbucket.org/git-vn/at.packages.frontend/commits/d13f19462c2fe117934df7fe2e09fd0aa95a0167)
|
|
30
|
-
- feat(MatchesAnySelect): create and handle new MatchesAnySelect component [`a89c46e`](https://bitbucket.org/git-vn/at.packages.frontend/commits/a89c46e00e81d5a28ac37f42166dcab1c49212df)
|
|
31
|
-
- chore: update filter matches any datatable [`4db6dc8`](https://bitbucket.org/git-vn/at.packages.frontend/commits/4db6dc81b62a9168ca9fe1a5e39e414e473e7285)
|
|
32
|
-
|
|
33
|
-
#### [v1.3.5-beta.446](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.3.5-beta.446..v1.0.10)
|
|
34
|
-
|
|
35
|
-
> 2 July 2024
|
|
36
|
-
|
|
37
|
-
- chore(datatable): update useTableListing hook [`262def1`](https://bitbucket.org/git-vn/at.packages.frontend/commits/262def14c8a44ae73d1d9163696afc25e026ba45)
|
|
38
|
-
- chore: update data table component [`7fce77d`](https://bitbucket.org/git-vn/at.packages.frontend/commits/7fce77db8191ff7633679ea9befe28718eb40a88)
|
|
39
|
-
- chore(storybook): add addon-controls [`8ea93fc`](https://bitbucket.org/git-vn/at.packages.frontend/commits/8ea93fc4bb41c50f7a7025bc79d968d849e8d113)
|
|
40
|
-
|
|
41
|
-
#### [v1.0.10](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.10..v1.0.9)
|
|
42
|
-
|
|
43
|
-
> 20 June 2024
|
|
44
|
-
|
|
45
|
-
#### [v1.0.9](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.9..v1.0.8)
|
|
46
|
-
|
|
47
|
-
> 20 June 2024
|
|
48
|
-
|
|
49
|
-
#### [v1.0.8](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.8..v1.0.3)
|
|
50
|
-
|
|
51
|
-
> 20 June 2024
|
|
52
|
-
|
|
53
|
-
- feat(SelectAccount): add component [`2f1dea0`](https://bitbucket.org/git-vn/at.packages.frontend/commits/2f1dea035af07a01a6be8da47b531d52d2977bbe)
|
|
54
|
-
- fix: update style for calendar selection [`4347b91`](https://bitbucket.org/git-vn/at.packages.frontend/commits/4347b91f5bbe31caeb64478116c1822fe443f359)
|
|
55
|
-
- feat(EditorTab): use modal async in onCloseTab [`76aece8`](https://bitbucket.org/git-vn/at.packages.frontend/commits/76aece8cc7a44385d63019058daa1f8477c8fbcb)
|
|
56
|
-
|
|
57
|
-
#### [v1.0.3](https://bitbucket.org/git-vn/at.packages.frontend/compare/v1.0.3..v1.0.2)
|
|
58
|
-
|
|
59
|
-
> 17 January 2023
|
|
60
|
-
|
|
61
|
-
- update timeline package [`e198927`](https://bitbucket.org/git-vn/at.packages.frontend/commits/e198927d83931f9155e90ab9a1d9d3a5ac2989c4)
|
|
62
|
-
- update-ticket-editor [`38dd7b0`](https://bitbucket.org/git-vn/at.packages.frontend/commits/38dd7b0a7b2b0b58a63e725419e9b057e053f44f)
|
|
63
|
-
- update-upload-file-ticket-editor [`bb2f2ef`](https://bitbucket.org/git-vn/at.packages.frontend/commits/bb2f2ef1c46f4239ad716c897e53856a6368ea7d)
|
|
64
|
-
|
|
65
|
-
#### v1.0.2
|
|
66
|
-
|
|
67
|
-
> 4 January 2023
|
|
68
|
-
|
|
69
|
-
- Sprint10/vinlt/feature/date advanced [`#24`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/24)
|
|
70
|
-
- Sprint10/sangndd/feature/extend value matches any [`#23`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/23)
|
|
71
|
-
- Sprint10/sangndd/feature/extend value matches any [`#22`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/22)
|
|
72
|
-
- [Scatter chart] Max X-axis giá trị bị lặp [`#20`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/20)
|
|
73
|
-
- Sprint8/vinlt/feature/show data label short [`#18`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/18)
|
|
74
|
-
- Fix duplicate axis max value [`#17`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/17)
|
|
75
|
-
- [Antalyser] Một số bug khi nhập axis giá trị thập phân [`#16`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/16)
|
|
76
|
-
- Sprint6/vinlt/fixbug/chart [`#15`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/15)
|
|
77
|
-
- - Axis allows input of decimal values [`#14`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/14)
|
|
78
|
-
- Sprint4/sangndd/feature/icons [`#12`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/12)
|
|
79
|
-
- Sprint4/sangndd/feature/icons [`#11`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/11)
|
|
80
|
-
- Sprint4/thanghn/fixbug/pivot alias border [`#10`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/10)
|
|
81
|
-
- fix scroll dimension and total column [`#9`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/9)
|
|
82
|
-
- [ANTALYSER][Filter][Khi filter filed có type date và semantic là "Month day" thì không load được danh sách các ngày trong tháng] [`#7`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/7)
|
|
83
|
-
- [ANTALYSER][Pivot chart][Tính năng Add border shadow chưa hoạt động] [`#8`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/8)
|
|
84
|
-
- Fix bug [ANTALYSER][Scatter chart][Label ở cột X và Y chưa đổi theo alias name đã change ở metric] [`#6`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/6)
|
|
85
|
-
- Fix bug [Pivot chart] Row color không hiển thị được khi chọn hiển thị data của metric là Bar [`#5`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/5)
|
|
86
|
-
- Fix bug package antscorp/charts [`#1`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/1)
|
|
87
|
-
- Fix bug package antscorp/chart [`#2`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/2)
|
|
88
|
-
- table component [`#1`](https://bitbucket.org/git-vn/at.packages.frontend/pull-requests/1)
|
|
89
|
-
- Update map indonesia [`fc94208`](https://bitbucket.org/git-vn/at.packages.frontend/commits/fc9420838b3f4087a5763017e9bf7e72ee8c5e31)
|
|
90
|
-
- Update geomap [`43f3098`](https://bitbucket.org/git-vn/at.packages.frontend/commits/43f3098506f30a215dc2b30734590e5c55f8b490)
|
|
91
|
-
- sync package master [`7476118`](https://bitbucket.org/git-vn/at.packages.frontend/commits/7476118de2fcfa1bd6b0a9e3c0f887b29fd149b6)
|