aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-01 23:15:55 -0400
committerbobzel <zzzman@gmail.com>2020-09-01 23:15:55 -0400
commit4ab5484797ccc39a4e7924135f92259c2b15d88f (patch)
treeb87c435e8d97964ec5861b64c0da5c352a93174d /src/client/views/PropertiesView.tsx
parent25d8d43425785038a74acbc9be618b70f48bbba0 (diff)
trying new solr schema that splits words on whitespace. fixed context menu clicking in schema/search view.
Diffstat (limited to 'src/client/views/PropertiesView.tsx')
-rw-r--r--src/client/views/PropertiesView.tsx15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index b9d7bd18d..ddc76d373 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -178,7 +178,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
const docs = SelectionManager.SelectedDocuments().length < 2 ? [this.dataDoc] : SelectionManager.SelectedDocuments().map(dv => dv.dataDoc);
docs.forEach(doc => Object.keys(doc).forEach(key => !(key in ids) && doc[key] !== ComputedField.undefined && (ids[key] = key)));
const rows: JSX.Element[] = [];
- const noviceReqFields = ["author", "creationDate"];
+ const noviceReqFields = ["author", "creationDate", "tags"];
const noviceLayoutFields = ["_curPage"];
const noviceKeys = [...Array.from(Object.keys(ids)).filter(key => key[0] === "#" || key.indexOf("lastModified") !== -1 || (key[0] === key[0].toUpperCase() && !key.startsWith("ACL"))),
...noviceReqFields, ...noviceLayoutFields];
@@ -234,11 +234,20 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
docs.forEach(doc => {
if (value.indexOf(":") !== -1) {
const newVal = value[0].toUpperCase() + value.substring(1, value.length);
- KeyValueBox.SetField(doc, newVal.substring(0, newVal.indexOf(":")), newVal.substring(newVal.indexOf(":") + 1, newVal.length), true);
+ const splits = newVal.split(":");
+ KeyValueBox.SetField(doc, splits[0], splits[1], true);
+ const tags = StrCast(doc.tags, ":");
+ if (tags.includes(`${splits[0]}:`) && splits[1] === "undefined") {
+ KeyValueBox.SetField(doc, "tags", `"${tags.replace(splits[0] + ":", "")}"`, true);
+ }
return true;
} else if (value[0] === "#") {
const newVal = value + `:'${value}'`;
- KeyValueBox.SetField(doc, newVal.substring(0, newVal.indexOf(":")), newVal.substring(newVal.indexOf(":") + 1, newVal.length), true);
+ KeyValueBox.SetField(doc, value, `'${value}'`, true);
+ const tags = StrCast(doc.tags, ":");
+ if (!tags.includes(`#${value}:`)) {
+ KeyValueBox.SetField(doc, "tags", `"${tags + value + ':'}"`, true);
+ }
return true;
}
});