@vtex/faststore-plugin-buyer-portal 1.0.13 → 1.0.15
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.
- package/package.json +1 -1
- package/plugin.config.js +1 -1
- package/src/components/ProfileSummary/ProfileSummary.tsx +1 -1
- package/src/layouts/HomeLayout/HomeLayout.tsx +3 -3
- package/src/mock/contracts-data.ts +24 -24
- package/src/pages/home.tsx +8 -2
- package/src/services/get-organization.service.ts +9 -2
package/package.json
CHANGED
package/plugin.config.js
CHANGED
|
@@ -33,7 +33,7 @@ export const ProfileSummary = ({
|
|
|
33
33
|
<h2 data-fs-self-profile-summary-org-name>{orgName}</h2>
|
|
34
34
|
{showManageLink && (
|
|
35
35
|
<Link data-fs-self-profile-summary-org-link href="/buyer-portal">
|
|
36
|
-
|
|
36
|
+
Manage Organization <Icon name="OpenInNew" width={20} height={20} />
|
|
37
37
|
</Link>
|
|
38
38
|
)}
|
|
39
39
|
</div>
|
|
@@ -23,9 +23,9 @@ export const HomeLayout = ({ data }: HomeLayoutProps) => (
|
|
|
23
23
|
<UsersCard users={data.users} />
|
|
24
24
|
|
|
25
25
|
{/* Remove this comments when mocks be removed */}
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
{data.contracts.length === 1 && (
|
|
27
|
+
<AddressesCard addresses={data.addresses} />
|
|
28
|
+
)}
|
|
29
29
|
<OrganizationalUnitsCard
|
|
30
30
|
organizationalUnits={data.orgUnitsHierarchy.nodes}
|
|
31
31
|
/>
|
|
@@ -2,34 +2,34 @@ import { ContractData } from "../types/ContractData";
|
|
|
2
2
|
|
|
3
3
|
export const contractsData: ContractData[] = [
|
|
4
4
|
// Uncomment to test with a single contract
|
|
5
|
-
{
|
|
6
|
-
name: "ByTech",
|
|
7
|
-
email: "bytech@demo.com",
|
|
8
|
-
id: "12-32-DDDD",
|
|
9
|
-
status: false,
|
|
10
|
-
creationDate: "October 10, 2024"
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Comment to test with single contract
|
|
14
5
|
// {
|
|
15
6
|
// name: "ByTech",
|
|
16
7
|
// email: "bytech@demo.com",
|
|
17
8
|
// id: "12-32-DDDD",
|
|
18
9
|
// status: false,
|
|
19
10
|
// creationDate: "October 10, 2024"
|
|
20
|
-
// }
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
// }
|
|
12
|
+
|
|
13
|
+
// Comment to test with single contract
|
|
14
|
+
{
|
|
15
|
+
name: "ByTech",
|
|
16
|
+
email: "bytech@demo.com",
|
|
17
|
+
id: "12-32-DDDD",
|
|
18
|
+
status: false,
|
|
19
|
+
creationDate: "October 10, 2024"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "ByTech South",
|
|
23
|
+
email: "bytech@demo.com",
|
|
24
|
+
id: "12-32-AAAA",
|
|
25
|
+
status: true,
|
|
26
|
+
creationDate: "May 5, 2024"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Stellar Inc",
|
|
30
|
+
email: "Stellar@stellar.com",
|
|
31
|
+
id: "32-32-32",
|
|
32
|
+
status: true,
|
|
33
|
+
creationDate: "January 1, 2025"
|
|
34
|
+
},
|
|
35
35
|
];
|
package/src/pages/home.tsx
CHANGED
|
@@ -4,8 +4,14 @@ import { OrganizationData } from "../types/OrganizationData";
|
|
|
4
4
|
|
|
5
5
|
export type HomePageData = { data: OrganizationData };
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
type HomePageLoaderContext = {
|
|
8
|
+
query: {
|
|
9
|
+
contractMode?: string[]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function loader(data: HomePageLoaderContext): Promise<HomePageData> {
|
|
14
|
+
return { data: await getOrganizationService(data.query.contractMode ? data.query.contractMode[0] : '') };
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
const HomePage = ({ data }: HomePageData) => {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { organizationData } from "../mock/organization-data";
|
|
2
2
|
import { OrganizationData } from "../types/OrganizationData";
|
|
3
3
|
|
|
4
|
-
export const getOrganizationService = async (): Promise<OrganizationData> => {
|
|
5
|
-
|
|
4
|
+
export const getOrganizationService = async (contractMode: string): Promise<OrganizationData> => {
|
|
5
|
+
let mockOrganizationData = organizationData
|
|
6
|
+
console.log('>>>', contractMode)
|
|
7
|
+
|
|
8
|
+
if (contractMode === 'single') {
|
|
9
|
+
mockOrganizationData = { ...organizationData, contracts: [organizationData.contracts[0]] }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return mockOrganizationData;
|
|
6
13
|
};
|