@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.
Files changed (38) hide show
  1. package/package.json +36 -24
  2. package/src/libs/route-metadata.server.ts +67 -0
  3. package/src/modules/Grids.filters.ts +36 -0
  4. package/src/modules/Grids.tsx +610 -0
  5. package/src/modules/RouteShell.tsx +76 -0
  6. package/src/schemas/organization.ts +128 -0
  7. package/src/utils/email.ts +117 -0
  8. package/src/utils/list-web.ts +17 -0
  9. package/src/utils/log-web.helpers.ts +99 -0
  10. package/src/utils/log-web.icons.ts +184 -0
  11. package/src/utils/log-web.ts +74 -364
  12. package/src/utils/operation-pages.ts +154 -0
  13. package/src/utils/org-web.ts +35 -8
  14. package/src/utils/route-helpers.ts +837 -596
  15. package/src/utils/workflow-web.ts +72 -0
  16. package/tests/log-web.test.ts +134 -0
  17. package/tests/route-helpers.test.ts +17 -0
  18. package/tsconfig.json +11 -11
  19. package/src/modules/DataTable-ContextMenu.tsx +0 -169
  20. package/src/modules/DataTable-InboundContact.tsx +0 -523
  21. package/src/modules/DataTable.tsx +0 -5060
  22. package/src/modules/Sheet-ContextMenu.tsx +0 -161
  23. package/src/modules/Sheet.tsx +0 -28
  24. package/src/modules/cell-save-beacon.ts +0 -67
  25. package/src/modules/dataTable-interaction-state.ts +0 -276
  26. package/src/modules/dataTable-shortcuts.ts +0 -192
  27. package/src/modules/dataTable-viewport.ts +0 -89
  28. package/src/modules/grid-cell-render.ts +0 -72
  29. package/src/modules/grid-context-menu.ts +0 -112
  30. package/src/modules/grid-keyboard.ts +0 -267
  31. package/src/modules/grid-render-store.ts +0 -103
  32. package/src/modules/grid-runtime.ts +0 -178
  33. package/src/modules/grid-selection.ts +0 -336
  34. package/src/modules/grid-viewport.ts +0 -57
  35. package/src/modules/use-dataTable-states.ts +0 -529
  36. package/src/modules/use-debounced-cell-save-batch.ts +0 -160
  37. package/tests/DataTable.test.tsx +0 -4466
  38. package/tests/dataTable-interaction-state.test.ts +0 -127
@@ -1,14 +1,39 @@
1
1
  import i18n from '@jsb188/app/i18n/index.ts';
2
- import type { OrganizationGQL } from '@jsb188/mday/types/organization.d.ts';
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 all title icons for organization/vendor
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: COMMON_ICON_NAMES[operation] || 'info-circle',
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((item: any) => item.expirationDate && item.expirationDate > todayCalDate);
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({