@capillarytech/blaze-ui 5.0.8 → 5.0.9

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 (39) hide show
  1. package/.DS_Store +0 -0
  2. package/CapConditionPreview/index.js +184 -132
  3. package/CapConditionPreview/index.js.map +1 -1
  4. package/CapNavigation/index.js +47449 -25621
  5. package/CapNavigation/index.js.map +1 -1
  6. package/CapTopBar/CapOrgSelect.d.ts +12 -0
  7. package/CapTopBar/CapOrgSelect.d.ts.map +1 -0
  8. package/CapTopBar/CapOrgSelectUtils.d.ts +38 -0
  9. package/CapTopBar/CapOrgSelectUtils.d.ts.map +1 -0
  10. package/CapTopBar/README.md +146 -0
  11. package/CapTopBar/constants.d.ts +2 -0
  12. package/CapTopBar/constants.d.ts.map +1 -0
  13. package/CapTopBar/index.d.ts +11 -0
  14. package/CapTopBar/index.d.ts.map +1 -0
  15. package/CapTopBar/index.js +44490 -28171
  16. package/CapTopBar/index.js.map +1 -1
  17. package/CapTopBar/themeConfig.d.ts +6 -0
  18. package/CapTopBar/themeConfig.d.ts.map +1 -0
  19. package/CapTopBar/types.d.ts +106 -0
  20. package/CapTopBar/types.d.ts.map +1 -0
  21. package/CapTopBar/utils.d.ts +8 -0
  22. package/CapTopBar/utils.d.ts.map +1 -0
  23. package/index.d.ts +2 -2
  24. package/index.d.ts.map +1 -1
  25. package/index.js +1042 -721
  26. package/index.js.map +1 -1
  27. package/package.json +1 -1
  28. package/.npmrc +0 -2
  29. package/CapCondition/messages.d.ts +0 -85
  30. package/CapCondition/messages.d.ts.map +0 -1
  31. package/CapConditionPreview/MIGRATION_ANALYSIS.md +0 -70
  32. package/CapConditionPreview/README.md +0 -40
  33. package/CapConditionPreview/constants.d.ts +0 -24
  34. package/CapConditionPreview/constants.d.ts.map +0 -1
  35. package/CapConditionPreview/index.d.ts +0 -7
  36. package/CapConditionPreview/index.d.ts.map +0 -1
  37. package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +0 -65
  38. package/CapConditionPreview/types.d.ts +0 -82
  39. package/CapConditionPreview/types.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/blaze-ui",
3
- "version": "5.0.8",
3
+ "version": "5.0.9",
4
4
  "description": "Capillary UI component library with Ant Design v6",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/.npmrc DELETED
@@ -1,2 +0,0 @@
1
- npm config set scope capillarytech
2
- //registry.npmjs.org/:_authToken=${NPM_TOKEN}
@@ -1,85 +0,0 @@
1
- export declare const scope = "app.commonUtils.capUiLibrary.CapCondition";
2
- declare const _default: {
3
- selectPossibleValue: {
4
- id: string;
5
- defaultMessage: string;
6
- };
7
- searchPossibleValue: {
8
- id: string;
9
- defaultMessage: string;
10
- };
11
- maxPossibleValues: {
12
- id: string;
13
- defaultMessage: string;
14
- };
15
- title: {
16
- id: string;
17
- defaultMessage: string;
18
- };
19
- selectTriggerEventAttribute: {
20
- id: string;
21
- defaultMessage: string;
22
- };
23
- entryTriggerEventAttribute: {
24
- id: string;
25
- defaultMessage: string;
26
- };
27
- selectDateAttribute: {
28
- id: string;
29
- defaultMessage: string;
30
- };
31
- search: {
32
- id: string;
33
- defaultMessage: string;
34
- };
35
- noResultsFound: {
36
- id: string;
37
- defaultMessage: string;
38
- };
39
- more: {
40
- id: string;
41
- defaultMessage: string;
42
- };
43
- onMsg: {
44
- id: string;
45
- defaultMessage: string;
46
- };
47
- beforeMsg: {
48
- id: string;
49
- defaultMessage: string;
50
- };
51
- afterMsg: {
52
- id: string;
53
- defaultMessage: string;
54
- };
55
- betweenMsg: {
56
- id: string;
57
- defaultMessage: string;
58
- };
59
- daysAfterMsg: {
60
- id: string;
61
- defaultMessage: string;
62
- };
63
- daysBeforeMsg: {
64
- id: string;
65
- defaultMessage: string;
66
- };
67
- andMsg: {
68
- id: string;
69
- defaultMessage: string;
70
- };
71
- endDate: {
72
- id: string;
73
- defaultMessage: string;
74
- };
75
- of: {
76
- id: string;
77
- defaultMessage: string;
78
- };
79
- profileNameMessage: {
80
- id: string;
81
- defaultMessage: string;
82
- };
83
- };
84
- export default _default;
85
- //# sourceMappingURL=messages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../components/CapCondition/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,8CAA8C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjE,wBAiFG"}
@@ -1,70 +0,0 @@
1
- # Stage 1: Pre-Analysis Report for CapConditionPreview
2
-
3
- ## 1. Antd Style Overrides Found
4
-
5
- | Line # | Old Override | Can Tokenize? | Token Path | Token Value | Override Reason |
6
- |--------|-------------|---------------|------------|-------------|-----------------|
7
- | — | — | — | — | — | — |
8
-
9
- **Tokenizable overrides**: 0
10
- **Non-tokenizable overrides**: 0
11
- **No antd overrides found - will skip theme config update.**
12
-
13
- CapConditionPreview does not use any Ant Design components. It uses only Cap UI primitives (CapRow, CapColumn, CapLabel, CapIcon, CapTruncateList) and react-intl FormattedMessage. `styles.scss` contains only BEM class `.capConditionPreview__string` (text-overflow/ellipsis) with no `:global` or `.ant-` usage.
14
-
15
- ---
16
-
17
- ## 2. API Breaking Changes
18
-
19
- | Old API | New API | Affected Props |
20
- |---------|---------|----------------|
21
- | — | — | None |
22
-
23
- No Antd components are used; no v3→v6 API changes apply to this component.
24
-
25
- ---
26
-
27
- ## 3. Backward Compatibility Plan
28
-
29
- | Deprecated Prop | Fallback Logic |
30
- |----------------|----------------|
31
- | — | — |
32
-
33
- No deprecated props in this component.
34
-
35
- ---
36
-
37
- ## 4. Type Definitions Needed
38
-
39
- - **CapConditionPreviewProps** – Main props interface (all current props with TypeScript types).
40
- - **LinkedConditionExpression** – Shape for `additionalFields[key].expression` (operator, operand, storeSource, isStoreUploadFailed, isStoreUploadInvalid, storeUploadIsInProgress).
41
- - **AdditionalFieldEntry** – Shape for `additionalFields[key]` (description, factId, expression).
42
- - **DateTypeData** – Shape for `dateTypeData` (dateType, startDate, endDate, date, days, contextData with profileName).
43
- - **DstData** – Shape for `dstData` (e.g. couponSeriesNames); optional/minimal for type safety.
44
- - **ViewMoreLinkComponent** – React component type for `ViewMoreLink` (e.g. `React.ComponentType<{ onClick: () => void; children: React.ReactNode }>`).
45
-
46
- Complex types: `operand` and `listData` are polymorphic (number, string, string[], etc.) depending on `type`; we will use union types or careful typing to avoid `any`.
47
-
48
- ---
49
-
50
- ## 5. PropTypes Removal
51
-
52
- - [x] Component uses PropTypes: **YES**
53
- - [x] PropTypes file exists: **NO** (PropTypes live in index.tsx)
54
- - [x] PropTypes imports found: **YES** (`import PropTypes from 'prop-types'` in index.tsx)
55
- - [x] Component.propTypes assignments found: **YES** (`CapConditionPreview.propTypes = { ... }` in index.tsx)
56
- - **Action**: Remove all PropTypes and replace with TypeScript types from `types.ts`.
57
-
58
- ---
59
-
60
- ## 6. DefaultProps Removal
61
-
62
- - [x] Component uses defaultProps: **NO**
63
- - [x] Component.defaultProps assignments found: **NO**
64
- - [x] Old function syntax with props parameter: **NO** (already uses destructuring `({ ... })`)
65
- - [x] Default values assigned inside function body: **NO** (only `listData = null` and `hideNumberAndProductFields = false` in destructuring)
66
- - **Action**: No defaultProps to remove. Keep destructuring defaults as-is; ensure any other optional props that need defaults get them in destructuring in index.tsx.
67
-
68
- ---
69
-
70
- **STAGE 1 COMPLETE. Proceeding to Stage 2 (skip theme config) and Stage 3 (implementation).**
@@ -1,40 +0,0 @@
1
- # CapConditionPreview
2
-
3
- Preview block for condition configuration (e.g. "Include whose [condition name] is [operator] [operand]").
4
-
5
- ## Migration (Antd v3 → v6)
6
-
7
- - **Antd usage**: This component does **not** use any Ant Design components. It uses only Cap UI primitives (CapRow, CapColumn, CapLabel, CapIcon, CapTruncateList) and `react-intl` FormattedMessage. No theme config or antd API changes apply.
8
- - **PropTypes removed**: All runtime PropTypes were removed and replaced with TypeScript types from `types.ts`.
9
- - **defaultProps**: None were present; default values use destructuring in the component signature (`listData = null`, `hideNumberAndProductFields = false`).
10
- - **Styles**: `styles.scss` has no `:global` or `.ant-` overrides. A single BEM-style class is used for the string truncation state, applied via CSS Modules (`styles.capConditionPreview__string`).
11
-
12
- ## Props
13
-
14
- See `types.ts` for full interfaces. Main props:
15
-
16
- | Prop | Type | Description |
17
- |------|------|-------------|
18
- | `type` | `string` | Data type: NUMBER, STRING, LIST, MULTI_SELECT, STRING_LIST, DATE, entryTriggerEventAttribute, etc. |
19
- | `operand` | `number \| string \| string[]` | Value(s) for the condition. |
20
- | `operator` | `string` | Operator key (EQ, GT, LT, IN, NOT_IN, IS_EXACT_DATE, etc.). |
21
- | `conditionName` | `string` | Label for the condition (e.g. "Extended fields in the transaction"). |
22
- | `isExcluded` | `boolean` | When true, shows "Exclude" instead of "Include". |
23
- | `listData` | `string[] \| null` | List of values for MULTI_SELECT (e.g. SKU list). Default `null`. |
24
- | `additionalFields` | `Record<string, AdditionalFieldEntry>` | Extra condition entries (EXTENDED_FIELD, CUSTOM_FIELD, STORE_FILTER, etc.). |
25
- | `hideNumberAndProductFields` | `boolean` | When true, hides operand/operator block (e.g. journey context). Default `false`. |
26
- | `dateTypeData` | `DateTypeData \| null` | For DATE type: RANGE, SINGLE, DAYS_AFTER, DAYS_BEFORE. |
27
- | `ViewMoreLink` | `ComponentType<ViewMoreLinkProps>` | Custom link component for "View more" (e.g. store filter). |
28
- | `onClickConfigure` | `(blockId: string) => void` | Called when "View more" is clicked. |
29
- | `setPopoverVisible` | `(visible: boolean) => void` | Called to close popover when "View more" is used. |
30
-
31
- Message props (`includeMsg`, `excludeMsg`, `whoseMsg`, `equalMsg`, etc.) are typically provided by `LocaleHoc` from translations.
32
-
33
- ## Breaking changes
34
-
35
- None. This component did not use antd or deprecated APIs.
36
-
37
- ## Dependencies
38
-
39
- - `classnames`, `lodash`, `react-intl` (already in blaze-ui dependencies).
40
- - No new package.json entries required for this migration.
@@ -1,24 +0,0 @@
1
- export declare const LIST = "LIST";
2
- export declare const MULTI_SELECT = "MULTI_SELECT";
3
- export declare const NUMBER = "NUMBER";
4
- export declare const STRING = "STRING";
5
- export declare const DATE_TYPE = "DATE";
6
- export declare const PRODUCT_ATTRIBUTE = "PRODUCT_ATTRIBUTE";
7
- export declare const CUSTOM_FIELD = "CUSTOM_FIELD";
8
- export declare const EXTENDED_FIELD = "EXTENDED_FIELD";
9
- export declare const SKU = "SKU";
10
- export declare const CATEGORY = "CATEGORY";
11
- export declare const UPLOAD = "UPLOAD";
12
- export declare const ENTRY_TRIGGER_EVENT_ATTRIBUTE = "entryTriggerEventAttribute";
13
- export declare const STRING_LIST = "STRING_LIST";
14
- export declare const TEXT_ON_MSG = "onMsg";
15
- export declare const TEXT_BEFORE_MSG = "beforeMsg";
16
- export declare const TEXT_AFTER_MSG = "afterMsg";
17
- export declare const TEXT_BETWEEN_MSG = "betweenMsg";
18
- export declare const TEXT_DAYS_BEFORE_MSG = "daysBeforeMsg";
19
- export declare const TEXT_DAYS_AFTER_MSG = "daysAfterMsg";
20
- export declare const DATE_TYPE_RANGE = "RANGE";
21
- export declare const DATE_TYPE_SINGLE = "SINGLE";
22
- export declare const DATE_TYPE_DAYS_AFTER = "DAYS_AFTER";
23
- export declare const DATE_TYPE_DAYS_BEFORE = "DAYS_BEFORE";
24
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../components/CapConditionPreview/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,SAAS,SAAS,CAAC;AAChC,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAC1E,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAGzC,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AACpD,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAGlD,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,qBAAqB,gBAAgB,CAAC"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { CapConditionPreviewProps } from './types';
3
- declare const _default: React.FC<import("react-intl").WithIntlProps<CapConditionPreviewProps & import("react-intl").WrappedComponentProps>> & {
4
- WrappedComponent: React.ComponentType<CapConditionPreviewProps & import("react-intl").WrappedComponentProps>;
5
- };
6
- export default _default;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapConditionPreview/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoC1B,OAAO,KAAK,EAAE,wBAAwB,EAA6B,MAAM,SAAS,CAAC;;;;AA8anF,wBAA8E"}
@@ -1,65 +0,0 @@
1
- # Test Cases: CapConditionPreview (Antd v3→v6)
2
-
3
- **Component:** CapConditionPreview
4
- **Complexity:** medium (≤20 test cases)
5
- **Source:** blaze-ui/components/CapConditionPreview/
6
-
7
- ---
8
-
9
- ## Google Sheets
10
-
11
- **Spreadsheet ID:** `1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg`
12
- **Tab:** CapConditionPreview
13
-
14
- ### Steps (run in your environment)
15
-
16
- 1. Check connection: `COMPOSIO_CHECK_ACTIVE_CONNECTION` toolkit="googlesheets"
17
- 2. Create tab: `GOOGLESHEETS_ADD_SHEET` with title `CapConditionPreview`, gridProperties `{ "rowCount": 100, "columnCount": 7 }`
18
- 3. Write data: `GOOGLESHEETS_VALUES_UPDATE` with range `CapConditionPreview!A1` and the values table below.
19
-
20
- ---
21
-
22
- ## Use cases table (for Storybook + migration validation)
23
-
24
- | ID | Use Case | Props/Config | Expected Visual/Behavior | Priority | Storybook Story | Notes |
25
- |----|----------|--------------|---------------------------|----------|-----------------|--------|
26
- | UC-001 | All data type and operator variants | type: NUMBER \| STRING \| LIST \| MULTI_SELECT \| STRING_LIST \| ENTRY_TRIGGER_EVENT_ATTRIBUTE \| DATE; operator: EQ, GT, LT, GTE, LTE, IN_RANGE, NEQ, IN, NOT_IN, IS_EXACT_DATE, IS_BEFORE_DATE, IS_AFTER_DATE, IS_INBETWEEN_DATES, IS_BEFORE_DAYS, IS_AFTER_DAYS; operand/listData/dateTypeData as needed | Correct label and value for each type and operator (e.g. "greater than" + "42" for NUMBER+GT; "Include whose … is on 1/15/2024" for DATE SINGLE) | P0 | TypeAndOperatorVariants | Grouped all type + operator combos into one test |
27
- | UC-002 | Include vs Exclude and hideNumberAndProductFields | isExcluded: true \| false; hideNumberAndProductFields: true \| false | "Exclude" vs "Include"; when hideNumberAndProductFields true, operand/operator block hidden for STRING/NUMBER/etc., condition name and "whose" still visible | P0 | VisualStates | Default, excluded, and journey/store profile modes |
28
- | UC-003 | Store upload states (STORE_FILTER) | additionalFields.STORE_FILTER with storeSource: UPLOAD; storeUploadIsInProgress \| isStoreUploadFailed \| isStoreUploadInvalid \| success (operand count) | Progress icon + "Upload in progress"; error icon + "Upload failed" or "Invalid file uploaded"; or "N Stores" when success | P0 | StoreUploadStates | Grouped in progress / failed / invalid / success |
29
- | UC-004 | ViewMoreLink and SKU download interactions | ViewMoreLink with onClick; setPopoverVisible, onClickConfigure, blockId; MULTI_SELECT + listData (SKU) for download link | Click View more → setPopoverVisible(false) and onClickConfigure(blockId); click "uploaded" → CSV download with SKU list and skuFileName | P0 | Interactions | All interactive handlers in one test |
30
- | UC-005 | Content: normal, empty, long | operand/listData: normal values; empty listData or []; long operand string; additionalFields: {} vs multiple entries | Renders without crash; empty list shows attachment icon or empty state; long text truncates or wraps; multiple additional conditions show "and" + lineItemMsg | P1 | ContentVariants | Normal, empty, long, multiple conditions |
31
- | UC-006 | Styling (className) | className: "custom-class" | Root has class "custom-class" and "cap-condition-wrapper"; layout and styled labels (pill background) unchanged | P1 | Styling | className only; no style prop on component |
32
- | UC-007 | Additional fields (EXTENDED_FIELD, CUSTOM_FIELD, STORE_FILTER, multiple) | additionalFields: EXTENDED_FIELD, CUSTOM_FIELD, STORE_FILTER; expression with operator/operand; multiple keys | Correct description, operator label, and OperandValues for each; "only for lineitems with" and "and" between items when multiple | P0 | AdditionalFields | Grouped all additional field variants |
33
- | UC-008 | DATE_TYPE sub-variants (RANGE, SINGLE, DAYS_AFTER, DAYS_BEFORE) | type: DATE; dateTypeData: RANGE (startDate, endDate), SINGLE (date or contextData.profileName), DAYS_AFTER/DAYS_BEFORE (days, contextData) | RANGE: "between" + two formatted dates; SINGLE: date or "End date of {profileName} event date attribute"; DAYS_AFTER/BEFORE: "{days} days after/before" + End date of profile | P0 | DateTypeVariants | Grouped RANGE, SINGLE, DAYS_AFTER, DAYS_BEFORE |
34
- | UC-009 | DATE_TYPE edge cases | dateTypeData: null, undefined; dateType: null, "", "INVALID_TYPE"; startDate/endDate/date: null, undefined, "", invalid string | No date content rendered when null/undefined/invalid; no crash; empty dates show "and" only where applicable | P1 | DateTypeEdgeCases | Production-safe null/undefined/invalid handling |
35
- | UC-010 | STRING_LIST single vs multiple | type: STRING_LIST; operand: [single] vs [v1, v2, …] | Single: "value1" only; multiple: "value1 +N more" with correct count | P1 | StringListContent | Grouped single and multiple values |
36
- | UC-011 | MULTI_SELECT: SKU (download) vs non-SKU vs store upload | type: MULTI_SELECT; listData; additionalFields SKU vs none vs STORE_FILTER with UPLOAD | SKU: TruncateList + "uploaded" download link; non-SKU: TruncateList only; store upload: StoreUploadMsg + View more | P0 | MultiSelectVariants | SKU download, list-only, store upload |
37
- | UC-012 | Entry trigger event attribute | type: ENTRY_TRIGGER_EVENT_ATTRIBUTE; entryTriggerEventAttribute: string; operator | Shows operator label and "Entry trigger event attribute" + attribute name (e.g. "fact1") | P1 | EntryTriggerAttribute | Single test for entry trigger block |
38
- | UC-013 | Event handlers and callbacks | ViewMoreLink onClick, setPopoverVisible, onClickConfigure; download (setAttribute href/download) | All callbacks invoked with correct args; download link gets correct data URI and filename | P1 | EventHandlers | Grouped all handlers; no mock of Cap components |
39
- | UC-014 | OperandsMapping labels (i18n) | All operator keys: equalMsg, greaterThanMsg, lessThanMsg, greaterThanOrEqualMsg, lessThanorEqualMsg, inRangeMsg, notEqualMsg, inMsg, notInMsg, date msgs | Correct translated label for each operator in UI | P1 | OperandsMapping | Grouped all operator label props |
40
- | UC-015 | Empty or missing operand / listData | operand: null, undefined, ""; listData: null, []; type NUMBER/STRING/LIST/MULTI_SELECT | No crash; missing values render empty or fallback (e.g. attachment icon for MULTI_SELECT with no listData) | P1 | EmptyOperand | Edge case for missing data |
41
- | UC-016 | DATE_TYPE_SINGLE with contextData vs raw date | dateTypeData: SINGLE with date only vs contextData only vs both (contextData takes precedence) | Raw date: formatted date; contextData: "End date of {profileName} event date attribute"; both: contextData branch shown | P1 | DateSingleContext | Precedence and profile name display |
42
- | UC-017 | Format date for preview (YYYY-MM-DD, ISO, invalid) | dateTypeData with date: "2024-01-15", "2024-01-15T00:00:00.000Z", "invalid" | YYYY-MM-DD and ISO format as en-US locale; invalid returns empty string, no broken UI | P1 | FormatDateForPreview | Timezone-safe and invalid handling |
43
- | UC-018 | Migration parity (v3 → v6) | Same props as v3 usage; FormattedMessage (react-intl); no antd in component | Same copy and structure as v3; FormattedMessage resolves; no antd dependency in CapConditionPreview | P0 | MigrationParity | i18n and structure parity |
44
- | UC-019 | Default and optional props | listData=null, hideNumberAndProductFields=false; omit optional msg props (use defaults from LocaleHoc) | Sensible defaults; no crash when optional props omitted; LocaleHoc provides messages | P2 | DefaultProps | Grouped default/optional behavior |
45
- | UC-020 | Multiple additional conditions (and + lineItemMsg) | additionalFields with 2+ entries (e.g. EXTENDED_FIELD + CUSTOM_FIELD) | First condition without "and"; subsequent with "and" + lineItemMsg; each shows description + operator + OperandValues | P1 | MultipleAdditionalConditions | And/lineItemMsg grouping |
46
-
47
- ---
48
-
49
- ## Requirements checklist
50
-
51
- - Stay within strict limit for complexity level: **medium ≤20** (20 rows).
52
- - Group similar scenarios aggressively (types, operators, store states, date variants, events).
53
- - Each test is manually verifiable in Storybook and with RTL.
54
- - Focus on real-world usage (conditions, store filter, SKU, dates).
55
- - Prioritize P0/P1 over P2.
56
- - Grouping rationale noted in Notes column.
57
-
58
- ---
59
-
60
- ## Testing notes (Do / Don't)
61
-
62
- - **Do:** Use React Testing Library with Jest; prefer `data-testid` for querying; clear mocks between tests if applicable.
63
- - **Don't:** Mock Cap UI Library components unless instructed; avoid over-reliance on getByRole; don’t write overly complex tests.
64
-
65
- **If approaching limit, merge more test cases. Quality > quantity.**
@@ -1,82 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- /** Context data for date conditions (e.g. profile name) */
3
- export interface DateTypeContextData {
4
- profileName?: string;
5
- }
6
- /** Shape of dateTypeData prop for DATE type conditions */
7
- export interface DateTypeData {
8
- dateType?: 'RANGE' | 'SINGLE' | 'DAYS_AFTER' | 'DAYS_BEFORE';
9
- startDate?: string | null;
10
- endDate?: string | null;
11
- date?: string | null;
12
- days?: number;
13
- contextData?: DateTypeContextData | null;
14
- }
15
- /** Expression inside additionalFields entries */
16
- export interface LinkedConditionExpression {
17
- operator?: string;
18
- operand?: string[];
19
- storeSource?: string;
20
- isStoreUploadFailed?: boolean;
21
- isStoreUploadInvalid?: boolean;
22
- storeUploadIsInProgress?: boolean;
23
- }
24
- /** Single entry in additionalFields */
25
- export interface AdditionalFieldEntry {
26
- description?: string;
27
- factId?: string;
28
- expression?: LinkedConditionExpression;
29
- }
30
- /** DstData passed to component (e.g. couponSeriesNames fallback) */
31
- export interface DstData {
32
- couponSeriesNames?: string[];
33
- }
34
- /** View more link component props */
35
- export interface ViewMoreLinkProps {
36
- onClick: () => void;
37
- children: ReactNode;
38
- }
39
- export interface CapConditionPreviewProps {
40
- className?: string;
41
- type?: string;
42
- operand?: number | string | string[];
43
- operator?: string;
44
- dstData?: DstData;
45
- listData?: string[] | null;
46
- additionalFields?: Record<string, AdditionalFieldEntry>;
47
- isExcluded?: boolean;
48
- conditionName?: string;
49
- /** Message strings (typically from translations) */
50
- excludeMsg?: string;
51
- includeMsg?: string;
52
- whoseMsg?: string;
53
- isMsg?: string;
54
- andMsg?: string;
55
- equalMsg?: string;
56
- greaterThanMsg?: string;
57
- lessThanMsg?: string;
58
- greaterThanOrEqualMsg?: string;
59
- lessThanorEqualMsg?: string;
60
- inRangeMsg?: string;
61
- notEqualMsg?: string;
62
- lineItemMsg?: string;
63
- addedSKUsMsg?: string;
64
- skuFileName?: string;
65
- uploadedMsg?: string;
66
- inMsg?: string;
67
- notInMsg?: string;
68
- /** When true, hides operand/operator block (e.g. for Store profile, Custom fields in journey) */
69
- hideNumberAndProductFields?: boolean;
70
- viewMoreMsg?: string;
71
- storesMsg?: string;
72
- uploadInProgressMsg?: string;
73
- ViewMoreLink?: React.ComponentType<ViewMoreLinkProps>;
74
- onClickConfigure?: (blockId: string) => void;
75
- blockId?: string;
76
- setPopoverVisible?: (visible: boolean) => void;
77
- uploadFailedErrorMsg?: string;
78
- uploadInvalidErrorMsg?: string;
79
- entryTriggerEventAttribute?: string;
80
- dateTypeData?: DateTypeData | null;
81
- }
82
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapConditionPreview/types.ts"],"names":[],"mappings":"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"}