@tap-payments/os-micro-frontend-shared 0.0.271 → 0.0.273-test.1
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.
- package/build/components/VirtualTable/components/TableError.d.ts +11 -0
- package/build/components/VirtualTable/components/TableError.js +23 -0
- package/build/components/VirtualTable/components/TableNoData.d.ts +1 -1
- package/build/components/VirtualTable/components/TableNoData.js +3 -22
- package/build/components/VirtualTable/components/index.d.ts +2 -0
- package/build/components/VirtualTable/components/index.js +2 -0
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/utils/date.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type TableErrorProps = {
|
|
3
|
+
isTimeoutError?: boolean;
|
|
4
|
+
tableError?: boolean;
|
|
5
|
+
sandboxMode?: boolean;
|
|
6
|
+
tableEmpty?: boolean;
|
|
7
|
+
error: Error | null;
|
|
8
|
+
triggerDataRefetch: () => Promise<unknown>;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<(props: TableErrorProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import ErrorList from './ErrorList';
|
|
4
|
+
import { backendErrorHandler } from '../../../utils/index.js';
|
|
5
|
+
import EmptyList from './EmptyList';
|
|
6
|
+
const TableError = (props) => {
|
|
7
|
+
const { isTimeoutError, tableError, triggerDataRefetch, sandboxMode, tableEmpty, error } = props;
|
|
8
|
+
if (isTimeoutError) {
|
|
9
|
+
return (_jsx(ErrorList, { "data-testid": "VirtualTable_ErrorList_timeoutError", shouldMinimizeWidth: true, heading: "timeOut", message: "yourRequestOutPleaseTryAgain", triggerDataRefetch: triggerDataRefetch, sandboxMode: sandboxMode }));
|
|
10
|
+
}
|
|
11
|
+
if (tableError) {
|
|
12
|
+
const axiosErr = error;
|
|
13
|
+
const { formatted } = backendErrorHandler({ error: axiosErr, fallbackMessage: 'connectionErrorMsg' });
|
|
14
|
+
return (_jsx(ErrorList, { "data-testid": "VirtualTable_ErrorList_tableError", heading: "somethingWentWrong", message: formatted, triggerDataRefetch: triggerDataRefetch, sandboxMode: sandboxMode }));
|
|
15
|
+
}
|
|
16
|
+
if (tableEmpty) {
|
|
17
|
+
const axiosErr = error;
|
|
18
|
+
const { formatted } = backendErrorHandler({ error: axiosErr, fallbackMessage: 'tryAdjustingTheDateOrFilters' });
|
|
19
|
+
return _jsx(EmptyList, { sandboxMode: sandboxMode, heading: "nothingFound", message: formatted });
|
|
20
|
+
}
|
|
21
|
+
return (_jsx(ErrorList, { "data-testid": "VirtualTable_ErrorList_tableError", heading: "somethingWentWrong", message: "connectionErrorMsg", triggerDataRefetch: triggerDataRefetch, sandboxMode: sandboxMode }));
|
|
22
|
+
};
|
|
23
|
+
export default memo(TableError);
|
|
@@ -10,7 +10,7 @@ interface TableNoDataProps {
|
|
|
10
10
|
triggerDataRefetch: () => Promise<unknown>;
|
|
11
11
|
footerProps: IVirtualTable['footerProps'];
|
|
12
12
|
}
|
|
13
|
-
declare function TableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps, }: TableNoDataProps): JSX.Element;
|
|
13
|
+
declare function TableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps, }: TableNoDataProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
declare namespace TableNoData {
|
|
15
15
|
var displayName: string;
|
|
16
16
|
}
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
-
import { backendErrorHandler } from '../../../utils/index.js';
|
|
4
|
-
import EmptyList from './EmptyList/EmptyList';
|
|
5
|
-
import ErrorList from './ErrorList/ErrorList';
|
|
6
3
|
import TableLoading from './TableLoading';
|
|
7
4
|
import { StyledSolidBackground } from '../style';
|
|
5
|
+
import TableError from './TableError';
|
|
8
6
|
function TableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps, }) {
|
|
9
|
-
let content;
|
|
10
7
|
if (tableLoading) {
|
|
11
|
-
|
|
8
|
+
return (_jsx(StyledSolidBackground, Object.assign({ "data-testid": "VirtualTable_SolidBackground" }, { children: _jsx(TableLoading, { "data-testid": "VirtualTable_TableLoading", columns: orderedColumns, isLoading: true }) })));
|
|
12
9
|
}
|
|
13
|
-
|
|
14
|
-
content = (_jsx(ErrorList, { "data-testid": "VirtualTable_ErrorList_timeoutError", shouldMinimizeWidth: true, heading: "timeOut", message: "yourRequestOutPleaseTryAgain", triggerDataRefetch: triggerDataRefetch, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode }));
|
|
15
|
-
}
|
|
16
|
-
else if (tableError) {
|
|
17
|
-
const axiosErr = error;
|
|
18
|
-
const { formatted } = backendErrorHandler({ error: axiosErr, fallbackMessage: 'connectionErrorMsg' });
|
|
19
|
-
content = (_jsx(ErrorList, { "data-testid": "VirtualTable_ErrorList_tableError", heading: "somethingWentWrong", message: formatted, triggerDataRefetch: triggerDataRefetch, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode }));
|
|
20
|
-
}
|
|
21
|
-
else if (tableEmpty) {
|
|
22
|
-
const axiosErr = error;
|
|
23
|
-
const { formatted } = backendErrorHandler({ error: axiosErr, fallbackMessage: 'tryAdjustingTheDateOrFilters' });
|
|
24
|
-
content = _jsx(EmptyList, { sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode, heading: "nothingFound", message: formatted });
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
content = (_jsx(ErrorList, { "data-testid": "VirtualTable_ErrorList_tableError", heading: "somethingWentWrong", message: "connectionErrorMsg", triggerDataRefetch: triggerDataRefetch, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode }));
|
|
28
|
-
}
|
|
29
|
-
return content;
|
|
10
|
+
return (_jsx(TableError, { isTimeoutError: isTimeoutError, tableEmpty: tableEmpty, tableError: tableError, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode, error: error, triggerDataRefetch: triggerDataRefetch }));
|
|
30
11
|
}
|
|
31
12
|
TableNoData.displayName = 'TableNoData';
|
|
32
13
|
export default memo(TableNoData);
|
|
@@ -2,6 +2,8 @@ export { default as ColumnFilter, Inputs, List } from './ColumnFilter';
|
|
|
2
2
|
export * from './EmptyList';
|
|
3
3
|
export * from './ErrorList';
|
|
4
4
|
export * from './TableFooter';
|
|
5
|
+
export { default as TableFooter } from './TableFooter';
|
|
6
|
+
export { default as TableError } from './TableError';
|
|
5
7
|
export * from './virtualScroll';
|
|
6
8
|
export * from './RowErrorState';
|
|
7
9
|
export { default as TableHeader } from './TableHeader';
|
|
@@ -2,6 +2,8 @@ export { default as ColumnFilter, Inputs, List } from './ColumnFilter';
|
|
|
2
2
|
export * from './EmptyList';
|
|
3
3
|
export * from './ErrorList';
|
|
4
4
|
export * from './TableFooter';
|
|
5
|
+
export { default as TableFooter } from './TableFooter';
|
|
6
|
+
export { default as TableError } from './TableError';
|
|
5
7
|
export * from './virtualScroll';
|
|
6
8
|
export * from './RowErrorState';
|
|
7
9
|
export { default as TableHeader } from './TableHeader';
|
|
@@ -12,7 +12,7 @@ export { default as Checkbox } from './Checkbox';
|
|
|
12
12
|
export { default as Dialog, DialogToolbar } from './Dialog';
|
|
13
13
|
export { default as Tooltip } from './Tooltip';
|
|
14
14
|
export * from './RFH';
|
|
15
|
-
export { default as VirtualTable, TableRowLoading, TableHeader as VirtualTableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
15
|
+
export { default as VirtualTable, TableRowLoading, TableHeader as VirtualTableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, TableFooter, TableError, } from './VirtualTable';
|
|
16
16
|
export { default as SheetViewVirtualTable } from './VirtualTable/SheetView/SheetViewVirtualTable';
|
|
17
17
|
export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
|
|
18
18
|
export { default as TapLogo } from './TapLogo';
|
|
@@ -12,7 +12,7 @@ export { default as Checkbox } from './Checkbox';
|
|
|
12
12
|
export { default as Dialog, DialogToolbar } from './Dialog';
|
|
13
13
|
export { default as Tooltip } from './Tooltip';
|
|
14
14
|
export * from './RFH';
|
|
15
|
-
export { default as VirtualTable, TableRowLoading, TableHeader as VirtualTableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
15
|
+
export { default as VirtualTable, TableRowLoading, TableHeader as VirtualTableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, TableFooter, TableError, } from './VirtualTable';
|
|
16
16
|
export { default as SheetViewVirtualTable } from './VirtualTable/SheetView/SheetViewVirtualTable';
|
|
17
17
|
export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
|
|
18
18
|
export { default as TapLogo } from './TapLogo';
|
package/build/utils/date.js
CHANGED
|
@@ -58,7 +58,7 @@ export const formatUTCOffset = (offset = 0) => {
|
|
|
58
58
|
const paddedOffset = Math.abs(offset).toString().padStart(2, '0');
|
|
59
59
|
return `UTC${sign}${paddedOffset}:00`;
|
|
60
60
|
};
|
|
61
|
-
export const getDefaultDateRange = (startDay =
|
|
61
|
+
export const getDefaultDateRange = (startDay = 7) => {
|
|
62
62
|
const monthDaysMinus = dayjs().subtract(startDay, 'day').hour(0).minute(0).second(0).toDate();
|
|
63
63
|
const today = dayjs(new Date()).hour(23).minute(59).second(59).toDate();
|
|
64
64
|
return [monthDaysMinus, today];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.273-test.1",
|
|
5
5
|
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
@@ -131,4 +131,4 @@
|
|
|
131
131
|
"publishConfig": {
|
|
132
132
|
"registry": "https://registry.npmjs.org/"
|
|
133
133
|
}
|
|
134
|
-
}
|
|
134
|
+
}
|