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:
@@ -11,13 +11,10 @@ import {
|
||||
FieldNode,
|
||||
Item,
|
||||
NestedCollectionNode,
|
||||
Permission,
|
||||
PermissionsAction,
|
||||
PrimaryKey,
|
||||
Query,
|
||||
SchemaOverview,
|
||||
Aggregate,
|
||||
} from '../types';
|
||||
import { Query, Aggregate, Permission, PermissionsAction } from '@directus/shared/types';
|
||||
import { ItemsService } from './items';
|
||||
import { PayloadService } from './payload';
|
||||
|
||||
@@ -105,7 +102,11 @@ export class AuthorizationService {
|
||||
}
|
||||
}
|
||||
|
||||
function checkFields(collection: string, children: (NestedCollectionNode | FieldNode)[], aggregate?: Aggregate) {
|
||||
function checkFields(
|
||||
collection: string,
|
||||
children: (NestedCollectionNode | FieldNode)[],
|
||||
aggregate?: Aggregate | null
|
||||
) {
|
||||
// We check the availability of the permissions in the step before this is run
|
||||
const permissions = permissionsForCollections.find((permission) => permission.collection === collection)!;
|
||||
const allowedFields = permissions.fields || [];
|
||||
@@ -185,7 +186,7 @@ export class AuthorizationService {
|
||||
query.filter._and.push(parsedPermissions);
|
||||
}
|
||||
|
||||
if (query.filter._and.length === 0) delete query.filter._and;
|
||||
if (query.filter._and.length === 0) delete query.filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,7 +259,7 @@ export class AuthorizationService {
|
||||
}
|
||||
|
||||
if (requiredColumns.length > 0) {
|
||||
permission.validation = hasValidationRules ? { _and: [permission.validation] } : { _and: [] };
|
||||
permission.validation = hasValidationRules ? { _and: [permission.validation!] } : { _and: [] };
|
||||
|
||||
for (const field of requiredColumns) {
|
||||
if (action === 'create' && field.defaultValue === null) {
|
||||
|
||||
Reference in New Issue
Block a user