@vtex/faststore-plugin-buyer-portal 1.3.8 → 1.3.10

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.
@@ -0,0 +1,60 @@
1
+ name: Changelog Integrity Check
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ check-changelog:
9
+ name: Check Changelog Integrity
10
+ runs-on: ubuntu-latest
11
+ # Skip this check if PR has the 'skip-changelog' label
12
+ if: "!contains(github.event.pull_request.labels.*.name, 'skip-changelog')"
13
+
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v3
17
+ with:
18
+ fetch-depth: 0 # Fetch all history for comparing changes
19
+
20
+ - name: Set up Node.js
21
+ uses: actions/setup-node@v3
22
+ with:
23
+ node-version: "20"
24
+
25
+ - name: Check for CHANGELOG.md changes
26
+ id: check-changelog-updated
27
+ run: |
28
+ if git diff --name-only origin/${{ github.base_ref }} | grep -q "CHANGELOG.md"; then
29
+ echo "Changelog was updated. ✅"
30
+ echo "updated=true" >> $GITHUB_OUTPUT
31
+ else
32
+ echo "No changes to CHANGELOG.md found. ❌"
33
+ echo "updated=false" >> $GITHUB_OUTPUT
34
+ fi
35
+
36
+ - name: Fail if changelog not updated
37
+ if: steps.check-changelog-updated.outputs.updated == 'false'
38
+ run: |
39
+ # Check if this PR is exempt from requiring changelog updates
40
+ if [[ "${{ contains(github.event.pull_request.labels.*.name, 'documentation') || contains(github.event.pull_request.title, 'docs:') }}" == "true" ]]; then
41
+ echo "This is a documentation change. Skipping changelog check."
42
+ exit 0
43
+ fi
44
+
45
+ echo "Error: No changes to CHANGELOG.md found. Please update the changelog with your changes."
46
+ echo "If this PR doesn't require a changelog entry, add the 'skip-changelog' label."
47
+ exit 1
48
+
49
+ - name: Comment on PR
50
+ if: failure() && github.event_name == 'pull_request'
51
+ uses: actions/github-script@v6
52
+ with:
53
+ github-token: ${{ secrets.GITHUB_TOKEN }}
54
+ script: |
55
+ github.rest.issues.createComment({
56
+ issue_number: context.issue.number,
57
+ owner: context.repo.owner,
58
+ repo: context.repo.repo,
59
+ body: '⚠️ **Changelog check failed!** Please update CHANGELOG.md with your changes. If this PR doesn\'t require a changelog entry, add the `skip-changelog` label.'
60
+ })
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.10] - 2025-10-23
11
+
12
+ ### Added
13
+
14
+ - Add About drawer to check app's version and it's dependencies
15
+
16
+ ## [1.3.9] - 2025-10-21
17
+
18
+ ### Added
19
+
20
+ - Add Changelog entry check on actions
21
+
10
22
  ## [1.3.8] - 2025-10-17
11
23
 
12
24
  ### Added
@@ -62,6 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
62
74
  - Responsiviness to Roles and Roles Details page
63
75
 
64
76
  ### Added
77
+
65
78
  - Responsiviness adjustment to to Buying policies page
66
79
 
67
80
  ### Added
@@ -152,17 +165,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
152
165
  - Add CHANGELOG file
153
166
  - Add README file
154
167
 
155
- [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.8...HEAD
168
+ [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.10...HEAD
156
169
  [1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.2.2...1.2.3
157
170
  [1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.3
158
171
  [1.2.4]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.4
159
172
  [1.3.2]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.2
160
173
  [1.3.3]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.3
161
174
  [1.3.4]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.4
162
-
163
175
  [1.3.5]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.5
164
-
165
176
  [1.3.6]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.6
166
-
177
+ [1.3.10]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.9...v1.3.10
178
+ [1.3.9]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.8...v1.3.9
167
179
  [1.3.8]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.7...v1.3.8
168
180
  [1.3.7]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,13 +7,17 @@ import {
7
7
  DropdownButton,
8
8
  DropdownMenu,
9
9
  Skeleton,
10
+ IconButton,
10
11
  } from "@faststore/ui";
11
12
 
12
13
  import { ProfileSummary } from "../../../profile/components";
13
14
  import { Icon } from "../../../shared/components";
15
+ import { useDrawerProps } from "../../../shared/hooks";
16
+ import { AboutDrawer } from "../../../shared/layouts/BaseTabsLayout/about-drawer/AboutDrawer";
14
17
  import { doLogout } from "../../../shared/utils";
15
18
 
16
19
  export type OrgUnitDetailsNavbarProps = {
20
+ orgId: string;
17
21
  orgName: string;
18
22
  person: {
19
23
  image?: string;
@@ -26,8 +30,15 @@ export type OrgUnitDetailsNavbarProps = {
26
30
  export const OrgUnitDetailsNavbar = ({
27
31
  person,
28
32
  orgName,
33
+ orgId,
29
34
  loading = false,
30
35
  }: OrgUnitDetailsNavbarProps) => {
36
+ const {
37
+ open: openAboutMenu,
38
+ isOpen: isOpenAboutMenu,
39
+ ...aboutMenuDrawerProps
40
+ } = useDrawerProps();
41
+
31
42
  return (
32
43
  <header data-fs-bp-org-unit-details-navbar>
33
44
  <Link href="/" data-fs-bp-org-unit-details-navbar-link>
@@ -37,6 +48,21 @@ export const OrgUnitDetailsNavbar = ({
37
48
  <Link href="/" data-fs-bp-org-unit-details-navbar-start-shopping-link>
38
49
  Start shopping
39
50
  </Link>
51
+
52
+ <IconButton
53
+ data-fs-bp-nav-about-trigger
54
+ icon={
55
+ <Icon
56
+ name="CircleQuestionMark"
57
+ width={24}
58
+ height={24}
59
+ weight="regular"
60
+ />
61
+ }
62
+ aria-label={"open about menu"}
63
+ onClick={openAboutMenu}
64
+ />
65
+
40
66
  {loading ? (
41
67
  <Skeleton size={{ width: "2.5rem", height: "2.5rem" }} />
42
68
  ) : (
@@ -58,6 +84,13 @@ export const OrgUnitDetailsNavbar = ({
58
84
  </Dropdown>
59
85
  )}
60
86
  </div>
87
+ {isOpenAboutMenu && (
88
+ <AboutDrawer
89
+ {...aboutMenuDrawerProps}
90
+ isOpen={isOpenAboutMenu}
91
+ unitId={orgId}
92
+ />
93
+ )}
61
94
  </header>
62
95
  );
63
96
  };
@@ -54,6 +54,16 @@
54
54
  height: var(--fs-spacing-6);
55
55
  cursor: pointer;
56
56
  }
57
+
58
+ [data-fs-bp-nav-about-trigger] {
59
+ display: flex;
60
+ justify-content: center;
61
+ align-items: center;
62
+ width: var(--fs-spacing-6);
63
+ height: var(--fs-spacing-6);
64
+ cursor: pointer;
65
+ margin-top: 0.2rem;
66
+ }
57
67
  }
58
68
 
59
69
  [data-fs-bp-org-unit-details-navbar-menu] {
@@ -76,6 +76,7 @@ export const OrgUnitsDetailsLayout = ({
76
76
  <GlobalLayout>
77
77
  {/* TODO: Add person here */}
78
78
  <OrgUnitDetailsNavbar
79
+ orgId={orgUnit.id}
79
80
  orgName={orgUnit.name}
80
81
  person={{
81
82
  name: user?.name ?? "",
@@ -2,6 +2,7 @@
2
2
  @import "@faststore/ui/src/components/molecules/Breadcrumb/styles.scss";
3
3
  @import "../../../shared/components/BasicDropdownMenu/basic-dropdown-menu.scss";
4
4
  @import "../../components/OrgUnitDetailsNavbar/org-unit-details-navbar.scss";
5
+ @import "../../../shared/layouts/BaseTabsLayout/about-drawer/about-drawer.scss";
5
6
  @import "../../../credit-cards/components/CreateCreditCardDrawer/create-credit-card-drawer.scss";
6
7
  @import "../../components/OrgUnitBreadcrumb/org-unit-breadcrumb.scss";
7
8
 
@@ -10,13 +11,22 @@
10
11
  @import "../../../shared/components/VerticalNav/vertical-nav.scss";
11
12
  @import "../../../shared/components/LetterHighlight/letter-highlight.scss";
12
13
  @import "../../../shared/components/HeaderInside/header-inside.scss";
13
-
14
-
15
- $fs-spacing-3-0: calc(var(--fs-spacing-3) + var(--fs-spacing-0)); // 1.25rem, 20px
16
- $fs-spacing-3-2: calc(var(--fs-spacing-3) + var(--fs-spacing-2)); // 1.75rem, 28px
17
- $fs-spacing-7-2: calc(var(--fs-spacing-7) + var(--fs-spacing-2)); // 3.75rem, 52px
18
- $fs-spacing-9-0: calc(var(--fs-spacing-9) + var(--fs-spacing-0)); // 4.25rem, 68px
19
- $fs-spacing-13-4: calc(var(--fs-spacing-13) + var(--fs-spacing-4)); // 7.5rem, 120px
14
+
15
+ $fs-spacing-3-0: calc(
16
+ var(--fs-spacing-3) + var(--fs-spacing-0)
17
+ ); // 1.25rem, 20px
18
+ $fs-spacing-3-2: calc(
19
+ var(--fs-spacing-3) + var(--fs-spacing-2)
20
+ ); // 1.75rem, 28px
21
+ $fs-spacing-7-2: calc(
22
+ var(--fs-spacing-7) + var(--fs-spacing-2)
23
+ ); // 3.75rem, 52px
24
+ $fs-spacing-9-0: calc(
25
+ var(--fs-spacing-9) + var(--fs-spacing-0)
26
+ ); // 4.25rem, 68px
27
+ $fs-spacing-13-4: calc(
28
+ var(--fs-spacing-13) + var(--fs-spacing-4)
29
+ ); // 7.5rem, 120px
20
30
 
21
31
  padding: 0 $fs-spacing-7-2 $fs-spacing-13-4 $fs-spacing-7-2;
22
32
 
@@ -0,0 +1,30 @@
1
+ import { getApiUrl } from "../utils";
2
+
3
+ import { Client } from "./Client";
4
+
5
+ type BuyerPortalApp = {
6
+ appName: string;
7
+ appVersion: string;
8
+ };
9
+
10
+ type AppVersionInformation = {
11
+ buyerPortalApps: BuyerPortalApp[];
12
+ };
13
+
14
+ export default class AboutClient extends Client {
15
+ constructor() {
16
+ super(getApiUrl());
17
+ }
18
+
19
+ getVersionInformation(unitId: string, cookie: string) {
20
+ return this.get<AppVersionInformation>(`units/${unitId}/about`, {
21
+ headers: {
22
+ Cookie: cookie,
23
+ },
24
+ });
25
+ }
26
+ }
27
+
28
+ const aboutClient = new AboutClient();
29
+
30
+ export { aboutClient };
@@ -12,3 +12,4 @@ export { useAddToScope } from "./useAddToScope";
12
12
  export { useRemoveFromScope } from "./useRemoveFromScope";
13
13
  export { usePageItems, type UsePageItemsProps } from "./usePageItems";
14
14
  export { useRouterLoading } from "./useRouterLoading";
15
+ export { useGetDependenciesVersion } from "./useGetDependenciesVersion";
@@ -0,0 +1,21 @@
1
+ import { getDependenciesVersionService } from "../services";
2
+
3
+ import { type QueryOptions, useQuery } from "./useQuery";
4
+
5
+ export const useGetDependenciesVersion = (
6
+ unitId: string,
7
+ options?: QueryOptions<AwaitedType<typeof getDependenciesVersionService>>
8
+ ) => {
9
+ const { data, error, isLoading, refetch } = useQuery(
10
+ `api/about/${unitId}`,
11
+ ({ cookie }) => getDependenciesVersionService({ unitId, cookie }),
12
+ options
13
+ );
14
+
15
+ return {
16
+ dependenciesVersion: data,
17
+ hasDependenciesVersionError: error,
18
+ isDependenciesVersionLoading: isLoading,
19
+ refetchDependenciesVersion: refetch,
20
+ };
21
+ };
@@ -18,6 +18,7 @@ import { useDrawerProps } from "../../hooks";
18
18
  import { doLogout } from "../../utils";
19
19
  import { buyerPortalRoutes } from "../../utils/buyerPortalRoutes";
20
20
 
21
+ import { AboutDrawer } from "./about-drawer/AboutDrawer";
21
22
  import { SidebarDrawer } from "./sidebar-drawer/SidebarDrawer";
22
23
 
23
24
  import type { OrgUnitBasicData } from "../../../org-units/types";
@@ -47,6 +48,12 @@ export const Navbar = ({
47
48
  ...deleteOpenSidebarMenuDrawerProps
48
49
  } = useDrawerProps();
49
50
 
51
+ const {
52
+ open: openAboutMenu,
53
+ isOpen: isOpenAboutMenu,
54
+ ...aboutMenuDrawerProps
55
+ } = useDrawerProps();
56
+
50
57
  const { orgUnit: userUnit } = useOrgUnitByUser(person.id);
51
58
 
52
59
  const orgUnitList = orgUnit?.path.ids.split("/").slice(1) ?? [];
@@ -89,6 +96,13 @@ export const Navbar = ({
89
96
  Start shopping
90
97
  </Link>
91
98
 
99
+ <IconButton
100
+ data-fs-bp-nav-about-trigger
101
+ icon={<Icon name="CircleQuestionMark" width={24} height={24} />}
102
+ aria-label={"open about menu"}
103
+ onClick={openAboutMenu}
104
+ />
105
+
92
106
  {loading ? (
93
107
  <Skeleton size={{ width: "2.5rem", height: "2.5rem" }} />
94
108
  ) : (
@@ -121,6 +135,13 @@ export const Navbar = ({
121
135
  isOpen={isOpenSidebarMenuDrawerOpen}
122
136
  />
123
137
  )}
138
+ {isOpenAboutMenu && (
139
+ <AboutDrawer
140
+ {...aboutMenuDrawerProps}
141
+ unitId={orgUnit?.id ?? ""}
142
+ isOpen={isOpenAboutMenu}
143
+ />
144
+ )}
124
145
  </>
125
146
  );
126
147
  };
@@ -0,0 +1,59 @@
1
+ import { Skeleton } from "@faststore/ui";
2
+
3
+ import { BasicDrawer, type BasicDrawerProps } from "../../../components";
4
+ import { useGetDependenciesVersion } from "../../../hooks";
5
+ import { CURRENT_VERSION } from "../../../utils/constants";
6
+
7
+ export type AboutDrawerProps = Omit<BasicDrawerProps, "children"> & {
8
+ unitId: string;
9
+ close: () => void;
10
+ };
11
+
12
+ export const AboutDrawer = ({ unitId, close, ...props }: AboutDrawerProps) => {
13
+ const { dependenciesVersion, isDependenciesVersionLoading } =
14
+ useGetDependenciesVersion(unitId);
15
+
16
+ return (
17
+ <BasicDrawer
18
+ data-bp-about-menu
19
+ close={close}
20
+ {...props}
21
+ data-fs-slide-over-direction="rightSide"
22
+ >
23
+ <BasicDrawer.Heading title="About" onClose={close} />
24
+ <BasicDrawer.Body data-bp-about-menu-drawer-body>
25
+ Version details
26
+ {isDependenciesVersionLoading && (
27
+ <div data-fs-bp-basic-buying-policy-drawer-skeleton>
28
+ <Skeleton size={{ width: "100%", height: "3.5rem" }} />
29
+ </div>
30
+ )}
31
+ {!isDependenciesVersionLoading && (
32
+ <div data-fs-bp-about-information>
33
+ <div data-fs-bp-about-row>
34
+ <span data-fs-bp-about-row-label>Organization Account</span>
35
+ <span data-fs-bp-about-row-value>{CURRENT_VERSION}</span>
36
+ </div>
37
+ <hr data-fs-bp-about-divider />
38
+ {dependenciesVersion &&
39
+ dependenciesVersion.buyerPortalApps.map((buyerPortalApp) => {
40
+ return (
41
+ <div key={buyerPortalApp.appName}>
42
+ <div data-fs-bp-about-row>
43
+ <span data-fs-bp-about-row-label>
44
+ {buyerPortalApp.appName}
45
+ </span>
46
+ <span data-fs-bp-about-row-value>
47
+ {buyerPortalApp.appVersion}
48
+ </span>
49
+ </div>
50
+ <hr data-fs-bp-about-divider />
51
+ </div>
52
+ );
53
+ })}
54
+ </div>
55
+ )}
56
+ </BasicDrawer.Body>
57
+ </BasicDrawer>
58
+ );
59
+ };
@@ -0,0 +1,57 @@
1
+ [data-bp-about-menu] {
2
+ @import "../../../../shared/components/BasicDrawer/basic-drawer.scss";
3
+
4
+ @include media(">=tablet") {
5
+ width: 30rem !important;
6
+ min-width: 30rem !important;
7
+ max-width: 30rem !important;
8
+ }
9
+
10
+ @include media("<=tablet") {
11
+ width: 19rem !important;
12
+ min-width: 19rem !important;
13
+ max-width: 19rem !important;
14
+ height: 100% !important;
15
+ border-radius: 0 !important;
16
+ }
17
+ [data-fs-bp-basic-drawer-body] [data-fs-bp-basic-drawer-body-wrapper] {
18
+ padding-top: 2.5rem !important;
19
+ }
20
+
21
+ [data-fs-bp-basic-drawer-heading] {
22
+ [data-fs-bp-basic-drawer-heading-title] {
23
+ font-weight: 600;
24
+ font-size: 20px;
25
+ line-height: 28px;
26
+ color: #1f1f1f;
27
+ }
28
+ }
29
+
30
+ [data-fs-bp-about-row] {
31
+ display: flex;
32
+ padding: 1.375rem 0;
33
+ font-weight: var(--fs-text-weight-medium);
34
+ size: var(--fs-text-size-1);
35
+ line-height: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
36
+
37
+ [data-fs-bp-about-row-label] {
38
+ width: 12.5rem;
39
+ color: #707070;
40
+ font-size: var(--fs-text-size-1);
41
+ font-weight: 500;
42
+ }
43
+
44
+ [data-fs-bp-about-row-details] {
45
+ color: #000;
46
+ font-size: var(--fs-text-size-1);
47
+ font-weight: 500;
48
+ }
49
+ }
50
+
51
+ [data-fs-bp-about-divider] {
52
+ border: calc(var(--fs-border-width) / 2) solid #e0e0e0;
53
+ }
54
+ [data-fs-bp-about-information] {
55
+ padding-top: 1rem;
56
+ }
57
+ }
@@ -24,11 +24,11 @@
24
24
  [data-fs-bp-breadcrumb-current],
25
25
  [data-fs-bp-breadcrumb-dropdown-trigger] {
26
26
  font-size: var(--fs-text-size-2);
27
-
27
+
28
28
  @include media("<=phonemid") {
29
29
  font-size: var(--fs-text-size-1);
30
30
  }
31
- }
31
+ }
32
32
  }
33
33
 
34
34
  [data-fs-bp-nav-menu-btn-container] {
@@ -63,6 +63,14 @@
63
63
  line-height: var(--fs-text-size-5);
64
64
  }
65
65
 
66
+ [data-fs-bp-nav-about-trigger] {
67
+ cursor: pointer;
68
+ }
69
+
70
+ [data-fs-bp-nav-account-menu-trigger] {
71
+ cursor: pointer;
72
+ }
73
+
66
74
  [data-fs-bp-nav-menu] {
67
75
  --fs-profile-dropdown-menu-width: 22.5rem;
68
76
  width: auto;
@@ -106,6 +106,7 @@ export const ErrorTabsLayout = ({ children, error }: ErrorTabsLayoutProps) => {
106
106
  return (
107
107
  <div data-fs-bp-create-user-error-state>
108
108
  <OrgUnitDetailsNavbar
109
+ orgId={orgUnit?.id ?? ""}
109
110
  orgName={orgUnit?.name ?? ""}
110
111
  person={{
111
112
  name: user?.name ?? "",
@@ -0,0 +1,13 @@
1
+ import { aboutClient } from "../clients/AboutClient";
2
+
3
+ export type GetDependenciesVersionProps = {
4
+ unitId: string;
5
+ cookie: string;
6
+ };
7
+
8
+ export const getDependenciesVersionService = async ({
9
+ cookie,
10
+ unitId,
11
+ }: GetDependenciesVersionProps) => {
12
+ return aboutClient.getVersionInformation(unitId, cookie);
13
+ };
@@ -10,3 +10,7 @@ export {
10
10
  validateAccessService,
11
11
  type ValidateAccessServiceProps,
12
12
  } from "./validate-access.service";
13
+ export {
14
+ getDependenciesVersionService,
15
+ type GetDependenciesVersionProps,
16
+ } from "./get-dependencies-version.service";
@@ -13,4 +13,4 @@ export const LOCAL_STORAGE_LOCATION_EDIT_KEY = "bp_hide_edit_location_confirm";
13
13
  export const LOCAL_STORAGE_RECIPIENT_EDIT_KEY =
14
14
  "bp_hide_edit_recipient_confirm";
15
15
 
16
- export const CURRENT_VERSION = "1.3.8";
16
+ export const CURRENT_VERSION = "1.3.10";