Skip to content

Commit 7f455c6

Browse files
feat: change logo (#292)
Co-authored-by: Łukasz Goral <[email protected]>
1 parent d809e0b commit 7f455c6

File tree

10 files changed

+141
-86
lines changed

10 files changed

+141
-86
lines changed

public/co-logo-orchestrating.png

-143 KB
Binary file not shown.

public/locales/en.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"Login": {
3-
"welcomeMessage": "Welcome to openMCP UI",
4-
"description": "Your place to manage your openMCPs, see your installed components and managed resources!",
5-
"learnMore": "Learn more in our documentation",
6-
"signInButton": "Sign in"
2+
"SignInPage": {
3+
"welcomeMessage": "Welcome to ManagedControlPlane UI",
4+
"subtitle": "Your central hub to orchestrate control planes, components, and managed resources",
5+
"learnMoreLink": "Learn about ManagedControlPlanes",
6+
"signInButton": "Sign In"
77
},
88
"Entities": {
99
"ManagedControlPlane": "ManagedControlPlane",

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useAuthOnboarding } from './spaces/onboarding/auth/AuthContextOnboardin
33
import '@ui5/webcomponents-icons/dist/AllIcons.d.ts';
44
import { useEffect } from 'react';
55
import { useFrontendConfig } from './context/FrontendConfigContext.tsx';
6-
import LoginView from './views/Login.tsx';
6+
import { SignInPage } from './spaces/onboarding/pages/SignInPage/SignInPage.tsx';
77
import { BusyIndicator } from '@ui5/webcomponents-react';
88
import * as Sentry from '@sentry/react';
99

@@ -22,7 +22,7 @@ function App() {
2222
}
2323

2424
if (!auth.isAuthenticated) {
25-
return <LoginView />;
25+
return <SignInPage />;
2626
}
2727

2828
Sentry.setUser({
55.1 KB
Loading
59.7 KB
Loading
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { SignInPage } from './SignInPage.tsx';
2+
import { useAuthOnboarding } from '../../auth/AuthContextOnboarding.tsx';
3+
import { useLink } from '../../../../lib/shared/useLink.ts'; // if useLink relies on router
4+
5+
describe('SignInPage', () => {
6+
let logInCalled = false;
7+
const fakeUseAuthOnboarding = (() => ({
8+
login: () => {
9+
logInCalled = true;
10+
},
11+
})) as typeof useAuthOnboarding;
12+
13+
beforeEach(() => {
14+
logInCalled = false;
15+
});
16+
17+
it('renders the SignInPage', () => {
18+
cy.mount(<SignInPage useAuthOnboarding={fakeUseAuthOnboarding} />);
19+
20+
cy.get('ui5-title').should('exist');
21+
});
22+
23+
it('calls the login function when the user clicks the "Sign In" button', () => {
24+
cy.mount(<SignInPage useAuthOnboarding={fakeUseAuthOnboarding} />);
25+
26+
cy.wrap(null).then(() => {
27+
expect(logInCalled).to.equal(false);
28+
});
29+
30+
cy.get('ui5-button').eq(0).should('contain', 'Sign In').click();
31+
32+
cy.wrap(null).then(() => {
33+
expect(logInCalled).to.equal(true);
34+
});
35+
});
36+
37+
it('contains a link to the documentation', () => {
38+
const fakeUseLink = (() => ({
39+
documentationHomepage: 'https://link-to-documentation.com',
40+
})) as typeof useLink;
41+
42+
cy.mount(<SignInPage useAuthOnboarding={fakeUseAuthOnboarding} useLink={fakeUseLink} />);
43+
44+
cy.get('a')
45+
.should('have.attr', 'target', '_blank')
46+
.and('have.attr', 'rel', 'noreferrer')
47+
.and('have.attr', 'href', 'https://link-to-documentation.com');
48+
});
49+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.container {
2+
height: 100vh;
3+
}
4+
5+
.cardContent {
6+
padding: 2rem 3rem;
7+
}
8+
9+
.heading {
10+
margin-bottom: 0.75rem;
11+
}
12+
13+
.description {
14+
font-size: 1.25em;
15+
}
16+
17+
.logo {
18+
width: 240px;
19+
height: 290px;
20+
margin: 3rem;
21+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { useEffect } from 'react';
2+
import { useTranslation } from 'react-i18next';
3+
import * as Sentry from '@sentry/react';
4+
5+
import { Button, Card, FlexBox, Text, Title } from '@ui5/webcomponents-react';
6+
import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
7+
8+
import { useAuthOnboarding as _useAuthOnboarding } from '../../auth/AuthContextOnboarding';
9+
import { useLink as _useLink } from '../../../../lib/shared/useLink';
10+
import { useTheme } from '../../../../hooks/useTheme';
11+
12+
import LogoLight from '../../../../assets/images/co-logo-orchestrating.png';
13+
import LogoDark from '../../../../assets/images/co-logo-orchestrating-dark.png';
14+
15+
import styles from './SignInPage.module.css';
16+
17+
export interface SignInPageProps {
18+
useAuthOnboarding?: typeof _useAuthOnboarding;
19+
useLink?: typeof _useLink;
20+
}
21+
export function SignInPage({ useAuthOnboarding = _useAuthOnboarding, useLink = _useLink }: SignInPageProps) {
22+
const { login } = useAuthOnboarding();
23+
const { documentationHomepage } = useLink();
24+
const { t } = useTranslation();
25+
const { isDarkTheme } = useTheme();
26+
27+
useEffect(() => {
28+
Sentry.addBreadcrumb({
29+
category: 'auth',
30+
message: 'Visit SignInPage',
31+
level: 'info',
32+
});
33+
}, []);
34+
return (
35+
<FlexBox className={styles.container} justifyContent="Center" alignItems="Center" direction="Column">
36+
<FlexBox direction="Column" gap="1em">
37+
<Card>
38+
<FlexBox alignItems="Center" direction="Column" className={styles.cardContent}>
39+
<Title level="H1" size="H2" className={styles.heading}>
40+
{t('SignInPage.welcomeMessage')}
41+
</Title>
42+
43+
<Text className={styles.description}> {t('SignInPage.subtitle')}</Text>
44+
45+
<img className={styles.logo} src={isDarkTheme ? LogoDark : LogoLight} alt="" />
46+
47+
<FlexBox direction="Column" alignItems="Center" gap="1em">
48+
<Button design={ButtonDesign.Emphasized} onClick={() => void login()}>
49+
{t('SignInPage.signInButton')}
50+
</Button>
51+
</FlexBox>
52+
</FlexBox>
53+
</Card>
54+
<FlexBox justifyContent="End">
55+
<a href={documentationHomepage} target="_blank" rel="noreferrer">
56+
<Button tabIndex={-1} design="Transparent">
57+
{t('SignInPage.learnMoreLink')}
58+
</Button>
59+
</a>
60+
</FlexBox>
61+
</FlexBox>
62+
</FlexBox>
63+
);
64+
}

src/views/Login.tsx

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/views/login.css

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)