@vtex/faststore-plugin-buyer-portal 1.1.95 → 1.1.96
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/features/addresses/components/AddressLocationsList/AddressLocationsList.tsx +28 -39
- package/src/features/addresses/components/AddressRecipientsList/AddressRecipientsList.tsx +42 -42
- package/src/features/addresses/layouts/AddressDetailsLayout/address-details-layout.scss +285 -286
- package/src/features/addresses/layouts/AddressesLayout/AddressesLayout.tsx +26 -29
- package/src/features/addresses/layouts/AddressesLayout/addresses-layout.scss +144 -151
- package/src/features/budgets/components/BudgetAllocationsSelection/BudgetAllocationsSelection.tsx +61 -57
- package/src/features/budgets/components/BudgetAllocationsSelection/budget-allocations-selection.scss +131 -232
- package/src/features/budgets/components/BudgetAllocationsTable/BudgetAllocationsTable.tsx +104 -91
- package/src/features/budgets/components/BudgetAllocationsTable/budget-allocations-table.scss +80 -182
- package/src/features/budgets/components/BudgetsTable/BudgetsTable.tsx +90 -107
- package/src/features/budgets/components/BudgetsTable/budgets-table.scss +128 -126
- package/src/features/budgets/layouts/BudgetsLayout/BudgetsLayout.tsx +0 -15
- package/src/features/buying-policies/layouts/BuyingPoliciesLayout/BuyingPoliciesLayout.tsx +61 -46
- package/src/features/buying-policies/layouts/BuyingPoliciesLayout/buying-policies-layout.scss +64 -70
- package/src/features/collections/components/CollectionsTable/CollectionsTable.tsx +12 -18
- package/src/features/collections/components/CollectionsTable/collections-table.scss +138 -118
- package/src/features/collections/components/table/AddCollectionsDrawerTable.tsx +48 -54
- package/src/features/collections/components/table/add-collections-drawer-table.scss +57 -56
- package/src/features/credit-cards/layouts/CreditCardsLayout/CreditCardLayout.tsx +55 -61
- package/src/features/credit-cards/layouts/CreditCardsLayout/credit-card-layout.scss +63 -153
- package/src/features/payment-methods/components/AddPaymentMethodsDrawer/AddPaymentMethodsDrawer.tsx +58 -49
- package/src/features/payment-methods/components/AddPaymentMethodsDrawer/add-payment-methods-drawer.scss +58 -63
- package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +15 -12
- package/src/features/roles/layout/RoleDetailsLayout/RoleDetailsLayout.tsx +57 -26
- package/src/features/roles/layout/RoleDetailsLayout/role-details-layout.scss +77 -0
- package/src/features/roles/layout/RolesLayout/RolesLayout.tsx +4 -12
- package/src/features/roles/layout/RolesLayout/roles-layout.scss +8 -22
- package/src/features/shared/components/CustomField/table/CustomFieldTable.tsx +67 -110
- package/src/features/shared/components/CustomField/table/custom-field-table.scss +39 -144
- package/src/features/shared/components/IconBookmarked/IconBookmarked.tsx +9 -0
- package/src/features/shared/components/IconBookmarked/icon-bookmarked.scss +9 -0
- package/src/features/shared/components/Table/Table.tsx +7 -2
- package/src/features/shared/components/Table/TableCell/TableCell.tsx +15 -3
- package/src/features/shared/components/Table/TableCell/table-cell.scss +34 -0
- package/src/features/shared/components/Table/TableHead/TableHead.tsx +34 -6
- package/src/features/shared/components/Table/TableHead/table-head.scss +53 -49
- package/src/features/shared/components/Table/TableLoading/TableLoading.tsx +16 -6
- package/src/features/shared/components/Table/TableLoading/table-loading.scss +13 -8
- package/src/features/shared/components/Table/TableRow/TableRow.tsx +65 -42
- package/src/features/shared/components/Table/TableRow/table-row.scss +104 -68
- package/src/features/shared/components/Table/table.scss +11 -6
- package/src/features/shared/components/Table/utils/tableColumns.ts +30 -33
- package/src/features/shared/components/index.ts +1 -0
- package/src/features/users/layouts/UsersLayout/UsersLayout.tsx +20 -27
- package/src/themes/layouts.scss +1 -0
|
@@ -5,157 +5,67 @@
|
|
|
5
5
|
@import "@faststore/ui/src/components/molecules/Toggle/styles.scss";
|
|
6
6
|
|
|
7
7
|
[data-fs-credit-card-section] {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
[data-fs-credit-card-list] {
|
|
72
|
-
width: 100%;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
|
|
76
|
-
[data-fs-bp-credit-card-list-title] {
|
|
77
|
-
color: #5c5c5c;
|
|
78
|
-
margin-bottom: 0.5rem;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
[data-fs-credit-card-line] {
|
|
82
|
-
border-top: var(--fs-border-width) solid #e5e5e5;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
[data-fs-credit-card-line-loading] {
|
|
86
|
-
padding: var(--fs-spacing-2) 0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
[data-fs-credit-card-row] {
|
|
90
|
-
display: flex;
|
|
91
|
-
justify-content: space-between;
|
|
92
|
-
|
|
93
|
-
&:hover {
|
|
94
|
-
background-color: #f5f5f5;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&:visited {
|
|
98
|
-
color: red;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[data-fs-credit-card-default-icon] {
|
|
102
|
-
display: flex;
|
|
103
|
-
align-items: center;
|
|
104
|
-
padding-right: var(--fs-spacing-2);
|
|
105
|
-
color: #0366dd;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
[data-fs-credit-card-row-information] {
|
|
109
|
-
display: flex;
|
|
110
|
-
align-items: center;
|
|
111
|
-
margin-left: var(--fs-spacing-3);
|
|
112
|
-
padding: var(--fs-spacing-2) 0;
|
|
113
|
-
size: var(--fs-text-size-1);
|
|
114
|
-
color: #0366dd;
|
|
115
|
-
text-decoration: none;
|
|
116
|
-
flex: 1;
|
|
117
|
-
|
|
118
|
-
@include media("<=notebook") {
|
|
119
|
-
margin-left: 0;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
[data-fs-credit-card-row-icon-wrapper] {
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
justify-content: center;
|
|
126
|
-
width: var(--fs-spacing-6);
|
|
127
|
-
height: var(--fs-spacing-6);
|
|
128
|
-
|
|
129
|
-
margin-right: calc(var(--fs-spacing-2) - var(--fs-spacing-0));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
[data-fs-credit-card-name] {
|
|
133
|
-
width: var(--data-fs-users-table-width);
|
|
134
|
-
font-weight: 500;
|
|
135
|
-
font-size: var(--fs-text-size-1);
|
|
136
|
-
line-height: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
|
|
137
|
-
text-decoration: none;
|
|
138
|
-
color: #000;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
[data-fs-credit-card-row-action] {
|
|
143
|
-
align-items: center;
|
|
144
|
-
display: flex;
|
|
145
|
-
|
|
146
|
-
[data-fs-credit-card-row-dropdown-button] {
|
|
147
|
-
height: var(--fs-spacing-6);
|
|
148
|
-
width: var(--fs-spacing-6);
|
|
149
|
-
border-radius: var(--fs-border-radius-pill);
|
|
150
|
-
color: #5c5c5c;
|
|
151
|
-
margin-left: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
|
|
152
|
-
|
|
153
|
-
&:hover {
|
|
154
|
-
background-color: #e0e0e0;
|
|
155
|
-
cursor: pointer;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
8
|
+
@import "../../../shared/components/InternalSearch/internal-search.scss";
|
|
9
|
+
@import "../../../shared/components/DropdownFilter/dropdown-filter.scss";
|
|
10
|
+
@import "../../../shared/components/HeaderInside/header-inside.scss";
|
|
11
|
+
@import "../../../shared/components/EmptyState/empty-state.scss";
|
|
12
|
+
@import "../../../shared/components/Table/table.scss";
|
|
13
|
+
@import "../../../shared/components/IconBookmarked/icon-bookmarked.scss";
|
|
14
|
+
|
|
15
|
+
padding: 0 calc(var(--fs-spacing-9) - var(--fs-spacing-0));
|
|
16
|
+
|
|
17
|
+
@include media("<=notebook") {
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[data-fs-topbar-actions-wrapper] {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: row;
|
|
24
|
+
[data-fs-topbar-dropdown-filter-trigger] {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
|
|
29
|
+
[data-fs-topbar-dropdown-filter-trigger-label] {
|
|
30
|
+
font-weight: var(--fs-text-weight-medium);
|
|
31
|
+
font-size: var(--fs-text-size-2);
|
|
32
|
+
color: #1f1f1f;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-fs-topbar-dropdown-filter-trigger-icon] {
|
|
36
|
+
color: #707070;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[data-fs-topbar-dropdown-add-trigger] {
|
|
41
|
+
background-color: #0366dd;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
padding: calc(var(--fs-spacing-2) - var(--fs-spacing-0)) var(--fs-spacing-2);
|
|
46
|
+
border-radius: var(--fs-border-radius-pill);
|
|
47
|
+
color: white;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
|
|
50
|
+
[data-fs-topbar-dropdown-add-trigger-label] {
|
|
51
|
+
font-weight: var(--fs-text-weight-semibold);
|
|
52
|
+
font-size: var(--fs-text-size-1);
|
|
53
|
+
line-height: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
svg {
|
|
57
|
+
color: white;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
[data-fs-bp-credit-card-search-container] {
|
|
63
|
+
display: flex;
|
|
64
|
+
gap: var(--fs-spacing-1);
|
|
65
|
+
padding-bottom: 2rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-fs-credit-card-divider] {
|
|
69
|
+
border: calc(var(--fs-border-width) / 2) solid #e0e0e0;
|
|
70
|
+
}
|
|
161
71
|
}
|
package/src/features/payment-methods/components/AddPaymentMethodsDrawer/AddPaymentMethodsDrawer.tsx
CHANGED
|
@@ -2,19 +2,21 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { useRouter } from "next/router";
|
|
4
4
|
|
|
5
|
-
import { Checkbox,
|
|
5
|
+
import { Checkbox, useUI } from "@faststore/ui";
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
type BasicDrawerProps,
|
|
9
9
|
BasicDrawer,
|
|
10
10
|
EmptyState,
|
|
11
|
-
|
|
11
|
+
Table,
|
|
12
12
|
} from "../../../shared/components";
|
|
13
13
|
import { useBuyerPortal } from "../../../shared/hooks";
|
|
14
14
|
import { useAddPaymentMethodsToUnit } from "../../hooks";
|
|
15
15
|
import { useDebouncedSearchPaymentMethods } from "../../hooks/useDebouncedSearchPaymentMethods";
|
|
16
16
|
import { SearchPaymentMethods } from "../SearchPaymentMethods/SearchPaymentMethods";
|
|
17
17
|
|
|
18
|
+
import type { TableColumn } from "../../../shared/components/Table/TableHead/TableHead";
|
|
19
|
+
|
|
18
20
|
export type AddPaymentMethodsDrawerProps = Omit<
|
|
19
21
|
BasicDrawerProps,
|
|
20
22
|
"children"
|
|
@@ -115,58 +117,65 @@ export const AddPaymentMethodsDrawer = ({
|
|
|
115
117
|
addPaymentMethods({ customerId, unitId, paymentMethodsIds });
|
|
116
118
|
};
|
|
117
119
|
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
120
|
+
const columns: TableColumn[] = [
|
|
121
|
+
{
|
|
122
|
+
key: "check",
|
|
123
|
+
align: "center",
|
|
124
|
+
size: "2.5rem",
|
|
125
|
+
label: (
|
|
126
|
+
<Checkbox
|
|
127
|
+
data-fs-bp-payment-methods-checkbox
|
|
128
|
+
ref={selectAllRef}
|
|
129
|
+
checked={allSelected}
|
|
130
|
+
onChange={toggleAll}
|
|
131
|
+
disabled={readonly || availableMethods.length === 0}
|
|
132
|
+
aria-label="Select all payment methods"
|
|
133
|
+
/>
|
|
134
|
+
),
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: "name",
|
|
138
|
+
label: "Name",
|
|
139
|
+
align: "left",
|
|
140
|
+
size: "100%",
|
|
141
|
+
},
|
|
142
|
+
];
|
|
135
143
|
|
|
136
144
|
const renderList = () => (
|
|
137
|
-
<
|
|
138
|
-
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
</
|
|
145
|
+
<Table layoutFixed>
|
|
146
|
+
<Table.Head columns={columns} />
|
|
147
|
+
<Table.Body>
|
|
148
|
+
{availableMethods.map(({ id, name }) => (
|
|
149
|
+
<Table.Row
|
|
150
|
+
key={id}
|
|
151
|
+
title={name}
|
|
152
|
+
iconName="AccountBalanceWallet"
|
|
153
|
+
selected={selectedMethods.has(id)}
|
|
154
|
+
iconSize={20}
|
|
155
|
+
prependColumns={
|
|
156
|
+
<Table.Cell align="center">
|
|
157
|
+
<Checkbox
|
|
158
|
+
data-fs-bp-payment-methods-checkbox
|
|
159
|
+
checked={selectedMethods.has(id)}
|
|
160
|
+
onChange={() => toggleItem(id)}
|
|
161
|
+
disabled={readonly}
|
|
162
|
+
aria-label={`Select ${name}`}
|
|
163
|
+
/>
|
|
164
|
+
</Table.Cell>
|
|
165
|
+
}
|
|
166
|
+
/>
|
|
167
|
+
))}
|
|
168
|
+
</Table.Body>
|
|
169
|
+
</Table>
|
|
162
170
|
);
|
|
163
171
|
|
|
164
172
|
const renderLoading = () => (
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
<Table layoutFixed>
|
|
174
|
+
<Table.Head columns={columns} />
|
|
175
|
+
<Table.Body>
|
|
176
|
+
<Table.Loading columns={columns.length} />
|
|
177
|
+
</Table.Body>
|
|
178
|
+
</Table>
|
|
170
179
|
);
|
|
171
180
|
|
|
172
181
|
const renderEmpty = () => (
|
|
@@ -1,80 +1,75 @@
|
|
|
1
1
|
@import "../SearchPaymentMethods/search-payment-methods.scss";
|
|
2
2
|
|
|
3
3
|
[data-fs-bp-basic-drawer][data-fs-slide-over-size="partial"] {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
width: 66%;
|
|
5
|
+
min-width: 66%;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
@include media(">=notebook") {
|
|
8
|
+
width: 60rem;
|
|
9
|
+
min-width: 60rem;
|
|
10
|
+
max-width: 60rem;
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
[data-fs-bp-add-payment-methods-drawer] {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
[data-fs-payment-methods-drawer] {
|
|
16
|
+
@import "../../../shared/components/EmptyState/empty-state.scss";
|
|
17
|
+
@import "../../../shared/components/Table/table.scss";
|
|
18
|
+
@import "@faststore/ui/src/components/atoms/Checkbox/styles.scss";
|
|
19
|
+
@import "@faststore/ui/src/components/atoms/Skeleton/styles.scss";
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
[data-fs-bp-add-payment-methods-drawer-description] {
|
|
22
|
+
color: #1f1f1f;
|
|
23
|
+
margin-bottom: var(--fs-spacing-3);
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
span {
|
|
26
|
+
color: #0366dd;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
[data-fs-bp-payment-methods-checkbox] {
|
|
31
|
+
border-color: #e5e5e5;
|
|
32
|
+
margin: 0 auto;
|
|
33
|
+
}
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
[data-fs-bp-payment-methods-checkbox]:checked {
|
|
36
|
+
background-color: #0366dd;
|
|
37
|
+
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
[data-fs-bp-basic-drawer-button-loading-indicator] {
|
|
40
|
+
position: relative;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
[data-fs-bp-add-payment-methods-drawer-footer] {
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: flex-end;
|
|
47
|
+
gap: var(--fs-spacing-3);
|
|
48
|
+
}
|
|
49
|
+
[data-fs-bp-payment-methods-search-container] {
|
|
50
|
+
[data-fs-bp-pagination] {
|
|
51
|
+
[data-fs-bp-counter-bottom] {
|
|
52
|
+
display: block;
|
|
53
|
+
text-align: end;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
48
57
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
[data-fs-bp-payment-methods-search-container] {
|
|
55
|
-
[data-fs-bp-pagination] {
|
|
56
|
-
[data-fs-bp-counter-bottom] {
|
|
57
|
-
display: block;
|
|
58
|
-
text-align: end;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
58
|
+
@include media("<=tablet") {
|
|
59
|
+
[data-fs-buyer-portal-internal-search] {
|
|
60
|
+
width: 18rem !important;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
@include media("<=phonemid") {
|
|
65
|
+
[data-fs-buyer-portal-internal-search] {
|
|
66
|
+
width: 14rem !important;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
@include media("<=phone") {
|
|
76
|
-
[data-fs-buyer-portal-internal-search] {
|
|
77
|
-
width: 10rem !important;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
70
|
+
@include media("<=phone") {
|
|
71
|
+
[data-fs-buyer-portal-internal-search] {
|
|
72
|
+
width: 10rem !important;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
80
75
|
}
|
|
@@ -105,6 +105,8 @@ export const PaymentMethodsLayout = ({
|
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
+
const columns = getTableColumns({ actionsLength: 1 });
|
|
109
|
+
|
|
108
110
|
// --------- Render helpers (sem ternários encadeados) ----------
|
|
109
111
|
const renderEmpty = () => (
|
|
110
112
|
<EmptyState
|
|
@@ -120,29 +122,30 @@ export const PaymentMethodsLayout = ({
|
|
|
120
122
|
const renderTableRows = () =>
|
|
121
123
|
currentPaymentMethods.map((method) => (
|
|
122
124
|
<Table.Row
|
|
123
|
-
data-fs-bp-payment-method-table-row
|
|
124
125
|
key={method?.id}
|
|
125
126
|
searchTerm={querySearch}
|
|
126
127
|
title={method?.name}
|
|
127
128
|
iconName="AccountBalanceWallet"
|
|
128
129
|
iconSize={24}
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
/>
|
|
136
|
-
</td>
|
|
130
|
+
actionIcons={
|
|
131
|
+
<RemoveMethodButton
|
|
132
|
+
isLoading={isRemovingPaymentMethod}
|
|
133
|
+
onClick={() => onRemoveClick(method)}
|
|
134
|
+
disabled={isSinglePaymentMethod || isRemovingPaymentMethod}
|
|
135
|
+
/>
|
|
137
136
|
}
|
|
138
137
|
/>
|
|
139
138
|
));
|
|
140
139
|
|
|
141
140
|
const renderTable = () => (
|
|
142
|
-
<Table>
|
|
143
|
-
<Table.Head columns={
|
|
141
|
+
<Table layoutFixed>
|
|
142
|
+
<Table.Head columns={columns} />
|
|
144
143
|
<Table.Body>
|
|
145
|
-
{isLoadingPaymentMethods ?
|
|
144
|
+
{isLoadingPaymentMethods ? (
|
|
145
|
+
<Table.Loading columns={columns.length} />
|
|
146
|
+
) : (
|
|
147
|
+
renderTableRows()
|
|
148
|
+
)}
|
|
146
149
|
</Table.Body>
|
|
147
150
|
</Table>
|
|
148
151
|
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HeaderInside, Icon } from "../../../shared/components";
|
|
2
2
|
import { Table } from "../../../shared/components/Table/Table";
|
|
3
|
+
import { getTableColumns } from "../../../shared/components/Table/utils/tableColumns";
|
|
3
4
|
import { useBuyerPortal } from "../../../shared/hooks";
|
|
4
5
|
import { GlobalLayout } from "../../../shared/layouts";
|
|
5
6
|
import { OrgUnitTabsLayout } from "../../../shared/layouts/OrgUnitTabsLayout/OrgUnitTabLayout";
|
|
6
7
|
import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
|
|
7
8
|
|
|
8
|
-
import type { TableColumn } from "../../../shared/components/Table/TableHead/TableHead";
|
|
9
9
|
import type { RolePermission } from "../../types";
|
|
10
10
|
|
|
11
11
|
export type RoleDetailsLayoutProps = {
|
|
@@ -20,29 +20,19 @@ export const RoleDetailsLayout = ({
|
|
|
20
20
|
}: RoleDetailsLayoutProps) => {
|
|
21
21
|
const { currentOrgUnit } = useBuyerPortal();
|
|
22
22
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
size: "large",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
key: "active",
|
|
40
|
-
label: "",
|
|
41
|
-
align: "right",
|
|
42
|
-
colspan: 1,
|
|
43
|
-
size: "large",
|
|
44
|
-
},
|
|
45
|
-
];
|
|
23
|
+
const columns = getTableColumns({
|
|
24
|
+
nameColumnLabel: "Permissions",
|
|
25
|
+
nameColumnSize: "18rem",
|
|
26
|
+
actionsLength: 1,
|
|
27
|
+
extraColumns: [
|
|
28
|
+
{
|
|
29
|
+
label: "",
|
|
30
|
+
key: "description",
|
|
31
|
+
size: "100%",
|
|
32
|
+
hideOnScreenSize: "tablet",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
});
|
|
46
36
|
|
|
47
37
|
return (
|
|
48
38
|
<GlobalLayout>
|
|
@@ -56,7 +46,48 @@ export const RoleDetailsLayout = ({
|
|
|
56
46
|
/>
|
|
57
47
|
|
|
58
48
|
<div data-fs-role-details-page>
|
|
59
|
-
<Table>
|
|
49
|
+
<Table layoutFixed>
|
|
50
|
+
<Table.Head columns={columns} />
|
|
51
|
+
<Table.Body>
|
|
52
|
+
{roles.map((role) => (
|
|
53
|
+
<Table.Row
|
|
54
|
+
data-fs-bp-role-details-row
|
|
55
|
+
key={role.label}
|
|
56
|
+
title={
|
|
57
|
+
<>
|
|
58
|
+
<p data-fs-bp-role-details-label>{role.label}</p>
|
|
59
|
+
<p data-fs-bp-role-details-description>
|
|
60
|
+
{role.description}
|
|
61
|
+
</p>
|
|
62
|
+
</>
|
|
63
|
+
}
|
|
64
|
+
enabled={role.inRole}
|
|
65
|
+
actionIcons={
|
|
66
|
+
role.inRole ? (
|
|
67
|
+
<Icon
|
|
68
|
+
name="CheckCircle"
|
|
69
|
+
width={20}
|
|
70
|
+
height={20}
|
|
71
|
+
data-fs-bp-check-icon
|
|
72
|
+
/>
|
|
73
|
+
) : (
|
|
74
|
+
<Icon
|
|
75
|
+
name="Block"
|
|
76
|
+
width={20}
|
|
77
|
+
height={20}
|
|
78
|
+
data-fs-bp-block-icon
|
|
79
|
+
/>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
<Table.Cell align="left" hideOnScreenSize="tablet">
|
|
84
|
+
{role.description}
|
|
85
|
+
</Table.Cell>
|
|
86
|
+
</Table.Row>
|
|
87
|
+
))}
|
|
88
|
+
</Table.Body>
|
|
89
|
+
</Table>
|
|
90
|
+
{/* <Table>
|
|
60
91
|
<Table.Head columns={configTable} />
|
|
61
92
|
<Table.Body>
|
|
62
93
|
{roles.map((role) => (
|
|
@@ -88,7 +119,7 @@ export const RoleDetailsLayout = ({
|
|
|
88
119
|
</Table.Row>
|
|
89
120
|
))}
|
|
90
121
|
</Table.Body>
|
|
91
|
-
</Table>
|
|
122
|
+
</Table> */}
|
|
92
123
|
</div>
|
|
93
124
|
</section>
|
|
94
125
|
</OrgUnitTabsLayout>
|