diff --git a/apps/cs/src/pages/menu/ui/editable-node.tsx b/apps/cs/src/pages/menu/ui/editable-node.tsx
index f2274f4d8..4f1fe859c 100644
--- a/apps/cs/src/pages/menu/ui/editable-node.tsx
+++ b/apps/cs/src/pages/menu/ui/editable-node.tsx
@@ -1,5 +1,6 @@
import type { ComponentProps } from "react";
import { Button, Input } from "@common/components";
+import { Tooltip, TooltipContent, TooltipTrigger } from "@/shared/ui/tooltip";
type EditableNodeProps = {
depth?: number;
@@ -20,22 +21,34 @@ function EditableNode({
>
-
-
+
+
+
+
+ 저장
+
+
+
+
+
+ 취소
+
);
diff --git a/apps/cs/src/pages/role/api/site-authority-service.ts b/apps/cs/src/pages/role/api/site-authority-service.ts
new file mode 100644
index 000000000..c9d0513da
--- /dev/null
+++ b/apps/cs/src/pages/role/api/site-authority-service.ts
@@ -0,0 +1,28 @@
+import { client } from "@/shared/api";
+import type {
+ SiteAuthorityCreatePayload,
+ SiteAuthorityList,
+ SiteAuthoritySearchParams,
+ SiteAuthorityService,
+} from "../model/site-authority-interface";
+import { ENDPOINT } from "@/shared/config";
+
+export class SiteAuthorityApiService implements SiteAuthorityService {
+ public async getSiteAuthorityList(
+ params: SiteAuthoritySearchParams,
+ ): Promise {
+ const response = await client.get(
+ ENDPOINT.CMS_SERVICE.SITE_AUTHORITY,
+ { params },
+ );
+ return response.data;
+ }
+
+ public async createSiteAuthority(
+ data: SiteAuthorityCreatePayload[],
+ ): Promise {
+ await client.post(ENDPOINT.CMS_SERVICE.SITE_AUTHORITY, data);
+ }
+}
+
+export const SiteAuthorityApi = new SiteAuthorityApiService();
diff --git a/apps/cs/src/pages/role/model/site-authority-interface.ts b/apps/cs/src/pages/role/model/site-authority-interface.ts
new file mode 100644
index 000000000..70ac79cfa
--- /dev/null
+++ b/apps/cs/src/pages/role/model/site-authority-interface.ts
@@ -0,0 +1,24 @@
+import type { PageableList, PageableParams } from "@/shared/model";
+
+export interface SiteAuthoritySearchParams extends PageableParams {
+ siteId?: string;
+ authrtId?: string;
+}
+
+export interface SiteAuthority {
+ siteId: string;
+ authrtId: string;
+ siteNm: string;
+ mode: string;
+}
+
+export type SiteAuthorityCreatePayload = Omit;
+
+export type SiteAuthorityList = PageableList;
+
+export interface SiteAuthorityService {
+ getSiteAuthorityList: (
+ params: SiteAuthoritySearchParams,
+ ) => Promise;
+ createSiteAuthority: (data: SiteAuthorityCreatePayload[]) => Promise;
+}
diff --git a/apps/cs/src/pages/role/ui/mapping-role-dialog.tsx b/apps/cs/src/pages/role/ui/mapping-role-dialog.tsx
index c7f8cdcdb..46f3d45f0 100644
--- a/apps/cs/src/pages/role/ui/mapping-role-dialog.tsx
+++ b/apps/cs/src/pages/role/ui/mapping-role-dialog.tsx
@@ -1,5 +1,6 @@
-import { getCoreRowModel, type ColumnDef } from "@tanstack/react-table";
+import { useState, useRef } from "react";
import { useQuery, useQueryClient } from "@tanstack/react-query";
+import { getCoreRowModel, type ColumnDef } from "@tanstack/react-table";
import {
Dialog,
DialogTrigger,
@@ -8,6 +9,7 @@ import {
DialogTitle,
Button,
Switch,
+ Input,
} from "@common/components";
import {
RoleAuthorizationsApi,
@@ -31,12 +33,18 @@ function MappingRoleDialog({
}: MappingRoleDialogProps) {
const queryClient = useQueryClient();
const alert = useAlertStore((state) => state.setMessage);
+ const inputRef = useRef(null);
+ const [searchParams, setSearchParams] = useState({
+ keyword: "",
+ keywordType: "authorizationName",
+ });
const query = useQuery({
- queryKey: [ENDPOINT.USER_SERVICE.AUTHORIZATIONS],
+ queryKey: [ENDPOINT.USER_SERVICE.ROLE_AUTHORIZATIONS, searchParams],
queryFn: () =>
RoleAuthorizationsApi.getRoleAuthorizationsListByRoleId({
roleId,
+ ...searchParams,
}),
enabled: open,
});
@@ -46,7 +54,7 @@ function MappingRoleDialog({
RoleAuthorizationsApi.createRoleAuthorizations(data),
onSuccess: () => {
queryClient.invalidateQueries({
- queryKey: [ENDPOINT.USER_SERVICE.AUTHORIZATIONS],
+ queryKey: [ENDPOINT.USER_SERVICE.ROLE_AUTHORIZATIONS],
});
alert("권한 맵핑이 완료되었습니다.");
},
@@ -66,6 +74,26 @@ function MappingRoleDialog({
);
};
+ const handleSubmit = (e: React.FormEvent) => {
+ e.preventDefault();
+ const formData = new FormData(e.target as HTMLFormElement);
+ const keyword = formData.get("keyword") as string;
+ setSearchParams({
+ ...searchParams,
+ keyword,
+ });
+ };
+
+ const handleReset = () => {
+ if (inputRef.current) {
+ inputRef.current.value = "";
+ }
+ setSearchParams({
+ ...searchParams,
+ keyword: "",
+ });
+ };
+
const { tableComponent } = useDataTable({
query,
tableOptions: {
@@ -79,21 +107,31 @@ function MappingRoleDialog({
-
+
모듈 목록
-
-
-