feat: align frontend document and rule management flows

This commit is contained in:
wren
2026-05-06 09:40:37 +08:00
parent 8a5044b024
commit c54f84382b
41 changed files with 4239 additions and 2903 deletions
+3 -2
View File
@@ -7,7 +7,8 @@ import { FilterPanel, FilterSelect, SearchFilter } from '~/components/ui/FilterP
import { Pagination } from '~/components/ui/Pagination';
import { Table } from '~/components/ui/Table';
import { Tag, type TagColor } from '~/components/ui/Tag';
import { loadRuleYamlPacks, type RuleSummary, type RuleYamlPack } from '~/utils/rules-yaml-mock.server';
import { loadRuleConfigPacks } from '~/utils/rules-config-packs.server';
import type { RuleSummary, RuleYamlPack } from '~/utils/rules-yaml-mock.server';
import styles from '~/styles/pages/rules_test.css?url';
export const links = () => [
@@ -84,7 +85,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
pageSize: [10, 20, 30, 50].includes(requestedPageSize) ? requestedPageSize : 10
};
const packs = await loadRuleYamlPacks();
const packs = await loadRuleConfigPacks(request);
const documentTypes = unique(packs.map(pack => pack.documentType));
const inferredDocumentType = packs.find(pack => pack.mainType === requestedFilters.mainType)?.documentType || '';
const currentDocumentType = documentTypes.includes(requestedFilters.documentType)