mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Add new advanced filters experience (#8570)
* Remove advanced filter sidebar detail So long, and thanks for all the fish. * Remove filter conversion logic * Start replacing/removing old skool filters * Add inline mode for usages in search bar * Make filter work in header bar * Emit empty string as null in filter * Move shared filter types to shared * Upgrade use-items * Fix manual sort on tabular * Cleanup styling in search bar usage * Tweak styling * Fix filtering issues * Update cards * Remove activeFilterCount from tabular * Update maps to work with new filters * Update calendar to new filter/sort structure * Fix activity module nav/search * Fix no-results message * Update file library filtering * Finalize user search * Allow filtering in drawer-collection * Handle cancelled responses semi-gracefully * Add loading start state timeout * Replace sort type in api * Last commit before redoing a bunch * Finish new visual style * Remove unused rounded prop from v-menu * Tweak sizing * Enough size tweaking for now * Count all filter operators instead of top * Fix archive casting * Fix api build * Add merge filters util * Split filter in user vs system * Fix export sidebar detail * Show field label on permissions configuration * Add migration for filter/sort * Use filters in insights
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Query } from './query';
|
||||
import { Query } from '@directus/shared/types';
|
||||
import { Relation } from './relation';
|
||||
|
||||
export type M2ONode = {
|
||||
|
||||
2
api/src/types/express.d.ts
vendored
2
api/src/types/express.d.ts
vendored
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { Accountability } from '@directus/shared/types';
|
||||
import { Query } from './query';
|
||||
import { Query } from '@directus/shared/types';
|
||||
import { SchemaOverview } from './schema';
|
||||
|
||||
export {};
|
||||
|
||||
@@ -9,8 +9,6 @@ export * from './graphql';
|
||||
export * from './items';
|
||||
export * from './meta';
|
||||
export * from './migration';
|
||||
export * from './permissions';
|
||||
export * from './query';
|
||||
export * from './relation';
|
||||
export * from './revision';
|
||||
export * from './schema';
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { Filter } from './query';
|
||||
|
||||
export type PermissionsAction = 'create' | 'read' | 'update' | 'delete' | 'comment' | 'explain';
|
||||
|
||||
export type Permission = {
|
||||
id?: number;
|
||||
role: string | null;
|
||||
collection: string;
|
||||
action: PermissionsAction;
|
||||
permissions: Record<string, any>;
|
||||
validation: Filter | null;
|
||||
presets: Record<string, any> | null;
|
||||
fields: string[] | null;
|
||||
system?: true;
|
||||
};
|
||||
@@ -1,40 +0,0 @@
|
||||
import { Meta } from './meta';
|
||||
|
||||
export type Query = {
|
||||
fields?: string[];
|
||||
sort?: Sort[];
|
||||
filter?: Filter;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
page?: number;
|
||||
meta?: Meta[];
|
||||
search?: string;
|
||||
export?: 'json' | 'csv' | 'xml';
|
||||
group?: string[];
|
||||
aggregate?: Aggregate;
|
||||
deep?: Record<string, Query>;
|
||||
alias?: Record<string, string>;
|
||||
};
|
||||
|
||||
export type Sort = {
|
||||
column: string;
|
||||
order: 'asc' | 'desc';
|
||||
};
|
||||
|
||||
export type Filter = {
|
||||
[keyOrOperator: string]: Filter | any;
|
||||
};
|
||||
|
||||
/**
|
||||
* Aggregate operation. Contains column name, and the field alias it should be returned as
|
||||
*/
|
||||
export type Aggregate = {
|
||||
avg?: string[];
|
||||
avgDistinct?: string[];
|
||||
count?: string[];
|
||||
countDistinct?: string[];
|
||||
sum?: string[];
|
||||
sumDistinct?: string[];
|
||||
min?: string[];
|
||||
max?: string[];
|
||||
};
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Type } from '@directus/shared/types';
|
||||
import { Permission } from './permissions';
|
||||
import { Type, Permission } from '@directus/shared/types';
|
||||
import { Relation } from './relation';
|
||||
|
||||
export type FieldOverview = {
|
||||
|
||||
@@ -2,8 +2,7 @@ import { Knex } from 'knex';
|
||||
import { SchemaOverview } from '../types';
|
||||
import { Accountability } from '@directus/shared/types';
|
||||
import { Item, PrimaryKey } from './items';
|
||||
import { PermissionsAction } from './permissions';
|
||||
import { Query } from './query';
|
||||
import { Query, PermissionsAction } from '@directus/shared/types';
|
||||
|
||||
export type AbstractServiceOptions = {
|
||||
knex?: Knex;
|
||||
|
||||
Reference in New Issue
Block a user