forked from baron/baron-sso
chore: consolidate local integration changes
This commit is contained in:
@@ -62,6 +62,7 @@ import {
|
||||
import { toast } from "../../../components/ui/use-toast";
|
||||
import {
|
||||
exportTenantsCSV,
|
||||
exportUsersCSV,
|
||||
fetchAllTenants,
|
||||
fetchUsers,
|
||||
type TenantSummary,
|
||||
@@ -432,6 +433,24 @@ function TenantUserGroupsTab() {
|
||||
),
|
||||
});
|
||||
|
||||
const exportCurrentMembersMutation = useMutation({
|
||||
mutationFn: (tenantSlug: string) => exportUsersCSV("", tenantSlug, false),
|
||||
onSuccess: ({ blob, filename }) => {
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = filename;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
window.URL.revokeObjectURL(url);
|
||||
},
|
||||
onError: () =>
|
||||
toast.error(
|
||||
t("msg.admin.users.export_error", "사용자 내보내기에 실패했습니다."),
|
||||
),
|
||||
});
|
||||
|
||||
// Data Fetching
|
||||
const {
|
||||
data: allTenantsData,
|
||||
@@ -623,6 +642,20 @@ function TenantUserGroupsTab() {
|
||||
<UserPlus size={16} className="mr-2" />
|
||||
{t("ui.admin.users.list.add", "멤버 추가")}
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
exportCurrentMembersMutation.mutate(selectedNode.slug)
|
||||
}
|
||||
disabled={
|
||||
!selectedNode.slug || exportCurrentMembersMutation.isPending
|
||||
}
|
||||
data-testid="tenant-current-users-export-btn"
|
||||
>
|
||||
<Download size={16} className="mr-2" />
|
||||
{t("ui.admin.tenants.members.export", "선택 조직 사용자 CSV")}
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
|
||||
Reference in New Issue
Block a user