Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/ControlPlane/MCPHealthPopoverButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ function StatusTable({
);
}

export function getIconForOverallStatus(
status: ReadyStatus | undefined,
): JSX.Element {
function getIconForOverallStatus(status: ReadyStatus | undefined): JSX.Element {
switch (status) {
case ReadyStatus.Ready:
return <Icon style={{ color: 'green' }} name="sap-icon://sys-enter" />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '@ui5/webcomponents-icons/dist/delete';
import Loading from '../../Shared/Loading.tsx';
import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
import { ControlPlaneListWorkspaceGridTile } from './ControlPlaneListWorkspaceGridTile.tsx';
import useApiResource from '../../../lib/api/useApiResource.ts';
import { useApiResource } from '../../../lib/api/useApiResource.ts';
import { ListWorkspaces } from '../../../lib/api/types/crate/listWorkspaces.ts';
import { useFrontendConfig } from '../../../context/FrontendConfigContext.tsx';
import { useTranslation } from 'react-i18next';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import {
DeleteWorkspaceResource,
DeleteWorkspaceType,
} from '../../../lib/api/types/crate/deleteWorkspace.ts';
import useApiResource, {
import {
useApiResourceMutation,
useApiResource,
} from '../../../lib/api/useApiResource.ts';
import { DISPLAY_NAME_ANNOTATION } from '../../../lib/api/types/shared/keyNames.ts';
import { DeleteConfirmationDialog } from '../../Dialogs/DeleteConfirmationDialog.tsx';
Expand Down Expand Up @@ -64,7 +65,7 @@ export function ControlPlaneListWorkspaceGridTile({

function createErrorView(error: APIError) {
if (error) {
if (error.status == 403) {
if (error.status === 403) {
return (
<IllustratedError
title={t(
Expand Down
15 changes: 1 addition & 14 deletions src/components/ControlPlanes/List/MembersAvatarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PopoverPlacement from '@ui5/webcomponents/dist/types/PopoverPlacement.js'
import { useRef, useState } from 'react';
import { MemberTable } from '../../Members/MemberTable.tsx';
import { Member } from '../../../lib/api/types/shared/members';
import { generateInitialsForEmail } from '../../Helper/GenerateInitialsForEmail.ts';

interface Props {
project?: string;
Expand Down Expand Up @@ -53,17 +54,3 @@ export function MembersAvatarView({ members, project, workspace }: Props) {
</div>
);
}

export function generateInitialsForEmail(email: string | undefined): string {
if (!email) {
return '';
}
const [name, _] = email.split('@');
const nameParts = name.split('.');
// return the first letter of each part of the name up to 3 characters
return nameParts
.map((part) => part[0])
.join('')
.substring(0, 3)
.toUpperCase();
}
2 changes: 1 addition & 1 deletion src/components/Core/ShellBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
ShellBarDomRef,
Ui5CustomEvent,
} from '@ui5/webcomponents-react';
import { generateInitialsForEmail } from '../ControlPlanes/List/MembersAvatarView.tsx';
import { useAuth } from 'react-oidc-context';
import { RefObject, useRef, useState } from 'react';
import { ShellBarProfileClickEventDetail } from '@ui5/webcomponents-fiori/dist/ShellBar.js';
import PopoverPlacement from '@ui5/webcomponents/dist/types/PopoverPlacement.js';
import { useTranslation } from 'react-i18next';
import { generateInitialsForEmail } from '../Helper/GenerateInitialsForEmail';

export function ShellBarComponent() {
const auth = useAuth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export const KubectlDeleteWorkspace = ({
/>
</>
);
};
};
4 changes: 2 additions & 2 deletions src/components/Dialogs/KubectlCommandInfo/KubectlTerminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export const KubectlTerminal = ({ command }: KubeCtlTerminalProps) => {

return (
<>
<span>echo '</span>
<span>echo &apos;</span>
<div style={{ marginLeft: '16px' }}>{yamlLines}</div>
<span>'</span> | <span>{kubectlPart}</span>
<span>&apos;</span> | <span>{kubectlPart}</span>
</>
);
}
Expand Down
13 changes: 13 additions & 0 deletions src/components/Helper/GenerateInitialsForEmail.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export function generateInitialsForEmail(email: string | undefined): string {
if (!email) {
return '';
}
const [name, _] = email.split('@');
const nameParts = name.split('.');
// return the first letter of each part of the name up to 3 characters
return nameParts
.map((part) => part[0])
.join('')
.substring(0, 3)
.toUpperCase();
}
2 changes: 1 addition & 1 deletion src/components/Shared/ConfiguredAnalyticsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function ConfiguredAnalyticsTable(props: Props) {
scaleWidthMode={AnalyticalTableScaleWidthMode.Smart}
loading={props.isLoading}
filterable
style={{margin: "12px"}}
style={{ margin: '12px' }}
/>
);
}
10 changes: 5 additions & 5 deletions src/context/FrontendConfigContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ interface FrontendConfigContextProps {
links: DocLinkCreator;
}

export const FrontendConfigContext = createContext<FrontendConfigContextProps | null>(
null,
);

export const FrontendConfigContext =
createContext<FrontendConfigContextProps | null>(null);

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

interface FrontendConfigProviderProps {
children: ReactNode;
}

export function FrontendConfigProvider({ children }: FrontendConfigProviderProps) {
export function FrontendConfigProvider({
children,
}: FrontendConfigProviderProps) {
const config = use(fetchPromise);
const docLinks = new DocLinkCreator(config.documentationBaseUrl);
const value: FrontendConfigContextProps = {
Expand Down
4 changes: 2 additions & 2 deletions src/types/__generated__/graphql/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ export const extractWorkspaceNameFromNamespace = (namespace: string) => {
export const projectnameToNamespace = (projectname: string) => {
return `project-${projectname}`;
};

4 changes: 2 additions & 2 deletions src/utils/testing.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { DocLinkCreator } from '../lib/shared/links.ts';
import { Landscape } from '../context/FrontendConfigContext.tsx';

export const isInTestingMode: Boolean = !!window.Cypress;
export const isInTestingMode: boolean = !!window.Cypress;
const documentationBaseUrl = 'http://localhost:3000';
export const mockedFrontendConfig = {
backendUrl: 'http://localhost:3000',
landscape: Landscape.Local,
documentationBaseUrl: 'http://localhost:3000',
links: new DocLinkCreator(documentationBaseUrl),
};
};
Loading