From 1aa0fca62091f295dcea27371060d949c97b4034 Mon Sep 17 00:00:00 2001 From: HelaKaraa Date: Tue, 3 Sep 2024 11:34:39 +0200 Subject: [PATCH 1/2] feat #741: update logo lonk to redirect on / instead of /apis feat #741: change title link list --- .../src/components/frontend/MaybeHomePage.tsx | 7 +++-- .../src/components/utils/sidebar/SideBar.tsx | 29 ++++++++++++------- daikoku/javascript/vite.config.ts | 2 ++ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/daikoku/javascript/src/components/frontend/MaybeHomePage.tsx b/daikoku/javascript/src/components/frontend/MaybeHomePage.tsx index 0d7204bbe..a747aef01 100644 --- a/daikoku/javascript/src/components/frontend/MaybeHomePage.tsx +++ b/daikoku/javascript/src/components/frontend/MaybeHomePage.tsx @@ -21,10 +21,11 @@ export const MaybeHomePage = ({ if (message) { toast.success(translate(message)) } - - if (!tenant.homePageVisible || connectedUser?._humanReadableId) { + console.log('homePageVisible', tenant.homePageVisible); + if (tenant.homePageVisible) { + window.location.replace('/_/'); + } else navigate('/apis'); - } else window.location.replace('/_/'); }, []); return null; diff --git a/daikoku/javascript/src/components/utils/sidebar/SideBar.tsx b/daikoku/javascript/src/components/utils/sidebar/SideBar.tsx index 13049fee0..b6600cb6b 100644 --- a/daikoku/javascript/src/components/utils/sidebar/SideBar.tsx +++ b/daikoku/javascript/src/components/utils/sidebar/SideBar.tsx @@ -60,17 +60,24 @@ export const SideBar = () => {
- - {translate('tenant.logo')} - + + {translate("tenant.logo")} + +
+ + + +
{!connectedUser.isGuest && ( <> diff --git a/daikoku/javascript/vite.config.ts b/daikoku/javascript/vite.config.ts index 6e0696c9a..9ac149a48 100644 --- a/daikoku/javascript/vite.config.ts +++ b/daikoku/javascript/vite.config.ts @@ -12,6 +12,8 @@ export default defineConfig({ publicDir: "public", server: { proxy: { + "/_": "http://localhost:9000", + "/cms": "http://localhost:9000", "/api/": "http://localhost:9000", "/account": "http://localhost:9000", "/auth/Local/callback": "http://localhost:9000", From 6260446523c8a3c07d35edbbdf0ea4e79f1e551a Mon Sep 17 00:00:00 2001 From: HelaKaraa Date: Tue, 3 Sep 2024 17:06:21 +0200 Subject: [PATCH 2/2] feat #741: playwright test correction --- daikoku/javascript/src/components/utils/sidebar/SideBar.tsx | 2 +- daikoku/javascript/tests/completeJourney.spec.ts | 4 ++-- daikoku/javascript/tests/connectedUser.spec.ts | 2 +- daikoku/javascript/tests/manageMembers.spec.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/daikoku/javascript/src/components/utils/sidebar/SideBar.tsx b/daikoku/javascript/src/components/utils/sidebar/SideBar.tsx index b6600cb6b..0c608a609 100644 --- a/daikoku/javascript/src/components/utils/sidebar/SideBar.tsx +++ b/daikoku/javascript/src/components/utils/sidebar/SideBar.tsx @@ -7,7 +7,7 @@ import Plus from 'react-feather/dist/icons/plus'; import Search from 'react-feather/dist/icons/search'; import Zap from 'react-feather/dist/icons/zap'; import { Link, useLocation } from 'react-router-dom'; - +import RectangleList from 'react-feather/dist/icons/list'; import { I18nContext } from '../../../contexts/i18n-context'; import { GlobalContext } from '../../../contexts/globalContext'; import * as Services from '../../../services'; diff --git a/daikoku/javascript/tests/completeJourney.spec.ts b/daikoku/javascript/tests/completeJourney.spec.ts index 4d251efcc..34f768528 100644 --- a/daikoku/javascript/tests/completeJourney.spec.ts +++ b/daikoku/javascript/tests/completeJourney.spec.ts @@ -29,7 +29,7 @@ test('test a complete user journey', async ({ page }) => { // FIXME: find the fine selector to check user is connected //create a new team - await page.locator('div:nth-child(3) > .notification-link').first().click(); + await page.locator('div:nth-child(4) > .notification-link').first().click(); await page.getByRole('button', { name: '' }).first().click(); await page.getByLabel('Name').fill('The A team'); await page.getByLabel('Description').fill('the A team'); @@ -39,7 +39,7 @@ test('test a complete user journey', async ({ page }) => { await page.locator('.navbar-panel-background').click(); //create a new API - await page.locator('div:nth-child(3) > .notification-link').first().click(); + await page.locator('div:nth-child(4) > .notification-link').first().click(); await page.locator('span').filter({ hasText: 'API' }).first().click(); await page.locator('div').filter({ hasText: /^The A team$/ }).click(); diff --git a/daikoku/javascript/tests/connectedUser.spec.ts b/daikoku/javascript/tests/connectedUser.spec.ts index cea902ce1..fb7a97cca 100644 --- a/daikoku/javascript/tests/connectedUser.spec.ts +++ b/daikoku/javascript/tests/connectedUser.spec.ts @@ -170,7 +170,7 @@ test('Create & manage API', async ({ page }) => { await page.getByPlaceholder('Password').fill('password'); await page.getByPlaceholder('Password').press('Enter'); //create new API - await page.locator('div:nth-child(3) > .notification-link').first().click(); + await page.locator('div:nth-child(4) > .notification-link').first().click(); await page.locator('span').filter({ hasText: 'API' }).first().click(); await page.locator('#portal-root div').filter({ hasText: /^Testers$/ }).click(); await page.getByRole('button', { name: 'Published' }).click(); diff --git a/daikoku/javascript/tests/manageMembers.spec.ts b/daikoku/javascript/tests/manageMembers.spec.ts index 83bf34aa5..bafd51879 100644 --- a/daikoku/javascript/tests/manageMembers.spec.ts +++ b/daikoku/javascript/tests/manageMembers.spec.ts @@ -23,7 +23,7 @@ test('manage team as admin', async ({ page }) => { await page.getByPlaceholder('Email adress').fill('user@foo.bar'); await page.getByPlaceholder('Password').fill('password'); await page.getByPlaceholder('Password').press('Enter'); - await page.locator('div:nth-child(3) > .notification-link').first().click(); + await page.locator('div:nth-child(4) > .notification-link').first().click(); await page.locator('span.block__entry__link').filter({ hasText: 'Team' }).first().click(); await page.getByLabel('Name').fill('komainu'); await page.getByRole('button', { name: 'Create' }).click();