aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-07-04 18:34:00 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-07-04 18:34:00 -0400
commit0fe82e37ba345a32ff4f9dcbb0052ce45595b58b (patch)
tree17591b121bf6e97747d0cf8986c26c611fadd67c /src/fields/Doc.ts
parent77b3e319233f05de64276d4d77ff4328aa850a28 (diff)
parent638a3ce3bcd4aa7287544be82d8d9d07ee963600 (diff)
Merge branch 'master' into collaboration-sarah
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 8f9f36153..99712fb04 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -774,7 +774,7 @@ export namespace Doc {
linkMap.set(link[Id], await Doc.makeClone(link, cloneMap, linkMap, rtfs, exclusions, pruneDocs, cloneLinks));
}
});
- Doc.SetInPlace(copy, 'title', 'CLONE: ' + doc.title, true);
+ Doc.SetInPlace(copy, 'title', '>:' + doc.title, true);
copy.cloneOf = doc;
cloneMap.set(doc[Id], copy);
@@ -1428,6 +1428,8 @@ export namespace Doc {
}
}
+ export const FilterSep = '::';
+
// filters document in a container collection:
// all documents with the specified value for the specified key are included/excluded
// based on the modifiers :"check", "x", undefined
@@ -1437,7 +1439,7 @@ export namespace Doc {
const childFilters = StrListCast(container[filterField]);
runInAction(() => {
for (let i = 0; i < childFilters.length; i++) {
- const fields = childFilters[i].split(':'); // split key:value:modifier
+ const fields = childFilters[i].split(FilterSep); // split key:value:modifier
if (fields[0] === key && (fields[1] === value || modifiers === 'match' || (fields[2] === 'match' && modifiers === 'remove'))) {
if (fields[2] === modifiers && modifiers && fields[1] === value) {
if (toggle) modifiers = 'remove';
@@ -1452,7 +1454,7 @@ export namespace Doc {
container[filterField] = undefined;
} else if (modifiers !== 'remove') {
!append && (childFilters.length = 0);
- childFilters.push(key + ':' + value + ':' + modifiers);
+ childFilters.push(key + FilterSep + value + FilterSep + modifiers);
container[filterField] = new List<string>(childFilters);
}
});