@vtex/faststore-plugin-buyer-portal 1.1.83 → 1.1.86
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/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/basic-buying-policy-drawer.scss +3 -3
- package/src/features/buying-policies/utils/orderFieldsCriteriaOptions.ts +11 -10
- package/src/features/users/components/CreateUserDrawer/CreateUserDrawer.tsx +1 -6
- package/src/features/users/components/UpdateUserDrawer/UpdateUserDrawer.tsx +1 -6
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
@import "@faststore/ui/src/components/molecules/Tooltip/styles.scss";
|
|
10
10
|
@import "@faststore/ui/src/components/molecules/Dropdown/styles.scss";
|
|
11
11
|
|
|
12
|
-
&[data-fs-bp-basic-drawer] {
|
|
13
|
-
--fs-slide-over-partial-max-width-notebook: 60rem;
|
|
12
|
+
&[data-fs-bp-basic-drawer][data-fs-slide-over-size="partial"] {
|
|
13
|
+
--fs-slide-over-partial-max-width-notebook: 60rem;
|
|
14
|
+
min-width: var(--fs-slide-over-partial-max-width-notebook);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
|
|
17
17
|
[data-fs-bp-autocomplete-dropdown] {
|
|
18
18
|
[data-fs-bp-input-text-input] {
|
|
19
19
|
top: 0;
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
export const orderFieldsCriteriaOptions = [
|
|
2
2
|
{
|
|
3
3
|
label: "If the order contains a budget",
|
|
4
|
-
criteria: "$count(budgetData.
|
|
4
|
+
criteria: "$count(budgetData.unitAllocations) > 0",
|
|
5
5
|
},
|
|
6
6
|
{
|
|
7
7
|
label: "If the order contains the budgets X, Y, Z",
|
|
8
8
|
criteria:
|
|
9
|
-
'budgetData.
|
|
9
|
+
'budgetData.unitAllocations.budgetId = "Tech" or budgetData.unitAllocations.budgetId = "Growth"',
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
label: "If the order contains an exceeded budget",
|
|
13
|
-
criteria: "budgetData.
|
|
13
|
+
criteria: "budgetData.unitAllocations.budgetBalance.remaining < 0",
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
label: "If the order contains an expired budget Pending confirmation",
|
|
17
|
-
criteria: "budgetData.
|
|
17
|
+
criteria: "budgetData.unitAllocations.cycleConfiguration.endDate < now()",
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
label: "If the order contains a PO number",
|
|
21
|
-
criteria:
|
|
21
|
+
criteria: '$exists(customData.customFields.fields[name="poNumber"].value)',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
label: "If the order contains the PO numbers X, Y, Z",
|
|
25
25
|
criteria:
|
|
26
|
-
'customData.customFields.fields.
|
|
26
|
+
'customData.customFields.fields[name="poNumber"].value = "1112223334444" or customData.customFields.fields[name="poNumber"].value = "1234567890"',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
label: "If the order contains a cost center",
|
|
30
|
-
criteria:
|
|
30
|
+
criteria:
|
|
31
|
+
'$exists(customData.customFields.fields[name="costCenter"].value)',
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
34
|
label: "If the order contains the cost centers X, Y, Z",
|
|
34
35
|
criteria:
|
|
35
|
-
'customData.customFields.fields.
|
|
36
|
+
'customData.customFields.fields[name="costCenter"].value = "CC1" or customData.customFields.fields[name="costCenter"].value = "CC2"',
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
label: "If all order items are negotiated items",
|
|
39
40
|
criteria:
|
|
40
|
-
'customData.customApps[id.$contains("vtex.customorderfields")].fields.
|
|
41
|
+
'customData.customApps[id.$contains("vtex.customorderfields")].fields[name="allContractItems"].value = "1"',
|
|
41
42
|
},
|
|
42
43
|
{
|
|
43
44
|
label: "If there are restricted items in the order",
|
|
44
45
|
criteria:
|
|
45
|
-
'customData.customApps[id.$contains("vtex.customorderfields")].fields.
|
|
46
|
+
'customData.customApps[id.$contains("vtex.customorderfields")].fields[name="hasRestrictItems"].value = "1"',
|
|
46
47
|
},
|
|
47
48
|
];
|
|
@@ -123,7 +123,7 @@ export const CreateUserDrawer = ({
|
|
|
123
123
|
|
|
124
124
|
const isAllFieldsFilled = Object.keys(form).every((key) => {
|
|
125
125
|
if (key === "roles") {
|
|
126
|
-
return
|
|
126
|
+
return true; // allow empty roles
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
return (form[key as keyof typeof form] as string)?.trim();
|
|
@@ -256,11 +256,6 @@ export const CreateUserDrawer = ({
|
|
|
256
256
|
);
|
|
257
257
|
})}
|
|
258
258
|
</div>
|
|
259
|
-
|
|
260
|
-
<ErrorMessage
|
|
261
|
-
show={isTouched && !roles?.length}
|
|
262
|
-
message="Role is required"
|
|
263
|
-
/>
|
|
264
259
|
</>
|
|
265
260
|
)}
|
|
266
261
|
</BasicDrawer.Body>
|
|
@@ -100,7 +100,7 @@ export const UpdateUserDrawer = ({
|
|
|
100
100
|
|
|
101
101
|
const isAllFieldsFilled = Object.keys(form).every((key) => {
|
|
102
102
|
if (key === "roles") {
|
|
103
|
-
return
|
|
103
|
+
return true; // allow empty roles
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
return (form[key as keyof typeof form] as string)?.trim();
|
|
@@ -222,11 +222,6 @@ export const UpdateUserDrawer = ({
|
|
|
222
222
|
);
|
|
223
223
|
})}
|
|
224
224
|
</div>
|
|
225
|
-
|
|
226
|
-
<ErrorMessage
|
|
227
|
-
show={isTouched && !roles?.length}
|
|
228
|
-
message="Role is required"
|
|
229
|
-
/>
|
|
230
225
|
</BasicDrawer.Body>
|
|
231
226
|
<BasicDrawer.Footer>
|
|
232
227
|
<BasicDrawer.Button variant="ghost" onClick={close}>
|