fix(dashboard): customer groups fixes (#9258)
**What** - fix add customer to customer group toast - move modal actions to footer --- FIXES CC-514
This commit is contained in:
1 parent
d238dd0099
commit
981745e98b
2 files changed
+26
-13
No files matched your search
@@ -779,6 +779,7 @@
|
|||||||
"noRecordsMessage": "This customer doesn't belong to any group."
|
"noRecordsMessage": "This customer doesn't belong to any group."
|
||||||
},
|
},
|
||||||
"add": {
|
"add": {
|
||||||
|
"success": "Customer added to: {{groups}}.",
|
||||||
"list": {
|
"list": {
|
||||||
"noRecordsMessage": "Please create a customer group first."
|
"noRecordsMessage": "Please create a customer group first."
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-13
@@ -126,6 +126,16 @@ export const AddCustomerGroupsForm = ({
|
|||||||
|
|
||||||
await Promise.all(promises)
|
await Promise.all(promises)
|
||||||
|
|
||||||
|
toast.success(t("general.success"), {
|
||||||
|
description: t("customers.groups.add.success", {
|
||||||
|
groups: data.customer_group_ids
|
||||||
|
.map((id) => customer_groups?.find((g) => g.id === id))
|
||||||
|
.filter(Boolean)
|
||||||
|
.map((cg) => cg.name),
|
||||||
|
}),
|
||||||
|
dismissLabel: t("actions.close"),
|
||||||
|
})
|
||||||
|
|
||||||
await queryClient.invalidateQueries({
|
await queryClient.invalidateQueries({
|
||||||
queryKey: customerGroupsQueryKeys.lists(),
|
queryKey: customerGroupsQueryKeys.lists(),
|
||||||
})
|
})
|
||||||
@@ -155,19 +165,6 @@ export const AddCustomerGroupsForm = ({
|
|||||||
{form.formState.errors.customer_group_ids.message}
|
{form.formState.errors.customer_group_ids.message}
|
||||||
</Hint>
|
</Hint>
|
||||||
)}
|
)}
|
||||||
<RouteFocusModal.Close asChild>
|
|
||||||
<Button variant="secondary" size="small">
|
|
||||||
{t("actions.cancel")}
|
|
||||||
</Button>
|
|
||||||
</RouteFocusModal.Close>
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
variant="primary"
|
|
||||||
size="small"
|
|
||||||
isLoading={isPending}
|
|
||||||
>
|
|
||||||
{t("actions.save")}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</RouteFocusModal.Header>
|
</RouteFocusModal.Header>
|
||||||
<RouteFocusModal.Body className="size-full overflow-hidden">
|
<RouteFocusModal.Body className="size-full overflow-hidden">
|
||||||
@@ -187,6 +184,21 @@ export const AddCustomerGroupsForm = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</RouteFocusModal.Body>
|
</RouteFocusModal.Body>
|
||||||
|
<RouteFocusModal.Footer>
|
||||||
|
<RouteFocusModal.Close asChild>
|
||||||
|
<Button variant="secondary" size="small">
|
||||||
|
{t("actions.cancel")}
|
||||||
|
</Button>
|
||||||
|
</RouteFocusModal.Close>
|
||||||
|
<Button
|
||||||
|
type="submit"
|
||||||
|
variant="primary"
|
||||||
|
size="small"
|
||||||
|
isLoading={isPending}
|
||||||
|
>
|
||||||
|
{t("actions.save")}
|
||||||
|
</Button>
|
||||||
|
</RouteFocusModal.Footer>
|
||||||
</form>
|
</form>
|
||||||
</RouteFocusModal.Form>
|
</RouteFocusModal.Form>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user