Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Oct 11, 2023
1 parent a034d58 commit 53ea6d7
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 55 deletions.
6 changes: 3 additions & 3 deletions backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -758,9 +758,9 @@ export type GPUInfo = {

export type AcceleratorInfo = {
configured: boolean;
available: {[key: string]: number};
total: {[key: string]: number};
allocated: {[key: string]: number};
available: { [key: string]: number };
total: { [key: string]: number };
allocated: { [key: string]: number };
};

export type EnvironmentVariable = EitherNotBoth<
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/components/OdhAppCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import React from 'react';
import classNames from 'classnames';
import { Link } from 'react-router-dom';
import { AlertVariant, Button, Card, CardBody, CardFooter, CardHeader, Popover } from '@patternfly/react-core';
import {
AlertVariant,
Button,
Card,
CardBody,
CardFooter,
CardHeader,
Popover,
} from '@patternfly/react-core';
import { Dropdown, DropdownItem, KebabToggle } from '@patternfly/react-core/deprecated';
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
import { OdhApplication } from '~/types';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/OdhDocCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const OdhDocCard: React.FC<OdhDocCardProps> = ({ odhDoc, favorite, updateFavorit
<CardHeader
actions={{
actions: (
<FavoriteButton isFavorite={favorite} onClick={() => updateFavorite(!favorite)} />
<FavoriteButton isFavorite={favorite} onClick={() => updateFavorite(!favorite)} />
),
hasNoOffset: true,
className: undefined,
Expand Down
43 changes: 21 additions & 22 deletions frontend/src/components/OdhExploreCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,36 +56,35 @@ const OdhExploreCard: React.FC<OdhExploreCardProps> = ({
{...(!dashboardConfig.spec.dashboardConfig.disableISVBadges && {
actions: {
actions: (
<Flex
spaceItems={{ default: 'spaceItemsSm' }}
alignItems={{ default: 'alignItemsCenter' }}
direction={{ default: 'column' }}
>
{odhApp.spec.comingSoon && (
<FlexItem className="odh-card__coming-soon">Coming soon</FlexItem>
)}
{!odhApp.spec.comingSoon && odhApp.spec.category && (
<FlexItem className={badgeClasses}>
<OdhExploreCardTypeBadge category={odhApp.spec.category} />
</FlexItem>
)}
{odhApp.spec.beta && (
<FlexItem className="odh-card__partner-badge odh-m-beta">Beta</FlexItem>
)}
</Flex>
<Flex
spaceItems={{ default: 'spaceItemsSm' }}
alignItems={{ default: 'alignItemsCenter' }}
direction={{ default: 'column' }}
>
{odhApp.spec.comingSoon && (
<FlexItem className="odh-card__coming-soon">Coming soon</FlexItem>
)}
{!odhApp.spec.comingSoon && odhApp.spec.category && (
<FlexItem className={badgeClasses}>
<OdhExploreCardTypeBadge category={odhApp.spec.category} />
</FlexItem>
)}
{odhApp.spec.beta && (
<FlexItem className="odh-card__partner-badge odh-m-beta">Beta</FlexItem>
)}
</Flex>
),
hasNoOffset: true,
className: undefined,
},
selectableActions: {
selectableActions: {
// eslint-disable-next-line no-console
selectableActionId: `${odhApp.metadata.name}-selectable-card-id`,
name: `odh-explore-selectable-card`,
variant: "single",
variant: 'single',
isChecked: isSelected,
onChange: () => !disabled && onSelect()
}

onChange: () => !disabled && onSelect(),
},
})}
>
<BrandImage src={odhApp.spec.img} alt={odhApp.spec.displayName} />
Expand Down
12 changes: 8 additions & 4 deletions frontend/src/components/SupportedAppTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ type SupportedAppTitleProps = {
onClick?: () => void;
};

const SupportedAppTitle: React.FC<SupportedAppTitleProps> = ({ odhApp, showProvider = false, onClick }) => {
const SupportedAppTitle: React.FC<SupportedAppTitleProps> = ({
odhApp,
showProvider = false,
onClick,
}) => {
let title = odhApp.spec.displayName;
let icon;

Expand All @@ -35,9 +39,9 @@ const SupportedAppTitle: React.FC<SupportedAppTitleProps> = ({ odhApp, showProvi

return (
<CardTitle>
<Button variant={onClick ? "link" : "plain"} isInline onClick={onClick}>
{title}
</Button>
<Button variant={onClick ? 'link' : 'plain'} isInline onClick={onClick}>
{title}
</Button>
{icon}
{showProvider && odhApp.spec.provider && (
<div>
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/concepts/k8s/NameDescriptionField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ const NameDescriptionField: React.FC<NameDescriptionFieldProps> = ({
{!disableK8sName && (
<FormHelperText>
<HelperText>
<HelperTextItem {...(!isValidK8sName(data.k8sName) && { icon: <ExclamationCircleIcon />, variant: 'error'})}>
<HelperTextItem
{...(!isValidK8sName(data.k8sName) && {
icon: <ExclamationCircleIcon />,
variant: 'error',
})}
>
{`Must consist of lower case alphanumeric characters or '-', and must start and
end with an alphanumeric character`}
</HelperTextItem>
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/pages/modelServing/screens/metrics/MetricsChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,17 @@ const MetricsChart: React.FC<MetricsChartProps> = ({ title, color, metrics, unit
) : (
<EmptyState variant={EmptyStateVariant.lg}>
{metrics.loaded ? (
<EmptyStateHeader titleText={metrics.error ? metrics.error.message : 'No available data'} headingLevel="h4" icon={<EmptyStateIcon icon={CubesIcon} />} />
<EmptyStateHeader
titleText={metrics.error ? metrics.error.message : 'No available data'}
headingLevel="h4"
icon={<EmptyStateIcon icon={CubesIcon} />}
/>
) : (
<EmptyStateHeader titleText="Loading" headingLevel="h4" icon={<EmptyStateIcon icon={Spinner} />} />
<EmptyStateHeader
titleText="Loading"
headingLevel="h4"
icon={<EmptyStateIcon icon={Spinner} />}
/>
)}
</EmptyState>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,20 @@ const DataConnectionFolderPathField: React.FC<DataConnectionFolderPathFieldProps
placeholder="Example, data_folder"
onChange={(e, folderPath: string) => handlePathChange(folderPath)}
/>

</InputGroupItem>
</InputGroup>
<FormHelperText>
<HelperText>
<HelperTextItem
{...(validated === 'error' && { icon: <ExclamationCircleIcon /> })}
variant={validated}
>
{validated === 'error'
? 'The path must not point to a root folder.'
: 'Enter a path to a model or folder. This path cannot point to a root folder.'}
</HelperTextItem>
</HelperText>
</FormHelperText>
<HelperText>
<HelperTextItem
{...(validated === 'error' && { icon: <ExclamationCircleIcon /> })}
variant={validated}
>
{validated === 'error'
? 'The path must not point to a root folder.'
: 'Enter a path to a model or folder. This path cannot point to a root folder.'}
</HelperTextItem>
</HelperText>
</FormHelperText>
</FormGroup>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ const ServingRuntimeTokenInput: React.FC<ServingRuntimeTokenInputProps> = ({
/>
<FormHelperText>
<HelperText>
<HelperTextItem {...(token.error && { icon: <ExclamationCircleIcon />, variant: 'error'})}>
{token.error ? token.error : 'Enter the service account name for which the token will be generated'}
<HelperTextItem
{...(token.error && { icon: <ExclamationCircleIcon />, variant: 'error' })}
>
{token.error
? token.error
: 'Enter the service account name for which the token will be generated'}
</HelperTextItem>
</HelperText>
</FormHelperText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { ProjectSharingRBType } from '~/pages/projects/projectSharing/types';
type ProjectSharingNameInputProps = {
type: ProjectSharingRBType;
value: string;
onChange: (
selection: string,
) => void;
onChange: (selection: string) => void;
onClear: () => void;
placeholderText: string;
typeAhead?: string[];
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/redux/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AlertVariant } from "@patternfly/react-core";
import { AlertVariant } from '@patternfly/react-core';
import * as React from 'react';

export enum Actions {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utilities/useEnableApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { getValidationStatus, postValidateIsv } from '~/services/validateIsvService';
import { addNotification, forceComponentsUpdate } from '~/redux/actions/actions';
import { useAppDispatch } from '~/redux/hooks';
import { Alert, AlertVariant } from "@patternfly/react-core";
import { Alert, AlertVariant } from '@patternfly/react-core';

Check failure on line 5 in frontend/src/utilities/useEnableApplication.tsx

View workflow job for this annotation

GitHub Actions / Tests (18.x)

`@patternfly/react-core` import should occur before import of `~/services/validateIsvService`

Check failure on line 5 in frontend/src/utilities/useEnableApplication.tsx

View workflow job for this annotation

GitHub Actions / Tests (18.x)

'Alert' is defined but never used

export enum EnableApplicationStatus {
INPROGRESS,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utilities/useNotification.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AlertVariant } from "@patternfly/react-core";
import { AlertVariant } from '@patternfly/react-core';
import * as React from 'react';
import { addNotification } from '~/redux/actions/actions';
import { useAppDispatch } from '~/redux/hooks';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utilities/useWatchBuildStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { addNotification } from '~/redux/actions/actions';
import { useAppDispatch } from '~/redux/hooks';
import { useDeepCompareMemoize } from './useDeepCompareMemoize';
import { POLL_INTERVAL } from './const';
import { AppNotification } from "~/redux/types";
import { AppNotification } from '~/redux/types';

Check failure on line 9 in frontend/src/utilities/useWatchBuildStatus.tsx

View workflow job for this annotation

GitHub Actions / Tests (18.x)

`~/redux/types` import should occur before import of `./useDeepCompareMemoize`

Check failure on line 9 in frontend/src/utilities/useWatchBuildStatus.tsx

View workflow job for this annotation

GitHub Actions / Tests (18.x)

'AppNotification' is defined but never used

const runningStatuses = [
BUILD_PHASE.new,
Expand Down

0 comments on commit 53ea6d7

Please sign in to comment.