Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic/b2b commerce quotes #16345

Merged
merged 429 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
429 commits
Select commit Hold shift + click to select a range
3737131
Trigger Build
Larisa-Staroverova Oct 10, 2023
2d306bd
a11y: action-links shall be links and not buttons (CXSPA-4920) (#17942)
Uli-Tiger Oct 10, 2023
aee9ddb
Feature/cxspa 4930 new entry point (#17943)
ChristophHi Oct 10, 2023
7c006c5
fix: fix cypress test due to a11y changes (CXSPA-4949) (#17945)
Uli-Tiger Oct 11, 2023
e6d8eca
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Oct 11, 2023
ebde45b
Remove obsolete TODO
ChristophHi Oct 11, 2023
0a5a7f8
feat: Move entry related logic from action normalizer to entry normal…
Uli-Tiger Oct 12, 2023
509a2dd
[Internal team] review feedback
Larisa-Staroverova Oct 12, 2023
c094f64
Remove un-used test code
ChristophHi Oct 12, 2023
a47bcd2
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
ChristophHi Oct 12, 2023
4f9d98c
Feature/cxspa 4931 installation schematics (#17948)
ChristophHi Oct 12, 2023
d7bebfe
review feedback
Uli-Tiger Oct 12, 2023
73cd440
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Oct 12, 2023
12ed637
Add license header
github-actions[bot] Oct 12, 2023
bad6226
review feedback II: rename addCartEntryComment -> addQuoteEntryCommen…
Uli-Tiger Oct 12, 2023
5375acf
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Oct 12, 2023
385150c
Define a seperate indicator for paragraph truncation (#17969)
Larisa-Staroverova Oct 12, 2023
e7ba794
fix sonar issue
Uli-Tiger Oct 12, 2023
9ecf7e6
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Oct 12, 2023
a187020
organize imports
Uli-Tiger Oct 12, 2023
cbaac34
prettier
Uli-Tiger Oct 12, 2023
fa9c9a2
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Uli-Tiger Oct 13, 2023
250417b
Review feedback von @ChristophHi
Larisa-Staroverova Oct 16, 2023
431dd24
Review feedback from @Uli-Tiger
Larisa-Staroverova Oct 16, 2023
1c2b5a9
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Oct 17, 2023
79f5d92
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Oct 19, 2023
117547d
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Oct 19, 2023
be7be9a
Fix feature-libs/quote/tsconfig.schematics.json
Larisa-Staroverova Oct 19, 2023
705ba85
A11Y: Quote modal needs enhancements for screen readers (#17959)
Larisa-Staroverova Oct 19, 2023
fa3e8bc
test: enhance coverage (#17977)
Uli-Tiger Oct 19, 2023
440c7b3
Rearrange the card tiles (#17989)
Larisa-Staroverova Oct 19, 2023
ed20f46
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Oct 20, 2023
aba712f
Fix faling graph-utils_spec.ts test
Larisa-Staroverova Oct 20, 2023
27f7458
fix: Translation texts missing in reject quote modal (#17994)
Larisa-Staroverova Oct 20, 2023
aac86eb
fix: add new cart to tab chain (#17996)
Uli-Tiger Oct 20, 2023
461fe22
a11y: improve a11y of quote page (CXSPA-4918) (#17949)
Uli-Tiger Oct 20, 2023
a156860
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Uli-Tiger Oct 20, 2023
8f5f597
npm run config:update
Uli-Tiger Oct 20, 2023
aa3e366
[QUOTE] Failing cypress test (#17993)
Larisa-Staroverova Oct 23, 2023
b0a1583
E2e quote details page tabbing test (#17974)
Larisa-Staroverova Oct 24, 2023
ac37ca1
a11y: improve aria labels for, button input and DDLB (CXSPA-4922) (#1…
Uli-Tiger Oct 24, 2023
501cb96
fix: a11y improvements for seller edit (CXSPA-5095) (#18001)
Uli-Tiger Oct 24, 2023
289aa0f
fix: show confirm dialog on seller approver approve action (CXSPA-510…
Uli-Tiger Oct 24, 2023
a6b61d2
feature: quote-header-price component - minimal scope (#18003)
Uli-Tiger Oct 25, 2023
a24c5a6
test: e2e test for quote cart (CXSPA-4242)(#17896)
Stofftiger Oct 26, 2023
60ebba1
fix: build error in template
Uli-Tiger Oct 26, 2023
c326749
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Uli-Tiger Oct 26, 2023
89b9bad
feature: (cxspa 4968) display from quote cart (#18002)
ChristophHi Oct 27, 2023
fb843fe
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
ChristophHi Oct 30, 2023
7b70d06
Review feedback: rename attribute / introduce constant
ChristophHi Oct 30, 2023
df984db
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
ChristophHi Oct 30, 2023
6e73db3
fix: requested formatted value for order and product discounts (CXSPA…
Uli-Tiger Oct 30, 2023
223a8a5
test: add test for feature/component assignment (#18032)
ChristophHi Oct 30, 2023
084c5c0
chore: review feedback (#18040)
ChristophHi Oct 31, 2023
0372a5c
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
ChristophHi Oct 31, 2023
8e3078b
Fix schematics test
ChristophHi Oct 31, 2023
c43e19e
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
ChristophHi Oct 31, 2023
1f5fe44
Review feedback (#18050)
Larisa-Staroverova Oct 31, 2023
0b98e00
fix: requested formatted value for order and product discounts (CXSPA…
Uli-Tiger Oct 31, 2023
7f94533
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Oct 31, 2023
40715d3
review feedback #1
Uli-Tiger Oct 31, 2023
0c5e610
review feedback #2
Uli-Tiger Oct 31, 2023
58ff7e3
Merge branch 'develop-6.6.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 2, 2023
19551e5
Merge develop
Larisa-Staroverova Nov 2, 2023
762ba96
CXSPA-4925: Set focus on create/edit quote (#18039)
steinsebastian Nov 2, 2023
7710732
Review feedback
Larisa-Staroverova Nov 2, 2023
70c98ea
Refactor CommonQuoteTestUtilsService helper class
Larisa-Staroverova Nov 2, 2023
632117b
chore: add return type and type script doc
Uli-Tiger Nov 2, 2023
0348c22
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Nov 2, 2023
6e714c9
Rename all tests instance as 'classUnderTest' except component instan…
Larisa-Staroverova Nov 2, 2023
c2d0ae8
Remove artifacts from test classes
Larisa-Staroverova Nov 2, 2023
d8b0e2d
cleanUp cypress tests (CXSPA-5209) (#18036)
Stofftiger Nov 2, 2023
c6aaac1
remove powertools constant
Uli-Tiger Nov 2, 2023
b2c6921
A11Y: Improvements for quote list (#18047)
Larisa-Staroverova Nov 2, 2023
ff369b2
Fix all spelling mistakes
Larisa-Staroverova Nov 2, 2023
547c09d
Fix typo
Larisa-Staroverova Nov 2, 2023
3d4d268
Apply JSDoc guidelines
Larisa-Staroverova Nov 2, 2023
cc00b8e
test: reduce flakiness for cy quote-configurator integration tests (#…
Uli-Tiger Nov 2, 2023
5a7e609
Comment changes
ChristophHi Nov 3, 2023
7cd1e82
A11Y issues in reading mode (#17954)
Larisa-Staroverova Nov 6, 2023
6e5b04c
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
ChristophHi Nov 7, 2023
bdaea25
`npm run config:update`
Uli-Tiger Nov 7, 2023
04a681c
test: fix flakyness for quote-configurator.e2e tests (CXSPA-5170) (#1…
Stofftiger Nov 7, 2023
28c27ba
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 8, 2023
d8d726d
Trigger Build
Larisa-Staroverova Nov 8, 2023
99cbc81
Revert changes in cypress helper asm.ts
Larisa-Staroverova Nov 8, 2023
434ba5a
Remove unnecessary MockFocusDirective from card.component test
Larisa-Staroverova Nov 8, 2023
37b3bdb
fix: RTL styling issues (#18077)
Larisa-Staroverova Nov 8, 2023
9c70a3e
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 9, 2023
0cb44de
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 9, 2023
e94b611
feat: active quote carts must not be swapped with saved carts (#18085)
ChristophHi Nov 9, 2023
af354b8
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 10, 2023
8a0ec22
CXSPA-5269: Quote: Improvements for JAWS screenreader on Windows (#18…
steinsebastian Nov 10, 2023
0f8c33a
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 10, 2023
aa01e1a
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 13, 2023
25badab
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 13, 2023
10d7434
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 14, 2023
3319a04
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 15, 2023
1187ab8
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 17, 2023
84864f2
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 20, 2023
e419d74
fix: Cart does not get wiped on "Submit quote" or "Cancel quote" (#18…
Larisa-Staroverova Nov 20, 2023
669cadb
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 21, 2023
39339ac
npm run config:update
Larisa-Staroverova Nov 21, 2023
28cb82d
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 22, 2023
e711eb0
a11y: Add a11y regions (#18147)
Larisa-Staroverova Nov 23, 2023
7ffb051
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 24, 2023
a7815c8
refactor: Add pagination at the top for the quote list (mobile versio…
Larisa-Staroverova Nov 24, 2023
202791b
fix: make sonar happy
Larisa-Staroverova Nov 24, 2023
77ef764
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 27, 2023
e5309c3
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 29, 2023
833f7de
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Nov 30, 2023
981e856
feat: create a new component that contains order summary, action butt…
Larisa-Staroverova Nov 30, 2023
ac20ba5
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 1, 2023
1247fa4
feat: use percentage discount instead of absolute (#18081)
ChristophHi Dec 1, 2023
0d722dd
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 4, 2023
b572232
npm run config:update
Larisa-Staroverova Dec 4, 2023
d99d083
feat: cxspa 5177 aoc directive (#18167)
ChristophHi Dec 4, 2023
6227844
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 5, 2023
b995115
Remove obsolete hack
ChristophHi Dec 5, 2023
8b748c5
feat: Save active cart when starting to edit a quote (#18176)
steinsebastian Dec 5, 2023
68b0941
test: stabilize flaky tests and add selectors (#18096)
Stofftiger Dec 5, 2023
c2ac68d
fix: add empty list to cartOutlet if no item exists [CXSPA-5574] (#18…
Stofftiger Dec 5, 2023
bdd1244
feat: make action buttons sticky on mobile widgets (#18165)
Larisa-Staroverova Dec 7, 2023
5c78325
Fix failing cypress tests
Larisa-Staroverova Dec 8, 2023
cb1a509
refactor: Move quote helper class into helper/b2b folder and rename i…
Larisa-Staroverova Dec 12, 2023
e2f31fc
Merge branch 'develop-6.8.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 12, 2023
ae802c9
Merge branch 'develop-6.8.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 12, 2023
36a5500
Merge branch 'develop-6.8.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 12, 2023
dc5bccf
feat: display section with action buttons when there are any buttons …
Larisa-Staroverova Dec 13, 2023
b596921
Merge branch 'develop-6.8.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 15, 2023
bc5362f
feat: CXSPA-5638 Adjust error handling (#18253)
ChristophHi Dec 15, 2023
bf47d01
Merge branch 'develop-6.8.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 19, 2023
a480a97
Execute npm run config:update
Larisa-Staroverova Dec 19, 2023
978cabc
Merge branch 'develop-6.8.x' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 20, 2023
c28dd84
Merge remote-tracking branch 'origin/develop-next-major' into epic/b2…
ChristophHi Dec 21, 2023
4b0ec3a
Quote feature lib uses ng 17
ChristophHi Dec 21, 2023
85d3f30
Revert un-intended changes
ChristophHi Dec 21, 2023
c1fbc79
Add bootstrap dependency
ChristophHi Dec 21, 2023
84d7756
Update package-lock.json
ChristophHi Dec 21, 2023
fa1d021
Update package.json
ChristophHi Dec 21, 2023
1cf5671
Fix e2e project
ChristophHi Dec 21, 2023
f7687cc
test: added tests for saved cart behaviour (#18295)
Stofftiger Dec 26, 2023
8b17aa5
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
Larisa-Staroverova Dec 28, 2023
8fc8f69
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
ChristophHi Jan 3, 2024
906ef6c
Add license header
github-actions[bot] Jan 3, 2024
971fc55
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
ChristophHi Jan 4, 2024
1a4e2e0
test: fix schematics tests
ChristophHi Jan 4, 2024
b661e42
Make quotes known to schematics project and fix test
ChristophHi Jan 4, 2024
83abd83
Trigger Build
ChristophHi Jan 4, 2024
23a5ec8
Add quote to installation script
ChristophHi Jan 4, 2024
e78de39
Add required b2b dependency for quote library + test
ChristophHi Jan 4, 2024
2fe4e2e
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
ChristophHi Jan 8, 2024
eb18843
CXSPA-5531: Improve annotation of dialog for accessibilty (#18307)
steinsebastian Jan 8, 2024
96b821b
Resolve conflicts
ChristophHi Jan 12, 2024
c7dbde2
Fix licence header issue in quote lib
Larisa-Staroverova Jan 12, 2024
74a31b4
Remove unused element
Larisa-Staroverova Jan 12, 2024
c71d82f
Review feedback: move logic from constructor to ngOnInit()
Larisa-Staroverova Jan 12, 2024
c4feabc
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
Larisa-Staroverova Jan 12, 2024
e02081d
Revert changes for quote-cart-event.listener.ts
Larisa-Staroverova Jan 15, 2024
5ca1817
Review feedback I: Avoid untypeFormControl, fix typos
ChristophHi Jan 15, 2024
434a062
review: reverted unintended changes
Uli-Tiger Jan 15, 2024
4cc828a
Add license header
github-actions[bot] Jan 15, 2024
6d7a92b
review: requested changes
Uli-Tiger Jan 15, 2024
238f8f9
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Jan 15, 2024
d126666
fix minor sonar finding
Uli-Tiger Jan 15, 2024
ece0dd9
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
Uli-Tiger Jan 15, 2024
886ca0f
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
Larisa-Staroverova Jan 16, 2024
da0a342
Review feedback II: Redirecting in quote cart guard
ChristophHi Jan 16, 2024
c66521c
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
ChristophHi Jan 16, 2024
0a9ae36
Remove console output
ChristophHi Jan 16, 2024
a074806
Review feedback: refactor getRowTitle method by using combineLatest m…
Larisa-Staroverova Jan 16, 2024
c459982
Review feedback: get rid of breakpointService and use css media query…
Larisa-Staroverova Jan 16, 2024
1a5753a
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
Larisa-Staroverova Jan 16, 2024
2de020a
Review feedback 3: http error handlers and minor issues
ChristophHi Jan 16, 2024
ef1d051
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
ChristophHi Jan 16, 2024
543ed08
Review feedback 4: JSDoc and minor fixes
ChristophHi Jan 16, 2024
ca5cf0c
rename Item -> MessageEventBoundItem
Uli-Tiger Jan 16, 2024
689dd8b
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Jan 16, 2024
d9f2ddf
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
Larisa-Staroverova Jan 17, 2024
396881e
Review feedback 5: Use ReplaySubject for directive
ChristophHi Jan 17, 2024
1f14dfd
Fix sonar issue
ChristophHi Jan 17, 2024
1bd30d9
Fix e2e test
ChristophHi Jan 17, 2024
fea2f22
Review feedback: refactor tooltip for an item in the quote list
Larisa-Staroverova Jan 17, 2024
3696ae9
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Larisa-Staroverova Jan 17, 2024
9550d56
Simplify guard
ChristophHi Jan 17, 2024
132a8f1
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
ChristophHi Jan 17, 2024
5dedd76
Add JS Doc
ChristophHi Jan 17, 2024
feb7bce
Delete un-needed routing artefacts
ChristophHi Jan 17, 2024
492af29
Refactor guard component (previously 'aware'), respective feature
ChristophHi Jan 18, 2024
5947966
add js doc as requested by reviewer
Uli-Tiger Jan 18, 2024
9189430
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Jan 18, 2024
d56080a
Fix cart guard entry point
ChristophHi Jan 18, 2024
05325ec
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
ChristophHi Jan 18, 2024
f4a6a5f
js doc
Uli-Tiger Jan 18, 2024
ede7ee4
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Jan 18, 2024
6fdb63e
review feedback use combineLatest
Uli-Tiger Jan 18, 2024
fb8bfd5
review feedback - eliminate force re-render
Uli-Tiger Jan 18, 2024
0e13f6d
refactor based on review
Uli-Tiger Jan 18, 2024
263c1a7
feat: fix quote comments issues found on test day (CXSPA-5802) (#18377)
Uli-Tiger Jan 19, 2024
ca77027
Refactor quote-summary-actions component (#18383)
Larisa-Staroverova Jan 19, 2024
1ab3c05
Fix failng test
Larisa-Staroverova Jan 19, 2024
cdb6588
Do not retrigger search on navigation
ChristophHi Jan 23, 2024
b9d0171
feat: better document the need for cy.wait after quote edit (CXSPA-5703)
Uli-Tiger Jan 23, 2024
eb57ac0
fix: [quote list] the tooltip should only contain the truncated name …
Larisa-Staroverova Jan 24, 2024
437034a
feat: Avoid OCC calls if user is not logged in (#18411)
ChristophHi Jan 24, 2024
7bc46d9
fix: move method declaration
Uli-Tiger Jan 24, 2024
ed787c1
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Jan 24, 2024
e548811
feat: navigation to quote list after reject and approve (#18422)
ChristophHi Jan 25, 2024
702a83e
Resolve conflicts
ChristophHi Jan 25, 2024
abe8382
fix package.json
ChristophHi Jan 25, 2024
bdc962e
Fix quote adapter
ChristophHi Jan 25, 2024
ce18f51
Revert un-intended change
ChristophHi Jan 26, 2024
7e0dfc5
Revert unintended change
ChristophHi Jan 26, 2024
f7f2154
add feature toggle for changes to card component (#18379)
Uli-Tiger Jan 26, 2024
e6ad2fe
Merge branch 'develop-next-major' into epic/b2b-commerce-quotes
ChristophHi Jan 30, 2024
72a05be
Revert unintended changes
ChristophHi Jan 30, 2024
86d0b14
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
ChristophHi Jan 30, 2024
07f8bea
Revert unintended changes
ChristophHi Jan 30, 2024
7643f36
fix config
ChristophHi Jan 30, 2024
3187622
Fix schematics test
ChristophHi Jan 30, 2024
33a7ce9
Merge branch 'develop' into epic/b2b-commerce-quotes
ChristophHi Feb 7, 2024
50ce095
chore: turn translations to JSON
ChristophHi Feb 7, 2024
637b190
Introduce preliminary scss feature flag for messaging component
ChristophHi Feb 7, 2024
b1d7cfa
Fix styling of request quote button
Larisa-Staroverova Feb 8, 2024
7de83ce
review feedback cart-item-list.component
Uli-Tiger Feb 8, 2024
4c49539
refactor abstractOrderKey (#18462) according to review feedback
ChristophHi Feb 8, 2024
8dc3ffd
Merge conflicts
ChristophHi Feb 8, 2024
a9bc555
Rename quote cypress tests not to be run in the central pipeline
Larisa-Staroverova Feb 9, 2024
fbe11ef
resolve conflicts
ChristophHi Feb 13, 2024
e035c9e
Fix license headers
ChristophHi Feb 13, 2024
8a80d1f
Fix license header
ChristophHi Feb 13, 2024
0de417e
fix sonar: add omitted curly braces
Uli-Tiger Feb 13, 2024
d300832
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Feb 13, 2024
1ec729b
Update package.json
ChristophHi Feb 13, 2024
b9acefa
Revert unintended change
ChristophHi Feb 13, 2024
937c386
Review feedback: Rename
ChristophHi Feb 13, 2024
bf7387e
Rename e2e test to not run it always (sample data missing in pipeline)
ChristophHi Feb 13, 2024
8c988d2
Update quote-tabbing.e2e-spec-flaky.cy.ts
ChristophHi Feb 13, 2024
eb4bc21
Merge branch 'develop' into epic/b2b-commerce-quotes
ChristophHi Feb 13, 2024
46c91b4
Resolve conflicts
ChristophHi Feb 14, 2024
a2c61cf
config update
ChristophHi Feb 14, 2024
b8549fc
Rename CMS cart guard component
ChristophHi Feb 14, 2024
d6e8a8c
Rename quote-tabbing test und fix headers
Larisa-Staroverova Feb 14, 2024
6fb9fb6
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Larisa-Staroverova Feb 14, 2024
f49619c
Set code owners for quote feature lib
ChristophHi Feb 14, 2024
766f286
Deal with codeowners later
ChristophHi Feb 14, 2024
499c334
Trigger Build
ChristophHi Feb 14, 2024
0c92219
fix: ensure view is re-rendered on quantity change (CXSPA-6116)
Uli-Tiger Feb 14, 2024
1f9375c
Merge branch 'epic/b2b-commerce-quotes' of https://github.com/SAP/spa…
Uli-Tiger Feb 14, 2024
649e639
Merge branch 'develop' into epic/b2b-commerce-quotes
ChristophHi Feb 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions core-libs/setup/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,20 @@
"@spartacus/qualtrics/root": [
"../../feature-libs/qualtrics/root/public_api"
],
"@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"],
"@spartacus/quote/components/aware": [
"../../feature-libs/quote/components/aware/public_api"
],
"@spartacus/quote/components": [
"../../feature-libs/quote/components/public_api"
],
"@spartacus/quote/components/request-button": [
"../../feature-libs/quote/components/request-button/public_api"
],
"@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"],
"@spartacus/quote": ["../../feature-libs/quote/public_api"],
"@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"],
"@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"],
"@spartacus/requested-delivery-date/assets": [
"../../feature-libs/requested-delivery-date/assets/public_api"
],
Expand Down
1 change: 1 addition & 0 deletions extra-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = {
'@spartacus/tracking': path.join(__dirname, 'feature-libs/tracking'),
'@spartacus/cart': path.join(__dirname, 'feature-libs/cart'),
'@spartacus/order': path.join(__dirname, 'feature-libs/order'),
'@spartacus/quote': path.join( __dirname, 'feature-libs/quote'),
'@spartacus/epd-visualization': path.join(
__dirname,
'integration-libs/epd-visualization'
Expand Down
14 changes: 14 additions & 0 deletions feature-libs/asm/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,20 @@
"@spartacus/qualtrics/root": [
"../../feature-libs/qualtrics/root/public_api"
],
"@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"],
"@spartacus/quote/components/aware": [
"../../feature-libs/quote/components/aware/public_api"
],
"@spartacus/quote/components": [
"../../feature-libs/quote/components/public_api"
],
"@spartacus/quote/components/request-button": [
"../../feature-libs/quote/components/request-button/public_api"
],
"@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"],
"@spartacus/quote": ["../../feature-libs/quote/public_api"],
"@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"],
"@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"],
"@spartacus/requested-delivery-date/assets": [
"../../feature-libs/requested-delivery-date/assets/public_api"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]>
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import { Injectable } from '@angular/core';

import { AbstractOrderType } from '@spartacus/cart/base/root';
import { BehaviorSubject } from 'rxjs';
import { AbstractOrderContext } from './abstract-order-context.model';

/**
* Context source for AbstractOrderContext. Default values represent the context
* of an active cart
*
* AbstractOrderContext should be injected in child components.
*/
@Injectable()
export class AbstractOrderContextSource implements AbstractOrderContext {
readonly type$ = new BehaviorSubject<AbstractOrderType>(
AbstractOrderType.CART
);
readonly id$ = new BehaviorSubject<string | undefined>(undefined);
ChristophHi marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import { Component, inject } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { tap } from 'rxjs/operators';
import { AbstractOrderType } from '../../root/models/cart.model';
import { AbstractOrderContext } from './abstract-order-context.model';
import { AbstractOrderContextModule } from './abstract-order-context.module';

const abstractOrderId = '129374';

let emissionCounterId = 0;
let emissionCounterType = 0;

@Component({
selector: 'cx-test-cmp',
template: `
<span [cxAbstractOrderContext]="{id:id, type:type}"><cx-test-cmp-inner/>
</span>`,
})
class TestComponent {
readonly abstractOrderType = AbstractOrderType;
id = abstractOrderId;
type = AbstractOrderType.CART;
}

@Component({
selector: 'cx-test-cmp-inner',
template: `
<ng-container *ngIf="myId$ | async as id">
{{ id }}
</ng-container>
<ng-container *ngIf="myType$ | async as type">
{{ type }}
</ng-container>
`,
})
class TestInnerComponent {
abstractOrderContext = inject(AbstractOrderContext, { optional: true });
myId$ = this.abstractOrderContext?.id$.pipe(
tap(() => (emissionCounterId = emissionCounterId + 1))
);
myType$ = this.abstractOrderContext?.type$.pipe(
tap(() => (emissionCounterType = emissionCounterType + 1))
);
}

describe('AbstractOrderContextDirective', () => {
let fixture: ComponentFixture<TestComponent>;
let testOuterComponent: TestComponent;

beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestComponent, TestInnerComponent],
imports: [AbstractOrderContextModule],
providers: [],
}).compileComponents();
emissionCounterId = 0;
emissionCounterType = 0;
fixture = TestBed.createComponent(TestComponent);
testOuterComponent = fixture.componentInstance;
fixture.detectChanges();
})
);

it('should propagate abstract order ID to inner component', () => {
expect(fixture.nativeElement.innerHTML).toContain(abstractOrderId);
});

it('should propagate abstract order type to inner component', () => {
expect(fixture.nativeElement.innerHTML).toContain(AbstractOrderType.CART);
});

it('should emit changes only if actual value has changed for id', () => {
expect(emissionCounterId).toBe(1);
expect(emissionCounterType).toBe(1);

testOuterComponent.type = AbstractOrderType.SAVED_CART;
fixture.detectChanges();
expect(emissionCounterId).toBe(1);
expect(emissionCounterType).toBe(2);
});

it('should should emit changes only if actual value has changed for type', () => {
expect(emissionCounterId).toBe(1);
expect(emissionCounterType).toBe(1);

testOuterComponent.id = 'newId';
fixture.detectChanges();
expect(emissionCounterId).toBe(2);
expect(emissionCounterType).toBe(1);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]>
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import {
Directive,
Input,
OnChanges,
SimpleChanges,
inject,
} from '@angular/core';

import { AbstractOrderKey } from '@spartacus/cart/base/root';
import { AbstractOrderContextSource } from './abstract-order-context-source.model';
import { AbstractOrderContext } from './abstract-order-context.model';

@Directive({
selector: '[cxAbstractOrderContext]',
providers: [
AbstractOrderContextSource,
{ provide: AbstractOrderContext, useExisting: AbstractOrderContextSource },
],
})
export class AbstractOrderContextDirective implements OnChanges {
@Input() cxAbstractOrderContext: AbstractOrderKey;

protected abstractOrderContextSource = inject(AbstractOrderContextSource);

ngOnChanges(changes: SimpleChanges): void {
if (changes.cxAbstractOrderContext) {
if (
this.cxAbstractOrderContext.id !==
this.abstractOrderContextSource.id$.value
) {
this.abstractOrderContextSource.id$.next(
this.cxAbstractOrderContext.id
);
}
if (
this.cxAbstractOrderContext.type !==
this.abstractOrderContextSource.type$.value
) {
this.abstractOrderContextSource.type$.next(
this.cxAbstractOrderContext.type
);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]>
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import { Injectable } from '@angular/core';
import { AbstractOrderType } from '@spartacus/cart/base/root';

import { Observable } from 'rxjs';

/**
* Context for transporting information about an abstract order (active cart, saved cart, order, quote).
*/
@Injectable()
export abstract class AbstractOrderContext {
readonly type$: Observable<AbstractOrderType>;
readonly id$: Observable<string | undefined>;
ChristophHi marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]>
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import { NgModule } from '@angular/core';
import { AbstractOrderContextDirective } from './abstract-order-context.directive';

@NgModule({
declarations: [AbstractOrderContextDirective],
exports: [AbstractOrderContextDirective],
})
export class AbstractOrderContextModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]>
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

export * from './abstract-order-context-source.model';
export * from './abstract-order-context.directive';
export * from './abstract-order-context.model';
export * from './abstract-order-context.module';
Original file line number Diff line number Diff line change
Expand Up @@ -422,5 +422,30 @@ describe('CartItemListComponent', () => {
expect(component.readonly).toEqual(mockContext.readonly);
expect(setLoading).toHaveBeenCalledWith(mockContext.cartIsLoading);
});

it('should mark view for check and force re-creation of item controls when outlet context emits with changed read-only flag', () => {
const secondMockContext = structuredClone(mockContext);
secondMockContext.readonly = false;
const context$ = of(mockContext, secondMockContext);
configureTestingModule().overrideProvider(OutletContextData, {
useValue: { context$ },
});
TestBed.compileComponents();
stubSeviceAndCreateComponent();
const control0 = component.form.get(mockItem0.entryNumber.toString());
const control1 = component.form.get(mockItem1.entryNumber.toString());
spyOn(component['cd'], 'markForCheck').and.callThrough();

component.ngOnInit();

expect(component['cd'].markForCheck).toHaveBeenCalled();
expect(control0).not.toBe(
component.form.get(mockItem0.entryNumber.toString())
);
expect(control1).not.toBe(
component.form.get(mockItem1.entryNumber.toString())
);
expect(component['_forceRerender']).toBe(false); // flag reset
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class CartItemListComponent implements OnInit, OnDestroy {
@Input() cartId: string;

protected _items: OrderEntry[] = [];
protected _forceRerender: boolean = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM]
Introducing this _forceRerender property which couples methods getInputsFromContext() with rerenderChangedItems() makes it much harder for me to understand how the component works.
I guess, it was introduced to workaround to some issue with change detection.

What other alternatives did we consider to fix the issue. What pros and cons of them do you see?

Copy link
Contributor

@Uli-Tiger Uli-Tiger Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Platonn As far as i remember the issue was the following. As you can see in the type script doc of the rerenderChangedItem method, the component only re-renders any cart item when it was actually changed in an attempt to optimize performance

We'd like to avoid the unnecessary re-renders of unchanged cart items after the data reload. OCC cart entries don't have any unique identifier that we could use in Angular trackBy.So we update each array element to the new object only when it's any different to the previous one.

For quote there is one case where this is not sufficient. In case a quote is switched from read-only to edit mode or vice versa, a re-render is also required, as an item is rendered differently in read-only mode compared to edit mode. For example in edit mode there is a stepper to enter a quantity, while the same control is disabled in read-only mode.

So when switching the quote from read-only to edit mode, the state of the read-only flag in the context will change and the component shall re-render.

The way its implemented is in my eyes the straight forward way of fixing the issue. In case the read-only flag from context switches, we need to re-render any item once, no matter whether the item was changed or not.

But maybe i'm missing here something, so let me know if you have any other idea, better way of fixing it.

Copy link
Contributor

@Platonn Platonn Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree your solution is probably the least invasive one that could exist. It's because the existing TS of this component is already complex. Unfortunately, it the proposed solution makes the component also a bit harder to reason about, and is not correct in 100% cases (e.g. when readonly property is changed via a regular @Input() but not via an injectable Context).


Here's how I understand the reasons of the existing complexity:

  1. Input data to this component can be passed in 2 possible ways:
  • via regular @Input()s passed by a parent component
  • via injectable and observable Context
    The values from the injectable Context are copied to the regular properties being @Input()s
  1. Setting new value for some@Input() properties triggers a complex logic, e.g. the setter of the proptery items triggers 2 functions: resolveItems(items) and createForm() (which depend only on the value of items).
  2. In some cases, the logic triggered by a change of some input properties depends also on values of other properties/inputs, which is prone to race conditions, when the properties are changed in a different order. For example: the setter of the proeprty isCartLodaing depends on the value of readonly (see source) - please note that in this case the order updating values of properties isCartLoading and readonly matter. In particular, if the logic for the setter of isCartLoading may use the outdated value of readonly, if the property readonly is updated only after the isCartLoading.

This PR adds up to the complexity, by introducing the property _forceRerender which is set on change of the property readonly, but used (and reset) in the setter's logic of the property items:

  1. In this PR, we propose that the function resolveItems(items) triggered by the setter of the property items now depends on the value of readonly (or to be precise: on the fact whether the property readonly just have changed). This is prone to a race condition issues, if the property readonly is updated only after the property items is updated - because then the logic of resolveItems(items) won't know yet about the latest value (and also about the change) of the property readonly.

  2. Moreover this PR proposes to save an information about a change of the property readonly to the boolean property _forceRerender only, when the value of readonly is changed only by the Context. But to be 100% correct, we should behave similarly, also if the property readonly is changed via a regular @Input() - this is not handled now, as far as I understand from the code.

  3. The information about the change of the property readonly is stored in the class state, in a property _forceRerender. Then this property is reset to false by some other method. Ideally the such a volatile information as "property has changed" should be passed directly as an argument to a logic that needs this information at the moment of the change. Storing it in a property and then resetting in some other method makes the class logic harder to reason about.

  4. Now we call cdr.markForCheck() only after the change of the property readonly, but not in the case of chaning other properties, which is not obvious why, on the first sight. Btw. [QUESTION]: Do we really need to call markForCheck() when property readonly changes? If yes, don't we need to do it for the update of any other property?

I can understand that because of the existing complexity of this class, it's challenging to find a simple solution to a bug (bug is the following, as far as I understood: the form controls are not updated in the html view when the property readonly changes its value).


To avoid having race conditions in terms of setting various input properties, we should avoid triggering any setters logic on individual input properties, but instead trigger all such logic only after all inputs are updated. In particular, we should do it in those moments:

  • when input properties are changed by the observable Context -> in the end of the subscription's callback inside getInputsFromContext()
  • when input properties are updated via regular @Input()s passed by a parent component - in ngOnChanges() lifecycle hook

Here's a snippet of code illustrating this idea:

export class CartItemListComponent implements OnInit, OnChanges, OnDestroy {
  /* ... */
 @Input('items')
  set items(items: OrderEntry[]) {} // logic moved to `ngOnChanges`
  get items(): OrderEntry[] {
    return this._items;
  }
  
  /* ... */
  
  @Input('cartIsLoading') set setLoading(value: boolean) {} // logic moved to `ngOnChanges`
  
  /* ... */
  
  // no _forceRerender property

  protected getInputsFromContext(): Subscription | undefined {
    return this.outlet?.context$.subscribe((context) => {
      if (context.readonly !== undefined) {
        this.readonly = context.readonly;
      }
      if (context.hasHeader !== undefined) {
        this.hasHeader = context.hasHeader;
      }
      if (context.options !== undefined) {
        this.options = context.options;
      }
      if (context.cartId !== undefined) {
        this.cartId = context.cartId;
      }
      if (context.items !== undefined) {
        this.items = context.items;
      }
      if (context.promotionLocation !== undefined) {
        this.promotionLocation = context.promotionLocation;
      }
      if (context.cartIsLoading !== undefined) {
        this.setLoading = context.cartIsLoading;
      }

      // trigger calling `ngOnChanges` manually:
      this.ngOnChanges(/* SimpleChanges object created from the Context */);
    });
  }

  // triggered on regular `@Input()`s change OR when outlet context changes:
  ngOnChanges(changes: SimpleChanges): void {
    const readonlyChanged = changes.readonly?.currentValue !== changes.readonly?.previousValue;
    const itemsChanged = changes.items?.currentValue !== changes.items?.previousValue;

    if(itemsChanged || readonlyChanged) {
      this.resolveItems(changes.items.currentValue, {resetAllItems: readonlyChanged});
      this.createForm();
    }

    // ---

    const cartIsLoadingChanged = changes.cartIsLoading?.currentValue !== changes.cartIsLoading?.previousValue;
    if(cartIsLoadingChanged && !this.readonly) {
      // Whenever the cart is loading, we disable the complete form
      // to avoid any user interaction with the cart.
      this.cartIsLoading
        ? this.form.disable({ emitEvent: false })
        : this.form.enable({ emitEvent: false });
      this.cd.markForCheck();
    }
  }
 
  // please note new optional argument `{ resetAllItems: boolean }`, which is true,
  // when the property `readonly` has changed, and can be used later in the method `rerenderChangedItems()
  // also via an optional new argument
  protected resolveItems(items: OrderEntry[], options?: {resetAllItems?: boolean}): void {
    / * ... */
      this.rerenderChangedItems(items, { resetAllItems: options?.resetAllitems } );
   }
   
  /* ... */
  
  // `resetAllItems` is used eventually in this method
  protected rerenderChangedItems(items: OrderEntry[], options?: {resetAllItems?: boolean} ) {
    /* ... */
    if (
        options.resetAllItems ||
        JSON.stringify(this._items?.[index]) !== JSON.stringify(items[index])
      ) {
    /* ... */
   }

All that said, I like the solution proposed originally in this PR for its brevity. Unfortunately it has some considerable cons and is prone to mistakes. I'm not forcing my above mentioned snippet of code and I didn't test it. I wanted to visualize my thoughts. But the most I'd like to hear your feedback. Then we can come together to some agreement that should serve the long-term health of this class.

I'm looking forward to hearing your honest feedback. Thanks in advance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not seen this component before in detail, therefore hopefully I am not missing anything:
I understand your concerns Kris, agree that the component is too complex already now (and maybe depends on some assumptions that are not always met), and that the quote extension even increases the concerns. What you propose sounds plausible.
However I see 2 risks for the refactoring: (1) Applying the feature flags for covering the breaking changes will again increase the complexity and too is error-prone
(2) We are probably not aware of all possible cart features and usages of this components, so we could create regressions.

In case we do the the proposed refactoring, we also need to involve someone who has a bit of knowledge about all SPA cart features..(or would that be you Kris?). That would at least mitigate the second risk. What do you think @Uli-Tiger and @Platonn ?

Copy link
Contributor

@Uli-Tiger Uli-Tiger Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[QUESTION]: Do we really need to call markForCheck() when property readonly changes? If yes, don't we need to do it for the update of any other property?

If i remove the markForCheck() the issue occurs again. I tested a bit and it seems that it needs to be called before the items setter is called, which in turn triggers the re-render logic. The other properties will not trigger a re-render, so i guess it is not required in that case.
PS: Please also consider that markForCheck() is already called in setLoading setter as side effect dependent on the readonly state of the cart. Since in our case isLoading is undefined, we need the explicit call.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored the code a bit to address at least some concerns, but still keeping the amount of changes limited, so that i have confidence that my changes do not break anything, especially considering that i do not know all the use case of the component. Especially the _forceReRender property was eliminated, instead passing on the flag as optional method parameter.
The fact that i do not know all the use cases of the component, and that i do not know why it was written in this way in the first place is for strong indicator to avoid a full refactoring potentially breaking scenarios i do not know or understand.

form: UntypedFormGroup = new UntypedFormGroup({});

@Input('items')
Expand Down Expand Up @@ -107,7 +108,9 @@ export class CartItemListComponent implements OnInit, OnDestroy {
protected getInputsFromContext(): Subscription | undefined {
Uli-Tiger marked this conversation as resolved.
Show resolved Hide resolved
return this.outlet?.context$.subscribe((context) => {
if (context.readonly !== undefined) {
Uli-Tiger marked this conversation as resolved.
Show resolved Hide resolved
this._forceRerender = this.readonly !== context.readonly;
this.readonly = context.readonly;
this.cd.markForCheck();
}
if (context.hasHeader !== undefined) {
Uli-Tiger marked this conversation as resolved.
Show resolved Hide resolved
this.hasHeader = context.hasHeader;
Expand Down Expand Up @@ -173,6 +176,7 @@ export class CartItemListComponent implements OnInit, OnDestroy {
) {
const index = i - offset;
if (
this._forceRerender ||
JSON.stringify(this._items?.[index]) !== JSON.stringify(items[index])
) {
if (this._items[index]) {
Expand All @@ -186,6 +190,7 @@ export class CartItemListComponent implements OnInit, OnDestroy {
}
}
}
this._forceRerender = false;
}

/**
Expand Down
1 change: 1 addition & 0 deletions feature-libs/cart/base/components/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

export * from './abstract-order-context/index';
export * from './added-to-cart-dialog/index';
export * from './cart-base-components.module';
export * from './cart-coupon/index';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { TestBed } from '@angular/core/testing';
import {
Cart,
ORDER_ENTRY_PROMOTIONS_NORMALIZER,
PromotionResult,
} from '@spartacus/cart/base/root';
import { ConverterService, PRODUCT_NORMALIZER } from '@spartacus/core';
import { ConverterService, Occ, PRODUCT_NORMALIZER } from '@spartacus/core';
import { OccCartNormalizer } from './occ-cart-normalizer';

class MockConverterService {
Expand Down Expand Up @@ -88,4 +89,23 @@ describe('OccCartNormalizer', () => {
},
]);
});
describe('handleQuoteCode', () => {
const quoteCode = '00100092';
const source: Occ.Cart = { sapQuote: { code: quoteCode } };

it('should set quote code if sapQuote is present in OCC response', () => {
const target: Cart = {};
occCartNormalizer['handleQuoteCode'](source, target);
expect(target.quoteCode).toBe(quoteCode);
});

it('should ignore missing sapQuote in OCC response', () => {
const target: Cart = {};
occCartNormalizer['handleQuoteCode'](
{ ...source, sapQuote: undefined },
target
);
expect(target.quoteCode).toBe(undefined);
});
});
});
Loading
Loading