Commit 76a3327c authored by Themousaillon's avatar Themousaillon

fix some bugs

parent 4215b5a6
......@@ -315,7 +315,8 @@
},
"additionalFields": [
["url", "regId"]
["url", "regId"],
["summary", "text"]
],
"nodeTypes2": {
......@@ -417,9 +418,14 @@
"IndexEntry"
],
"filterable": {
"date": ["regest"],
"keywords": ["regest"]
"filterConf": {
"date": {
"filterable": ["regest"]
},
"keywords": {
"filterable": ["regest"],
"field": "summary"
}
},
"source": {
......
......@@ -151,6 +151,9 @@
"dateFields": ["startDate", "endDate"]
},
"additionalFields": [
],
"nodeTypes2": {
"dacia": {
"labelField": "name",
......
......@@ -133,7 +133,7 @@ class NodeFilters {
* @param endDate sould be a @Date object
*/
filterByDate = (startDate, endDate) => node => {
const filterable = this._settings.filterable["date"]
const filterable = this._settings.filterConf.date.filterable["date"]
if (node.collapsed)
return false
if (filterable.includes(node.type) && node.data["startDate"] && node.data["endDate"])
......@@ -143,13 +143,15 @@ class NodeFilters {
}
filterByKeywords = keywords => node => {
const filterable = this._settings.filterable["keywords"]
const filterable = this._settings.filterConf.keywords.filterable
const filterField = this._settings.filter.keywords.field
const content = filterField === "label" ? node.label: node.data[filterField]
if (node.collapsed)
return false
if (keywords.length === 0)
return true
else if (filterable.includes(node.type))
return keywords.every(keyword => node.label.includes(keyword))
return keywords.every(keyword => content.includes(keywords))
else
return true
}
......
......@@ -18,7 +18,7 @@ const dbConnectorConstructor = require('../database/DatabaseConnector'),
const cvceSettings = require('../../settings/blizaar.json');
const reggF3Settings = require('../../settings/regesta.json');
const Romans1by1Settings = require('../../settings/romans1by1.json');
const settingsList = [reggF3Settings, cvceSettings, Romans1by1Settings];
const settingsList = [reggF3Settings, Romans1by1Settings];
const toIso = (dateValue) => {
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment