From 2f6cf5a5f11e50b4d64a1484c1a0fe8cb715cd3c Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Fri, 31 May 2024 21:04:54 +0100 Subject: [PATCH 1/9] feat: add usergroup column FE elements Signed-off-by: Cleopatra Enjeck M --- .../main/partials/ColumnFormComponent.vue | 3 + .../main/partials/ColumnTypeSelection.vue | 5 + src/modules/modals/CreateColumn.vue | 21 ++- src/modules/modals/EditColumn.vue | 6 +- .../components/ncTable/mixins/columnClass.js | 13 ++ .../ncTable/mixins/columnHandler.js | 1 + .../components/ncTable/mixins/columnParser.js | 2 + .../ncTable/mixins/columnsTypes/usergroup.js | 55 ++++++ .../components/ncTable/mixins/filter.js | 6 +- .../components/ncTable/mixins/magicFields.js | 4 +- .../ncTable/partials/TableCellUsergroup.vue | 43 +++++ .../components/ncTable/partials/TableRow.vue | 3 + .../forms/UsergroupForm.vue | 161 ++++++++++++++++++ .../rowTypePartials/UsergroupForm.vue | 81 +++++++++ src/shared/constants.js | 1 + src/store/data.js | 1 + 16 files changed, 398 insertions(+), 8 deletions(-) create mode 100644 src/shared/components/ncTable/mixins/columnsTypes/usergroup.js create mode 100644 src/shared/components/ncTable/partials/TableCellUsergroup.vue create mode 100644 src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue create mode 100644 src/shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue diff --git a/src/modules/main/partials/ColumnFormComponent.vue b/src/modules/main/partials/ColumnFormComponent.vue index da258c0e9..7a2a1c6e4 100644 --- a/src/modules/main/partials/ColumnFormComponent.vue +++ b/src/modules/main/partials/ColumnFormComponent.vue @@ -17,6 +17,8 @@ import DatetimeForm from '../../../shared/components/ncTable/partials/rowTypePar import DatetimeDateForm from '../../../shared/components/ncTable/partials/rowTypePartials/DatetimeDateForm.vue' import DatetimeTimeForm from '../../../shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue' import TextRichForm from '../../../shared/components/ncTable/partials/rowTypePartials/TextRichForm.vue' +import UsergroupForm from '../../../shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue' +import { AbstractColumn } from '../../../shared/components/ncTable/mixins/columnClass.js' export default { name: 'ColumnFormComponent', @@ -34,6 +36,7 @@ export default { DatetimeForm, DatetimeDateForm, DatetimeTimeForm, + UsergroupForm, }, props: { column: { diff --git a/src/modules/main/partials/ColumnTypeSelection.vue b/src/modules/main/partials/ColumnTypeSelection.vue index 524f8161c..36ce10ea6 100644 --- a/src/modules/main/partials/ColumnTypeSelection.vue +++ b/src/modules/main/partials/ColumnTypeSelection.vue @@ -14,6 +14,7 @@ +
{{ props.label }}
@@ -27,6 +28,7 @@ +
{{ props.label }}
@@ -43,6 +45,7 @@ import StarIcon from 'vue-material-design-icons/Star.vue' import ProgressIcon from 'vue-material-design-icons/ArrowRightThin.vue' import SelectionIcon from 'vue-material-design-icons/FormSelect.vue' import DatetimeIcon from 'vue-material-design-icons/ClipboardTextClockOutline.vue' +import ContactsIcon from 'vue-material-design-icons/Contacts.vue' import { NcSelect } from '@nextcloud/vue' export default { @@ -55,6 +58,7 @@ export default { LinkIcon, TextLongIcon, NcSelect, + ContactsIcon, }, props: { columnId: { @@ -77,6 +81,7 @@ export default { { id: 'selection', label: t('tables', 'Selection') }, { id: 'datetime', label: t('tables', 'Date and time') }, + { id: 'usergroup', label: t('tables', 'Users and groups') }, ], } }, diff --git a/src/modules/modals/CreateColumn.vue b/src/modules/modals/CreateColumn.vue index 6bed3fcb1..d5add5c0e 100644 --- a/src/modules/modals/CreateColumn.vue +++ b/src/modules/modals/CreateColumn.vue @@ -107,6 +107,7 @@ import '@nextcloud/dialogs/dist/index.css' import ColumnTypeSelection from '../main/partials/ColumnTypeSelection.vue' import TextRichForm from '../../shared/components/ncTable/partials/columnTypePartials/forms/TextRichForm.vue' import { ColumnTypes } from '../../shared/components/ncTable/mixins/columnHandler.js' +import UsergroupForm from '../../shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue' export default { name: 'CreateColumn', @@ -128,6 +129,7 @@ export default { NcCheckboxRadioSwitch, SelectionForm, SelectionMultiForm, + UsergroupForm, }, props: { showModal: { @@ -172,6 +174,11 @@ export default { selectionOptions: null, selectionDefault: null, datetimeDefault: '', + usergroupDefault: null, + usergroupMultipleItems: false, + usergroupSelectUsers: true, + usergroupSelectGroups: false, + showUserStatus: false, }, textAppAvailable: !!window.OCA?.Text?.createEditor, addNewAfterSave: false, @@ -188,6 +195,7 @@ export default { { id: 'selection', label: t('tables', 'Selection') }, { id: 'datetime', label: t('tables', 'Date and time') }, + { id: 'usergroup', label: t('tables', 'Users and groups') }, ], } }, @@ -209,7 +217,7 @@ export default { if (this.$options.components && this.$options.components[form]) { return form } else { - throw Error('Form ' + form + ' does not exist') + throw Error('Form ' + form + ' does no exist') } }, type() { @@ -316,6 +324,12 @@ export default { } } else if (this.column.type === 'datetime') { data.datetimeDefault = this.column.datetimeDefault ? this.column.subtype === 'date' ? 'today' : 'now' : '' + } else if (this.column.type === 'usergroup') { + data.usergroupDefault = JSON.stringify(this.column.usergroupDefault) + data.usergroupMultipleItems = this.column.usergroupMultipleItems + data.usergroupSelectUsers = this.column.usergroupSelectUsers + data.usergroupSelectGroups = this.column.usergroupSelectGroups + data.showUserStatus = this.column.showUserStatus } else if (this.column.type === 'number') { data.numberDefault = this.column.numberDefault if (this.column.subtype === '') { @@ -364,6 +378,11 @@ export default { selectionOptions: null, selectionDefault: null, datetimeDefault: '', + usergroupDefault: null, + usergroupMultipleItems: false, + usergroupSelectUsers: true, + usergroupSelectGroups: false, + showUserStatus: false, } if (mainForm) { this.column.title = '' diff --git a/src/modules/modals/EditColumn.vue b/src/modules/modals/EditColumn.vue index fad138d5f..ba7c97bcf 100644 --- a/src/modules/modals/EditColumn.vue +++ b/src/modules/modals/EditColumn.vue @@ -64,6 +64,7 @@ import SelectionMultiForm from '../../shared/components/ncTable/partials/columnT import DatetimeForm from '../../shared/components/ncTable/partials/columnTypePartials/forms/DatetimeForm.vue' import DatetimeDateForm from '../../shared/components/ncTable/partials/columnTypePartials/forms/DatetimeDateForm.vue' import DatetimeTimeForm from '../../shared/components/ncTable/partials/columnTypePartials/forms/DatetimeTimeForm.vue' +import UsergroupForm from '../../shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue' import { ColumnTypes } from '../../shared/components/ncTable/mixins/columnHandler.js' import moment from '@nextcloud/moment' @@ -90,6 +91,7 @@ export default { ColumnInfoPopover, NcButton, NcUserBubble, + UsergroupForm, }, filters: { truncate(text, length, suffix) { @@ -119,7 +121,7 @@ export default { editColumn: Object.assign({}, this.column), deleteId: null, editErrorTitle: false, - canSave: true, // avoid to save an incorrect config + canSave: true, // used to avoid saving an incorrect config } }, computed: { @@ -131,7 +133,7 @@ export default { if (this.$options.components && this.$options.components[form]) { return form } else { - throw Error('Form ' + form + ' does not exist') + throw Error('Form ' + form + ' does no exist') } }, updateTime() { diff --git a/src/shared/components/ncTable/mixins/columnClass.js b/src/shared/components/ncTable/mixins/columnClass.js index 249ef1e4e..4f8d13f5a 100644 --- a/src/shared/components/ncTable/mixins/columnClass.js +++ b/src/shared/components/ncTable/mixins/columnClass.js @@ -73,6 +73,19 @@ export class AbstractColumn { } +export class AbstractUsergroupColumn extends AbstractColumn { + + constructor(data) { + super(data) + this.usergroupDefault = data.usergroupDefault + } + + default() { + return this.usergroupDefault + } + +} + export class AbstractNumberColumn extends AbstractColumn { constructor(data) { diff --git a/src/shared/components/ncTable/mixins/columnHandler.js b/src/shared/components/ncTable/mixins/columnHandler.js index 8110383b3..bc09340bb 100644 --- a/src/shared/components/ncTable/mixins/columnHandler.js +++ b/src/shared/components/ncTable/mixins/columnHandler.js @@ -12,4 +12,5 @@ export const ColumnTypes = { DatetimeDate: 'datetime-date', DatetimeTime: 'datetime-time', Datetime: 'datetime', + Usergroup: 'usergroup', } diff --git a/src/shared/components/ncTable/mixins/columnParser.js b/src/shared/components/ncTable/mixins/columnParser.js index dd93eb51d..f535e48a2 100644 --- a/src/shared/components/ncTable/mixins/columnParser.js +++ b/src/shared/components/ncTable/mixins/columnParser.js @@ -12,6 +12,7 @@ import TextLineColumn from './columnsTypes/textLine.js' import TextLinkColumn from './columnsTypes/textLink.js' import TextLongColumn from './columnsTypes/textLong.js' import TextRichColumn from './columnsTypes/textRich.js' +import UsergroupColumn from './columnsTypes/usergroup.js' export function parseCol(col) { const columnType = col.type + (col.subtype === '' ? '' : '-' + col.subtype) @@ -29,6 +30,7 @@ export function parseCol(col) { case ColumnTypes.Datetime: return new DatetimeColumn(col) case ColumnTypes.DatetimeDate: return new DatetimeDateColumn(col) case ColumnTypes.DatetimeTime: return new DatetimeTimeColumn(col) + case ColumnTypes.Usergroup: return new UsergroupColumn(col) default: throw Error(columnType + ' is not a valid column type!') } } diff --git a/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js b/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js new file mode 100644 index 000000000..9486fa69d --- /dev/null +++ b/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js @@ -0,0 +1,55 @@ +import { AbstractUsergroupColumn } from '../columnClass.js' +import { ColumnTypes } from '../columnHandler.js' +import { FilterIds } from '../filter.js' + +export default class UsergroupColumn extends AbstractUsergroupColumn { + + constructor(data) { + super(data) + this.type = ColumnTypes.Usergroup + this.showUserStatus = data.showUserStatus + this.usergroupMultipleItems = data.usergroupMultipleItems + this.usergroupSelectUsers = data.usergroupSelectUsers + this.usergroupSelectGroups = data.usergroupSelectGroups + } + + getValueString(valueObject) { + valueObject = valueObject || this.value || null + + const valueObjects = this.getObjects(valueObject.value) + let ret = '' + valueObjects?.forEach(obj => { + if (ret === '') { + ret = obj.id + } else { + ret += ', ' + obj.display + } + }) + return ret + } + + getObjects(values) { + const objects = [] + values?.forEach(item => { + objects.push(item) + }) + return objects + } + + isSearchStringFound(cell, searchString) { + return super.isSearchStringFound(this.getValueString(cell), cell, searchString) + } + + isFilterFound(cell, filter) { + const filterValue = filter.magicValuesEnriched ? filter.magicValuesEnriched : filter.value + const valueString = this.getValueString(cell) + + const filterMethod = { + [FilterIds.Contains]() { return valueString?.includes(filterValue) }, + [FilterIds.IsEqual]() { return valueString === filterValue }, + [FilterIds.IsEmpty]() { return !valueString }, + }[filter.operator.id] + return super.isFilterFound(filterMethod, cell) + } + +} diff --git a/src/shared/components/ncTable/mixins/filter.js b/src/shared/components/ncTable/mixins/filter.js index 34f796482..d33b702c7 100644 --- a/src/shared/components/ncTable/mixins/filter.js +++ b/src/shared/components/ncTable/mixins/filter.js @@ -49,7 +49,7 @@ export const Filters = { Contains: new Filter({ id: FilterIds.Contains, label: t('tables', 'Contains'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual], }), BeginsWith: new Filter({ @@ -68,7 +68,7 @@ export const Filters = { id: FilterIds.IsEqual, label: t('tables', 'Is equal'), shortLabel: '=', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.Contains, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual], }), IsGreaterThan: new Filter({ @@ -102,7 +102,7 @@ export const Filters = { IsEmpty: new Filter({ id: FilterIds.IsEmpty, label: t('tables', 'Is empty'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.Contains, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.IsEqual, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual, FilterIds.IsEmpty], noSearchValue: true, }), diff --git a/src/shared/components/ncTable/mixins/magicFields.js b/src/shared/components/ncTable/mixins/magicFields.js index d45e24a57..a001ac265 100644 --- a/src/shared/components/ncTable/mixins/magicFields.js +++ b/src/shared/components/ncTable/mixins/magicFields.js @@ -34,14 +34,14 @@ export const MagicFields = { id: 'me', label: t('tables', 'Me (user ID)'), icon: 'icon-user', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink, ColumnTypes.Usergroup], replace: getCurrentUser()?.uid, }), MyName: new MagicField({ id: 'my-name', label: t('tables', 'Me (name)'), icon: 'icon-user', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink, ColumnTypes.Usergroup], replace: getCurrentUser()?.displayName, }), Checked: new MagicField({ diff --git a/src/shared/components/ncTable/partials/TableCellUsergroup.vue b/src/shared/components/ncTable/partials/TableCellUsergroup.vue new file mode 100644 index 000000000..6344b1551 --- /dev/null +++ b/src/shared/components/ncTable/partials/TableCellUsergroup.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/shared/components/ncTable/partials/TableRow.vue b/src/shared/components/ncTable/partials/TableRow.vue index 483e563e7..68f5ce5b4 100644 --- a/src/shared/components/ncTable/partials/TableRow.vue +++ b/src/shared/components/ncTable/partials/TableRow.vue @@ -33,6 +33,7 @@ import TableCellTextLine from './TableCellTextLine.vue' import TableCellSelection from './TableCellSelection.vue' import TableCellMultiSelection from './TableCellMultiSelection.vue' import TableCellTextRich from './TableCellEditor.vue' +import TableCellUsergroup from './TableCellUsergroup.vue' import { ColumnTypes } from './../mixins/columnHandler.js' import { translate as t } from '@nextcloud/l10n' import { @@ -56,6 +57,7 @@ export default { TableCellSelection, TableCellMultiSelection, TableCellTextRich, + TableCellUsergroup, }, props: { @@ -105,6 +107,7 @@ export default { case ColumnTypes.Datetime: return 'TableCellDateTime' case ColumnTypes.DatetimeDate: return 'TableCellDateTime' case ColumnTypes.DatetimeTime: return 'TableCellDateTime' + case ColumnTypes.Usergroup: return 'TableCellUsergroup' default: return 'TableCellHtml' } }, diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue new file mode 100644 index 000000000..fa64518fc --- /dev/null +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue @@ -0,0 +1,161 @@ + + + + diff --git a/src/shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue new file mode 100644 index 000000000..d9b834dfa --- /dev/null +++ b/src/shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/shared/constants.js b/src/shared/constants.js index 98ac005ec..119a25aae 100644 --- a/src/shared/constants.js +++ b/src/shared/constants.js @@ -40,3 +40,4 @@ export const TYPE_SELECTION = 'selection' export const TYPE_TEXT = 'text' export const TYPE_NUMBER = 'number' export const TYPE_DATETIME = 'datetime' +export const TYPE_USERGROUP = 'usergroup' diff --git a/src/store/data.js b/src/store/data.js index dd2bac91c..527ec7495 100644 --- a/src/store/data.js +++ b/src/store/data.js @@ -109,6 +109,7 @@ export default { }, async updateColumn({ state, commit }, { id, isView, elementId, data }) { data.selectionOptions = JSON.stringify(data.selectionOptions) + data.usergroupDefault = JSON.stringify(data.usergroupDefault) let res = null try { From 41d1e415f94221add2ce939ccb63794156f41c32 Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Mon, 3 Jun 2024 09:22:32 +0100 Subject: [PATCH 2/9] fix: update usergroup column elements Signed-off-by: Cleopatra Enjeck M --- .../components/ncTable/mixins/columnsTypes/usergroup.js | 6 +++++- src/shared/components/ncTable/mixins/filter.js | 6 +++--- src/shared/components/ncTable/mixins/magicFields.js | 4 ++-- .../components/ncTable/partials/TableCellUsergroup.vue | 3 ++- .../partials/columnTypePartials/forms/UsergroupForm.vue | 8 ++++---- .../ncTable/partials/rowTypePartials/UsergroupForm.vue | 9 +++++---- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js b/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js index 9486fa69d..e02917102 100644 --- a/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js +++ b/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js @@ -13,6 +13,10 @@ export default class UsergroupColumn extends AbstractUsergroupColumn { this.usergroupSelectGroups = data.usergroupSelectGroups } + // TODO consider if we want to sort, and how + // sort(mode) { + // } + getValueString(valueObject) { valueObject = valueObject || this.value || null @@ -22,7 +26,7 @@ export default class UsergroupColumn extends AbstractUsergroupColumn { if (ret === '') { ret = obj.id } else { - ret += ', ' + obj.display + ret += ', ' + obj.id } }) return ret diff --git a/src/shared/components/ncTable/mixins/filter.js b/src/shared/components/ncTable/mixins/filter.js index d33b702c7..34f796482 100644 --- a/src/shared/components/ncTable/mixins/filter.js +++ b/src/shared/components/ncTable/mixins/filter.js @@ -49,7 +49,7 @@ export const Filters = { Contains: new Filter({ id: FilterIds.Contains, label: t('tables', 'Contains'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual], }), BeginsWith: new Filter({ @@ -68,7 +68,7 @@ export const Filters = { id: FilterIds.IsEqual, label: t('tables', 'Is equal'), shortLabel: '=', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.Contains, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual], }), IsGreaterThan: new Filter({ @@ -102,7 +102,7 @@ export const Filters = { IsEmpty: new Filter({ id: FilterIds.IsEmpty, label: t('tables', 'Is empty'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck], incompatibleWith: [FilterIds.Contains, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.IsEqual, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual, FilterIds.IsEmpty], noSearchValue: true, }), diff --git a/src/shared/components/ncTable/mixins/magicFields.js b/src/shared/components/ncTable/mixins/magicFields.js index a001ac265..d45e24a57 100644 --- a/src/shared/components/ncTable/mixins/magicFields.js +++ b/src/shared/components/ncTable/mixins/magicFields.js @@ -34,14 +34,14 @@ export const MagicFields = { id: 'me', label: t('tables', 'Me (user ID)'), icon: 'icon-user', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink], replace: getCurrentUser()?.uid, }), MyName: new MagicField({ id: 'my-name', label: t('tables', 'Me (name)'), icon: 'icon-user', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink], replace: getCurrentUser()?.displayName, }), Checked: new MagicField({ diff --git a/src/shared/components/ncTable/partials/TableCellUsergroup.vue b/src/shared/components/ncTable/partials/TableCellUsergroup.vue index 6344b1551..3d2495179 100644 --- a/src/shared/components/ncTable/partials/TableCellUsergroup.vue +++ b/src/shared/components/ncTable/partials/TableCellUsergroup.vue @@ -8,6 +8,7 @@ {{ item.id }} --> +

User

@{{ item.id }}
@@ -37,7 +38,7 @@ export default { }, }, mounted() { - console.log(value) + console.log(this.value) } } diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue index fa64518fc..584de2ee5 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue @@ -24,7 +24,7 @@ @@ -83,7 +83,7 @@ export default { data() { return { mutableColumn: this.column, - value: [], + value: this.column.usergroupDefault, } }, computed: { @@ -95,10 +95,10 @@ export default { // TODO update to get groups too if (Array.isArray(v)) { this.column.usergroupDefault = v.map(o => { - return {type: o.isUser ? 0 : 1, id: o.user } + return o }) } else { - this.column.usergroupDefault = [{ type: v.isUser ? 0 : 1, id: v.user }] + this.column.usergroupDefault = [v] } }, diff --git a/src/shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue index d9b834dfa..959f25b51 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue @@ -2,7 +2,7 @@ @@ -48,13 +48,14 @@ export default { }, set(v) { // TODO update to get groups too - let formattedValue = [] + console.log('v', v) + let formattedValue = null if (Array.isArray(v)) { formattedValue = v.map(o => { - return {displayName: o.displayName, type: o.isUser ? 0 : 1, id: o.user } + return o }) } else { - formattedValue = [{ displayName: v.displayName, type: v.isUser ? 0 : 1, id: v.user }] + formattedValue = [v] } console.log(formattedValue) this.$emit('update:value', formattedValue) From 0ba840c9bb6275b2670eb06211a0ae8955a7cf01 Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Mon, 13 May 2024 12:45:16 +0100 Subject: [PATCH 3/9] enh: refactor items for searching users and groups Signed-off-by: Cleopatra Enjeck M --- src/modules/sidebar/partials/ShareForm.vue | 2 +- src/shared/mixins/searchUserGroup.js | 4 +-- src/shared/mixins/shareTypesMixin.js | 39 ---------------------- 3 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 src/shared/mixins/shareTypesMixin.js diff --git a/src/modules/sidebar/partials/ShareForm.vue b/src/modules/sidebar/partials/ShareForm.vue index 5ff28f5d7..33fc0b754 100644 --- a/src/modules/sidebar/partials/ShareForm.vue +++ b/src/modules/sidebar/partials/ShareForm.vue @@ -154,7 +154,7 @@ export default { shareWith: result.value.shareWith, shareType: result.value.shareType, user: result.uuid || result.value.shareWith, - isNoUser: result.value.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER, + isNoUser: result.value.shareType !== SHARE_TYPES.SHARE_TYPE_USER, displayName: result.name || result.label, icon: result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_USER ? 'icon-user' : 'icon-group', // Vue unique binding to render within Multiselect's AvatarSelectOption diff --git a/src/shared/mixins/searchUserGroup.js b/src/shared/mixins/searchUserGroup.js index 5bd51d1a9..27fe7e53a 100644 --- a/src/shared/mixins/searchUserGroup.js +++ b/src/shared/mixins/searchUserGroup.js @@ -42,10 +42,10 @@ export default { getShareTypes() { const types = [] if (this.selectUsers) { - types.push(this.SHARE_TYPES.SHARE_TYPE_USER) + types.push(SHARE_TYPES.SHARE_TYPE_USER) } if (this.selectGroups) { - types.push(this.SHARE_TYPES.SHARE_TYPE_GROUP) + types.push(SHARE_TYPES.SHARE_TYPE_GROUP) } return types }, diff --git a/src/shared/mixins/shareTypesMixin.js b/src/shared/mixins/shareTypesMixin.js deleted file mode 100644 index 18b793f54..000000000 --- a/src/shared/mixins/shareTypesMixin.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @copyright Copyright (c) 2019 John Molakvoæ - * - * @author John Molakvoæ - * - * @license AGPL-3.0-or-later - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -export default { - data() { - return { - SHARE_TYPES: { - SHARE_TYPE_USER: OC.Share.SHARE_TYPE_USER, - SHARE_TYPE_GROUP: OC.Share.SHARE_TYPE_GROUP, - SHARE_TYPE_LINK: OC.Share.SHARE_TYPE_LINK, - SHARE_TYPE_EMAIL: OC.Share.SHARE_TYPE_EMAIL, - SHARE_TYPE_REMOTE: OC.Share.SHARE_TYPE_REMOTE, - SHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE, - SHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST, - SHARE_TYPE_REMOTE_GROUP: OC.Share.SHARE_TYPE_REMOTE_GROUP, - SHARE_TYPE_ROOM: OC.Share.SHARE_TYPE_ROOM, - }, - } - }, -} From 39e997e3854873a5044c1bec55f42d01fab484ea Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Fri, 31 May 2024 21:04:54 +0100 Subject: [PATCH 4/9] feat: add usergroup column FE elements Signed-off-by: Cleopatra Enjeck M --- src/shared/components/ncTable/mixins/filter.js | 6 +++--- src/shared/components/ncTable/mixins/magicFields.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/components/ncTable/mixins/filter.js b/src/shared/components/ncTable/mixins/filter.js index 34f796482..d33b702c7 100644 --- a/src/shared/components/ncTable/mixins/filter.js +++ b/src/shared/components/ncTable/mixins/filter.js @@ -49,7 +49,7 @@ export const Filters = { Contains: new Filter({ id: FilterIds.Contains, label: t('tables', 'Contains'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual], }), BeginsWith: new Filter({ @@ -68,7 +68,7 @@ export const Filters = { id: FilterIds.IsEqual, label: t('tables', 'Is equal'), shortLabel: '=', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.Contains, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual], }), IsGreaterThan: new Filter({ @@ -102,7 +102,7 @@ export const Filters = { IsEmpty: new Filter({ id: FilterIds.IsEmpty, label: t('tables', 'Is empty'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.Contains, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.IsEqual, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual, FilterIds.IsEmpty], noSearchValue: true, }), diff --git a/src/shared/components/ncTable/mixins/magicFields.js b/src/shared/components/ncTable/mixins/magicFields.js index d45e24a57..a001ac265 100644 --- a/src/shared/components/ncTable/mixins/magicFields.js +++ b/src/shared/components/ncTable/mixins/magicFields.js @@ -34,14 +34,14 @@ export const MagicFields = { id: 'me', label: t('tables', 'Me (user ID)'), icon: 'icon-user', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink, ColumnTypes.Usergroup], replace: getCurrentUser()?.uid, }), MyName: new MagicField({ id: 'my-name', label: t('tables', 'Me (name)'), icon: 'icon-user', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink, ColumnTypes.Usergroup], replace: getCurrentUser()?.displayName, }), Checked: new MagicField({ From 64958816c21fb2ba8d212895bc3da712a753e254 Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Mon, 3 Jun 2024 09:22:32 +0100 Subject: [PATCH 5/9] fix: update usergroup column elements Signed-off-by: Cleopatra Enjeck M --- src/shared/components/ncTable/mixins/filter.js | 6 +++--- src/shared/components/ncTable/mixins/magicFields.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/components/ncTable/mixins/filter.js b/src/shared/components/ncTable/mixins/filter.js index d33b702c7..34f796482 100644 --- a/src/shared/components/ncTable/mixins/filter.js +++ b/src/shared/components/ncTable/mixins/filter.js @@ -49,7 +49,7 @@ export const Filters = { Contains: new Filter({ id: FilterIds.Contains, label: t('tables', 'Contains'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual], }), BeginsWith: new Filter({ @@ -68,7 +68,7 @@ export const Filters = { id: FilterIds.IsEqual, label: t('tables', 'Is equal'), shortLabel: '=', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.Contains, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual], }), IsGreaterThan: new Filter({ @@ -102,7 +102,7 @@ export const Filters = { IsEmpty: new Filter({ id: FilterIds.IsEmpty, label: t('tables', 'Is empty'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck], incompatibleWith: [FilterIds.Contains, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.IsEqual, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual, FilterIds.IsEmpty], noSearchValue: true, }), diff --git a/src/shared/components/ncTable/mixins/magicFields.js b/src/shared/components/ncTable/mixins/magicFields.js index a001ac265..d45e24a57 100644 --- a/src/shared/components/ncTable/mixins/magicFields.js +++ b/src/shared/components/ncTable/mixins/magicFields.js @@ -34,14 +34,14 @@ export const MagicFields = { id: 'me', label: t('tables', 'Me (user ID)'), icon: 'icon-user', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink], replace: getCurrentUser()?.uid, }), MyName: new MagicField({ id: 'my-name', label: t('tables', 'Me (name)'), icon: 'icon-user', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink, ColumnTypes.Usergroup], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.TextRich, ColumnTypes.TextLink], replace: getCurrentUser()?.displayName, }), Checked: new MagicField({ From cd2a77f764ae890c994d2ded0e0fe104a96bc058 Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Mon, 8 Jul 2024 05:37:43 +0100 Subject: [PATCH 6/9] enh: update usergroup column elements Signed-off-by: Cleopatra Enjeck M --- .../main/partials/ColumnFormComponent.vue | 1 - src/modules/modals/CreateColumn.vue | 2 +- src/modules/sidebar/partials/ShareForm.vue | 2 +- .../ncTable/mixins/columnsTypes/usergroup.js | 17 ------ .../ncTable/partials/TableCellUsergroup.vue | 40 +++++++++----- .../columnTypePartials/forms/MainForm.vue | 2 +- .../forms/UsergroupForm.vue | 55 +++++++++++-------- .../rowTypePartials/UsergroupForm.vue | 37 +++++++------ src/shared/mixins/searchUserGroup.js | 4 +- src/shared/mixins/shareTypesMixin.js | 39 +++++++++++++ 10 files changed, 122 insertions(+), 77 deletions(-) create mode 100644 src/shared/mixins/shareTypesMixin.js diff --git a/src/modules/main/partials/ColumnFormComponent.vue b/src/modules/main/partials/ColumnFormComponent.vue index 7a2a1c6e4..de6b94e30 100644 --- a/src/modules/main/partials/ColumnFormComponent.vue +++ b/src/modules/main/partials/ColumnFormComponent.vue @@ -18,7 +18,6 @@ import DatetimeDateForm from '../../../shared/components/ncTable/partials/rowTyp import DatetimeTimeForm from '../../../shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue' import TextRichForm from '../../../shared/components/ncTable/partials/rowTypePartials/TextRichForm.vue' import UsergroupForm from '../../../shared/components/ncTable/partials/rowTypePartials/UsergroupForm.vue' -import { AbstractColumn } from '../../../shared/components/ncTable/mixins/columnClass.js' export default { name: 'ColumnFormComponent', diff --git a/src/modules/modals/CreateColumn.vue b/src/modules/modals/CreateColumn.vue index d5add5c0e..a8b62d5e6 100644 --- a/src/modules/modals/CreateColumn.vue +++ b/src/modules/modals/CreateColumn.vue @@ -78,7 +78,7 @@ {{ t('tables', 'Add more') }} - diff --git a/src/modules/sidebar/partials/ShareForm.vue b/src/modules/sidebar/partials/ShareForm.vue index 33fc0b754..5ff28f5d7 100644 --- a/src/modules/sidebar/partials/ShareForm.vue +++ b/src/modules/sidebar/partials/ShareForm.vue @@ -154,7 +154,7 @@ export default { shareWith: result.value.shareWith, shareType: result.value.shareType, user: result.uuid || result.value.shareWith, - isNoUser: result.value.shareType !== SHARE_TYPES.SHARE_TYPE_USER, + isNoUser: result.value.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER, displayName: result.name || result.label, icon: result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_USER ? 'icon-user' : 'icon-group', // Vue unique binding to render within Multiselect's AvatarSelectOption diff --git a/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js b/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js index e02917102..654704009 100644 --- a/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js +++ b/src/shared/components/ncTable/mixins/columnsTypes/usergroup.js @@ -1,6 +1,5 @@ import { AbstractUsergroupColumn } from '../columnClass.js' import { ColumnTypes } from '../columnHandler.js' -import { FilterIds } from '../filter.js' export default class UsergroupColumn extends AbstractUsergroupColumn { @@ -13,10 +12,6 @@ export default class UsergroupColumn extends AbstractUsergroupColumn { this.usergroupSelectGroups = data.usergroupSelectGroups } - // TODO consider if we want to sort, and how - // sort(mode) { - // } - getValueString(valueObject) { valueObject = valueObject || this.value || null @@ -44,16 +39,4 @@ export default class UsergroupColumn extends AbstractUsergroupColumn { return super.isSearchStringFound(this.getValueString(cell), cell, searchString) } - isFilterFound(cell, filter) { - const filterValue = filter.magicValuesEnriched ? filter.magicValuesEnriched : filter.value - const valueString = this.getValueString(cell) - - const filterMethod = { - [FilterIds.Contains]() { return valueString?.includes(filterValue) }, - [FilterIds.IsEqual]() { return valueString === filterValue }, - [FilterIds.IsEmpty]() { return !valueString }, - }[filter.operator.id] - return super.isFilterFound(filterMethod, cell) - } - } diff --git a/src/shared/components/ncTable/partials/TableCellUsergroup.vue b/src/shared/components/ncTable/partials/TableCellUsergroup.vue index 3d2495179..263ef5560 100644 --- a/src/shared/components/ncTable/partials/TableCellUsergroup.vue +++ b/src/shared/components/ncTable/partials/TableCellUsergroup.vue @@ -2,26 +2,27 @@
- - -

User

- @{{ item.id }} -
+
+
+ +
+
+
+ {{ item.id }} +
+
+
+ + diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/MainForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/MainForm.vue index 64ca16c14..b746b995c 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/MainForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/MainForm.vue @@ -5,7 +5,7 @@ {{ t('tables', 'Title') }}
- +
diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue index 584de2ee5..0d5ab9c1f 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/UsergroupForm.vue @@ -3,15 +3,15 @@
+ type="radio" data-cy="userSwitch"> {{ t('tables', 'Users') }} + name="usergroupTypeSelection" type="radio" data-cy="groupSwitch"> {{ t('tables', 'Groups') }} + type="radio" data-cy="userAndGroupSwitch"> {{ t('tables', 'Users and groups') }}
@@ -21,13 +21,11 @@ {{ t('tables', 'Default') }}
- + :user-select="true" :close-on-select="false" + :multiple="mutableColumn.usergroupMultipleItems" data-cy="usergroupDefaultSelect" @search="asyncFind" @input="addItem"> @@ -38,12 +36,11 @@ {{ t('tables', 'Select multiple items') }}
- +
- -
+
{{ t('tables', 'Show user status') }}
@@ -56,8 +53,6 @@ diff --git a/src/shared/mixins/searchUserGroup.js b/src/shared/mixins/searchUserGroup.js index 27fe7e53a..5bd51d1a9 100644 --- a/src/shared/mixins/searchUserGroup.js +++ b/src/shared/mixins/searchUserGroup.js @@ -42,10 +42,10 @@ export default { getShareTypes() { const types = [] if (this.selectUsers) { - types.push(SHARE_TYPES.SHARE_TYPE_USER) + types.push(this.SHARE_TYPES.SHARE_TYPE_USER) } if (this.selectGroups) { - types.push(SHARE_TYPES.SHARE_TYPE_GROUP) + types.push(this.SHARE_TYPES.SHARE_TYPE_GROUP) } return types }, diff --git a/src/shared/mixins/shareTypesMixin.js b/src/shared/mixins/shareTypesMixin.js new file mode 100644 index 000000000..18b793f54 --- /dev/null +++ b/src/shared/mixins/shareTypesMixin.js @@ -0,0 +1,39 @@ +/** + * @copyright Copyright (c) 2019 John Molakvoæ + * + * @author John Molakvoæ + * + * @license AGPL-3.0-or-later + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +export default { + data() { + return { + SHARE_TYPES: { + SHARE_TYPE_USER: OC.Share.SHARE_TYPE_USER, + SHARE_TYPE_GROUP: OC.Share.SHARE_TYPE_GROUP, + SHARE_TYPE_LINK: OC.Share.SHARE_TYPE_LINK, + SHARE_TYPE_EMAIL: OC.Share.SHARE_TYPE_EMAIL, + SHARE_TYPE_REMOTE: OC.Share.SHARE_TYPE_REMOTE, + SHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE, + SHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST, + SHARE_TYPE_REMOTE_GROUP: OC.Share.SHARE_TYPE_REMOTE_GROUP, + SHARE_TYPE_ROOM: OC.Share.SHARE_TYPE_ROOM, + }, + } + }, +} From 6c370f5a2b8c6007fcc9aaff39d5a7b3bd765a0c Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Mon, 8 Jul 2024 05:40:40 +0100 Subject: [PATCH 7/9] test: add Cypress tests for usergroup column Signed-off-by: Cleopatra Enjeck M --- cypress/e2e/column-usergroup.cy.js | 66 ++++++++++++ cypress/support/commands.js | 165 +++++++++++++---------------- 2 files changed, 140 insertions(+), 91 deletions(-) create mode 100644 cypress/e2e/column-usergroup.cy.js diff --git a/cypress/e2e/column-usergroup.cy.js b/cypress/e2e/column-usergroup.cy.js new file mode 100644 index 000000000..5aaa8bbdb --- /dev/null +++ b/cypress/e2e/column-usergroup.cy.js @@ -0,0 +1,66 @@ +let localUser +let nonLocalUser +const columnTitle = 'usergroup' +const tableTitlePrefix = 'Test usergroup' +let tableTitle = tableTitlePrefix +let testNumber = 0 + +describe('Test column ' + columnTitle, () => { + + before(function() { + cy.createRandomUser().then(user => { + localUser = user + }) + + cy.createRandomUser().then(user => { + nonLocalUser = user + }) + }) + + beforeEach(function() { + testNumber += 1 + tableTitle = `${tableTitlePrefix} ${testNumber}` + cy.login(localUser) + cy.visit('apps/tables') + }) + + it('Create column and rows with default values', () => { + cy.createTable(tableTitle) + cy.loadTable(tableTitle) + cy.createUsergroupColumn(columnTitle, true, true, true, [localUser.userId, nonLocalUser.userId], true) + cy.get('button').contains('Create row').click() + cy.get('[data-cy="createRowSaveButton"]').click() + cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(localUser.userId).should('be.visible') + cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(nonLocalUser.userId).should('be.visible') + }) + + it('Create column and rows without default values', () => { + cy.createTable(tableTitle) + cy.loadTable(tableTitle) + cy.createUsergroupColumn(columnTitle, true, false, false, [], true) + + cy.get('button').contains('Create row').click() + cy.get('[data-cy="usergroupRowSelect"] input').type(nonLocalUser.userId) + cy.get(`.vs__dropdown-menu [id="${nonLocalUser.userId}"]`).click() + cy.get('[data-cy="createRowSaveButton"]').click() + cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(nonLocalUser.userId).should('be.visible') + }) + + it('Create and edit rows', () => { + cy.createTable(tableTitle) + cy.loadTable(tableTitle) + cy.createUsergroupColumn(columnTitle, true, true, true, [localUser.userId], true) + cy.get('button').contains('Create row').click() + cy.get('[data-cy="createRowSaveButton"]').click() + cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(localUser.userId).should('be.visible') + + cy.get('[data-cy="ncTable"] [data-cy="editRowBtn"]').click() + cy.get('[data-cy="usergroupRowSelect"] input').clear().type(nonLocalUser.userId) + cy.get(`.vs__dropdown-menu [id="${nonLocalUser.userId}"]`).click() + cy.get('[data-cy="editRowSaveButton"]').click() + cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(localUser.userId).should('not.exist') + cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(nonLocalUser.userId).should('be.visible') + }) + + +}) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 984e12f97..bdd8e23be 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -56,6 +56,15 @@ Cypress.Commands.add('createView', (title) => { cy.contains('.app-navigation-entry-link span', title).should('exist') }) +Cypress.Commands.add('openCreateColumnModal', (isFirstColumn) => { + if (isFirstColumn) { + cy.get('.button-vue__text').contains('Create column').click({ force: true }) + } else { + cy.get('[data-cy="customTableAction"] button').click() + cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) + } +}) + Cypress.Commands.add('createContext', (title) => { cy.get('ul:nth-of-type(2) [data-cy="createContextIcon"]').click({ force: true }) cy.get('[data-cy="createContextModal"]').should('be.visible') @@ -67,10 +76,6 @@ Cypress.Commands.add('createContext', (title) => { cy.contains('h1', title).should('exist') }) -Cypress.Commands.add('loadContext', (title) => { - cy.get('[data-cy="navigationContextItem"]').contains(title).click({ force: true }) -}) - Cypress.Commands.add('openContextEditModal', (title) => { cy.get(`[data-cy="navigationContextItem"]:contains("${title}")`).find('button').click({ force: true }) cy.get('[data-cy="navigationContextEditBtn"]').contains('Edit application').click({ force: true }) @@ -99,21 +104,48 @@ Cypress.Commands.add('loadView', (name) => { cy.get('[data-cy="navigationViewItem"] a[title="' + name + '"]').click({ force: true }) }) +Cypress.Commands.add('loadContext', (title) => { + cy.get('[data-cy="navigationContextItem"]').contains(title).click({ force: true }) +}) + Cypress.Commands.add('unifiedSearch', (term) => { cy.get('#unified-search').click() cy.get('#unified-search__input').type(term) cy.get('.unified-search__results .unified-search__result-line-one span').contains(term, { matchCase: false }).should('exist') }) -Cypress.Commands.add('createTextLinkColumn', (title, ressourceProvider, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) +Cypress.Commands.add('createUsergroupColumn', (title, selectUsers, selectGroups, hasMultipleValues, defaultValue, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) + cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) + cy.get('.multiSelectOptionLabel').contains('Users and groups').click({ force: true }) + + if (hasMultipleValues) { + cy.get('[data-cy="usergroupMultipleSwitch"] .checkbox-content').click({ force: true }) + } + + if (selectUsers && selectGroups) { + cy.get('[data-cy="userAndGroupSwitch"] .checkbox-content').click() + } else if (selectUsers) { + cy.get('[data-cy="userSwitch"] .checkbox-content').click() + } else if (selectGroups) { + cy.get('[data-cy="groupSwitch"] .checkbox-content').click() } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) + defaultValue.forEach((value) => { + cy.get('[data-cy="usergroupDefaultSelect"] input').type(value) + cy.get(`.vs__dropdown-menu [id="${value}"]`).click() + }) + + cy.get('[data-cy="createColumnSaveBtn"]').click() + cy.wait(10).get('.toastify.toast-success').should('be.visible') + cy.get('[data-cy="ncTable"] table tr th').contains(title).should('exist') +}) + +Cypress.Commands.add('createTextLinkColumn', (title, ressourceProvider, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Link').click({ force: true }) // deactivate unwanted provider @@ -131,15 +163,10 @@ Cypress.Commands.add('createTextLinkColumn', (title, ressourceProvider, firstCol cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createSelectionColumn', (title, options, defaultOption, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } +Cypress.Commands.add('createSelectionColumn', (title, options, defaultOption, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Selection').click({ force: true }) // remove default option @@ -160,15 +187,11 @@ Cypress.Commands.add('createSelectionColumn', (title, options, defaultOption, fi cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createSelectionMultiColumn', (title, options, defaultOptions, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createSelectionMultiColumn', (title, options, defaultOptions, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Selection').click({ force: true }) cy.get('[data-cy="createColumnMultipleSelectionSwitch"]').contains('Multiple selection').click() @@ -191,14 +214,9 @@ Cypress.Commands.add('createSelectionMultiColumn', (title, options, defaultOptio cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createTextLineColumn', (title, defaultValue, maxLength, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createTextLineColumn', (title, defaultValue, maxLength, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) if (defaultValue) { cy.get('[data-cy="TextLineForm"] input').first().type(defaultValue) } @@ -210,14 +228,9 @@ Cypress.Commands.add('createTextLineColumn', (title, defaultValue, maxLength, fi cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createDatetimeColumn', (title, setNow, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createDatetimeColumn', (title, setNow, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Date and time').click({ force: true }) @@ -230,14 +243,9 @@ Cypress.Commands.add('createDatetimeColumn', (title, setNow, firstColumn) => { cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createDatetimeDateColumn', (title, setNow, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createDatetimeDateColumn', (title, setNow, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Date and time').click({ force: true }) cy.get('[data-cy="createColumnDateSwitch"]').contains('Date').click() @@ -251,14 +259,9 @@ Cypress.Commands.add('createDatetimeDateColumn', (title, setNow, firstColumn) => cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createDatetimeTimeColumn', (title, setNow, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createDatetimeTimeColumn', (title, setNow, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Date and time').click({ force: true }) cy.get('[data-cy="createColumnTimeSwitch"]').contains('Time').click() @@ -272,14 +275,9 @@ Cypress.Commands.add('createDatetimeTimeColumn', (title, setNow, firstColumn) => cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createNumberColumn', (title, defaultValue, decimals, min, max, prefix, suffix, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createNumberColumn', (title, defaultValue, decimals, min, max, prefix, suffix, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Number').click({ force: true }) @@ -306,14 +304,9 @@ Cypress.Commands.add('createNumberColumn', (title, defaultValue, decimals, min, cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createNumberProgressColumn', (title, defaultValue, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createNumberProgressColumn', (title, defaultValue, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Progress').click({ force: true }) @@ -325,14 +318,9 @@ Cypress.Commands.add('createNumberProgressColumn', (title, defaultValue, firstCo cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createNumberStarsColumn', (title, defaultValue, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createNumberStarsColumn', (title, defaultValue, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Stars rating').click({ force: true }) @@ -346,14 +334,9 @@ Cypress.Commands.add('createNumberStarsColumn', (title, defaultValue, firstColum cy.get('.custom-table table tr th .cell').contains(title).should('exist') }) -Cypress.Commands.add('createSelectionCheckColumn', (title, defaultValue, firstColumn) => { - if (firstColumn) { - cy.get('.button-vue__text').contains('Create column').click({ force: true }) - } else { - cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableCreateColumnBtn"]').contains('Create column').click({ force: true }) - } - cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) +Cypress.Commands.add('createSelectionCheckColumn', (title, defaultValue, isFirstColumn) => { + cy.openCreateColumnModal(isFirstColumn) + cy.get('[data-cy="columnTypeFormInput"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Selection').click({ force: true }) cy.get('[data-cy="createColumnYesNoSwitch"').contains('Yes/No').click() From 82373c1838524e66ed8d34e41a46743bd0198633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 25 Jul 2024 17:13:48 +0200 Subject: [PATCH 8/9] feat: Implement view filter types for usergroup column MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/shared/components/ncTable/mixins/filter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/components/ncTable/mixins/filter.js b/src/shared/components/ncTable/mixins/filter.js index 34f796482..d33b702c7 100644 --- a/src/shared/components/ncTable/mixins/filter.js +++ b/src/shared/components/ncTable/mixins/filter.js @@ -49,7 +49,7 @@ export const Filters = { Contains: new Filter({ id: FilterIds.Contains, label: t('tables', 'Contains'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextLong, ColumnTypes.TextLink, ColumnTypes.TextRich, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual], }), BeginsWith: new Filter({ @@ -68,7 +68,7 @@ export const Filters = { id: FilterIds.IsEqual, label: t('tables', 'Is equal'), shortLabel: '=', - goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti], + goodFor: [ColumnTypes.TextLine, ColumnTypes.Number, ColumnTypes.SelectionCheck, ColumnTypes.TextLink, ColumnTypes.NumberStars, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.Selection, ColumnTypes.SelectionMulti, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.IsEmpty, FilterIds.IsEqual, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.Contains, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual], }), IsGreaterThan: new Filter({ @@ -102,7 +102,7 @@ export const Filters = { IsEmpty: new Filter({ id: FilterIds.IsEmpty, label: t('tables', 'Is empty'), - goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck], + goodFor: [ColumnTypes.TextLine, ColumnTypes.TextRich, ColumnTypes.Number, ColumnTypes.TextLink, ColumnTypes.NumberProgress, ColumnTypes.DatetimeDate, ColumnTypes.DatetimeTime, ColumnTypes.Datetime, ColumnTypes.SelectionCheck, ColumnTypes.Usergroup], incompatibleWith: [FilterIds.Contains, FilterIds.BeginsWith, FilterIds.EndsWith, FilterIds.IsEqual, FilterIds.IsGreaterThan, FilterIds.IsGreaterThanOrEqual, FilterIds.IsLowerThan, FilterIds.IsLowerThanOrEqual, FilterIds.IsEmpty], noSearchValue: true, }), From da0857d36c72759915a3e53bfba5328089ba1b67 Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Wed, 31 Jul 2024 11:22:48 +0100 Subject: [PATCH 9/9] enh: correct spelling Signed-off-by: Cleopatra Enjeck M --- src/modules/modals/CreateColumn.vue | 2 +- src/modules/modals/EditColumn.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/modals/CreateColumn.vue b/src/modules/modals/CreateColumn.vue index a8b62d5e6..69cca3f4d 100644 --- a/src/modules/modals/CreateColumn.vue +++ b/src/modules/modals/CreateColumn.vue @@ -217,7 +217,7 @@ export default { if (this.$options.components && this.$options.components[form]) { return form } else { - throw Error('Form ' + form + ' does no exist') + throw Error('Form ' + form + ' does not exist') } }, type() { diff --git a/src/modules/modals/EditColumn.vue b/src/modules/modals/EditColumn.vue index ba7c97bcf..2a146d66a 100644 --- a/src/modules/modals/EditColumn.vue +++ b/src/modules/modals/EditColumn.vue @@ -133,7 +133,7 @@ export default { if (this.$options.components && this.$options.components[form]) { return form } else { - throw Error('Form ' + form + ' does no exist') + throw Error('Form ' + form + ' does not exist') } }, updateTime() {