@tap-payments/os-micro-frontend-shared 0.0.166 → 0.0.168
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.
|
@@ -7,7 +7,6 @@ export const JsonViewerDialogContextProvider = ({ children }) => {
|
|
|
7
7
|
const [isWindowMinimized, setIsWindowMinimized] = useState(false);
|
|
8
8
|
const [windowOrder, setWindowOrder] = useState(1);
|
|
9
9
|
const handleJsonViewerDialogOpen = useCallback((jsonViewer) => {
|
|
10
|
-
var _a;
|
|
11
10
|
if (jsonViewerList.length === 7) {
|
|
12
11
|
alert('Maximum allowed active Json Viewer is 7 per table.');
|
|
13
12
|
return;
|
|
@@ -15,8 +14,14 @@ export const JsonViewerDialogContextProvider = ({ children }) => {
|
|
|
15
14
|
if (jsonViewerList.some((item) => item.json.id === jsonViewer.json.id)) {
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const jsonCopy = structuredClone(jsonViewer.json);
|
|
18
|
+
const requestData = jsonCopy.request_body;
|
|
19
|
+
const jsonViewerPreservedRequest = {
|
|
20
|
+
json: jsonCopy,
|
|
21
|
+
requestJson: jsonViewer.requestJson || requestData || undefined,
|
|
22
|
+
};
|
|
23
|
+
delete jsonViewerPreservedRequest.json.request_body;
|
|
24
|
+
setJsonViewerList((prev) => [...prev, jsonViewerPreservedRequest]);
|
|
20
25
|
}, [jsonViewerList]);
|
|
21
26
|
const handleJsonViewerDialogClose = (index) => {
|
|
22
27
|
setJsonViewerList((prev) => prev.filter((_, idx) => index !== idx));
|
|
@@ -35,16 +35,20 @@ function StatusButton(_a) {
|
|
|
35
35
|
const dropdownIcon = hasDropdown ? _jsx(ChevronIcon, { isActive: variant === 'active' }) : null;
|
|
36
36
|
return (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ "data-testid": "StatusButton" }, props, { ref: buttonRef, onClick: (e) => {
|
|
37
37
|
var _a, _b;
|
|
38
|
-
e.stopPropagation();
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
if (hasDropdown) {
|
|
41
|
-
setAnchorEl(buttonRef.current);
|
|
42
|
-
}
|
|
43
38
|
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
44
39
|
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(lastActiveStatus || ((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status) || 'all');
|
|
45
40
|
}, sx: Object.assign({}, (hasDropdown && {
|
|
46
41
|
paddingInlineEnd: '27px',
|
|
47
|
-
})) }, { children: _jsxs(LabelWrapper,
|
|
42
|
+
})) }, { children: _jsxs(LabelWrapper, Object.assign({ onClick: (e) => {
|
|
43
|
+
if (showDropdownIcon) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
if (hasDropdown) {
|
|
49
|
+
setAnchorEl(buttonRef.current);
|
|
50
|
+
}
|
|
51
|
+
} }, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, lastActiveStatus ? t(lastActiveStatus) : label, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] })) })), open && !showDropdownIcon && (_jsx(StyledDropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: (_c = (dropdownOptions || [])) === null || _c === void 0 ? void 0 : _c.map((item) => (Object.assign(Object.assign({}, item), { onClick: (e) => {
|
|
48
52
|
var _a;
|
|
49
53
|
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
50
54
|
setLastActiveStatus(item.status);
|
|
@@ -35,16 +35,17 @@ export const StatusButton = memo((props) => {
|
|
|
35
35
|
const dropdownIcon = hasDropdown ? _jsx(ChevronIcon, { isActive: variant === 'active' }) : null;
|
|
36
36
|
return (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ "data-testid": "StatusButton" }, restProps, { ref: buttonRef, onClick: (e) => {
|
|
37
37
|
var _a, _b;
|
|
38
|
-
e.stopPropagation();
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
if (hasDropdown) {
|
|
41
|
-
setAnchorEl(buttonRef.current);
|
|
42
|
-
}
|
|
43
38
|
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
44
39
|
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(lastActiveStatus || ((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status) || 'all');
|
|
45
40
|
}, sx: Object.assign({}, (hasDropdown && {
|
|
46
41
|
paddingInlineEnd: '27px',
|
|
47
|
-
})) }, { children: _jsxs(LabelWrapper,
|
|
42
|
+
})) }, { children: _jsxs(LabelWrapper, Object.assign({ onClick: (e) => {
|
|
43
|
+
e.stopPropagation();
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
if (hasDropdown) {
|
|
46
|
+
setAnchorEl(buttonRef.current);
|
|
47
|
+
}
|
|
48
|
+
} }, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, lastActiveStatus ? t(lastActiveStatus) : label, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] })) })), open && (_jsx(StyledDropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: (_b = (dropdownOptions || [])) === null || _b === void 0 ? void 0 : _b.map((item) => (Object.assign(Object.assign({}, item), { onClick: (e) => {
|
|
48
49
|
var _a;
|
|
49
50
|
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
50
51
|
setLastActiveStatus(item.status);
|
package/package.json
CHANGED