forked from baron/baron-sso
chore: consolidate local integration changes
This commit is contained in:
@@ -107,6 +107,7 @@ import {
|
||||
} from "../utils/tenantCsvImport";
|
||||
import {
|
||||
filterTenantsByScope,
|
||||
getTenantSearchMatchIds,
|
||||
getTenantViewRows,
|
||||
resolveTenantSelectionIds,
|
||||
type TenantViewMode,
|
||||
@@ -842,6 +843,7 @@ function TenantListPage() {
|
||||
<RoleGuard roles={["super_admin"]}>
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
name="tenant-import-file"
|
||||
type="file"
|
||||
accept=".csv,text/csv"
|
||||
className="hidden"
|
||||
@@ -1368,6 +1370,8 @@ function TenantListPage() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<select
|
||||
id={`tenant-import-parent-select-${preview.row.rowNumber}`}
|
||||
name={`tenant-import-parent-select-${preview.row.rowNumber}`}
|
||||
className="h-9 w-full min-w-[220px] rounded-md border border-input bg-background px-3 text-sm"
|
||||
value={
|
||||
selectedParentRefs[preview.row.rowNumber] ??
|
||||
@@ -1457,6 +1461,8 @@ function TenantListPage() {
|
||||
<TableCell>
|
||||
<div className="space-y-2">
|
||||
<select
|
||||
id={`tenant-import-match-select-${preview.row.rowNumber}`}
|
||||
name={`tenant-import-match-select-${preview.row.rowNumber}`}
|
||||
className="h-9 w-full rounded-md border border-input bg-background px-3 text-sm"
|
||||
value={
|
||||
selectedMatches[preview.row.rowNumber] ??
|
||||
@@ -1705,6 +1711,10 @@ const TenantHierarchyView: React.FC<{
|
||||
|
||||
const virtualRows = rowVirtualizer.getVirtualItems();
|
||||
const shouldVirtualizeRows = !(isTest && flattenedRows.length < 100);
|
||||
const searchMatchIds = React.useMemo(
|
||||
() => new Set(getTenantSearchMatchIds(flattenedRows, search)),
|
||||
[flattenedRows, search],
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (isTest) return;
|
||||
@@ -1757,6 +1767,7 @@ const TenantHierarchyView: React.FC<{
|
||||
virtualRow?: { start: number; end: number },
|
||||
) => {
|
||||
const isSelected = selectedIds.includes(node.id);
|
||||
const isSearchMatch = searchMatchIds.has(node.id);
|
||||
const hasChildren =
|
||||
viewMode === "tree" && node.children && node.children.length > 0;
|
||||
const isExpanded =
|
||||
@@ -1770,6 +1781,9 @@ const TenantHierarchyView: React.FC<{
|
||||
ref={virtualRow ? rowVirtualizer.measureElement : undefined}
|
||||
className={cn(
|
||||
isSelected ? "bg-primary/5" : "",
|
||||
isSearchMatch
|
||||
? "bg-amber-50/80 ring-1 ring-inset ring-amber-300"
|
||||
: "",
|
||||
"h-[73px]",
|
||||
virtualRow ? "absolute left-0 w-full" : "",
|
||||
)}
|
||||
@@ -1851,6 +1865,15 @@ const TenantHierarchyView: React.FC<{
|
||||
{t("ui.admin.tenants.seed_badge", "초기 설정")}
|
||||
</Badge>
|
||||
)}
|
||||
{isSearchMatch && (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="flex-shrink-0 border-amber-300 bg-amber-100 text-[10px] font-semibold text-amber-900"
|
||||
data-testid={`tenant-search-match-${node.id}`}
|
||||
>
|
||||
{t("ui.admin.tenants.search_match_badge", "검색 일치")}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
{(() => {
|
||||
const parentPath = tenantParentPathMap.get(node.id) ?? [];
|
||||
|
||||
Reference in New Issue
Block a user