Skip to content

Commit 3681d17

Browse files
Linting issues fix part one (#80)
1 parent 66ab9a6 commit 3681d17

File tree

13 files changed

+33
-35
lines changed

13 files changed

+33
-35
lines changed

src/components/ControlPlane/MCPHealthPopoverButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ function StatusTable({
101101
);
102102
}
103103

104-
export function getIconForOverallStatus(
105-
status: ReadyStatus | undefined,
106-
): JSX.Element {
104+
function getIconForOverallStatus(status: ReadyStatus | undefined): JSX.Element {
107105
switch (status) {
108106
case ReadyStatus.Ready:
109107
return <Icon style={{ color: 'green' }} name="sap-icon://sys-enter" />;

src/components/ControlPlanes/List/ControlPlaneListAllWorkspaces.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import '@ui5/webcomponents-icons/dist/delete';
66
import Loading from '../../Shared/Loading.tsx';
77
import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
88
import { ControlPlaneListWorkspaceGridTile } from './ControlPlaneListWorkspaceGridTile.tsx';
9-
import useApiResource from '../../../lib/api/useApiResource.ts';
9+
import { useApiResource } from '../../../lib/api/useApiResource.ts';
1010
import { ListWorkspaces } from '../../../lib/api/types/crate/listWorkspaces.ts';
1111
import { useFrontendConfig } from '../../../context/FrontendConfigContext.tsx';
1212
import { useTranslation } from 'react-i18next';

src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ import {
2222
DeleteWorkspaceResource,
2323
DeleteWorkspaceType,
2424
} from '../../../lib/api/types/crate/deleteWorkspace.ts';
25-
import useApiResource, {
25+
import {
2626
useApiResourceMutation,
27+
useApiResource,
2728
} from '../../../lib/api/useApiResource.ts';
2829
import { DISPLAY_NAME_ANNOTATION } from '../../../lib/api/types/shared/keyNames.ts';
2930
import { DeleteConfirmationDialog } from '../../Dialogs/DeleteConfirmationDialog.tsx';
@@ -64,7 +65,7 @@ export function ControlPlaneListWorkspaceGridTile({
6465

6566
function createErrorView(error: APIError) {
6667
if (error) {
67-
if (error.status == 403) {
68+
if (error.status === 403) {
6869
return (
6970
<IllustratedError
7071
title={t(

src/components/ControlPlanes/List/MembersAvatarView.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import PopoverPlacement from '@ui5/webcomponents/dist/types/PopoverPlacement.js'
44
import { useRef, useState } from 'react';
55
import { MemberTable } from '../../Members/MemberTable.tsx';
66
import { Member } from '../../../lib/api/types/shared/members';
7+
import { generateInitialsForEmail } from '../../Helper/GenerateInitialsForEmail.ts';
78

89
interface Props {
910
project?: string;
@@ -53,17 +54,3 @@ export function MembersAvatarView({ members, project, workspace }: Props) {
5354
</div>
5455
);
5556
}
56-
57-
export function generateInitialsForEmail(email: string | undefined): string {
58-
if (!email) {
59-
return '';
60-
}
61-
const [name, _] = email.split('@');
62-
const nameParts = name.split('.');
63-
// return the first letter of each part of the name up to 3 characters
64-
return nameParts
65-
.map((part) => part[0])
66-
.join('')
67-
.substring(0, 3)
68-
.toUpperCase();
69-
}

src/components/Core/ShellBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import {
88
ShellBarDomRef,
99
Ui5CustomEvent,
1010
} from '@ui5/webcomponents-react';
11-
import { generateInitialsForEmail } from '../ControlPlanes/List/MembersAvatarView.tsx';
1211
import { useAuth } from 'react-oidc-context';
1312
import { RefObject, useRef, useState } from 'react';
1413
import { ShellBarProfileClickEventDetail } from '@ui5/webcomponents-fiori/dist/ShellBar.js';
1514
import PopoverPlacement from '@ui5/webcomponents/dist/types/PopoverPlacement.js';
1615
import { useTranslation } from 'react-i18next';
16+
import { generateInitialsForEmail } from '../Helper/GenerateInitialsForEmail';
1717

1818
export function ShellBarComponent() {
1919
const auth = useAuth();

src/components/Dialogs/KubectlCommandInfo/Controllers/KubectlDeleteWorkspace.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ export const KubectlDeleteWorkspace = ({
2727
/>
2828
</>
2929
);
30-
};
30+
};

src/components/Dialogs/KubectlCommandInfo/KubectlTerminal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ export const KubectlTerminal = ({ command }: KubeCtlTerminalProps) => {
3838

3939
return (
4040
<>
41-
<span>echo '</span>
41+
<span>echo &apos;</span>
4242
<div style={{ marginLeft: '16px' }}>{yamlLines}</div>
43-
<span>'</span> | <span>{kubectlPart}</span>
43+
<span>&apos;</span> | <span>{kubectlPart}</span>
4444
</>
4545
);
4646
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export function generateInitialsForEmail(email: string | undefined): string {
2+
if (!email) {
3+
return '';
4+
}
5+
const [name, _] = email.split('@');
6+
const nameParts = name.split('.');
7+
// return the first letter of each part of the name up to 3 characters
8+
return nameParts
9+
.map((part) => part[0])
10+
.join('')
11+
.substring(0, 3)
12+
.toUpperCase();
13+
}

src/components/Shared/ConfiguredAnalyticsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function ConfiguredAnalyticsTable(props: Props) {
2323
scaleWidthMode={AnalyticalTableScaleWidthMode.Smart}
2424
loading={props.isLoading}
2525
filterable
26-
style={{margin: "12px"}}
26+
style={{ margin: '12px' }}
2727
/>
2828
);
2929
}

src/context/FrontendConfigContext.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ interface FrontendConfigContextProps {
1717
links: DocLinkCreator;
1818
}
1919

20-
export const FrontendConfigContext = createContext<FrontendConfigContextProps | null>(
21-
null,
22-
);
23-
20+
export const FrontendConfigContext =
21+
createContext<FrontendConfigContextProps | null>(null);
2422

2523
const fetchPromise = fetch('/frontend-config.json').then((res) => res.json());
2624

2725
interface FrontendConfigProviderProps {
2826
children: ReactNode;
2927
}
3028

31-
export function FrontendConfigProvider({ children }: FrontendConfigProviderProps) {
29+
export function FrontendConfigProvider({
30+
children,
31+
}: FrontendConfigProviderProps) {
3232
const config = use(fetchPromise);
3333
const docLinks = new DocLinkCreator(config.documentationBaseUrl);
3434
const value: FrontendConfigContextProps = {

0 commit comments

Comments
 (0)