mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 16:42:56 +00:00
feat: add support for @filterable tag
This commit is contained in:
@@ -25,7 +25,7 @@ import {
|
||||
Type, TypeParameterType,
|
||||
UnionType,
|
||||
} from 'typedoc/dist/lib/models';
|
||||
import {fieldmap} from './mappings/definitions/fieldmap';
|
||||
import {fieldmap, filterableMap, filterableTagName} from './mappings/definitions/fieldmap';
|
||||
import {premaps} from './mappings/definitions/premap';
|
||||
import {settings} from './mappings/definitions/settings';
|
||||
import {dynamicTypes, ElasticsearchDataType, typemap} from './mappings/definitions/typemap';
|
||||
@@ -335,7 +335,6 @@ function readFieldTags(prev: ElasticsearchValue, path: string, tags?: CommentTag
|
||||
prev.fields = {};
|
||||
}
|
||||
if (tag.text.trim() === '') {
|
||||
// merge the fields
|
||||
prev.fields = {...prev.fields, ...fieldmap[tag.tagName].default};
|
||||
} else if (typeof fieldmap[tag.tagName][tag.text.trim()] !== 'undefined') {
|
||||
// merge the fields
|
||||
@@ -343,6 +342,20 @@ function readFieldTags(prev: ElasticsearchValue, path: string, tags?: CommentTag
|
||||
} else if (!fieldmap[tag.tagName].ignore.includes(tag.text.trim())) {
|
||||
composeErrorMessage(path, 'tag', tag.tagName, `Not implemented tag param "${tag.text.trim()}"`);
|
||||
}
|
||||
} else if (tag.tagName === filterableTagName) {
|
||||
if (typeof prev.fields === 'undefined') {
|
||||
prev.fields = {};
|
||||
}
|
||||
if ('type' in prev) {
|
||||
const type = filterableMap[prev.type];
|
||||
if (typeof type !== 'undefined') {
|
||||
prev.fields = {...prev.fields, ...{raw: {type: type}}};
|
||||
} else {
|
||||
composeErrorMessage(path, 'tag', tag.tagName, `Not implemented for ${prev.type}`);
|
||||
}
|
||||
} else {
|
||||
composeErrorMessage(path, 'tag', tag.tagName, 'Not applicable for object types');
|
||||
}
|
||||
} else {
|
||||
composeErrorMessage(path, 'tag', tag.tagName, `Not implemented tag`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user