Update menu assignment logic and enhance dynamic search filter rendering

- Modified the menu assignment logic to ensure that screen assignments are only deactivated if the menu URL is either empty or not a valid screen URL, improving the accuracy of screen management.
- Updated the rendering of active filters in the DynamicSearchFilter component to include a key for each filter, enhancing React's rendering performance and preventing potential issues with list updates.

These changes improve the functionality and performance of the admin interface, ensuring a more reliable user experience.
This commit is contained in:
kjs
2026-04-02 17:42:45 +09:00
parent 9749234c30
commit 148f20c7c5
2 changed files with 5 additions and 4 deletions
@@ -1405,10 +1405,11 @@ export async function updateMenu(
]
);
// menu_url이 비어있면 화면 할당 해제 (screen_menu_assignments의 is_active를 'N'으로)
if (!menuUrl) {
// menu_url이 비어있거나 화면관리 URL이 아니면 화면 할당 해제
const isScreenUrl = menuUrl && (menuUrl.startsWith("/screens/") || menuUrl.startsWith("/screen/"));
if (!menuUrl || !isScreenUrl) {
await query(
`UPDATE screen_menu_assignments
`UPDATE screen_menu_assignments
SET is_active = 'N'
WHERE menu_objid = $1 AND company_code = $2`,
[Number(menuId), companyCode]
@@ -432,7 +432,7 @@ export function DynamicSearchFilter({
{/* 활성 필터들 — 라벨 없이 placeholder만 */}
{activeFilters.length > 0 ? (
<div className="flex flex-1 flex-wrap items-center gap-2">
{activeFilters.map((filter) => renderFilterInput(filter))}
{activeFilters.map((filter) => <div key={filter.columnName}>{renderFilterInput(filter)}</div>)}
<Button variant="outline" size="sm" onClick={handleReset} className="h-9 shrink-0">
<RotateCcw className="mr-1 h-3.5 w-3.5" />
</Button>