Fix #4007 to allow linked integer page links to match property query

This commit is contained in:
Gabriel Horner
2022-02-02 16:37:20 -05:00
committed by Tienson Qin
parent f25e49c8d0
commit 5a126027eb
2 changed files with 68 additions and 45 deletions

View File

@@ -141,6 +141,20 @@
l)
@vars))
(defn ->property-query
([k v]
(->property-query k v '?v))
([k v sym]
[['?b :block/properties '?prop]
[(list 'missing? '$ '?b :block/name)]
[(list 'get '?prop (keyword k)) sym]
(list
'or
[(list '= sym v)]
[(list 'contains? sym v)]
;; For integer pages that aren't strings
[(list 'contains? sym (str v))])]))
(defn build-query
([repo e env]
(build-query repo e (assoc env :vars (atom {})) 0))
@@ -269,13 +283,7 @@
sym (if (= current-filter 'or)
'?v
(uniq-symbol counter "?v"))]
[['?b :block/properties '?prop]
[(list 'missing? '$ '?b :block/name)]
[(list 'get '?prop (keyword k)) sym]
(list
'or
[(list '= sym v)]
[(list 'contains? sym v)])])
(->property-query k v sym))
(and (= 'property fe)
(= 2 (count e)))