mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 08:02:55 +00:00
refactor: move mappingIgnoredTags into config file
This commit is contained in:
committed by
Rainer Killinger
parent
13938ecf21
commit
4ac6987813
@@ -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