mirror of
https://github.com/directus/directus.git
synced 2026-02-18 04:11:31 -05:00
Add support for Conditional Fields (#6864)
* Add conditions field to directus_fields * Add conditions configuration * Apply conditional overrides * Handle conditions in nested groups * Fix reverse mutating conditions * Start on filter setup interface * Move field types/constants to shared * [WIP] Updated client side filter validation * Support logical operators in client validation step * Use new validation util in conditions check * Add nesting in filter seutp * Add filter rule setup configurator * Fixes that should've been done in the merge * Strip out filter-settings interface TBD in a new PR * Move browser to index
This commit is contained in:
@@ -7,16 +7,8 @@ import { OpenAPIObject, OperationObject, PathItemObject, SchemaObject, TagObject
|
||||
import { version } from '../../package.json';
|
||||
import getDatabase from '../database';
|
||||
import env from '../env';
|
||||
import {
|
||||
AbstractServiceOptions,
|
||||
Accountability,
|
||||
Collection,
|
||||
Field,
|
||||
Permission,
|
||||
Relation,
|
||||
SchemaOverview,
|
||||
types,
|
||||
} from '../types';
|
||||
import { AbstractServiceOptions, Accountability, Collection, Permission, Relation, SchemaOverview } from '../types';
|
||||
import { Field, Type } from '@directus/shared/types';
|
||||
import { getRelationType } from '../utils/get-relation-type';
|
||||
import { CollectionsService } from './collections';
|
||||
import { FieldsService } from './fields';
|
||||
@@ -459,20 +451,33 @@ class OASSpecsService implements SpecificationSubService {
|
||||
}
|
||||
|
||||
private fieldTypes: Record<
|
||||
typeof types[number],
|
||||
Type,
|
||||
{
|
||||
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'integer' | 'null' | undefined;
|
||||
format?: string;
|
||||
items?: any;
|
||||
}
|
||||
> = {
|
||||
alias: {
|
||||
type: 'string',
|
||||
},
|
||||
bigInteger: {
|
||||
type: 'integer',
|
||||
format: 'int64',
|
||||
},
|
||||
binary: {
|
||||
type: 'string',
|
||||
format: 'binary',
|
||||
},
|
||||
boolean: {
|
||||
type: 'boolean',
|
||||
},
|
||||
csv: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
date: {
|
||||
type: 'string',
|
||||
format: 'date',
|
||||
@@ -488,6 +493,9 @@ class OASSpecsService implements SpecificationSubService {
|
||||
type: 'number',
|
||||
format: 'float',
|
||||
},
|
||||
hash: {
|
||||
type: 'string',
|
||||
},
|
||||
integer: {
|
||||
type: 'integer',
|
||||
},
|
||||
@@ -511,23 +519,13 @@ class OASSpecsService implements SpecificationSubService {
|
||||
type: 'string',
|
||||
format: 'timestamp',
|
||||
},
|
||||
binary: {
|
||||
type: 'string',
|
||||
format: 'binary',
|
||||
unknown: {
|
||||
type: undefined,
|
||||
},
|
||||
uuid: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
},
|
||||
csv: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
hash: {
|
||||
type: 'string',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user