[apps/cs] feat: 권한맵핑 다이얼로그 검색 조건 추가
This commit is contained in:
@@ -11,6 +11,7 @@ export interface WithRoleIdRoleAuthorizationsParams extends PageableParams {
|
||||
keywordType?: string;
|
||||
keyword?: string;
|
||||
roleId?: string;
|
||||
siteId?: string;
|
||||
}
|
||||
|
||||
export interface RoleAuthorizations {
|
||||
|
||||
@@ -40,9 +40,12 @@ function MappingRoleDialog({
|
||||
const queryClient = useQueryClient();
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const [keywordType, setKeywordType] = useState("");
|
||||
const [siteId, setSiteId] = useState("");
|
||||
const [searchParams, setSearchParams] = useState({
|
||||
keyword: "",
|
||||
keywordType: "authorizationName",
|
||||
keywordType: "",
|
||||
siteId: "",
|
||||
});
|
||||
|
||||
const query = useQuery({
|
||||
@@ -85,18 +88,20 @@ function MappingRoleDialog({
|
||||
const formData = new FormData(e.target as HTMLFormElement);
|
||||
const keyword = formData.get("keyword") as string;
|
||||
setSearchParams({
|
||||
...searchParams,
|
||||
keyword,
|
||||
keywordType,
|
||||
siteId: siteId === "ALL" ? "" : siteId,
|
||||
});
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
if (inputRef.current) {
|
||||
inputRef.current.value = "";
|
||||
}
|
||||
if (inputRef.current) inputRef.current.value = "";
|
||||
setKeywordType("");
|
||||
setSiteId("");
|
||||
setSearchParams({
|
||||
...searchParams,
|
||||
keyword: "",
|
||||
keywordType: "",
|
||||
siteId: "",
|
||||
});
|
||||
};
|
||||
|
||||
@@ -119,14 +124,22 @@ function MappingRoleDialog({
|
||||
</DialogHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<form onSubmit={handleSubmit} className="flex items-center gap-2">
|
||||
<SiteSelect enabledAllSite />
|
||||
<Select>
|
||||
<SiteSelect
|
||||
value={siteId}
|
||||
onValueChange={(value) => setSiteId(value)}
|
||||
enabledAllSite
|
||||
/>
|
||||
<Select
|
||||
value={keywordType}
|
||||
onValueChange={(value) => setKeywordType(value)}
|
||||
>
|
||||
<SelectTrigger className="w-[12rem]">
|
||||
<SelectValue placeholder="선택" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="authorizationName">API명</SelectItem>
|
||||
<SelectItem value="urlPatternValue">API URL</SelectItem>
|
||||
<SelectItem value="urlPatternValue">URL주소</SelectItem>
|
||||
<SelectItem value="httpMethodCode">전송방식</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Input
|
||||
|
||||
Reference in New Issue
Block a user