mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Allow filtering by selected cell value in cell context menu
Summary: Adds a command and `BaseView` method `filterByThisCellValue`. Test Plan: Added two tests to `nbrowser/CellContextMenu.ts` Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3383
This commit is contained in:
@@ -43,7 +43,9 @@ export function CellContextMenu(rowOptions: IRowContextMenu, colOptions: IMultiC
|
||||
...(
|
||||
(numCols > 1 || numRows > 1) ? [] : [
|
||||
menuDivider(),
|
||||
menuItemCmd(allCommands.copyLink, 'Copy anchor link')
|
||||
menuItemCmd(allCommands.copyLink, 'Copy anchor link'),
|
||||
menuDivider(),
|
||||
menuItemCmd(allCommands.filterByThisCellValue, `Filter by this value`),
|
||||
]
|
||||
),
|
||||
|
||||
|
||||
@@ -407,6 +407,7 @@ interface ICountOptions {
|
||||
*
|
||||
* The optional column type controls how complex cell values are decomposed into keys (e.g. Choice Lists have
|
||||
* the possible choices as keys).
|
||||
* Note that this logic is replicated in BaseView.prototype.filterByThisCellValue.
|
||||
*/
|
||||
function addCountsToMap(valueMap: Map<CellValue, IFilterCount>, rowIds: RowId[],
|
||||
{ keyMapFunc = identity, labelMapFunc = identity, columnType,
|
||||
|
||||
Reference in New Issue
Block a user