Browse Source

fix: PR review changes #2334

pull/7664/head
Ramesh Mane 9 months ago
parent
commit
902f332b19
  1. 8
      packages/nc-gui/components/general/FormBanner.vue
  2. 17
      tests/playwright/pages/Dashboard/Form/index.ts
  3. 13
      tests/playwright/tests/db/views/viewForm.spec.ts

8
packages/nc-gui/components/general/FormBanner.vue

@ -8,11 +8,11 @@ const { bannerImageUrl } = defineProps<Props>()
<template>
<div
class="w-full max-w-screen-xl mx-auto bg-white border-1 border-gray-200 rounded-3xl overflow-hidden"
:style="{
...(bannerImageUrl
:style="
bannerImageUrl
? { 'background-image': `url(${bannerImageUrl})`, 'background-size': 'cover', 'background-position': 'center' }
: {}),
}"
: {}
"
>
<!-- Todo: aspect ratio and cover image uploader and image cropper to crop image in fixed aspect ratio -->
<div v-if="!bannerImageUrl" class="h-full flex items-stretch justify-between">

17
tests/playwright/pages/Dashboard/Form/index.ts

@ -54,22 +54,10 @@ export class FormPage extends BasePage {
return this.dashboard.get().locator('[data-testid="nc-form-wrapper-submit"]');
}
// getFormHiddenColumn() {
// return this.get().locator('[data-testid="nc-form-hidden-column"]');
// }
getFormFields() {
return this.get().locator('[data-testid="nc-form-fields"]');
}
// getDragNDropToHide() {
// return this.get().locator('[data-testid="nc-drag-n-drop-to-hide"]');
// }
//
// getFormFieldsRemoveIcon() {
// return this.get().locator('[data-testid="nc-field-remove-icon"]');
// }
getFormFieldsRequired() {
return this.get().locator('[data-testid="nc-form-input-required"] + button');
}
@ -126,9 +114,6 @@ export class FormPage extends BasePage {
const dst = this.get().locator(`[data-testid="nc-drag-n-drop-to-hide"]`);
await src.dragTo(dst);
} else if (mode === 'hideField') {
// const src = this.get().locator(`.nc-form-drag-${field.replace(' ', '')}`);
// await src.locator(`[data-testid="nc-field-remove-icon"]`).click();
// in form-v2, hide field will be using right sidebar
await this.formFields.locator(`[data-testid="nc-form-field-item-${field}"]`).locator('.nc-switch').click();
}
@ -146,8 +131,6 @@ export class FormPage extends BasePage {
await src.dragTo(dst, { trial: true });
await src.dragTo(dst);
} else if (mode === 'clickField') {
// const src = this.get().locator(`[data-testid="nc-form-hidden-column-${field}"]`);
// await src.click();
await this.formFields.locator(`[data-testid="nc-form-field-item-${field}"]`).locator('.nc-switch').click();
}
}

13
tests/playwright/tests/db/views/viewForm.spec.ts

@ -49,19 +49,6 @@ test.describe('Form view', () => {
fields: ['LastUpdate', 'Country', 'Cities'],
});
// drag-drop feature to remove a field will not be supported in form v2
// remove & verify (drag-drop)
// await form.removeField({ field: 'Cities', mode: 'dragDrop' });
// await form.verifyFormViewFieldsOrder({
// fields: ['LastUpdate', 'Country'],
// });
// add & verify (drag-drop)
// await form.addField({ field: 'Cities', mode: 'dragDrop' });
// await form.verifyFormViewFieldsOrder({
// fields: ['LastUpdate', 'Country', 'Cities'],
// });
// remove & verify (hide field button)
await form.removeField({ field: 'Cities', mode: 'hideField' });
await form.verifyFormViewFieldsOrder({

Loading…
Cancel
Save