Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Enable rollup filtering after selecting a relation field https://github.com/siyuan-note/siyuan/issues/11088

Danielb61e505fac5a
diff --git a/app/src/protyle/render/av/rollup.ts b/app/src/protyle/render/av/rollup.ts
index 30568945a1..59a429c15d 100644
--- a/app/src/protyle/render/av/rollup.ts
+++ b/app/src/protyle/render/av/rollup.ts
@@ -59,6 +59,11 @@ const updateCol = (options: {
goSearchRollupCalcElement.setAttribute("data-col-type", itemElement.dataset.colType);
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
}
+ const relationColumn = fields.find((item) => item.id === colData.rollup?.relationKeyID);
+ const filterElement = options.target.closest(".b3-menu")?.querySelector(
+ '[data-type="goAttrViewColFilters"][data-filter-type="rollup"]');
+ const canFilter = options.isRelation ? !!itemElement.dataset.targetAvId : !!relationColumn?.relation?.avID;
+ filterElement?.classList.toggle("b3-menu__item--disabled", !canFilter);
const doOperations: IOperation[] = [{
action: "updateAttrViewColRollup",
id: options.colId,