mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.9 KiB
64 lines
1.9 KiB
2 years ago
|
import { DashboardPage } from '..';
|
||
|
import BasePage from '../../Base';
|
||
|
import { AuditSettingsPage } from './Audit';
|
||
|
import { SettingsErdPage } from './Erd';
|
||
|
import { MetaDataPage } from './Metadata';
|
||
|
import { AppStoreSettingsPage } from './AppStore';
|
||
|
import { MiscSettingsPage } from './Miscellaneous';
|
||
|
import { TeamsPage } from './Teams';
|
||
|
import { AclPage } from './Acl';
|
||
2 years ago
|
|
||
2 years ago
|
export enum SettingTab {
|
||
2 years ago
|
TeamAuth = 'teamAndAuth',
|
||
|
AppStore = 'appStore',
|
||
|
ProjectMetadata = 'projMetaData',
|
||
|
Audit = 'audit',
|
||
2 years ago
|
}
|
||
|
|
||
|
export enum SettingsSubTab {
|
||
2 years ago
|
ERD = 'erd',
|
||
|
Miscellaneous = 'misc',
|
||
|
ACL = 'acl',
|
||
2 years ago
|
}
|
||
2 years ago
|
|
||
2 years ago
|
export class SettingsPage extends BasePage {
|
||
|
private readonly dashboard: DashboardPage;
|
||
2 years ago
|
readonly audit: AuditSettingsPage;
|
||
2 years ago
|
readonly appStore: AppStoreSettingsPage;
|
||
2 years ago
|
readonly metaData: MetaDataPage;
|
||
2 years ago
|
readonly miscellaneous: MiscSettingsPage;
|
||
|
readonly erd: SettingsErdPage;
|
||
2 years ago
|
readonly teams: TeamsPage;
|
||
|
readonly acl: AclPage;
|
||
2 years ago
|
|
||
2 years ago
|
constructor(dashboard: DashboardPage) {
|
||
|
super(dashboard.rootPage);
|
||
|
this.dashboard = dashboard;
|
||
2 years ago
|
this.audit = new AuditSettingsPage(this);
|
||
2 years ago
|
this.appStore = new AppStoreSettingsPage(this);
|
||
2 years ago
|
this.metaData = new MetaDataPage(this);
|
||
2 years ago
|
this.miscellaneous = new MiscSettingsPage(this);
|
||
|
this.erd = new SettingsErdPage(this);
|
||
2 years ago
|
this.teams = new TeamsPage(this);
|
||
|
this.acl = new AclPage(this);
|
||
2 years ago
|
}
|
||
|
|
||
|
get() {
|
||
2 years ago
|
return this.rootPage.locator('.nc-modal-settings');
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async selectTab({ tab, subTab }: { tab: SettingTab; subTab?: SettingsSubTab }) {
|
||
2 years ago
|
await this.get().locator(`li[data-menu-id="${tab}"]`).click();
|
||
2 years ago
|
if (subTab) await this.get().locator(`li[data-menu-id="${subTab}"]`).click();
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async selectSubTab({ subTab }: { subTab: SettingsSubTab }) {
|
||
2 years ago
|
await this.get().locator(`li[data-menu-id="${subTab}"]`).click();
|
||
2 years ago
|
}
|
||
|
|
||
|
async close() {
|
||
2 years ago
|
await this.get().locator('[data-testid="settings-modal-close-button"]').click();
|
||
2 years ago
|
await this.get().waitFor({ state: 'hidden' });
|
||
2 years ago
|
}
|
||
2 years ago
|
}
|