mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-18 04:06:19 +00:00
refactor: move mappingIgnoredTags into config file
This commit is contained in:
committed by
Rainer Killinger
parent
13938ecf21
commit
4ac6987813
@@ -58,6 +58,7 @@ const config: Partial<SCConfigFile> = {
|
||||
SCThingType.Diff,
|
||||
SCThingType.Floor,
|
||||
],
|
||||
mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'],
|
||||
maxMultiSearchRouteQueries: 5,
|
||||
maxRequestBodySize: 512 * 1024,
|
||||
name: 'Technische Universität Berlin',
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@openstapps/core": "0.28.0",
|
||||
"@openstapps/core": "0.29.0",
|
||||
"@openstapps/core-tools": "0.9.0",
|
||||
"@openstapps/logger": "0.4.0",
|
||||
"@types/node": "10.14.12",
|
||||
|
||||
@@ -20,15 +20,13 @@ import {Client} from 'elasticsearch';
|
||||
import {existsSync, writeFileSync} from 'fs';
|
||||
import {readFile} from 'fs-extra';
|
||||
import {resolve} from 'path';
|
||||
import {coreVersion} from '../../common';
|
||||
import {configFile, coreVersion} from '../../common';
|
||||
|
||||
const dirPath = resolve('src', 'storage', 'elasticsearch', 'templates');
|
||||
const templatePath = resolve(dirPath, `template_${coreVersion}.json`);
|
||||
const errorPath = resolve(dirPath, `failed_template_${coreVersion}.json`);
|
||||
const errorReportPath = resolve(dirPath, `error_report_${coreVersion}.txt`);
|
||||
|
||||
const ignoredTags = ['minlength', 'pattern', 'see', 'tjs-format']; // TODO: put this into config
|
||||
|
||||
/**
|
||||
* Check if the correct template exists
|
||||
*/
|
||||
@@ -41,7 +39,7 @@ export function checkESTemplate(forceUpdate: boolean) {
|
||||
Logger.info(`No mapping for Core version ${coreVersion} found, starting automatic mapping generation. ` +
|
||||
`This may take a while.`);
|
||||
const map = generateTemplate(getProjectReflection(resolve('node_modules', '@openstapps', 'core', 'src')),
|
||||
ignoredTags, false);
|
||||
configFile.backend.mappingIgnoredTags, false);
|
||||
|
||||
if (map.errors.length > 0) {
|
||||
// tslint:disable-next-line:no-magic-numbers
|
||||
|
||||
Reference in New Issue
Block a user