@jsb188/mday-web 1.1.10 → 1.1.12
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/package.json +36 -24
- package/src/libs/route-metadata.server.ts +67 -0
- package/src/modules/Grids.filters.ts +36 -0
- package/src/modules/Grids.tsx +610 -0
- package/src/modules/RouteShell.tsx +76 -0
- package/src/schemas/organization.ts +128 -0
- package/src/utils/email.ts +117 -0
- package/src/utils/list-web.ts +17 -0
- package/src/utils/log-web.helpers.ts +99 -0
- package/src/utils/log-web.icons.ts +184 -0
- package/src/utils/log-web.ts +74 -364
- package/src/utils/operation-pages.ts +154 -0
- package/src/utils/org-web.ts +35 -8
- package/src/utils/route-helpers.ts +837 -596
- package/src/utils/workflow-web.ts +72 -0
- package/tests/log-web.test.ts +134 -0
- package/tests/route-helpers.test.ts +17 -0
- package/tsconfig.json +11 -11
- package/src/modules/DataTable-ContextMenu.tsx +0 -169
- package/src/modules/DataTable-InboundContact.tsx +0 -523
- package/src/modules/DataTable.tsx +0 -5060
- package/src/modules/Sheet-ContextMenu.tsx +0 -161
- package/src/modules/Sheet.tsx +0 -28
- package/src/modules/cell-save-beacon.ts +0 -67
- package/src/modules/dataTable-interaction-state.ts +0 -276
- package/src/modules/dataTable-shortcuts.ts +0 -192
- package/src/modules/dataTable-viewport.ts +0 -89
- package/src/modules/grid-cell-render.ts +0 -72
- package/src/modules/grid-context-menu.ts +0 -112
- package/src/modules/grid-keyboard.ts +0 -267
- package/src/modules/grid-render-store.ts +0 -103
- package/src/modules/grid-runtime.ts +0 -178
- package/src/modules/grid-selection.ts +0 -336
- package/src/modules/grid-viewport.ts +0 -57
- package/src/modules/use-dataTable-states.ts +0 -529
- package/src/modules/use-debounced-cell-save-batch.ts +0 -160
- package/tests/DataTable.test.tsx +0 -4466
- package/tests/dataTable-interaction-state.test.ts +0 -127
package/src/utils/org-web.ts
CHANGED
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
import i18n from '@jsb188/app/i18n/index.ts';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
OrganizationGQL,
|
|
4
|
+
OrganizationOperationEnum,
|
|
5
|
+
} from '@jsb188/mday/types/organization.d.ts';
|
|
3
6
|
import { COMMON_ICON_NAMES } from '@jsb188/react-web/svgs/Icon';
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
* Get
|
|
7
|
-
* @param org - Organization GQL data
|
|
8
|
-
* @param showIconsRule - Rules for which icons to show/not-show
|
|
9
|
-
* @returns Array of icon label objects with icon name and tooltip text
|
|
8
|
+
/*
|
|
9
|
+
* Get the icon name for one organization operation.
|
|
10
10
|
*/
|
|
11
|
+
export function getOrgOperationIconName(
|
|
12
|
+
operation?: OrganizationOperationEnum | string | null,
|
|
13
|
+
): string {
|
|
14
|
+
return (operation && COMMON_ICON_NAMES[operation]) || COMMON_ICON_NAMES.info;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* Get the <SimpleLabel> preset for one organization role badge. Owners and
|
|
19
|
+
* admins get colored outlines; every other role falls back to a neutral outline.
|
|
20
|
+
*/
|
|
21
|
+
export function getOrgRoleLabelPreset(
|
|
22
|
+
role?: string | null,
|
|
23
|
+
): 'outline_main' | 'outline_primary' | 'outline_secondary' | 'outline' {
|
|
24
|
+
switch (role) {
|
|
25
|
+
case 'OWNER':
|
|
26
|
+
return 'outline_primary';
|
|
27
|
+
case 'ADMIN':
|
|
28
|
+
return 'outline_secondary';
|
|
29
|
+
default:
|
|
30
|
+
return 'outline';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
11
33
|
|
|
34
|
+
/*
|
|
35
|
+
* Get all title icons for organization/vendor.
|
|
36
|
+
*/
|
|
12
37
|
export function getTitleIconsForOrganization(
|
|
13
38
|
org: OrganizationGQL,
|
|
14
39
|
showIconsRule: Record<string, boolean> = {},
|
|
@@ -18,7 +43,7 @@ export function getTitleIconsForOrganization(
|
|
|
18
43
|
|
|
19
44
|
if (operation && showIconsRule.operation !== false) {
|
|
20
45
|
titleIcons.push({
|
|
21
|
-
iconName:
|
|
46
|
+
iconName: getOrgOperationIconName(operation),
|
|
22
47
|
tooltipText: i18n.t(`org.type.${operation}`),
|
|
23
48
|
});
|
|
24
49
|
}
|
|
@@ -26,7 +51,9 @@ export function getTitleIconsForOrganization(
|
|
|
26
51
|
if (compliance?.length && showIconsRule.compliance !== false) {
|
|
27
52
|
const today = new Date();
|
|
28
53
|
const todayCalDate = today.toISOString().split('T')[0];
|
|
29
|
-
const notExpired = compliance.filter(
|
|
54
|
+
const notExpired = compliance.filter(
|
|
55
|
+
(item: any) => item.expirationDate && item.expirationDate > todayCalDate,
|
|
56
|
+
);
|
|
30
57
|
|
|
31
58
|
if (notExpired.length > 0) {
|
|
32
59
|
titleIcons.push({
|