@vtex/faststore-plugin-buyer-portal 2.0.8 → 2.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 (112) hide show
  1. package/.github/workflows/release.yaml +4 -4
  2. package/AGENTS.md +6 -0
  3. package/CHANGELOG.md +23 -1
  4. package/docs/superpowers/plans/2026-06-26-contracts-listing-selection-search-pagination.md +1070 -0
  5. package/docs/superpowers/specs/2026-06-26-contracts-listing-selection-search-pagination-design.md +157 -0
  6. package/package.json +1 -1
  7. package/plugin.config.js +8 -0
  8. package/public/buyer-portal-icons.svg +37 -1
  9. package/specs/001-suma-phase-2/checklists/requirements.md +36 -0
  10. package/specs/001-suma-phase-2/contracts/contracts-api.md +187 -0
  11. package/specs/001-suma-phase-2/contracts/feature-flag.md +91 -0
  12. package/specs/001-suma-phase-2/data-model.md +119 -0
  13. package/specs/001-suma-phase-2/plan.md +123 -0
  14. package/specs/001-suma-phase-2/quickstart.md +156 -0
  15. package/specs/001-suma-phase-2/research.md +150 -0
  16. package/specs/001-suma-phase-2/spec.md +186 -0
  17. package/specs/001-suma-phase-2/tasks.md +253 -0
  18. package/specs/suma-add-contracts.md +224 -0
  19. package/specs/suma-contract-listing.md +295 -0
  20. package/specs/suma-contract-switching.md +201 -0
  21. package/specs/suma-remove-contracts.md +233 -0
  22. package/specs/suma-set-default-contract.md +208 -0
  23. package/src/features/budgets/layouts/BudgetsLayout/BudgetsLayout.tsx +113 -105
  24. package/src/features/buying-policies/layouts/BuyingPoliciesLayout/BuyingPoliciesLayout.tsx +60 -46
  25. package/src/features/contracts/clients/ContractsClient.ts +45 -0
  26. package/src/features/contracts/components/AddContractsDrawer/AddContractsDrawer.tsx +323 -0
  27. package/src/features/contracts/components/AddContractsDrawer/add-contracts-drawer.scss +282 -0
  28. package/src/features/contracts/components/ConfirmRemoveDrawer/ConfirmRemoveDrawer.tsx +58 -0
  29. package/src/features/contracts/components/ConfirmRemoveDrawer/confirm-remove-drawer.scss +18 -0
  30. package/src/features/contracts/components/ContractListItem/ContractListItem.tsx +120 -0
  31. package/src/features/contracts/components/ContractSelectAllRow/ContractSelectAllRow.tsx +37 -0
  32. package/src/features/contracts/components/ContractSelectAllRow/index.ts +2 -0
  33. package/src/features/contracts/components/ContractSelectionBar/ContractSelectionBar.tsx +47 -0
  34. package/src/features/contracts/components/ContractSelectionBar/index.ts +2 -0
  35. package/src/features/contracts/components/ContractSelectionList/ContractSelectionList.tsx +55 -0
  36. package/src/features/contracts/components/ContractSwitchOverlay/ContractSwitchOverlay.tsx +36 -0
  37. package/src/features/contracts/components/ContractSwitchOverlay/contract-switch-overlay.scss +7 -0
  38. package/src/features/contracts/components/ContractsListHeader/ContractsListHeader.tsx +58 -0
  39. package/src/features/contracts/components/ContractsListHeader/index.ts +2 -0
  40. package/src/features/contracts/components/ErrorRemoveDrawer/ErrorRemoveDrawer.tsx +69 -0
  41. package/src/features/contracts/components/UnableToRemoveContractsDrawer/UnableToRemoveContractsDrawer.tsx +52 -0
  42. package/src/features/contracts/components/UnableToRemoveContractsDrawer/unable-to-remove-contracts-drawer.scss +29 -0
  43. package/src/features/contracts/components/index.ts +14 -0
  44. package/src/features/contracts/hooks/__tests__/contractListingHelpers.test.ts +71 -0
  45. package/src/features/contracts/hooks/__tests__/contractSwitchChannelHelpers.test.ts +32 -0
  46. package/src/features/contracts/hooks/__tests__/useAddContracts.test.ts +63 -0
  47. package/src/features/contracts/hooks/__tests__/useContractSelection.test.ts +72 -0
  48. package/src/features/contracts/hooks/__tests__/useRemoveContracts.test.ts +130 -0
  49. package/src/features/contracts/hooks/__tests__/useSetDefaultContract.test.ts +82 -0
  50. package/src/features/contracts/hooks/contractListingHelpers.ts +45 -0
  51. package/src/features/contracts/hooks/contractSelectionHelpers.ts +28 -0
  52. package/src/features/contracts/hooks/contractSwitchChannelHelpers.ts +9 -0
  53. package/src/features/contracts/hooks/index.ts +19 -0
  54. package/src/features/contracts/hooks/useAddContracts.ts +27 -0
  55. package/src/features/contracts/hooks/useContractListing.ts +71 -0
  56. package/src/features/contracts/hooks/useContractSelection.ts +53 -0
  57. package/src/features/contracts/hooks/useContractSwitchChannel.ts +49 -0
  58. package/src/features/contracts/hooks/useListAvailableContracts.ts +27 -0
  59. package/src/features/contracts/hooks/useRemoveContracts.ts +21 -0
  60. package/src/features/contracts/hooks/useSetDefaultContract.ts +21 -0
  61. package/src/features/contracts/hooks/useSwitchContract.ts +76 -0
  62. package/src/features/contracts/layouts/ContractInformationLayout/ContractInformationLayout.tsx +316 -0
  63. package/src/features/contracts/layouts/ContractListingLayout/ContractListingLayout.tsx +415 -0
  64. package/src/features/contracts/layouts/ContractListingLayout/ContractSettingsNav.tsx +83 -0
  65. package/src/features/contracts/layouts/ContractListingLayout/contract-listing-layout.scss +468 -0
  66. package/src/features/contracts/layouts/ContractListingLayout/utils.ts +4 -0
  67. package/src/features/contracts/layouts/index.ts +8 -0
  68. package/src/features/contracts/services/__tests__/contracts-client.test.ts +148 -0
  69. package/src/features/contracts/services/__tests__/list-attached-contracts.service.test.ts +95 -0
  70. package/src/features/contracts/services/add-contracts.service.ts +27 -0
  71. package/src/features/contracts/services/index.ts +24 -0
  72. package/src/features/contracts/services/list-attached-contracts.service.ts +40 -0
  73. package/src/features/contracts/services/list-available-contracts.service.ts +32 -0
  74. package/src/features/contracts/services/remove-contract.service.ts +27 -0
  75. package/src/features/contracts/services/remove-contracts.service.ts +36 -0
  76. package/src/features/contracts/services/set-default-contract.service.ts +27 -0
  77. package/src/features/contracts/types/ContractData.ts +1 -0
  78. package/src/features/contracts/utils/__tests__/changeContractToken.test.ts +141 -0
  79. package/src/features/contracts/utils/changeContractToken.ts +122 -0
  80. package/src/features/contracts/utils/clearPersistedSessionState.ts +74 -0
  81. package/src/features/org-units/components/OrgUnitDetailsNavbar/OrgUnitDetailsNavbar.tsx +45 -3
  82. package/src/features/org-units/components/OrgUnitDetailsNavbar/org-unit-details-navbar.scss +35 -0
  83. package/src/features/org-units/layouts/OrgUnitsLayout/OrgUnitsLayout.tsx +54 -48
  84. package/src/features/roles/layout/RolesLayout/RolesLayout.tsx +32 -23
  85. package/src/features/shared/components/BuyerPortalProvider/BuyerPortalProvider.tsx +1 -0
  86. package/src/features/shared/components/HeaderInside/HeaderInside.tsx +8 -1
  87. package/src/features/shared/components/HeaderInside/header-inside.scss +9 -0
  88. package/src/features/shared/layouts/BaseTabsLayout/SidebarMenu.tsx +6 -97
  89. package/src/features/shared/layouts/ContractTabsLayout/ContractTabsLayout.tsx +42 -5
  90. package/src/features/shared/layouts/LoadingTabsLayout/LoadingTabsLayout.tsx +1 -1
  91. package/src/features/shared/layouts/SumaPageLayout/FullSidebarNav.tsx +124 -0
  92. package/src/features/shared/layouts/SumaPageLayout/SumaPageLayout.tsx +56 -0
  93. package/src/features/shared/layouts/SumaPageLayout/SumaSidebar.tsx +80 -0
  94. package/src/features/shared/layouts/SumaPageLayout/SumaSidebarDrawer.tsx +48 -0
  95. package/src/features/shared/layouts/SumaPageLayout/index.ts +6 -0
  96. package/src/features/shared/layouts/SumaPageLayout/suma-sidebar-drawer.scss +37 -0
  97. package/src/features/shared/layouts/index.ts +6 -0
  98. package/src/features/shared/services/feature-flags/__tests__/get-feature-flags.service.test.ts +71 -0
  99. package/src/features/shared/services/feature-flags/get-feature-flags.service.ts +1 -0
  100. package/src/features/shared/utils/buyerPortalRoutes.ts +9 -0
  101. package/src/features/shared/utils/constants.ts +1 -1
  102. package/src/features/shared/utils/getSumaListingSidebarLinks.ts +18 -0
  103. package/src/features/shared/utils/index.ts +1 -0
  104. package/src/features/users/layouts/UsersLayout/UsersLayout.tsx +97 -103
  105. package/src/pages/contract-information.tsx +128 -0
  106. package/src/pages/contracts.tsx +104 -0
  107. package/src/pages/home.tsx +10 -6
  108. package/src/pages/org-unit-details.tsx +17 -13
  109. package/src/themes/layouts.scss +2 -0
  110. package/.agents/skills/create-page/SKILL.md +0 -154
  111. package/.agents/skills/create-page/metadata.json +0 -14
  112. package/.specify/memory/constitution.md +0 -83
@@ -38,8 +38,8 @@ jobs:
38
38
  - name: Install dependencies
39
39
  run: yarn install --ignore-engines
40
40
 
41
- - name: Update npm to latest
42
- run: npm install -g npm@latest
41
+ - name: Update npm
42
+ run: npm install -g npm@11.16.0
43
43
 
44
44
  - name: Generate CHANGELOG and update Version Const
45
45
  run: yarn release
@@ -80,8 +80,8 @@ jobs:
80
80
  - name: Install dependencies
81
81
  run: yarn install --ignore-engines
82
82
 
83
- - name: Update npm to latest
84
- run: npm install -g npm@latest
83
+ - name: Update npm
84
+ run: npm install -g npm@11.16.0
85
85
 
86
86
  - name: Get current version
87
87
  id: get_version
package/AGENTS.md CHANGED
@@ -82,3 +82,9 @@ See [docs/conventions.md](docs/conventions.md#feature-flags).
82
82
  | `ci.yml` | PR labeled `run-tests` | Cypress E2E against `b2bfaststoredev.store` |
83
83
  | `changelog.yml` | PR | Validates changelog entry |
84
84
  | `release.yaml` | Manual | Publishes to npm |
85
+
86
+ <!-- SPECKIT START -->
87
+ For additional context about technologies to be used, project structure,
88
+ shell commands, and other important information, read the current plan
89
+ at `specs/001-suma-phase-2/plan.md`.
90
+ <!-- SPECKIT END -->
package/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.9] - 2026-07-10
11
+
12
+ ### Added
13
+
14
+ - SUMA Phase 2 infrastructure foundation: `suma` feature flag wiring, `contracts` and `contract-information` route registration, `isDefault` field on `ContractData`, BFF service layer for attached/available contract listing, add, and remove-one operations (BFF v1.0.2 endpoints)
15
+ - Home page now redirects to the Contract Listing page when the `suma` feature flag is active, preserving the existing `org-unit-details` redirect when the flag is off
16
+ - Full-screen loading overlay during a contract switch, shown from click until the new contract context finishes loading
17
+ - "Unable to remove contracts" blocking drawer that prevents removing every contract from an organizational unit (at least one must remain)
18
+ - "Organization Manager" link with a sparkle icon in the contract listing navbar, routing to the buyer organization manager agent
19
+ - "Set as default" action for attached contracts, available from the Contract Listing dots menu and the Contract Information sidebar menu; calls BFF `PUT units/{unitId}/contracts/attached/{contractId}/default` (BFF v1.0.4) and refreshes the listing/page to reflect the new default. The default contract is marked with a star in the listing, and the action is disabled for the contract that is already the default ([B2BTEAM-3568](https://vtex-dev.atlassian.net/browse/B2BTEAM-3568))
20
+ - Hamburger menu toggle in the Contract Listing / Contract Details navbar, opening the sidebar as a left-side drawer on screens narrower than `notebook` (the sidebar is hidden by default at that breakpoint)
21
+
22
+ ### Fixed
23
+
24
+ - Contract Listing now flags the unit's default contract (returned first by the BFF) so it shows the default indicator, even when the BFF response omits an explicit `isDefault` flag
25
+ - Confirm-remove drawer on the Contract Listing now closes after a successful contract removal (previously it stayed open over the refreshed list)
26
+ - `contracts` and `contract-information` routes are now gated by the `suma` feature flag — they redirect to the org unit details page when the flag is off (previously they were directly reachable)
27
+ - "Back to contracts" link in the Contract Information sidebar is now shown only when the `suma` feature flag is active
28
+
10
29
  ## [2.0.8] - 2026-07-07
11
30
 
12
31
  ### Fixed
@@ -14,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
33
  - Fix Buying Policy criteria field not being editable: the click handler that re-focuses the criteria input referenced `isAccountingFieldCriteria`/`isAccountingValueCriteria` without calling them, so it never re-entered edit mode
15
34
 
16
35
  ## [2.0.7] - 2026-06-29
36
+
17
37
  ### Fixed
18
38
 
19
39
  - Remove `react-dom` from `dependencies` and move `@types/react-dom` to `devDependencies`
@@ -719,7 +739,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
719
739
  - Add CHANGELOG file
720
740
  - Add README file
721
741
 
722
- [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v2.0.8...HEAD
742
+ [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/2.0.9...HEAD
723
743
  [1.3.55]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.54...v1.3.55
724
744
  [1.3.54]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.53...v1.3.54
725
745
  [1.3.53]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.52...v1.3.53
@@ -813,3 +833,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
813
833
  [2.0.3]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v2.0.2...v2.0.3
814
834
  [2.0.2]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v2.0.1...v2.0.2
815
835
  [2.0.1]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/2.0.1
836
+
837
+ [2.0.9]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/2.0.9