forked from baron/baron-sso
누락 locale 키 추가 및 린트 정리
This commit is contained in:
@@ -27,20 +27,20 @@ import { Textarea } from "../../components/ui/textarea";
|
||||
import { toast } from "../../components/ui/use-toast";
|
||||
import {
|
||||
createDeveloperGrant,
|
||||
fetchDeveloperGrants,
|
||||
fetchDevUsers,
|
||||
fetchDevUser,
|
||||
revokeDeveloperGrant,
|
||||
type DevAssignableUser,
|
||||
fetchDeveloperGrants,
|
||||
fetchDevUser,
|
||||
fetchDevUsers,
|
||||
revokeDeveloperGrant,
|
||||
} from "../../lib/devApi";
|
||||
import { t } from "../../lib/i18n";
|
||||
import { resolveProfileRole } from "../../lib/role";
|
||||
import { fetchMe } from "../auth/authApi";
|
||||
import {
|
||||
developerAccessPageOptions,
|
||||
normalizeDeveloperAccessPages,
|
||||
normalizeDeveloperAccessPageSelection,
|
||||
type DeveloperAccessPage,
|
||||
developerAccessPageOptions,
|
||||
normalizeDeveloperAccessPageSelection,
|
||||
normalizeDeveloperAccessPages,
|
||||
} from "../developer-access/developerAccessPages";
|
||||
|
||||
function formatUserLabel(user: DevAssignableUser) {
|
||||
@@ -74,10 +74,7 @@ export default function DeveloperGrantsPage() {
|
||||
const [grantNotes, setGrantNotes] = useState("");
|
||||
const [adminNotes, setAdminNotes] = useState<Record<number, string>>({});
|
||||
|
||||
const {
|
||||
data: userSearchData,
|
||||
isFetching: isUserSearchLoading,
|
||||
} = useQuery({
|
||||
const { data: userSearchData, isFetching: isUserSearchLoading } = useQuery({
|
||||
queryKey: ["developer-grant-users", deferredUserSearch],
|
||||
queryFn: () => fetchDevUsers(deferredUserSearch, 10),
|
||||
enabled:
|
||||
@@ -87,14 +84,12 @@ export default function DeveloperGrantsPage() {
|
||||
selectedUser == null,
|
||||
});
|
||||
|
||||
const {
|
||||
data: selectedUserDetail,
|
||||
isFetching: isSelectedUserDetailLoading,
|
||||
} = useQuery({
|
||||
queryKey: ["developer-grant-user", selectedUser?.id],
|
||||
queryFn: () => fetchDevUser(selectedUser?.id || ""),
|
||||
enabled: hasAccessToken && isSuperAdmin && selectedUser != null,
|
||||
});
|
||||
const { data: selectedUserDetail, isFetching: isSelectedUserDetailLoading } =
|
||||
useQuery({
|
||||
queryKey: ["developer-grant-user", selectedUser?.id],
|
||||
queryFn: () => fetchDevUser(selectedUser?.id || ""),
|
||||
enabled: hasAccessToken && isSuperAdmin && selectedUser != null,
|
||||
});
|
||||
|
||||
const {
|
||||
data: grants,
|
||||
@@ -145,13 +140,8 @@ export default function DeveloperGrantsPage() {
|
||||
});
|
||||
|
||||
const revokeGrantMutation = useMutation({
|
||||
mutationFn: ({
|
||||
id,
|
||||
adminNotes,
|
||||
}: {
|
||||
id: number;
|
||||
adminNotes: string;
|
||||
}) => revokeDeveloperGrant(id, adminNotes),
|
||||
mutationFn: ({ id, adminNotes }: { id: number; adminNotes: string }) =>
|
||||
revokeDeveloperGrant(id, adminNotes),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["developer-grants"] });
|
||||
toast(
|
||||
@@ -203,10 +193,7 @@ export default function DeveloperGrantsPage() {
|
||||
const handleGrant = () => {
|
||||
if (!selectedUser) {
|
||||
toast(
|
||||
t(
|
||||
"msg.dev.grants.user_required",
|
||||
"부여할 사용자를 선택해주세요.",
|
||||
),
|
||||
t("msg.dev.grants.user_required", "부여할 사용자를 선택해주세요."),
|
||||
"error",
|
||||
);
|
||||
return;
|
||||
@@ -374,10 +361,7 @@ export default function DeveloperGrantsPage() {
|
||||
<CardHeader className="space-y-1 pb-3">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<CardTitle className="text-base">
|
||||
{t(
|
||||
"ui.dev.grants.selected_info",
|
||||
"선택된 사용자 정보",
|
||||
)}
|
||||
{t("ui.dev.grants.selected_info", "선택된 사용자 정보")}
|
||||
</CardTitle>
|
||||
<Badge variant="secondary">
|
||||
{t("ui.dev.grants.read_only", "읽기 전용")}
|
||||
@@ -476,7 +460,9 @@ export default function DeveloperGrantsPage() {
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
onChange={() => handleAccessPageToggle(option.value)}
|
||||
onChange={() =>
|
||||
handleAccessPageToggle(option.value)
|
||||
}
|
||||
/>
|
||||
<span className="font-medium">{option.label}</span>
|
||||
</label>
|
||||
@@ -577,8 +563,12 @@ export default function DeveloperGrantsPage() {
|
||||
<TableRow>
|
||||
<TableHead>{t("ui.dev.grants.user", "사용자")}</TableHead>
|
||||
<TableHead>{t("ui.dev.grants.tenant", "테넌트")}</TableHead>
|
||||
<TableHead>{t("ui.dev.grants.reason", "부여 사유")}</TableHead>
|
||||
<TableHead>{t("ui.dev.grants.pages", "권한 페이지")}</TableHead>
|
||||
<TableHead>
|
||||
{t("ui.dev.grants.reason", "부여 사유")}
|
||||
</TableHead>
|
||||
<TableHead>
|
||||
{t("ui.dev.grants.pages", "권한 페이지")}
|
||||
</TableHead>
|
||||
<TableHead>{t("ui.dev.grants.status", "상태")}</TableHead>
|
||||
<TableHead>{t("ui.dev.grants.date", "부여일")}</TableHead>
|
||||
<TableHead className="text-right">
|
||||
@@ -597,7 +587,7 @@ export default function DeveloperGrantsPage() {
|
||||
<div className="text-xs text-muted-foreground">
|
||||
{grant.email || grant.userId}
|
||||
</div>
|
||||
<div className="font-mono text-xs text-muted-foreground">
|
||||
<div className="font-mono text-xs text-muted-foreground">
|
||||
{grant.userId}
|
||||
</div>
|
||||
</div>
|
||||
@@ -605,7 +595,9 @@ export default function DeveloperGrantsPage() {
|
||||
<TableCell>
|
||||
<div className="space-y-1">
|
||||
<div className="font-medium">
|
||||
{grant.organization || grant.tenantId || t("ui.common.na", "없음")}
|
||||
{grant.organization ||
|
||||
grant.tenantId ||
|
||||
t("ui.common.na", "없음")}
|
||||
</div>
|
||||
<div className="font-mono text-xs text-muted-foreground">
|
||||
{grant.tenantId || t("ui.common.na", "없음")}
|
||||
|
||||
Reference in New Issue
Block a user