@vtex/faststore-plugin-buyer-portal 1.0.27 → 1.0.28
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/src/apis/new-route.ts +1 -1
- package/src/clients/BuyerPortalClient.ts +5 -5
- package/src/clients/Client.ts +1 -1
- package/src/components/overrides/Navbar.tsx +2 -2
- package/src/{components → features/addresses/components}/AddressLine/AddressLine.tsx +3 -4
- package/src/{components → features/addresses/components}/AddressesCard/AddressesCard.tsx +2 -4
- package/src/features/addresses/components/index.ts +2 -0
- package/src/features/addresses/hooks/index.ts +0 -0
- package/src/{layouts → features/addresses/layouts}/AddressDetailsLayout/AddressDetailsLayout.tsx +32 -23
- package/src/{layouts → features/addresses/layouts}/AddressDetailsLayout/address-details-layout.scss +1 -1
- package/src/{layouts → features/addresses/layouts}/AddressesLayout/AddressesLayout.tsx +13 -13
- package/src/{layouts → features/addresses/layouts}/AddressesLayout/addresses-layout.scss +7 -6
- package/src/features/addresses/layouts/index.ts +8 -0
- package/src/{mock → features/addresses/mocks}/addresses-data.ts +1 -1
- package/src/features/addresses/mocks/index.ts +1 -0
- package/src/features/addresses/services/get-address-details.service.ts +11 -0
- package/src/{services → features/addresses/services}/get-addresses.service.ts +2 -3
- package/src/features/addresses/services/index.ts +5 -0
- package/src/features/addresses/types/index.ts +1 -0
- package/src/{components → features/contracts/components}/ContractsCard/ContractsCard.tsx +2 -3
- package/src/features/contracts/components/index.ts +1 -0
- package/src/features/contracts/hooks/index.ts +0 -0
- package/src/{layouts → features/contracts/layouts}/ContractsLayout/ContractsLayout.tsx +12 -10
- package/src/{layouts → features/contracts/layouts}/ContractsLayout/contracts-layout.scss +5 -5
- package/src/features/contracts/layouts/index.ts +4 -0
- package/src/{mock → features/contracts/mocks}/contracts-data.ts +1 -1
- package/src/features/contracts/mocks/index.ts +1 -0
- package/src/{services → features/contracts/services}/get-contracts.service.ts +3 -4
- package/src/features/contracts/services/index.ts +4 -0
- package/src/{types → features/contracts/types}/ContractData.ts +1 -1
- package/src/features/contracts/types/index.ts +1 -0
- package/src/{components → features/org-units/components}/CreateOrgUnitDrawer/CreateOrgUnitDrawer.tsx +10 -6
- package/src/features/org-units/components/CreateOrgUnitDrawer/create-org-unit-drawer.scss +6 -0
- package/src/{components → features/org-units/components}/DeleteOrgUnitDrawer/DeleteOrgUnitDrawer.tsx +13 -8
- package/src/{components → features/org-units/components}/DeleteOrgUnitDrawer/delete-org-unit-drawer.scss +2 -2
- package/src/{components → features/org-units/components}/OrgUnitsDropdownMenu/OrgUnitsDropdownMenu.tsx +8 -6
- package/src/{components → features/org-units/components}/OrgUnitsDropdownMenu/org-units-dropdown-menu.scss +1 -1
- package/src/{components → features/org-units/components}/OrgUnitsHierarchyTree/OrgUnitsHierarchyTree.tsx +12 -10
- package/src/{components → features/org-units/components}/OrgUnitsHierarchyTree/org-units-hierarchy-tree.scss +1 -1
- package/src/{components → features/org-units/components}/OrganizationalUnitsCard/OrganizationalUnitsCard.tsx +4 -6
- package/src/{components → features/org-units/components}/UpdateOrgUnitDrawer/UpdateOrgUnitDrawer.tsx +12 -7
- package/src/features/org-units/components/UpdateOrgUnitDrawer/update-org-unit-drawer.scss +6 -0
- package/src/features/org-units/components/index.ts +21 -0
- package/src/features/org-units/hooks/index.ts +6 -0
- package/src/{hooks → features/org-units/hooks}/useChildrenOrgUnits.ts +2 -2
- package/src/{hooks → features/org-units/hooks}/useCreateNewOrgUnit.ts +4 -4
- package/src/{hooks → features/org-units/hooks}/useDeleteOrgUnit.ts +3 -3
- package/src/{hooks → features/org-units/hooks}/useOrgUnitStructure.ts +7 -3
- package/src/{hooks → features/org-units/hooks}/useRootOrgUnitByCustomer.ts +2 -2
- package/src/{hooks → features/org-units/hooks}/useUpdateOrgUnit.ts +3 -3
- package/src/{layouts → features/org-units/layouts}/OrgUnitDetailsLayout/OrgUnitDetailsLayout.tsx +11 -11
- package/src/{layouts → features/org-units/layouts}/OrgUnitsLayout/OrgUnitsLayout.tsx +15 -15
- package/src/{layouts → features/org-units/layouts}/OrgUnitsLayout/org-units-layout.scss +6 -5
- package/src/features/org-units/layouts/index.ts +8 -0
- package/src/features/org-units/mocks/index.ts +2 -0
- package/src/{mock → features/org-units/mocks}/org-units-data.ts +1 -1
- package/src/{mock → features/org-units/mocks}/organization-data.ts +4 -4
- package/src/{services → features/org-units/services}/create-new-org-unit.service.ts +1 -1
- package/src/{services → features/org-units/services}/delete-org-unit.service.ts +1 -1
- package/src/{services → features/org-units/services}/get-children-org-units.service.ts +1 -1
- package/src/{services → features/org-units/services}/get-org-unit-basic-data.service.ts +1 -1
- package/src/{services → features/org-units/services}/get-org-unit-by-id.service.ts +4 -3
- package/src/{services → features/org-units/services}/get-org-unit-summary.service.ts +1 -1
- package/src/{services → features/org-units/services}/get-organization.service.ts +2 -2
- package/src/{services → features/org-units/services}/get-root-org-unit-by-customer-id.service.ts +1 -1
- package/src/features/org-units/services/index.ts +24 -0
- package/src/{services → features/org-units/services}/update-org-unit.service.ts +1 -1
- package/src/{types → features/org-units/types}/OrgUnitSummaryData.ts +3 -3
- package/src/{types → features/org-units/types}/OrgUnitsData.ts +1 -1
- package/src/features/org-units/types/OrganizationData.ts +13 -0
- package/src/features/org-units/types/index.ts +6 -0
- package/src/{components → features/profile/components}/ProfileCard/ProfileCard.tsx +1 -1
- package/src/{components → features/profile/components}/ProfileSummary/ProfileSummary.tsx +3 -3
- package/src/features/profile/components/index.ts +5 -0
- package/src/features/profile/hooks/index.ts +0 -0
- package/src/{layouts → features/profile/layouts}/ProfileLayout/ProfileLayout.tsx +6 -6
- package/src/{layouts → features/profile/layouts}/ProfileLayout/profile-layout.scss +2 -2
- package/src/features/profile/layouts/index.ts +4 -0
- package/src/features/profile/mocks/index.ts +1 -0
- package/src/{mock → features/profile/mocks}/profile-data.ts +2 -2
- package/src/features/profile/services/index.ts +0 -0
- package/src/features/profile/types/index.ts +1 -0
- package/src/{components → features/shared/components}/AutocompleteDropdown/AutocompleteDropdown.tsx +3 -3
- package/src/{components → features/shared/components}/BuyerPortalProvider/BuyerPortalProvider.tsx +2 -2
- package/src/features/shared/components/Card/Card.tsx +17 -0
- package/src/{components → features/shared/components}/CustomerSwitch/CustomerSwitchDrawer.tsx +1 -1
- package/src/features/shared/components/CustomerSwitch/index.ts +13 -0
- package/src/{components → features/shared/components}/Navbar/Navbar.tsx +4 -4
- package/src/{components → features/shared/components}/SelfManagementDrawer/SelfManagementDrawer.tsx +8 -6
- package/src/features/shared/components/SelfManagementDrawer/SelfManagementDrawerBody.tsx +30 -0
- package/src/{components → features/shared/components}/SelfManagementDrawer/self-management-drawer.scss +2 -1
- package/src/{components → features/shared/components}/SortFilter/SortFilter.tsx +1 -1
- package/src/{components → features/shared/components}/Toast/Toast.tsx +4 -5
- package/src/features/shared/components/index.ts +55 -0
- package/src/features/shared/hooks/index.ts +5 -0
- package/src/{hooks → features/shared/hooks}/useBuyerPortal.ts +1 -1
- package/src/{hooks → features/shared/hooks}/useMutation.ts +5 -5
- package/src/{hooks → features/shared/hooks}/useQuery.ts +3 -2
- package/src/{layouts → features/shared/layouts}/HomeLayout/HomeLayout.tsx +6 -6
- package/src/{layouts → features/shared/layouts}/HomeLayout/home-layout.scss +1 -1
- package/src/features/shared/layouts/index.ts +5 -0
- package/src/features/shared/types/index.ts +2 -0
- package/src/{utils → features/shared/utils}/getClientContext.ts +8 -4
- package/src/features/shared/utils/index.ts +23 -0
- package/src/{components → features/users/components}/UsersCard/UsersCard.tsx +3 -5
- package/src/features/users/components/index.ts +1 -0
- package/src/features/users/hooks/index.ts +1 -0
- package/src/{hooks → features/users/hooks}/useUsersByOrgUnit.ts +2 -2
- package/src/{layouts → features/users/layouts}/UserDetailsLayout/UserDetailsLayout.tsx +11 -12
- package/src/{layouts → features/users/layouts}/UserDetailsLayout/user-details-layout.scss +1 -1
- package/src/{layouts → features/users/layouts}/UsersLayout/UsersLayout.tsx +13 -13
- package/src/{layouts → features/users/layouts}/UsersLayout/users-layout.scss +5 -5
- package/src/features/users/layouts/index.ts +5 -0
- package/src/features/users/mocks/index.ts +1 -0
- package/src/{mock → features/users/mocks}/users-data.ts +1 -1
- package/src/features/users/services/get-user-details.service.ts +6 -0
- package/src/{services → features/users/services}/get-users-by-org-unit-id.service.ts +2 -2
- package/src/{services → features/users/services}/get-users.service.ts +3 -4
- package/src/features/users/services/index.ts +6 -0
- package/src/features/users/types/index.ts +1 -0
- package/src/pages/address-details.tsx +7 -10
- package/src/pages/addresses.tsx +9 -10
- package/src/pages/contracts.tsx +6 -9
- package/src/pages/home.tsx +6 -9
- package/src/pages/org-unit-details.tsx +6 -9
- package/src/pages/org-units.tsx +6 -9
- package/src/pages/profile.tsx +7 -7
- package/src/pages/user-details.tsx +9 -10
- package/src/pages/users.tsx +8 -11
- package/src/themes/index.scss +2 -2
- package/src/themes/layouts.scss +22 -0
- package/src/components/Card/Card.tsx +0 -16
- package/src/components/CreateOrgUnitDrawer/create-org-unit-drawer.scss +0 -6
- package/src/components/SelfManagementDrawer/SelfManagementDrawerBody.tsx +0 -23
- package/src/components/UpdateOrgUnitDrawer/update-org-unit-drawer.scss +0 -6
- package/src/components/index.ts +0 -8
- package/src/layouts/index.scss +0 -9
- package/src/services/get-address-details.service.ts +0 -12
- package/src/services/get-user-details.service.ts +0 -6
- package/src/types/OrganizationData.ts +0 -13
- /package/src/{components → features/addresses/components}/AddressLine/address-line.scss +0 -0
- /package/src/{types → features/addresses/types}/AddressData.ts +0 -0
- /package/src/{components → features/profile/components}/ProfileSummary/profile-summary.scss +0 -0
- /package/src/{types → features/profile/types}/ProfileData.ts +0 -0
- /package/src/{components → features/shared/components}/AutocompleteDropdown/AutocompleteDropdownItem.tsx +0 -0
- /package/src/{components → features/shared/components}/AutocompleteDropdown/autocomplete-dropdown.scss +0 -0
- /package/src/{components → features/shared/components}/AutocompleteDropdown/useAutocompletePosition.ts +0 -0
- /package/src/{components → features/shared/components}/BasicCard/BasicCard.tsx +0 -0
- /package/src/{components → features/shared/components}/BasicDrawer/BasicDrawer.tsx +0 -0
- /package/src/{components → features/shared/components}/BasicDrawer/BasicDrawerBody.tsx +0 -0
- /package/src/{components → features/shared/components}/BasicDrawer/BasicDrawerButton.tsx +0 -0
- /package/src/{components → features/shared/components}/BasicDrawer/BasicDrawerFooter.tsx +0 -0
- /package/src/{components → features/shared/components}/BasicDrawer/BasicDrawerHeading.tsx +0 -0
- /package/src/{components → features/shared/components}/BasicDrawer/basic-drawer.scss +0 -0
- /package/src/{components → features/shared/components}/BasicDropdownMenu/BasicDropdownMenu.tsx +0 -0
- /package/src/{components → features/shared/components}/BasicDropdownMenu/basic-dropdown-menu.scss +0 -0
- /package/src/{components → features/shared/components}/Card/CardBody.tsx +0 -0
- /package/src/{components → features/shared/components}/Card/CardFooter.tsx +0 -0
- /package/src/{components → features/shared/components}/Card/CardHeader.tsx +0 -0
- /package/src/{components → features/shared/components}/Card/card.scss +0 -0
- /package/src/{components → features/shared/components}/Card/index.ts +0 -0
- /package/src/{components → features/shared/components}/CustomerSwitch/CustomerSwitchOption.tsx +0 -0
- /package/src/{components → features/shared/components}/CustomerSwitch/CustomerSwitchOptionsList.tsx +0 -0
- /package/src/{components → features/shared/components}/CustomerSwitch/CustomerSwitchSearch.tsx +0 -0
- /package/src/{components → features/shared/components}/CustomerSwitch/customer-switch.scss +0 -0
- /package/src/{components → features/shared/components}/DropdownFilter/DropdownFilter.tsx +0 -0
- /package/src/{components → features/shared/components}/DropdownFilter/dropdown-filter.scss +0 -0
- /package/src/{components → features/shared/components}/ErrorMessage/ErrorMessage.tsx +0 -0
- /package/src/{components → features/shared/components}/ErrorMessage/error-message.scss +0 -0
- /package/src/{components → features/shared/components}/HierarchyTree/HierarchyTree.tsx +0 -0
- /package/src/{components → features/shared/components}/HierarchyTree/hierarchy-tree.scss +0 -0
- /package/src/{components → features/shared/components}/Icon/Icon.tsx +0 -0
- /package/src/{components → features/shared/components}/Icon/index.ts +0 -0
- /package/src/{components → features/shared/components}/InputText/InputText.tsx +0 -0
- /package/src/{components → features/shared/components}/InputText/input-text.scss +0 -0
- /package/src/{components → features/shared/components}/InternalSearch/InternalSearch.tsx +0 -0
- /package/src/{components → features/shared/components}/InternalSearch/internal-search.scss +0 -0
- /package/src/{components → features/shared/components}/InternalTopbar/InternalTopbar.tsx +0 -0
- /package/src/{components → features/shared/components}/InternalTopbar/internal-top-bar.scss +0 -0
- /package/src/{components → features/shared/components}/Logo/Logo.tsx +0 -0
- /package/src/{components → features/shared/components}/MainLinksDropdownMenu/MainLinksDropdownMenu.tsx +0 -0
- /package/src/{components → features/shared/components}/MainLinksDropdownMenu/main-links-dropdown-menu.scss +0 -0
- /package/src/{components → features/shared/components}/Navbar/navbar.scss +0 -0
- /package/src/{components → features/shared/components}/SelfManagementDrawer/SelfManagementDrawerHeader.tsx +0 -0
- /package/src/{components → features/shared/components}/SelfManagementDrawer/index.ts +0 -0
- /package/src/{components → features/shared/components}/SelfManagementSignInButton/SelfManagementSignInButton.tsx +0 -0
- /package/src/{components → features/shared/components}/SelfManagementSignInButton/index.ts +0 -0
- /package/src/{components → features/shared/components}/SortFilter/sort-filter.scss +0 -0
- /package/src/{components → features/shared/components}/Tab/Tab.tsx +0 -0
- /package/src/{components → features/shared/components}/Tab/TabBar.tsx +0 -0
- /package/src/{components → features/shared/components}/Tab/TabContent.tsx +0 -0
- /package/src/{components → features/shared/components}/Tab/TabOption.tsx +0 -0
- /package/src/{components → features/shared/components}/Tab/tab.scss +0 -0
- /package/src/{components → features/shared/components}/Tag/Tag.tsx +0 -0
- /package/src/{components → features/shared/components}/Tag/tag.scss +0 -0
- /package/src/{components → features/shared/components}/Toast/toast.scss +0 -0
- /package/src/{hooks → features/shared/hooks}/useDrawerProps.ts +0 -0
- /package/src/{hooks → features/shared/hooks}/useQueryParams.ts +0 -0
- /package/src/{layouts → features/shared/layouts}/GlobalLayout/GlobalLayout.tsx +0 -0
- /package/src/{layouts → features/shared/layouts}/GlobalLayout/global-layout.scss +0 -0
- /package/src/{types → features/shared/types}/AwaitedType.d.ts +0 -0
- /package/src/{types → features/shared/types}/BreadcrumbData.ts +0 -0
- /package/src/{types → features/shared/types}/LoaderData.ts +0 -0
- /package/src/{utils → features/shared/utils}/addresLabelToPropMapping.ts +0 -0
- /package/src/{utils → features/shared/utils}/api.ts +0 -0
- /package/src/{utils → features/shared/utils}/compareItems.ts +0 -0
- /package/src/{utils → features/shared/utils}/constants.ts +0 -0
- /package/src/{utils → features/shared/utils}/cookie.ts +0 -0
- /package/src/{utils → features/shared/utils}/getTreeDepth.ts +0 -0
- /package/src/{utils → features/shared/utils}/logout.tsx +0 -0
- /package/src/{utils → features/shared/utils}/orders.tsx +0 -0
- /package/src/{utils → features/shared/utils}/search.tsx +0 -0
- /package/src/{utils → features/shared/utils}/toQueryParams.ts +0 -0
- /package/src/{types → features/users/types}/UserData.ts +0 -0
package/package.json
CHANGED
package/src/apis/new-route.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { AddressData } from "../types
|
|
2
|
-
import type { ContractData } from "../types
|
|
3
|
-
import type { OrgUnitData } from "../types/OrgUnitsData";
|
|
1
|
+
import type { AddressData } from "../features/addresses/types";
|
|
2
|
+
import type { ContractData } from "../features/contracts/types";
|
|
4
3
|
import type {
|
|
5
4
|
OrgUnitBasicData,
|
|
6
5
|
OrgUnitSummaryData,
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
OrgUnitData,
|
|
7
|
+
} from "../features/org-units/types";
|
|
8
|
+
import { getApiUrl } from "../features/shared/utils";
|
|
9
9
|
import Client from "./Client";
|
|
10
10
|
|
|
11
11
|
class BuyerPortalClient extends Client {
|
package/src/clients/Client.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SectionOverride } from "@faststore/core";
|
|
1
|
+
import type { SectionOverride } from "@faststore/core";
|
|
2
2
|
import { useSession_unstable as useSession } from "@faststore/core/experimental";
|
|
3
|
-
import { SelfManagementSignInButton } from "
|
|
3
|
+
import { SelfManagementSignInButton } from "../../features/shared/components";
|
|
4
4
|
|
|
5
5
|
const SECTION: SectionOverride["section"] = "Navbar";
|
|
6
6
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Toggle } from "@faststore/ui";
|
|
2
2
|
import Link from "next/link";
|
|
3
|
-
import { Tag } from "
|
|
4
|
-
import { Icon } from "../Icon";
|
|
3
|
+
import { Icon, Tag } from "../../../shared/components";
|
|
5
4
|
|
|
6
5
|
export type AddressLineProps = {
|
|
7
6
|
id: string;
|
|
@@ -31,12 +30,12 @@ export const AddressLine = ({
|
|
|
31
30
|
</span>
|
|
32
31
|
|
|
33
32
|
{types.map((type, index) => (
|
|
34
|
-
<Tag key={
|
|
33
|
+
<Tag key={type}>{type}</Tag>
|
|
35
34
|
))}
|
|
36
35
|
</Link>
|
|
37
36
|
|
|
38
37
|
<Toggle id={id} defaultChecked={isActive} />
|
|
39
|
-
<button data-fs-addresses-dropdown-trigger>
|
|
38
|
+
<button type="button" data-fs-addresses-dropdown-trigger>
|
|
40
39
|
<Icon
|
|
41
40
|
name="MoreVert"
|
|
42
41
|
width={20}
|
|
@@ -5,10 +5,8 @@ import {
|
|
|
5
5
|
DropdownMenu,
|
|
6
6
|
DropdownButton,
|
|
7
7
|
} from "@faststore/ui";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { Icon } from "../Icon";
|
|
11
|
-
import { BasicCard } from "../BasicCard/BasicCard";
|
|
8
|
+
import type { AddressData } from "../../types";
|
|
9
|
+
import { BasicCard, Icon, Tag } from "../../../shared/components";
|
|
12
10
|
|
|
13
11
|
type AddressesCardProps = {
|
|
14
12
|
addresses?: AddressData[];
|
|
File without changes
|
package/src/{layouts → features/addresses/layouts}/AddressDetailsLayout/AddressDetailsLayout.tsx
RENAMED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { DropdownItem, DropdownMenu, Toggle } from "@faststore/ui";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { InternalTopBar } from "
|
|
4
|
-
import
|
|
5
|
-
import { addressLabelToPropMapping } from "
|
|
6
|
-
import {
|
|
7
|
-
import { Icon } from "../../components/Icon";
|
|
2
|
+
import { useId, useState } from "react";
|
|
3
|
+
import { Icon, InternalTopBar } from "../../../shared/components";
|
|
4
|
+
import { GlobalLayout } from "../../../shared/layouts";
|
|
5
|
+
import { addressLabelToPropMapping } from "../../../shared/utils";
|
|
6
|
+
import type { AddressData } from "../../types";
|
|
8
7
|
|
|
9
|
-
export type AddressDetailsLayoutProps = { data: AddressData };
|
|
8
|
+
export type AddressDetailsLayoutProps = { data: AddressData | null };
|
|
10
9
|
|
|
11
|
-
export const AddressDetailsLayout = ({
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
export const AddressDetailsLayout = ({ data }: AddressDetailsLayoutProps) => {
|
|
11
|
+
// TODO: Implement the AddressDetailsLayout Fallback component
|
|
12
|
+
if (!data) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { id, isActive, ...addressData } = data;
|
|
14
17
|
const [checked, setChecked] = useState(isActive);
|
|
15
18
|
|
|
16
19
|
const props = Object.keys(addressLabelToPropMapping) as Array<
|
|
@@ -104,19 +107,25 @@ export const AddressDetailsLayout = ({
|
|
|
104
107
|
</div>
|
|
105
108
|
|
|
106
109
|
<div data-fs-address-details-locations>
|
|
107
|
-
{addressData.locations.map((location) =>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
{addressData.locations.map((location) => {
|
|
111
|
+
const id = useId();
|
|
112
|
+
return (
|
|
113
|
+
<div key={`${location}-${id}`} data-fs-address-details-location>
|
|
114
|
+
<span data-fs-address-details-location-name>{location}</span>
|
|
115
|
+
<span data-fs-address-details-location-actions>
|
|
116
|
+
<button
|
|
117
|
+
type="button"
|
|
118
|
+
data-fs-address-details-location-delete
|
|
119
|
+
>
|
|
120
|
+
<Icon name="Delete" width={24} height={24} />
|
|
121
|
+
</button>
|
|
122
|
+
<button type="button" data-fs-address-details-location-more>
|
|
123
|
+
<Icon name="MoreVert" width={24} height={24} />
|
|
124
|
+
</button>
|
|
125
|
+
</span>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
})}
|
|
120
129
|
</div>
|
|
121
130
|
</div>
|
|
122
131
|
</section>
|
package/src/{layouts → features/addresses/layouts}/AddressDetailsLayout/address-details-layout.scss
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[data-fs-address-details-section] {
|
|
2
2
|
@import "@faststore/ui/src/components/molecules/Toggle/styles.scss";
|
|
3
|
-
@import "
|
|
3
|
+
@import "../../../shared/components/InternalTopbar/internal-top-bar.scss";
|
|
4
4
|
|
|
5
5
|
width: 100%;
|
|
6
6
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
InternalTopBar,
|
|
3
|
+
MainLinksDropdownMenu,
|
|
4
|
+
InternalSearch,
|
|
5
|
+
DropdownFilter,
|
|
6
|
+
SortFilter,
|
|
7
|
+
Icon,
|
|
8
|
+
} from "../../../shared/components";
|
|
9
|
+
import { useQueryParams } from "../../../shared/hooks";
|
|
10
|
+
import { GlobalLayout } from "../../../shared/layouts";
|
|
11
|
+
import { statusFilters } from "../../../shared/utils";
|
|
12
|
+
import { AddressLine } from "../../components";
|
|
13
|
+
import type { AddressSummaryData } from "../../types";
|
|
14
14
|
|
|
15
15
|
export type AddressLayoutProps = {
|
|
16
16
|
data: AddressSummaryData[];
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "../../../shared/components/MainLinksDropdownMenu/main-links-dropdown-menu.scss";
|
|
2
2
|
|
|
3
3
|
[data-fs-addresses-section] {
|
|
4
4
|
@import "@faststore/ui/src/components/molecules/Toggle/styles.scss";
|
|
5
5
|
|
|
6
6
|
@import "../../components/AddressLine/address-line.scss";
|
|
7
|
-
|
|
8
|
-
@import "
|
|
9
|
-
@import "
|
|
10
|
-
@import "
|
|
11
|
-
@import "
|
|
7
|
+
|
|
8
|
+
@import "../../../shared/components/InternalSearch/internal-search.scss";
|
|
9
|
+
@import "../../../shared/components/DropdownFilter/dropdown-filter.scss";
|
|
10
|
+
@import "../../../shared/components/Tag/tag.scss";
|
|
11
|
+
@import "../../../shared/components/SortFilter/sort-filter.scss";
|
|
12
|
+
@import "../../../shared/components/InternalTopbar/internal-top-bar.scss";
|
|
12
13
|
|
|
13
14
|
[data-fs-topbar-actions-wrapper] {
|
|
14
15
|
display: flex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { addressesData } from "./addresses-data";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { addressesData } from "../mocks";
|
|
2
|
+
import type { AddressData } from "../types/AddressData";
|
|
3
|
+
|
|
4
|
+
export const getAddressDetailsService = async (
|
|
5
|
+
id: string
|
|
6
|
+
): Promise<AddressData | null> => {
|
|
7
|
+
// TODO: Need to create get of single address on api
|
|
8
|
+
const addressData =
|
|
9
|
+
addressesData.find((address) => String(address.id) === id) ?? null;
|
|
10
|
+
return addressData;
|
|
11
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AddressSummaryData } from "../types/AddressData";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { compareItems } from "../utils/compareItems";
|
|
2
|
+
import { buyerPortalClient } from "../../../clients/BuyerPortalClient";
|
|
3
|
+
import { compareItems, statusFilters } from "../../shared/utils";
|
|
5
4
|
|
|
6
5
|
export type GetAddressesServiceProps = Partial<{
|
|
7
6
|
search: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AddressData, AddressSummaryData } from "./AddressData";
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
DropdownMenu,
|
|
7
7
|
DropdownButton,
|
|
8
8
|
} from "@faststore/ui";
|
|
9
|
-
import {
|
|
10
|
-
import { BasicCard } from "
|
|
11
|
-
import type { ContractData } from "../../types/ContractData";
|
|
9
|
+
import type { ContractData } from "../../types";
|
|
10
|
+
import { BasicCard, Icon } from "../../../shared/components";
|
|
12
11
|
|
|
13
12
|
type ContractsCardProps = {
|
|
14
13
|
orgUnitData?: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ContractsCard } from "./ContractsCard/ContractsCard";
|
|
File without changes
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import DropdownFilter from "../../components/DropdownFilter/DropdownFilter";
|
|
3
|
-
import InternalSearch from "../../components/InternalSearch/InternalSearch";
|
|
4
|
-
import { InternalTopBar } from "../../components/InternalTopbar/InternalTopbar";
|
|
5
|
-
import SortFilter from "../../components/SortFilter/SortFilter";
|
|
6
|
-
import { statusFilters } from "../../utils/search";
|
|
1
|
+
import { Toggle } from "@faststore/ui";
|
|
7
2
|
|
|
8
3
|
import type { ContractData } from "../../types/ContractData";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import {
|
|
5
|
+
InternalTopBar,
|
|
6
|
+
MainLinksDropdownMenu,
|
|
7
|
+
InternalSearch,
|
|
8
|
+
DropdownFilter,
|
|
9
|
+
SortFilter,
|
|
10
|
+
Icon,
|
|
11
|
+
} from "../../../shared/components";
|
|
12
|
+
import { useQueryParams } from "../../../shared/hooks";
|
|
13
|
+
import { GlobalLayout } from "../../../shared/layouts";
|
|
14
|
+
import { statusFilters } from "../../../shared/utils";
|
|
13
15
|
|
|
14
16
|
export type ContractsLayoutProps = {
|
|
15
17
|
data: ContractData[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[data-fs-contracts-section] {
|
|
2
2
|
@import "@faststore/ui/src/components/molecules/Toggle/styles.scss";
|
|
3
3
|
|
|
4
|
-
@import "
|
|
5
|
-
@import "
|
|
6
|
-
@import "
|
|
7
|
-
@import "
|
|
8
|
-
@import "
|
|
4
|
+
@import "../../../shared/components/InternalSearch/internal-search.scss";
|
|
5
|
+
@import "../../../shared/components/DropdownFilter/dropdown-filter.scss";
|
|
6
|
+
@import "../../../shared/components/Tag/tag.scss";
|
|
7
|
+
@import "../../../shared/components/SortFilter/sort-filter.scss";
|
|
8
|
+
@import "../../../shared/components/InternalTopbar/internal-top-bar.scss";
|
|
9
9
|
|
|
10
10
|
[data-fs-contracts-page] {
|
|
11
11
|
padding: 0 calc(var(--fs-spacing-8) + var(--fs-spacing-0));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { contractsData } from "./contracts-data";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { statusFilters } from "
|
|
3
|
-
import {
|
|
4
|
-
import { compareItems } from "../utils/compareItems";
|
|
1
|
+
import { buyerPortalClient } from "../../../clients/BuyerPortalClient";
|
|
2
|
+
import { compareItems, statusFilters } from "../../shared/utils";
|
|
3
|
+
import type { ContractData } from "../types";
|
|
5
4
|
|
|
6
5
|
export type GetContractsServiceProps = {
|
|
7
6
|
search?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ContractData } from "./ContractData";
|
package/src/{components → features/org-units/components}/CreateOrgUnitDrawer/CreateOrgUnitDrawer.tsx
RENAMED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
|
-
|
|
3
|
-
import { BasicDrawer, BasicDrawerProps } from "../BasicDrawer/BasicDrawer";
|
|
4
|
-
import { InputText } from "../InputText/InputText";
|
|
5
|
-
import { Icon } from "../Icon";
|
|
6
|
-
import { ErrorMessage } from "../ErrorMessage/ErrorMessage";
|
|
7
|
-
import { useCreateNewOrgUnit } from "../../hooks/useCreateNewOrgUnit";
|
|
2
|
+
|
|
8
3
|
import { useUI } from "@faststore/ui";
|
|
9
4
|
import { useRouter } from "next/router";
|
|
5
|
+
import {
|
|
6
|
+
type BasicDrawerProps,
|
|
7
|
+
BasicDrawer,
|
|
8
|
+
AutocompleteDropdown,
|
|
9
|
+
ErrorMessage,
|
|
10
|
+
InputText,
|
|
11
|
+
Icon,
|
|
12
|
+
} from "../../../shared/components";
|
|
13
|
+
import { useCreateNewOrgUnit } from "../../hooks";
|
|
10
14
|
|
|
11
15
|
export type CreateOrgUnitDrawerProps = Omit<BasicDrawerProps, "children"> & {
|
|
12
16
|
options?: { id: string; name: string }[];
|
package/src/{components → features/org-units/components}/DeleteOrgUnitDrawer/DeleteOrgUnitDrawer.tsx
RENAMED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { useUI } from "@faststore/ui";
|
|
2
|
-
|
|
3
|
-
import { useDeleteOrgUnit } from "../../hooks/useDeleteOrgUnit";
|
|
4
|
-
import { useUsersByOrgUnit } from "../../hooks/useUsersByOrgUnit";
|
|
5
|
-
import { BasicDrawer, BasicDrawerProps } from "../BasicDrawer/BasicDrawer";
|
|
6
|
-
import { Icon } from "../Icon";
|
|
7
|
-
import { OrgUnitsHierarchyTree } from "../OrgUnitsHierarchyTree/OrgUnitsHierarchyTree";
|
|
8
|
-
import { Tab } from "../Tab/Tab";
|
|
2
|
+
|
|
9
3
|
import { useRouter } from "next/router";
|
|
10
4
|
|
|
5
|
+
import { useDeleteOrgUnit } from "../../hooks/useDeleteOrgUnit";
|
|
6
|
+
import { OrgUnitsHierarchyTree } from "..";
|
|
7
|
+
import { useChildrenOrgUnits } from "../../hooks";
|
|
8
|
+
import { useUsersByOrgUnit } from "../../../users/hooks";
|
|
9
|
+
import {
|
|
10
|
+
BasicDrawer,
|
|
11
|
+
Icon,
|
|
12
|
+
Tab,
|
|
13
|
+
type BasicDrawerProps,
|
|
14
|
+
} from "../../../shared/components";
|
|
15
|
+
|
|
11
16
|
export type DeleteOrgUnitDrawerProps = Omit<BasicDrawerProps, "children"> & {
|
|
12
17
|
id: string;
|
|
13
18
|
name: string;
|
|
@@ -116,7 +121,7 @@ export const DeleteOrgUnitDrawer = ({
|
|
|
116
121
|
{user.name}
|
|
117
122
|
</span>
|
|
118
123
|
<span data-fs-bp-delete-org-unit-drawer-user-org>
|
|
119
|
-
{user.orgUnit}
|
|
124
|
+
{user.orgUnit.name}
|
|
120
125
|
</span>
|
|
121
126
|
<span data-fs-bp-delete-org-unit-drawer-user-type>
|
|
122
127
|
{user.userType}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "../../../shared/components/BasicDrawer/basic-drawer.scss";
|
|
2
2
|
|
|
3
3
|
[data-fs-bp-basic-drawer][data-fs-bp-delete-org-unit-drawer] {
|
|
4
|
-
@import "
|
|
4
|
+
@import "../../../shared/components/Tab/tab.scss";
|
|
5
5
|
@import "../OrgUnitsHierarchyTree/org-units-hierarchy-tree.scss";
|
|
6
6
|
|
|
7
7
|
&[data-fs-bp-delete-org-unit-drawer-has-content="true"] {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { DropdownItem, Toggle } from "@faststore/ui";
|
|
2
|
-
import { CreateOrgUnitDrawer } from "../CreateOrgUnitDrawer/CreateOrgUnitDrawer";
|
|
3
|
-
import { useDrawerProps } from "../../hooks/useDrawerProps";
|
|
4
|
-
import { Icon } from "../Icon";
|
|
5
|
-
import { DeleteOrgUnitDrawer } from "../DeleteOrgUnitDrawer/DeleteOrgUnitDrawer";
|
|
6
|
-
import { UpdateOrgUnitDrawer } from "../UpdateOrgUnitDrawer/UpdateOrgUnitDrawer";
|
|
7
2
|
import { useRouter } from "next/router";
|
|
8
|
-
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
CreateOrgUnitDrawer,
|
|
6
|
+
DeleteOrgUnitDrawer,
|
|
7
|
+
UpdateOrgUnitDrawer,
|
|
8
|
+
} from "..";
|
|
9
|
+
import { useDrawerProps } from "../../../shared/hooks";
|
|
10
|
+
import { BasicDropdownMenu, Icon } from "../../../shared/components";
|
|
9
11
|
|
|
10
12
|
export type OrgUnitsDropdownMenuProps = {
|
|
11
13
|
id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "../../../shared/components/BasicDropdownMenu/basic-dropdown-menu.scss";
|
|
2
2
|
@import "../UpdateOrgUnitDrawer/update-org-unit-drawer.scss";
|
|
3
3
|
@import "../CreateOrgUnitDrawer/create-org-unit-drawer.scss";
|
|
4
4
|
@import "../DeleteOrgUnitDrawer/delete-org-unit-drawer.scss";
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { Dropdown, DropdownButton
|
|
2
|
-
|
|
3
|
-
import { OrgUnitHierarchyData } from "../../types
|
|
4
|
-
import {
|
|
5
|
-
import { useOrgUnitStructure } from "../../hooks
|
|
6
|
-
import {
|
|
7
|
-
import Link from "next/link";
|
|
8
|
-
import { OrgUnitsDropdownMenu } from "../OrgUnitsDropdownMenu/OrgUnitsDropdownMenu";
|
|
1
|
+
import { Link, Toggle, Dropdown, DropdownButton } from "@faststore/ui";
|
|
2
|
+
|
|
3
|
+
import type { OrgUnitHierarchyData } from "../../types";
|
|
4
|
+
import { OrgUnitsDropdownMenu } from "..";
|
|
5
|
+
import { useChildrenOrgUnits, useOrgUnitStructure } from "../../hooks";
|
|
6
|
+
import { HierarchyTree, Icon } from "../../../shared/components";
|
|
9
7
|
|
|
10
8
|
export type OrgUnitsHierarchyTreeProps = {
|
|
11
9
|
orgUnitHierarchyData: OrgUnitHierarchyData;
|
|
@@ -26,7 +24,7 @@ export const OrgUnitsHierarchyTree = ({
|
|
|
26
24
|
data-fs-org-units-hierarchy-root
|
|
27
25
|
>
|
|
28
26
|
{({ isRoot, isOpen, toggle, isLastNode, name, id }) => {
|
|
29
|
-
|
|
27
|
+
useChildrenOrgUnits(id, {
|
|
30
28
|
onSuccess: (orgUnitHierarchyData) => {
|
|
31
29
|
orgUnitHierarchyData?.nodes &&
|
|
32
30
|
setNode(id, orgUnitHierarchyData.nodes);
|
|
@@ -45,6 +43,7 @@ export const OrgUnitsHierarchyTree = ({
|
|
|
45
43
|
/>
|
|
46
44
|
)}
|
|
47
45
|
<button
|
|
46
|
+
type="button"
|
|
48
47
|
data-fs-org-unit-item-toggle
|
|
49
48
|
disabled={isLastNode}
|
|
50
49
|
onClick={toggle}
|
|
@@ -71,7 +70,10 @@ export const OrgUnitsHierarchyTree = ({
|
|
|
71
70
|
{!isRoot && <Toggle id={id} />}
|
|
72
71
|
<Dropdown>
|
|
73
72
|
<DropdownButton asChild>
|
|
74
|
-
<button
|
|
73
|
+
<button
|
|
74
|
+
type="button"
|
|
75
|
+
data-fs-org-unit-item-content-actions-more-button
|
|
76
|
+
>
|
|
75
77
|
<Icon name="MoreVert" width={24} height={24} />
|
|
76
78
|
</button>
|
|
77
79
|
</DropdownButton>
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Toggle, Button, Dropdown, DropdownButton } from "@faststore/ui";
|
|
2
|
+
import { CreateOrgUnitDrawer, OrgUnitsDropdownMenu } from "..";
|
|
2
3
|
|
|
3
|
-
import { OrgUnitData } from "../../types
|
|
4
|
-
import { Icon } from "
|
|
5
|
-
import {
|
|
6
|
-
import { OrgUnitsDropdownMenu } from "../OrgUnitsDropdownMenu/OrgUnitsDropdownMenu";
|
|
7
|
-
import { CreateOrgUnitDrawer } from "../CreateOrgUnitDrawer/CreateOrgUnitDrawer";
|
|
8
|
-
import { useDrawerProps } from "../../hooks/useDrawerProps";
|
|
4
|
+
import type { OrgUnitData } from "../../types";
|
|
5
|
+
import { BasicCard, Icon } from "../../../shared/components";
|
|
6
|
+
import { useDrawerProps } from "../../../shared/hooks";
|
|
9
7
|
|
|
10
8
|
type OrganizationalUnitsCardProps = {
|
|
11
9
|
orgUnitData?: {
|
package/src/{components → features/org-units/components}/UpdateOrgUnitDrawer/UpdateOrgUnitDrawer.tsx
RENAMED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
|
-
|
|
3
|
-
import { InputText } from "../InputText/InputText";
|
|
4
|
-
import { ErrorMessage } from "../ErrorMessage/ErrorMessage";
|
|
5
|
-
import { useUI } from "@faststore/ui";
|
|
6
|
-
import { useUpdateOrgUnit } from "../../hooks/useUpdateOrgUnit";
|
|
7
|
-
import { AutocompleteDropdown } from "../AutocompleteDropdown/AutocompleteDropdown";
|
|
8
|
-
import { Icon } from "../Icon";
|
|
2
|
+
|
|
9
3
|
import { useRouter } from "next/router";
|
|
4
|
+
import { useUI } from "@faststore/ui";
|
|
5
|
+
|
|
6
|
+
import { useUpdateOrgUnit } from "../../hooks";
|
|
7
|
+
import {
|
|
8
|
+
AutocompleteDropdown,
|
|
9
|
+
BasicDrawer,
|
|
10
|
+
type BasicDrawerProps,
|
|
11
|
+
ErrorMessage,
|
|
12
|
+
Icon,
|
|
13
|
+
InputText,
|
|
14
|
+
} from "../../../shared/components";
|
|
10
15
|
|
|
11
16
|
export type UpdateOrgUnitDrawerProps = Omit<BasicDrawerProps, "children"> & {
|
|
12
17
|
options?: { id: string; name: string }[];
|