selectByComponents

This commit is contained in:
2021-07-10 16:16:13 -06:00
parent 094e512009
commit b05da63720
3 changed files with 10 additions and 2 deletions

View File

@@ -181,4 +181,7 @@
entries) // TODO this includes entries that didn't have the tag in the changeset
(defcommand selectByTags [tagsBoolExp (Text null)]
(selectEntries (filter archive.entries ->e (tagsMatch archive e tagsBoolExp)))))
(selectEntries (filter archive.entries ->e (tagsMatch archive e tagsBoolExp))))
(defcommand selectByComponents [componentsBoolExp (Text null)]
(selectEntries (filter archive.entries ->e (componentsMatch e componentsBoolExp)))))

View File

@@ -70,4 +70,7 @@
(collect (t.keys))))
(defun tagsMatch [archive e tagsBoolExp]
(BoolExpInterp.eval tagsBoolExp (tagList archive e)))
(BoolExpInterp.eval tagsBoolExp (tagList archive e)))
(defun componentsMatch [:nat.Entry e componentsBoolExp]
(BoolExpInterp.eval componentsBoolExp (for =>cType cId e.components cType)))