Browse Source

Merge pull request #4703 from nocodb/refactor/create-project

refactor(gui): remove dropdown for create project from project list page
pull/4706/head
Raju Udava 2 years ago committed by GitHub
parent
commit
27b69481fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      packages/nc-gui/pages/index/index/index.vue
  2. 19
      tests/playwright/pages/ProjectsPage/index.ts
  3. 2
      tests/playwright/tests/projectOperations.spec.ts

41
packages/nc-gui/pages/index/index/index.vue

@ -174,42 +174,11 @@ const copyProjectMeta = async () => {
<div class="flex-1" />
<a-dropdown v-if="isUIAllowed('projectCreate', true)" :trigger="['click']" overlay-class-name="nc-dropdown-create-project">
<button class="nc-new-project-menu mt-4 md:mt-0">
<span class="flex items-center w-full">
{{ $t('title.newProj') }}
<MdiMenuDown class="menu-icon" />
</span>
</button>
<template #overlay>
<a-menu class="!py-0 rounded">
<a-menu-item>
<div
v-e="['c:project:create:xcdb']"
class="nc-project-menu-item group nc-create-xc-db-project"
@click="navigateTo('/create')"
>
<MdiPlusOutline class="group-hover:text-accent" />
<div>{{ $t('activity.createProject') }}</div>
</div>
</a-menu-item>
<a-menu-item v-if="appInfo.connectToExternalDB">
<div
v-e="['c:project:create:extdb']"
class="nc-project-menu-item group nc-create-external-db-project"
@click="navigateTo('/create-external')"
>
<MdiDatabaseOutline class="group-hover:text-accent" />
<div v-html="$t('activity.createProjectExtended.extDB')" />
</div>
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<button v-if="isUIAllowed('projectCreate', true)" class="nc-new-project-menu mt-4 md:mt-0" @click="navigateTo('/create')">
<span class="flex items-center w-full">
{{ $t('title.newProj') }}
</span>
</button>
</div>
<!--

19
tests/playwright/pages/ProjectsPage/index.ts

@ -17,27 +17,12 @@ export class ProjectsPage extends BasePage {
}
// create project
async createProject({
name = 'sample',
type = 'xcdb',
withoutPrefix,
}: {
name?: string;
type?: string;
withoutPrefix?: boolean;
}) {
async createProject({ name = 'sample', withoutPrefix }: { name?: string; type?: string; withoutPrefix?: boolean }) {
if (!withoutPrefix) name = this.prefixTitle(name);
// Click "New Project" button
await this.get().locator('.nc-new-project-menu').click();
const createProjectMenu = await this.rootPage.locator('.nc-dropdown-create-project');
if (type === 'xcdb') {
await createProjectMenu.locator(`.ant-dropdown-menu-title-content`).nth(0).click();
} else {
await createProjectMenu.locator(`.ant-dropdown-menu-title-content`).nth(1).click();
}
await this.rootPage.locator(`.nc-metadb-project-name`).waitFor();
await this.rootPage.locator(`input.nc-metadb-project-name`).fill(name);

2
tests/playwright/tests/projectOperations.spec.ts

@ -19,7 +19,7 @@ test.describe('Project operations', () => {
test('rename, delete', async () => {
await dashboard.clickHome();
await projectPage.createProject({ name: 'project-1', type: 'xcdb' });
await projectPage.createProject({ name: 'project-1' });
await dashboard.clickHome();
await projectPage.renameProject({
title: 'project-1',

Loading…
Cancel
Save