Skip to content

Commit 4baa3a8

Browse files
authored
fix: remove link (#163)
1 parent c395ff3 commit 4baa3a8

14 files changed

Lines changed: 52 additions & 125 deletions

File tree

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public-hoist-pattern[]=eslint-plugin-*
2+
public-hoist-pattern[]=@typescript-eslint/*
3+
public-hoist-pattern[]=eslint-config-*
4+
public-hoist-pattern[]=eslint-import-resolver-*

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"build": "sdk build",
1313
"start": "sdk watch",
1414
"deploy": "sdk deploy",
15+
"sdkInstall": "sdk install",
1516
"prepare": "is-ci || husky",
1617
"type-check": "tsc --noEmit",
1718
"type-check:watch": "pnpm run type-check -- --watch",

src/app.jsx renamed to src/app.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ import { TwoFactorAuthModal } from './components/two-factor-auth-modal';
1515

1616
const LazyAuth = lazy(() => import(/* webpackChunkName: "settings-view" */ './settings/auth-view'));
1717

18-
const Auth = (props) => (
18+
const Auth = (): React.JSX.Element => (
1919
<Suspense
2020
fallback={
2121
<Container>
2222
<Spinner color={'primary'} />
2323
</Container>
2424
}
2525
>
26-
<LazyAuth {...props} />
26+
<LazyAuth />
2727
</Suspense>
2828
);
2929

30-
export default function App() {
30+
export default function App(): React.JSX.Element {
3131
const navigate = useNavigate();
3232

3333
useEffect(() => {
@@ -41,7 +41,7 @@ export default function App() {
4141
id: 'carbonio-auth-ui',
4242
label: capitalize(t('changePassword.title', 'Change password')),
4343
icon: 'LockOutline',
44-
execute: () => navigate(`/settings/auth?section=changepassword`, { replace: true }),
44+
execute: (): void => navigate(`/settings/auth?section=changepassword`, { replace: true }),
4545
disabled: false,
4646
group: 'carbonio-auth-ui',
4747
primary: true

src/components/test/two-factor-auth-modal.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import React from 'react';
77

88
import { act, fireEvent, screen, waitFor } from '@testing-library/react';
9-
import fetchMock from '../../test/fetchMock';
109

10+
import fetchMock from '../../test/fetchMock';
1111
import { customRender } from '../../test/test-utils';
1212
import { TwoFactorAuthModal } from '../two-factor-auth-modal';
1313

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import React from 'react';
88

9-
export function EmptyState() {
9+
export function EmptyState(): React.JSX.Element {
1010
return (
1111
<svg
1212
width="286"

src/settings/assets/icons/powered-by-zextras.jsx renamed to src/settings/assets/icons/powered-by-zextras.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import React from 'react';
88

9-
export function PoweredByZextras() {
9+
export function PoweredByZextras(): React.JSX.Element {
1010
return (
1111
<svg
1212
width="128"

src/settings/auth-view.tsx

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66

77
import React, { useCallback, useEffect, useMemo, useState } from 'react';
88

9+
import styled from '@emotion/styled';
910
import { Container, Divider, Link, Padding, Row, Text } from '@zextras/carbonio-design-system';
1011
import { t, useUserSettings } from '@zextras/carbonio-shell-ui';
1112
import { compact, orderBy } from 'lodash';
13+
import { Trans } from 'react-i18next';
1214

1315
import { AuthOutline } from './assets/icons/auth-outline';
1416
import { AppMobile } from './components/operations/app-mobile';
@@ -17,17 +19,20 @@ import { ExchangeActiveSync } from './components/operations/exchange-active-sync
1719
import { OTPAuthentication } from './components/operations/otp-authentication';
1820
import { RecoveryPassword } from './components/operations/recovery-password';
1921
import { ResetPassword } from './components/operations/reset-password';
20-
import { ColumnFull, ColumnLeft, ColumnRight, Shell } from './components/shared/shell';
2122
import { SidebarNavigation } from './components/shared/sidebar-navigation';
2223
import { checkSupportedZextras } from './network/checkSupportedZextras';
2324
import { fetchSoap } from './network/fetchSoap';
2425
import { Password, Tab } from './types';
2526

27+
const ColumnRight = styled(Row)`
28+
width: ${({ theme, width }): string => `calc(${width} - ${theme.sizes.padding.large})`};
29+
`;
30+
2631
function Instruction({
2732
instruction,
2833
link
2934
}: Readonly<{
30-
instruction: string;
35+
instruction: React.ReactNode;
3136
link?: string;
3237
}>): React.JSX.Element {
3338
return (
@@ -74,8 +79,14 @@ function useAuthTabs(): {
7479
name: 'changepassword',
7580
label: t('changePassword.title', 'Change Password'),
7681
view: ChangePassword,
77-
instruction: t('instruction.changePassword', 'Here you can change your password.'),
78-
link: 'https://docs.zextras.com/suite/html/auth.html#auth-change-pass'
82+
instruction: (
83+
<Trans
84+
t={t}
85+
i18nKey="instruction.changePassword"
86+
components={{ br: <br /> }}
87+
defaults="Here you can change your password.<br>For more information, contact your administrator."
88+
/>
89+
)
7990
};
8091

8192
const resetPasswordItem = {
@@ -140,15 +151,6 @@ function useAuthTabs(): {
140151
link: 'https://docs.zextras.com/suite/html/auth.html#create-new-credentials-mobile-apps'
141152
},
142153
otpAuthenticationItem
143-
/* section is hidden cause not officially supported yet
144-
ref: AUTH-543
145-
{
146-
name: 'desktop',
147-
label: t('appDesktop.title', 'Desktop Apps'),
148-
view: AppDesktop,
149-
instruction: t('instruction.desktop', 'Here you can manage Desktop App password.'),
150-
link: 'https://docs.zextras.com/suite/html/auth.html#create-new-credentials-mobile-apps'
151-
}, */
152154
]);
153155

154156
return { links, linksWithoutZextras, otpAuthenticationItem };
@@ -250,34 +252,46 @@ export default function App(): React.JSX.Element {
250252
}, [checkHasZextras]);
251253

252254
const occupyFull = useMemo(() => window.innerWidth <= 1800, []);
255+
253256
return (
254-
<Shell>
257+
<Container
258+
orientation="horizontal"
259+
mainAlignment="flex-start"
260+
crossAlignment="flex-start"
261+
height="100%"
262+
background="gray5"
263+
padding={{ all: 'large' }}
264+
>
255265
<SideBar
256266
activeTab={activeTab}
257267
setActiveTab={setActiveTab}
258268
hasZextras={hasZextras}
259269
links={links}
260270
linksWithoutZextras={linksWithoutZextras}
261271
/>
262-
<ColumnFull data-testid="active-panel" mainAlignment="space-between" takeAvailableSpace>
263-
<ColumnLeft
272+
<Row
273+
width="100%"
274+
height="100%"
275+
data-testid="active-panel"
276+
mainAlignment="space-between"
277+
takeAvailableSpace
278+
>
279+
<Row
280+
height="100%"
264281
width={`${occupyFull ? '100%' : 'calc(60% - 6.25rem)'} `}
265282
mainAlignment="flex-start"
266283
crossAlignment="flex-start"
267284
>
268285
{activeTab && <ActiveTab activeTab={activeTab} />}
269-
</ColumnLeft>
286+
</Row>
270287
{!occupyFull && (
271-
<ColumnRight width="calc(40% + 6.25rem)">
288+
<ColumnRight width="calc(40% + 6.25rem)" height="100%">
272289
{activeTab?.instruction && (
273-
<Instruction
274-
instruction={activeTab && activeTab.instruction}
275-
link={activeTab && activeTab.link}
276-
/>
290+
<Instruction instruction={activeTab?.instruction} link={activeTab?.link} />
277291
)}
278292
</ColumnRight>
279293
)}
280-
</ColumnFull>
281-
</Shell>
294+
</Row>
295+
</Container>
282296
);
283297
}
File renamed without changes.

src/settings/components/shared/shell.jsx

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

0 commit comments

Comments
 (0)