mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-01 09:46:42 +00:00
* fix(nc-gui): reduce font weight of connection name col cell * fix(nc-gui): show spinner in edit source modal while loading integration * fix(nc-gui): show loading spinner in create source, create/edit connection modal * fix(nc-gui): monor changes * chore(nc-gui): lint * fix(nc-gui): remove extra integration pagemode check condition * fix(nc-gui): update ds test case * feat(nc-gui): add AI integration category * fix: move syncDataType and IntegrationCategoryType enum to noco-sdk * fix(nc-gui): cleanup unused code * fix(nc-gui): integration list modal open issue from create source modal * chore(nc-gui): lint * fix(nc-gui): prevent unnecessarily load integration api calls * fix(nc-gui): handle reset integration data on base change * fix(nc-gui): add missing sync pr changes
54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
import BasePage from '../../Base';
|
|
import { DataSourcePage } from './DataSourcePage';
|
|
|
|
export class SourcePage extends BasePage {
|
|
readonly dataSources: DataSourcePage;
|
|
|
|
constructor(dataSource: DataSourcePage) {
|
|
super(dataSource.rootPage);
|
|
this.dataSources = dataSource;
|
|
}
|
|
|
|
get() {
|
|
return this.dataSources.get();
|
|
}
|
|
|
|
getDsDetailsModal() {
|
|
return this.dataSources.getDsDetailsModal();
|
|
}
|
|
|
|
async openEditWindow({ sourceName }: { sourceName: string }) {
|
|
await this.get().locator('.ds-table-row', { hasText: sourceName }).click();
|
|
await this.getDsDetailsModal().getByTestId('nc-connection-tab').click();
|
|
|
|
await this.getDsDetailsModal().locator('.nc-general-overlay').first().waitFor({ state: 'hidden' });
|
|
}
|
|
|
|
async updateSchemaReadOnly({ sourceName, readOnly }: { sourceName: string; readOnly: boolean }) {
|
|
await this.openEditWindow({ sourceName });
|
|
const switchBtn = this.getDsDetailsModal().getByTestId('nc-allow-meta-write');
|
|
await switchBtn.scrollIntoViewIfNeeded();
|
|
|
|
if ((await switchBtn.getAttribute('aria-checked')) !== (!readOnly).toString()) {
|
|
await switchBtn.click();
|
|
}
|
|
await this.saveConnection();
|
|
}
|
|
|
|
async updateDataReadOnly({ sourceName, readOnly = true }: { sourceName: string; readOnly?: boolean }) {
|
|
await this.openEditWindow({ sourceName });
|
|
const switchBtn = this.getDsDetailsModal().getByTestId('nc-allow-data-write');
|
|
await switchBtn.scrollIntoViewIfNeeded();
|
|
|
|
if ((await switchBtn.getAttribute('aria-checked')) !== (!readOnly).toString()) {
|
|
await switchBtn.click();
|
|
}
|
|
await this.saveConnection();
|
|
}
|
|
|
|
async saveConnection() {
|
|
await this.getDsDetailsModal().locator('.nc-extdb-btn-test-connection').click();
|
|
await this.getDsDetailsModal().locator('.nc-extdb-btn-submit:enabled').click();
|
|
}
|
|
}
|