forked from baron/baron-sso
fix(adminfront): resolve biome accessibility and typing lints
This commit is contained in:
@@ -127,8 +127,9 @@ const SidebarNode: React.FC<{
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<div
|
<button
|
||||||
className={`flex items-center group px-2 py-1.5 rounded-md cursor-pointer transition-colors ${
|
type="button"
|
||||||
|
className={`w-full text-left flex items-center group px-2 py-1.5 rounded-md cursor-pointer transition-colors ${
|
||||||
isSelected
|
isSelected
|
||||||
? "bg-primary text-primary-foreground font-semibold"
|
? "bg-primary text-primary-foreground font-semibold"
|
||||||
: "hover:bg-muted/60 text-muted-foreground hover:text-foreground"
|
: "hover:bg-muted/60 text-muted-foreground hover:text-foreground"
|
||||||
@@ -174,7 +175,7 @@ const SidebarNode: React.FC<{
|
|||||||
>
|
>
|
||||||
{node.recursiveMemberCount}
|
{node.recursiveMemberCount}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</button>
|
||||||
|
|
||||||
{isExpanded && hasChildren && (
|
{isExpanded && hasChildren && (
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
@@ -233,7 +234,7 @@ const MemberTable: React.FC<{
|
|||||||
<TableHead className="text-right">
|
<TableHead className="text-right">
|
||||||
{t("ui.admin.users.table.role", "역할")}
|
{t("ui.admin.users.table.role", "역할")}
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableHead className="w-[50px]"></TableHead>
|
<TableHead className="w-[50px]" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
@@ -307,22 +308,22 @@ function TenantUserGroupsTab() {
|
|||||||
return buildTenantFullTree(allItems, tenantId);
|
return buildTenantFullTree(allItems, tenantId);
|
||||||
}, [allTenantsData, tenantId]);
|
}, [allTenantsData, tenantId]);
|
||||||
|
|
||||||
// Find selected node in the built tree
|
|
||||||
const findNode = (nodes: TenantNode[], id: string): TenantNode | null => {
|
|
||||||
if (!currentBase) return null;
|
|
||||||
if (currentBase.id === id) return currentBase;
|
|
||||||
|
|
||||||
for (const node of nodes) {
|
|
||||||
if (node.id === id) return node;
|
|
||||||
if (node.children.length > 0) {
|
|
||||||
const found = findNode(node.children, id);
|
|
||||||
if (found) return found;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
const selectedNode = useMemo(() => {
|
const selectedNode = useMemo(() => {
|
||||||
|
// Find selected node in the built tree
|
||||||
|
const findNode = (nodes: TenantNode[], id: string): TenantNode | null => {
|
||||||
|
if (!currentBase) return null;
|
||||||
|
if (currentBase.id === id) return currentBase;
|
||||||
|
|
||||||
|
for (const node of nodes) {
|
||||||
|
if (node.id === id) return node;
|
||||||
|
if (node.children.length > 0) {
|
||||||
|
const found = findNode(node.children, id);
|
||||||
|
if (found) return found;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
if (!currentBase) return null;
|
if (!currentBase) return null;
|
||||||
return findNode(currentBase.children, selectedNodeId) || currentBase;
|
return findNode(currentBase.children, selectedNodeId) || currentBase;
|
||||||
}, [currentBase, selectedNodeId]);
|
}, [currentBase, selectedNodeId]);
|
||||||
@@ -707,9 +708,10 @@ const UserAddDialog: React.FC<{
|
|||||||
toast.success(t("msg.info.saved_success", "사용자가 배정되었습니다."));
|
toast.success(t("msg.info.saved_success", "사용자가 배정되었습니다."));
|
||||||
onOpenChange(false);
|
onOpenChange(false);
|
||||||
resetFields();
|
resetFields();
|
||||||
} catch (err: any) {
|
} catch (err) {
|
||||||
|
const error = err as AxiosError<{ error?: string }>;
|
||||||
toast.error(
|
toast.error(
|
||||||
err.response?.data?.error ||
|
error.response?.data?.error ||
|
||||||
t("msg.admin.users.detail.update_error", "배정 실패"),
|
t("msg.admin.users.detail.update_error", "배정 실패"),
|
||||||
);
|
);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ services:
|
|||||||
- ory-net
|
- ory-net
|
||||||
- hydranet
|
- hydranet
|
||||||
|
|
||||||
# [수정됨] Oathkeeper 서비스 추가 (Backend 연결 문제 해결)
|
|
||||||
oathkeeper:
|
oathkeeper:
|
||||||
image: oryd/oathkeeper:${OATHKEEPER_VERSION:-v0.40.6}
|
image: oryd/oathkeeper:${OATHKEEPER_VERSION:-v0.40.6}
|
||||||
container_name: oathkeeper
|
container_name: oathkeeper
|
||||||
@@ -104,18 +103,83 @@ services:
|
|||||||
- oathkeeper_logs:/var/log/oathkeeper
|
- oathkeeper_logs:/var/log/oathkeeper
|
||||||
networks:
|
networks:
|
||||||
- ory-net
|
- ory-net
|
||||||
- baron_net # Backend가 통신하기 위해 필수
|
- baron_net
|
||||||
- public_net
|
- public_net
|
||||||
ports:
|
ports:
|
||||||
- "4455:4455" # Proxy
|
- "4455:4455"
|
||||||
- "4456:4456" # API (Backend 헬스체크용)
|
- "4456:4456"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:4456/health/ready"]
|
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:4456/health/ready"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
|
ory_stack_check:
|
||||||
|
image: alpine:latest
|
||||||
|
container_name: ory_stack_check
|
||||||
|
command: >
|
||||||
|
/bin/sh -c "
|
||||||
|
apk add --no-cache curl;
|
||||||
|
echo 'Wait for services...';
|
||||||
|
until curl -s http://kratos:4433/health/ready; do sleep 1; done;
|
||||||
|
until curl -s http://hydra:4444/health/ready; do sleep 1; done;
|
||||||
|
echo 'Ory Stack is fully operational!';"
|
||||||
|
depends_on:
|
||||||
|
- kratos
|
||||||
|
- hydra
|
||||||
|
networks:
|
||||||
|
- ory-net
|
||||||
|
|
||||||
|
init-rp:
|
||||||
|
image: oryd/hydra:${HYDRA_VERSION:-v25.4.0}
|
||||||
|
container_name: init-rp
|
||||||
|
entrypoint: ["/bin/sh"]
|
||||||
|
command:
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
echo "Creating/Updating OAuth2 Clients..."
|
||||||
|
|
||||||
|
hydra create oauth2-client \
|
||||||
|
--endpoint http://hydra:4445 \
|
||||||
|
--id adminfront \
|
||||||
|
--name "AdminFront" \
|
||||||
|
--grant-type authorization_code,refresh_token \
|
||||||
|
--response-type code \
|
||||||
|
--scope openid,offline_access,profile,email \
|
||||||
|
--token-endpoint-auth-method none \
|
||||||
|
--redirect-uri ${ADMINFRONT_CALLBACK_URLS:-http://localhost:5173/auth/callback,http://172.16.10.176:5173/auth/callback}
|
||||||
|
|
||||||
|
hydra create oauth2-client \
|
||||||
|
--endpoint http://hydra:4445 \
|
||||||
|
--id devfront \
|
||||||
|
--name "DevFront" \
|
||||||
|
--grant-type authorization_code,refresh_token \
|
||||||
|
--response-type code \
|
||||||
|
--scope openid,offline_access,profile,email \
|
||||||
|
--token-endpoint-auth-method none \
|
||||||
|
--redirect-uri ${DEVFRONT_CALLBACK_URLS:-http://localhost:5174/auth/callback,http://172.16.10.176:5174/auth/callback}
|
||||||
|
|
||||||
|
hydra create oauth2-client \
|
||||||
|
--endpoint http://hydra:4445 \
|
||||||
|
--id orgfront \
|
||||||
|
--name "OrgFront" \
|
||||||
|
--grant-type authorization_code,refresh_token \
|
||||||
|
--response-type code \
|
||||||
|
--scope openid,offline_access,profile,email \
|
||||||
|
--token-endpoint-auth-method none \
|
||||||
|
--redirect-uri ${ORGFRONT_CALLBACK_URLS:-http://localhost:5175/auth/callback,http://172.16.10.176:5175/auth/callback,https://baron-orgchart.hmac.kr/auth/callback}
|
||||||
|
|
||||||
|
echo "All RP clients initialized successfully."
|
||||||
|
depends_on:
|
||||||
|
ory_stack_check:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
networks:
|
||||||
|
- ory-net
|
||||||
|
- hydranet
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
ory_postgres_data:
|
ory_postgres_data:
|
||||||
|
oathkeeper_logs:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
ory-net:
|
ory-net:
|
||||||
@@ -130,7 +194,6 @@ networks:
|
|||||||
public_net:
|
public_net:
|
||||||
external: true
|
external: true
|
||||||
name: public_net
|
name: public_net
|
||||||
# [수정됨] Baron Net 추가 정의 (Oathkeeper 연결용)
|
|
||||||
baron_net:
|
baron_net:
|
||||||
external: true
|
external: true
|
||||||
name: baron_net
|
name: baron_net
|
||||||
|
|||||||
Reference in New Issue
Block a user