Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a11y issues in data connections modal and deploy models modal #994

Merged
merged 4 commits into from
Mar 9, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ const DataConnectionExistingField: React.FC<DataConnectionExistingFieldType> = (
</FormGroup>
</StackItem>
<StackItem>
<FormGroup label="Folder path">
<FormGroup fieldId="folder-path" label="Folder path">
<TextInput
id="storage-path"
id="folder-path"
value={data.storage.path}
onChange={(path) => setData('storage', { ...data.storage, path })}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ const DataConnectionSection: React.FC<DataConnectionSectionType> = ({
/>
</StackItem>
<StackItem>
<FormGroup label="Folder path">
<FormGroup fieldId="folder-path" label="Folder path">
<TextInput
id="storage-path"
id="folder-path"
value={data.storage.path}
onChange={(path) => setData('storage', { ...data.storage, path })}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const ManageInferenceServiceModal: React.FC<ManageInferenceServiceModalProps> =
/>
</StackItem>
<StackItem>
<FormGroup label="Model Name" isRequired>
<FormGroup label="Model Name" fieldId="inference-service-name-input" isRequired>
<TextInput
isRequired
id="inference-service-name-input"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const ServingRuntimeTokenInput: React.FC<ServingRuntimeTokenInputProps> = ({
return (
<FormGroup
label="Service account name"
fieldId="service-account-form-name"
helperText="Enter the service account name for which the token will be generated"
helperTextInvalid={token.error}
helperTextInvalidIcon={<ExclamationCircleIcon />}
Expand All @@ -56,9 +57,9 @@ const ServingRuntimeTokenInput: React.FC<ServingRuntimeTokenInputProps> = ({
value={token.name}
isRequired
type="text"
id="simple-form-name-01"
name="simple-form-name-01"
aria-describedby="simple-form-name-01-helper"
id="service-account-form-name"
name="service-account-form-name"
aria-describedby="service-account-form-name-helper"
validated={token.error ? ValidatedOptions.error : ValidatedOptions.default}
onChange={(value) => {
const tokens = data.tokens?.map((item) =>
Expand All @@ -78,6 +79,7 @@ const ServingRuntimeTokenInput: React.FC<ServingRuntimeTokenInputProps> = ({
<SplitItem>
<Button
variant="plain"
aria-label="Remove service account"
icon={<MinusCircleIcon />}
onClick={() => {
setData(
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/projects/components/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const DeleteModal: React.FC<DeleteModalProps> = ({
<StackItem>
<TextInput
id="delete-modal-input"
aria-label="Delete modal input"
value={value}
onChange={(newValue) => setValue(newValue)}
/>
Expand Down
49 changes: 19 additions & 30 deletions frontend/src/pages/projects/screens/projects/EmptyProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,26 @@ import {
Title,
} from '@patternfly/react-core';
import { CubesIcon } from '@patternfly/react-icons';
import { useNavigate } from 'react-router-dom';
import { Link } from 'react-router-dom';
import NewProjectButton from './NewProjectButton';

const EmptyProjects: React.FC = () => {
const navigate = useNavigate();

return (
<EmptyState>
<EmptyStateIcon icon={CubesIcon} />
<Title headingLevel="h2" size="lg">
No data science projects yet.
</Title>
<EmptyStateBody>
To get started, create a data science project or launch a notebook with Jupyter.
</EmptyStateBody>
<NewProjectButton />
<EmptyStateSecondaryActions>
<Button
href="/notebookController"
component="a"
variant="link"
onClick={(e) => {
e.preventDefault();
navigate('/notebookController');
}}
>
Launch Jupyter
</Button>
</EmptyStateSecondaryActions>
</EmptyState>
);
};
const EmptyProjects: React.FC = () => (
<EmptyState>
<EmptyStateIcon icon={CubesIcon} />
<Title headingLevel="h2" size="lg">
No data science projects yet.
</Title>
<EmptyStateBody>
To get started, create a data science project or launch a notebook with Jupyter.
</EmptyStateBody>
<NewProjectButton />
<EmptyStateSecondaryActions>
<Button
variant="link"
component={() => <Link to="/notebookController">Launch Jupyter</Link>}
/>
</EmptyStateSecondaryActions>
</EmptyState>
);

export default EmptyProjects;
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const EnvTypeSelectField: React.FC<EnvTypeSelectFieldProps> = ({
isOpen={open}
onToggle={() => setOpen(!open)}
selections={envVariable.type || ''}
placeholderText="Select one"
aria-label="Select one"
placeholderText="Select environment variable type"
aria-label="Select environment variable type"
onSelect={(e, value) => {
if (typeof value === 'string') {
onUpdate({
Expand Down