diff --git a/client/web/compose/src/components/PageBlocks/RecordListBase.vue b/client/web/compose/src/components/PageBlocks/RecordListBase.vue index 1be1eadce..f5567c0f6 100644 --- a/client/web/compose/src/components/PageBlocks/RecordListBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordListBase.vue @@ -474,11 +474,11 @@ :extra-options="options" />
+ + +
@@ -2066,6 +2078,30 @@ export default { this.inlineEdit.query = `recordID = ${record.recordID}` }, + filterByValue (record, { moduleField: field }) { + const value = field.isSystem ? record[field.name] : record.values[field.name] + + if (!this.recordListFilter.length) { + this.recordListFilter = [ + { + groupCondition: undefined, + filter: [ + this.createDefaultFilter('Where', field, value, '='), + ], + }, + ] + } else { + const { filter } = this.recordListFilter[0] + if (!filter.length || (filter.length && !filter[0].name)) { + this.recordListFilter[0].filter = [] + this.recordListFilter[0].filter.push(this.createDefaultFilter('Where', field, value)) + } else { + this.recordListFilter[0].filter.push(this.createDefaultFilter('OR', field, value)) + } + } + this.pullRecords(true) + }, + onInlineEditClose () { this.inlineEdit.fields = [] this.inlineEdit.record = {} @@ -2286,6 +2322,7 @@ tr:hover td.actions { margin-top: -2px; opacity: 0; transition: opacity 0.25s; + display: flex; } td:hover .inline-actions { diff --git a/client/web/compose/src/components/PageBlocks/RecordListConfigurator.vue b/client/web/compose/src/components/PageBlocks/RecordListConfigurator.vue index ba82e5a4e..8733eab10 100644 --- a/client/web/compose/src/components/PageBlocks/RecordListConfigurator.vue +++ b/client/web/compose/src/components/PageBlocks/RecordListConfigurator.vue @@ -714,6 +714,22 @@ + + + + + + = Object.freeze({ bulkRecordEditEnabled: true, inlineRecordEditEnabled: false, + inlineValueFiltering: false, filterPresets: [], showRecordPerPageOption: false, openRecordInEditMode: false, @@ -206,6 +208,7 @@ export class PageBlockRecordList extends PageBlock { 'showRefresh', 'bulkRecordEditEnabled', 'inlineRecordEditEnabled', + 'inlineValueFiltering', 'showRecordPerPageOption', 'openRecordInEditMode', ) diff --git a/locale/en/corteza-webapp-compose/block.yaml b/locale/en/corteza-webapp-compose/block.yaml index 548668f82..0e61ca764 100644 --- a/locale/en/corteza-webapp-compose/block.yaml +++ b/locale/en/corteza-webapp-compose/block.yaml @@ -325,13 +325,16 @@ recordList: customFilter: Custom filter prefilter: toggleInputType: Toggle input type + filterByValue: Filter by value filterPresets: filterName: Filter name saveFilterAsPreset: Save filter as preset + inlineValueFilter: + enabled: Enable inline value filtering inlineEdit: enabled: Inline value editing enabled button: - title: Edit {{label}} + title: Edit value modal: title: Update record values bulkRecord: