diff --git a/packages/nc-gui/components/cell/Duration.vue b/packages/nc-gui/components/cell/Duration.vue index fae891769f..fe3e85fadc 100644 --- a/packages/nc-gui/components/cell/Duration.vue +++ b/packages/nc-gui/components/cell/Duration.vue @@ -13,9 +13,10 @@ import { interface Props { modelValue: number | string | null | undefined + showValidationError: boolean } -const { modelValue } = defineProps() +const { modelValue, showValidationError = true } = defineProps() const emit = defineEmits(['update:modelValue']) @@ -99,7 +100,7 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() {{ localState }} -
+
Please enter a number
diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index af4d465b20..6fce902953 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -28,9 +28,10 @@ import MdiCloseCircle from '~icons/mdi/close-circle' interface Props { modelValue?: string | string[] rowIndex?: number + disableOptionCreation?: boolean } -const { modelValue } = defineProps() +const { modelValue, disableOptionCreation } = defineProps() const emit = defineEmits(['update:modelValue']) @@ -317,7 +318,13 @@ const onTagClick = (e: Event, onClose: Function) => { diff --git a/packages/nc-gui/components/cell/SingleSelect.vue b/packages/nc-gui/components/cell/SingleSelect.vue index 149e9764c9..ed206e8eef 100644 --- a/packages/nc-gui/components/cell/SingleSelect.vue +++ b/packages/nc-gui/components/cell/SingleSelect.vue @@ -14,6 +14,7 @@ import { extractSdkResponseErrorMsg, inject, ref, + useEventListener, useRoles, useSelectedCellKeyupListener, watch, @@ -22,9 +23,10 @@ import { interface Props { modelValue?: string | undefined rowIndex?: number + disableOptionCreation?: boolean } -const { modelValue } = defineProps() +const { modelValue, disableOptionCreation } = defineProps() const emit = defineEmits(['update:modelValue']) @@ -189,6 +191,14 @@ const toggleMenu = (e: Event) => { } isOpen.value = editAllowed.value && !isOpen.value } + +const handleClose = (e: MouseEvent) => { + if (aselect.value && !aselect.value.$el.contains(e.target)) { + isOpen.value = false + } +} + +useEventListener(document, 'click', handleClose) diff --git a/packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue b/packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue new file mode 100644 index 0000000000..f12b28fed8 --- /dev/null +++ b/packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue @@ -0,0 +1,186 @@ + + + diff --git a/tests/playwright/pages/Dashboard/WebhookForm/index.ts b/tests/playwright/pages/Dashboard/WebhookForm/index.ts index 7eff8ebcea..6fdc6e0602 100644 --- a/tests/playwright/pages/Dashboard/WebhookForm/index.ts +++ b/tests/playwright/pages/Dashboard/WebhookForm/index.ts @@ -87,7 +87,7 @@ export class WebhookFormPage extends BasePage { await this.rootPage.waitForTimeout(1500); if (operator != 'is null' && operator != 'is not null') { - await modal.locator('input.nc-filter-value-select').fill(value); + await modal.locator('.nc-filter-value-select > input').fill(value); } if (save) { diff --git a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts index 82953a7124..bb7389c033 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts @@ -65,7 +65,6 @@ export class SelectOptionCellPageObject extends BasePage { await this.get({ index, columnHeader }).click(); await this.rootPage.locator('.ant-select-single > .ant-select-clear').click(); - await this.cell.get({ index, columnHeader }).click(); await this.rootPage.locator(`.nc-dropdown-single-select-cell`).waitFor({ state: 'hidden' }); } diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts b/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts index 2b8f4ea71b..7e1b839969 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts +++ b/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts @@ -18,7 +18,7 @@ export class ToolbarFilterPage extends BasePage { await expect(this.get().locator('.nc-filter-field-select').nth(index)).toHaveText(column); await expect(this.get().locator('.nc-filter-operation-select').nth(index)).toHaveText(operator); await expect - .poll(async () => await this.get().locator('input.nc-filter-value-select').nth(index).inputValue()) + .poll(async () => await this.get().locator('.nc-filter-value-select > input').nth(index).inputValue()) .toBe(value); } @@ -71,7 +71,7 @@ export class ToolbarFilterPage extends BasePage { // if value field was provided, fill it if (value) { - const fillFilter = this.rootPage.locator('.nc-filter-value-select').last().fill(value); + const fillFilter = this.rootPage.locator('.nc-filter-value-select > input').last().fill(value); await this.waitForResponse({ uiAction: fillFilter, httpMethodsToMatch: ['GET'],