feat: align frontend document and rule management flows
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user