Browse Source

Merge pull request #7398 from nocodb/nc-fix/filter-bugs

Nc fix/filter bugs
pull/7401/head
Raju Udava 11 months ago committed by GitHub
parent
commit
43847d5e03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue
  2. 32
      tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

8
packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue

@ -70,7 +70,7 @@ provide(EditModeInj, readonly(editEnabled))
provide(ReadonlyInj, ref(false)) provide(ReadonlyInj, ref(false))
const checkTypeFunctions = { const checkTypeFunctions: Record<string, (column: ColumnType, abstractType?: string) => boolean> = {
isSingleSelect, isSingleSelect,
isMultiSelect, isMultiSelect,
isDate, isDate,
@ -106,7 +106,7 @@ const checkType = (filterType: FilterType) => {
return false return false
} }
return checkTypeFunction(column.value, abstractType) return checkTypeFunction(column.value, abstractType.value)
} }
const filterInput = computed({ const filterInput = computed({
@ -224,7 +224,7 @@ provide(IsFormInj, ref(true))
/> />
<div <div
v-else v-else
class="bg-white border-1 flex flex-grow min-h-4 h-full items-center nc-filter-input-wrapper !rounded-lg" class="bg-white border-1 flex flex-grow min-h-4 h-full px-1 items-center nc-filter-input-wrapper !rounded-lg"
:class="{ 'px-2': hasExtraPadding, 'border-brand-500': isInputBoxOnFocus }" :class="{ 'px-2': hasExtraPadding, 'border-brand-500': isInputBoxOnFocus }"
@mouseup.stop @mouseup.stop
> >
@ -234,7 +234,7 @@ provide(IsFormInj, ref(true))
:disabled="filter.readOnly" :disabled="filter.readOnly"
placeholder="Enter a value" placeholder="Enter a value"
:column="column" :column="column"
class="flex" class="flex !rounded-lg"
v-bind="componentProps" v-bind="componentProps"
location="filter" location="filter"
@focus="isInputBoxOnFocus = true" @focus="isInputBoxOnFocus = true"

32
tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

@ -288,14 +288,7 @@ export class ToolbarFilterPage extends BasePage {
.click(); .click();
break; break;
case UITypes.MultiSelect: case UITypes.MultiSelect:
await this.get() await this.get().locator('.nc-filter-value-select').locator('.ant-select-arrow').click({ force: true });
.locator('.nc-filter-value-select')
.click({
position: {
x: 1,
y: 1,
},
});
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const v = value.split(','); const v = value.split(',');
for (let i = 0; i < v.length; i++) { for (let i = 0; i < v.length; i++) {
@ -306,14 +299,12 @@ export class ToolbarFilterPage extends BasePage {
} }
break; break;
case UITypes.SingleSelect: case UITypes.SingleSelect:
await this.get() // for single select field, the drop select arrow is visible only for some operations
.locator('.nc-filter-value-select') if ((await this.get().locator('.nc-filter-value-select').locator('.ant-select-arrow').count()) > 0) {
.click({ await this.get().locator('.nc-filter-value-select').locator('.ant-select-arrow').click({ force: true });
position: { } else {
x: 1, await this.get().locator('.nc-filter-value-select').click({ force: true });
y: 1, }
},
});
// check if value was an array // check if value was an array
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const val = value.split(','); const val = value.split(',');
@ -333,14 +324,7 @@ export class ToolbarFilterPage extends BasePage {
break; break;
case UITypes.User: case UITypes.User:
if (!['is blank', 'is not blank'].includes(operation)) { if (!['is blank', 'is not blank'].includes(operation)) {
await this.get() await this.get().locator('.nc-filter-value-select').locator('.ant-select-arrow').click({ force: true });
.locator('.nc-filter-value-select')
.click({
position: {
x: 1,
y: 1,
},
});
const v = value.split(','); const v = value.split(',');
for (let i = 0; i < v.length; i++) { for (let i = 0; i < v.length; i++) {

Loading…
Cancel
Save