Skip to content

Commit

Permalink
Merge branch 'master' into underline
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinovega authored Sep 12, 2024
2 parents e273619 + 2f89057 commit 80aff9d
Show file tree
Hide file tree
Showing 17 changed files with 183 additions and 194 deletions.
2 changes: 1 addition & 1 deletion daikoku/javascript/src/apps/DaikokuApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const DaikokuApp = () => {
<ModalProvider>
<div className="d-flex flex-row">
<SideBar />
<div className="wrapper flex-grow-1">
<div className="wrapper flex-grow-1 container-fluid">
<Routes>
<Route
path='/error'
Expand Down
2 changes: 1 addition & 1 deletion daikoku/javascript/src/apps/DaikokuHomeApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export const ResetPassword = () => {
constraints.required(translate('constraints.required.confirmPassword')),
constraints.oneOf(
[constraints.ref('password')],
translate('constraint.oneof.confirm.password')
translate('constraints.oneof.confirm.password')
),
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,50 +264,52 @@ export const TeamList = () => {

return (<Can I={manage} a={TENANT} dispatchError>
<div className="row">
<div className="d-flex justify-content-between align-items-center">
<h1>
<Translation i18nkey="Teams">Teams</Translation>
</h1>
<div className="col-5">
<input
placeholder={translate('Find a team')}
className="form-control"
onChange={(e) => {
debouncedResults(e)
}} />
<div className="col">
<div className="d-flex justify-content-between align-items-center">
<h1>
<Translation i18nkey="Teams">Teams</Translation>
</h1>
<div className="col-5">
<input
placeholder={translate('Find a team')}
className="form-control"
onChange={(e) => {
debouncedResults(e)
}} />
</div>
</div>
</div>
{!dataRequest.isLoading && !dataRequest.isError && dataRequest.data &&
<div className="d-flex flex-wrap section">{
dataRequest.data.teams.map((team) => {
return (
<AvatarWithAction key={team._id} avatar={team.avatar} infos={<>
<span className=" section team__name text-truncate">{team.name}</span>
</>} actions={actions(team)} />)
})}
<div className="avatar-with-action new-team-button">
<div className="container">
<div className="avatar__container"
title={translate('Create a new team')}
onClick={createNewTeam}><Plus /></div>
{!dataRequest.isLoading && !dataRequest.isError && dataRequest.data &&
<div className="d-flex flex-wrap section">{
dataRequest.data.teams.map((team) => {
return (
<AvatarWithAction key={team._id} avatar={team.avatar} infos={<>
<span className=" section team__name text-truncate">{team.name}</span>
</>} actions={actions(team)} />)
})}
<div className="avatar-with-action new-team-button">
<div className="container">
<div className="avatar__container"
title={translate('Create a new team')}
onClick={createNewTeam}><Plus /></div>
</div>
</div>
</div>
<div className="apis__pagination d-flex justify-content-center align-items-center" style={{ width: '100%' }}>
<Pagination
previousLabel={translate('Previous')}
nextLabel={translate('Next')}
breakLabel={'...'}
breakClassName={'break'}
pageCount={Math.ceil(dataRequest.data.total / limit)}
marginPagesDisplayed={1}
pageRangeDisplayed={5}
onPageChange={(data) => handlePageClick(data)}
containerClassName={'pagination'}
pageClassName={'page-selector'}
forcePage={page}
activeClassName={'active'} />
</div>
</div>}
<div className="apis__pagination d-flex justify-content-center align-items-center" style={{ width: '100%' }}>
<Pagination
previousLabel={translate('Previous')}
nextLabel={translate('Next')}
breakLabel={'...'}
breakClassName={'break'}
pageCount={Math.ceil(dataRequest.data.total / limit)}
marginPagesDisplayed={1}
pageRangeDisplayed={5}
onPageChange={(data) => handlePageClick(data)}
containerClassName={'pagination'}
pageClassName={'page-selector'}
forcePage={page}
activeClassName={'active'} />
</div>
</div>}
</div>
</div>
</Can>);
};
Expand Down
4 changes: 2 additions & 2 deletions daikoku/javascript/src/components/backoffice/me/MyProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export const MyProfile = () => {
constraints.required(translate('constraints.required.newPassword')),
constraints.matches(
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[#$^+=!*()@%&]).{8,1000}$/,
translate('constraint.matches.password')
translate('constraints.matches.password')
),
],
},
Expand All @@ -449,7 +449,7 @@ export const MyProfile = () => {
constraints.required(translate('constraints.required.newPassword')),
constraints.oneOf(
[constraints.ref('newPassword')],
translate('constraint.oneof.confirm.password')
translate('constraints.oneof.confirm.password')
),
],
},
Expand Down
2 changes: 1 addition & 1 deletion daikoku/javascript/src/components/frontend/api/ApiCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const ApiCard = (props: {
<span className="flex-grow-1 api-description my-2">{api.smallDescription}</span>
{props.teamVisible && team && (
<small
className="cursor-pointer underline-on-hover a-fake d-flex align-items-baseline justify-content-end"
className="cursor-pointer underline-on-hover a-fake d-flex align-items-center justify-content-end"
onClick={() => props.handleTeamSelect(team)}
>
<img alt="avatar" src={team.avatar} style={{ marginRight: 5, width: 20 }} />
Expand Down
28 changes: 13 additions & 15 deletions daikoku/javascript/src/components/frontend/team/MyHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,19 @@ export const MyHome = () => {
return (
<main role="main">
<section className="organisation__header col-12 mb-4 p-3">
<div className="container">
<div className="row text-center">
<div className="col-sm-4">
<img
className="organisation__avatar"
src={tenant.logo ? tenant.logo : '/assets/images/daikoku.svg'}
alt="avatar"
/>
</div>
<div className="col-sm-7 d-flex flex-column justify-content-center">
<h1 className="jumbotron-heading">
{tenant.title ? tenant.title : translate('Your APIs center')}
</h1>
<Description description={tenant.description} />
</div>
<div className="row text-center">
<div className="col-sm-4">
<img
className="organisation__avatar"
src={tenant.logo ? tenant.logo : '/assets/images/daikoku.svg'}
alt="avatar"
/>
</div>
<div className="col-sm-7 d-flex flex-column justify-content-center">
<h1 className="jumbotron-heading">
{tenant.title ? tenant.title : translate('Your APIs center')}
</h1>
<Description description={tenant.description} />
</div>
</div>
</section>
Expand Down
8 changes: 4 additions & 4 deletions daikoku/javascript/src/components/utils/sidebar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ export const SideBar = () => {
<div className="navbar_top d-flex flex-column align-items-center">
<a
href={'/'}
title="Daikoku home"
aria-label="Go home"
title={translate("Daikoku.home")}
aria-label={translate("Daikoku.home")}
className="mb-3 brand"
>
<img src={tenant.logo} alt={translate("tenant.logo")} />
</a>
<div className="nav_item mb-3 cursor-pointer">
<Link
to="/apis"
title="list apis"
aria-label="Access to list apis"
title={translate("API.list")}
aria-label={translate("API.list")}
className="mb-3 brand"
>
<RectangleList />
Expand Down
16 changes: 9 additions & 7 deletions daikoku/javascript/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"filter.preview.tag": "tagged",
"filter.preview.team": "produced by",
"clear filter": "clear filter",
"Search your API...": "Search your API...",
"Search your API...": "Search your API",
"Previous": "Previous",
"Next": "Next",
"All": "All",
Expand Down Expand Up @@ -1276,9 +1276,9 @@
"select.team.placeholder": "Select a team",
"otoroshi.missing.entities": "Missing Otoroshi entities",
"otoroshi.missing.target": "Missing Otoroshi target",
"apiList.tag.search": "Search a tag",
"apiList.category.search": "Search a category",
"apiList.team.search": "Search a team",
"apiList.tag.search": "By tag",
"apiList.category.search": "By category",
"apiList.team.search": "By team",
"team.email.verification.send": "Mail sent to %s for verify this email address.",
"team.email.alreadyVerified": "This mail is already verified",
"team.email.notVerified": "Send a mail",
Expand Down Expand Up @@ -1306,8 +1306,8 @@
"authorized.groups": "Services groups",
"authorized.services": "Services",
"authorized.routes": "Routes",
"login.placeholder": "Email adress",
"login.label": "Email adress",
"login.placeholder": "Email address",
"login.label": "Email address",
"password.label": "Password",
"login.btn.label": "Login",
"api_documentation_modal.import.title": "Choose a documentation page to import from another version of this API.",
Expand Down Expand Up @@ -1440,5 +1440,7 @@
"apikeys.delete.confirm.label": "To confirm the deletion, please enter the exact name of the subscription: %s",
"apikeys.delete.success.message": "The subscription has been successfully deleted",
"apikeys.view.api": "View API",
"apikeys.view.apikeys": "View APIkeys"
"apikeys.view.apikeys": "View APIkeys",
"Daikoku.home" : "Daikoku home",
"API.list" : "APIs list"
}
10 changes: 6 additions & 4 deletions daikoku/javascript/src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1276,9 +1276,9 @@
"select.team.placeholder": "Sélectionner une équipe",
"otoroshi.missing.entities": "Entités Otoroshi manquantes",
"otoroshi.missing.target": "Cible Otoroshi manquante",
"apiList.tag.search": "Recherchez un tag",
"apiList.category.search": "Recherchez une catégorie",
"apiList.team.search": "Recherchez une équipe",
"apiList.tag.search": "Par tag",
"apiList.category.search": "Par catégorie",
"apiList.team.search": "Par équipe",
"team.email.verification.send": "Mail envoyé à %s pour vérifier cette adresse email.",
"team.email.alreadyVerified": "Cet email est déjà vérifié",
"team.email.notVerified": "Envoyer un mail",
Expand Down Expand Up @@ -1440,5 +1440,7 @@
"apikeys.delete.confirm.label": "Pour confirmer la suppression, veuillez saisir le nom exact de la souscription : %s",
"apikeys.delete.success.message": "La souscription a été correctement supprimée",
"apikeys.view.api": "Voir l'API",
"apikeys.view.apikeys": "Voir les clés d'API"
"apikeys.view.apikeys": "Voir les clés d'API",
"Daikoku.home" : "Accueil Daikoku",
"API.list" : "Liste des APIs"
}
8 changes: 4 additions & 4 deletions daikoku/javascript/tests/anonymousUser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('[public tenant] - external user can join a team', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'admin-api-tenant-default' })).toBeHidden();
await expect(page.getByRole('heading', { name: 'test API' })).toBeVisible();
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByPlaceholder('Password').press('Enter');
await page.getByText('Consumers').click();
Expand Down Expand Up @@ -58,7 +58,7 @@ test('[public tenant] - external user can join a team', async ({ page }) => {
await page.getByText('Validate your Evil Corp.').first().click();
await page.getByRole('link', { name: 'Confirm' }).click();
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('Pa$$w0rd');
await page.getByRole('button', { name: 'Login' }).click();
await expect(page.getByRole('heading', { name: 'public with permissions API' })).toBeVisible();
Expand Down Expand Up @@ -195,7 +195,7 @@ test('[public tenant] - external user can signup', async ({ page }) => {
await page.getByRole('link', { name: 'Confirm' }).click();
await page.locator('h1.jumbotron-heading').filter({ hasText: 'Evil Corp.' }).waitFor({ state: 'visible' })
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('Pa$$w0rd');
await page.getByRole('button', { name: 'Login' }).click();
await page.waitForResponse(response => response.url().includes('/auth/Local/callback') && response.status() === 303)
Expand Down Expand Up @@ -302,7 +302,7 @@ test('[public tenant] - unlogged user can accept subscription demand', async ({
// await expect(page.getByRole('alert')).toContainText('Thank you for your response');
// await page.getByRole('link', { name: 'Go back' }).click();
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByPlaceholder('Password').press('Enter');
await page.getByText('Consumers').click();
Expand Down
2 changes: 1 addition & 1 deletion daikoku/javascript/tests/completeJourney.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('test a complete user journey', async ({ page }) => {
//connection
await page.goto(`http://localhost:${exposedPort}/apis`);
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByRole('button', { name: 'Login' }).click();
await page.waitForResponse(response => response.url().includes('/auth/Local/callback') && response.status() === 303)
Expand Down
12 changes: 6 additions & 6 deletions daikoku/javascript/tests/connectedUser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ test('Create & manage API', async ({ page }) => {
//connection with admin
await page.goto(`http://localhost:${exposedPort}/apis`);
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByPlaceholder('Password').press('Enter');
//create new API
Expand Down Expand Up @@ -371,7 +371,7 @@ test('aggregation mode', async ({ page, request }) => {
//login
await page.goto(`http://localhost:${exposedPort}/apis`);
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByRole('button', { name: 'Login' }).click();

Expand Down Expand Up @@ -451,7 +451,7 @@ test('do search', async ({ page, request }) => {
//login
await page.goto(`http://localhost:${exposedPort}/apis`);
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByPlaceholder('Password').press('Enter');
await page.waitForResponse(r => r.url().includes('/api/me/context') && r.status() === 200)
Expand Down Expand Up @@ -486,7 +486,7 @@ test('do search', async ({ page, request }) => {
test('API admin can transfer his own API ownership', async ({ page }) => {
await page.goto(`http://localhost:${exposedPort}/apis`);
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByRole('button', { name: 'Login' }).click();
await page.getByRole('heading', { name: 'test API' }).click();
Expand Down Expand Up @@ -530,7 +530,7 @@ test('Filter API List', async ({ page, request }) => {

await page.goto(`http://localhost:${exposedPort}/apis`);
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByRole('button', { name: 'Login' }).click();
await page.waitForResponse(r => r.url().includes('/api/me/context') && r.status() === 200)
Expand Down Expand Up @@ -558,7 +558,7 @@ test('Filter API List', async ({ page, request }) => {
await page.getByRole('option', { name: 'external' }).click();
await expect(page.locator('.preview')).toContainText('1 result categorized in external');
await page.getByText('clear filter').click();
await page.getByPlaceholder('Search your API...').fill('test');
await page.getByPlaceholder('Search your API').fill('test');
await expect(page.locator('.preview')).toContainText('2 results matching test');
await page.locator('.reactSelect__indicator').first().click();
await page.getByRole('option', { name: 'Testers' }).click();
Expand Down
2 changes: 1 addition & 1 deletion daikoku/javascript/tests/envMode.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test('aggregation security works', async ({ page, request }) => {
//login
await page.goto(`http://localhost:${exposedPort}/apis`);
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByRole('button', { name: 'Login' }).click();

Expand Down
4 changes: 2 additions & 2 deletions daikoku/javascript/tests/manageMembers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.beforeAll(async () => {
test('manage team as admin', async ({ page }) => {
await page.goto(`http://localhost:${exposedPort}/apis`);
await page.getByRole('img', { name: 'user menu' }).click();
await page.getByPlaceholder('Email adress').fill('[email protected]');
await page.getByPlaceholder('Email address').fill('[email protected]');
await page.getByPlaceholder('Password').fill('password');
await page.getByPlaceholder('Password').press('Enter');
await page.locator('div:nth-child(4) > .notification-link').first().click();
Expand Down Expand Up @@ -56,7 +56,7 @@ test('manage team as admin', async ({ page }) => {
// test('join a team as daikoku user', async ({ page }) => {
// await page.goto('http://localhost:9000/apis');
// await page.getByRole('img', { name: 'user menu' }).click();
// await page.getByPlaceholder('Email adress').fill('[email protected]');
// await page.getByPlaceholder('Email address').fill('[email protected]');
// await page.getByPlaceholder('Password').fill('password');
// await page.getByPlaceholder('Password').press('Enter');
// await page.waitForResponse(r => r.url().includes('/api/me/context') && r.status() === 200)
Expand Down
Loading

0 comments on commit 80aff9d

Please sign in to comment.