8000 Execution environment form fixups by himdel · Pull Request #4457 · ansible/ansible-hub-ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Execution environment form fixups #4457

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

Merged
merged 4 commits into from
Oct 31, 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
3 changes: 1 addition & 2 deletions src/components/approval/approval-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
ButtonVariant,
DropdownItem,
Label,
LabelGroup,
Spinner,
} from '@patternfly/react-core';
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
Expand All @@ -14,7 +13,7 @@ import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/excl
import React from 'react';
import { Link } from 'react-router-dom';
import { CollectionAPI, CollectionVersionSearch } from 'src/api';
import { DateComponent, ListItemActions } from 'src/components';
import { DateComponent, LabelGroup, ListItemActions } from 'src/components';
import { IAppContextType } from 'src/loaders/app-context';
import { Paths, formatPath } from 'src/paths';

Expand Down
10 changes: 3 additions & 7 deletions src/components/collection-list/collection-list-item.tsx
8000
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Flex,
FlexItem,
Label,
LabelGroup,
Text,
TextContent,
TextVariants,
Expand All @@ -20,16 +19,13 @@ import {
CollectionRatings,
DateComponent,
DeprecatedTag,
LabelGroup,
Logo,
Tag,
} from 'src/components';
import { useContext } from 'src/loaders/app-context';
import { Paths, formatPath } from 'src/paths';
import {
chipGroupProps,
convertContentSummaryCounts,
namespaceTitle,
} from 'src/utilities';
import { convertContentSummaryCounts, namespaceTitle } from 'src/utilities';
import { SignatureBadge } from '../signing';
import './list-item.scss';

Expand Down Expand Up @@ -122,7 +118,7 @@ export const CollectionListItem = ({
))}
</div>
<div className='hub-entry pf-l-flex pf-m-wrap'>
<LabelGroup {...chipGroupProps()}>
<LabelGroup>
{collection_version.tags.map((tag, index) => (
<Tag key={index}>{tag.name}</Tag>
))}
Expand Down
19 changes: 5 additions & 14 deletions src/components/execution-environment/repository-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
FormGroup,
InputGroup,
Label,
LabelGroup,
Modal,
Spinner,
TextArea,
Expand All @@ -23,12 +22,12 @@ import {
AlertList,
AlertType,
HelperText,
LabelGroup,
closeAlertMixin,
} from 'src/components';
import {
ErrorMessagesType,
alertErrorsWithoutFields,
chipGroupProps,
errorMessage,
isFieldValid,
isFormValid,
Expand Down Expand Up @@ -292,11 +291,7 @@ export class RepositoryForm extends React.Component<IProps, IState> {
fieldId='currentTag'
label={t`Currently included tags`}
>
<LabelGroup
{...chipGroupProps()}
id='remove-tag'
defaultIsOpen={true}
>
<LabelGroup id='remove-tag' defaultIsOpen={true}>
{includeTags.map((tag) => (
<Label
icon={<TagIcon />}
Expand Down Expand Up @@ -339,11 +334,7 @@ export class RepositoryForm extends React.Component<IProps, IState> {
fieldId='currentTag'
label={t`Currently excluded tags`}
>
<LabelGroup
{...chipGroupProps()}
id='remove-tag'
defaultIsOpen={true}
>
<LabelGroup id='remove-tag' defaultIsOpen={true}>
{excludeTags.map((tag) => (
<Label
icon={<TagIcon />}
Expand Down Expand Up @@ -388,7 +379,7 @@ export class RepositoryForm extends React.Component<IProps, IState> {
this.setState({ formErrors: { ...this.state.formErrors, name: null } });
return;
} else {
const error = t`Container names can only contain alphanumeric characters, ".", "_", "-" and a up to one "/".`;
const error = t`Container names can only contain alphanumeric characters, ".", "_", "-" and zero or one "/".`;
this.setState({ formErrors: { ...this.state.formErrors, name: error } });
}
}
Expand Down Expand Up @@ -420,7 +411,7 @@ export class RepositoryForm extends React.Component<IProps, IState> {

private addTags(tags, key: 'includeTags' | 'excludeTags') {
const current = new Set(this.state[key]);
tags.split(/\s+|\s*,\s*/).forEach((tag) => current.add(tag));
tags.split(/\s+|\s*,\s*/).forEach((tag) => tag && current.add(tag));

this.setState({
[key]: Array.from(current.values()),
Expand Down
11 changes: 3 additions & 8 deletions src/components/execution-environment/tag-manifest-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
FormGroup,
InputGroup,
Label,
LabelGroup,
Modal,
Spinner,
TextInput,
Expand All @@ -22,8 +21,8 @@ import {
PulpStatus,
TaskAPI,
} from 'src/api';
import { AlertType } from 'src/components';
import { chipGroupProps, parsePulpIDFromURL } from 'src/utilities';
import { AlertType, LabelGroup } from 'src/components';
import { parsePulpIDFromURL } from 'src/utilities';

interface IState {
tagsToAdd: string[];
Expand Down Expand Up @@ -188,11 +187,7 @@ export class TagManifestModal extends React.Component<IProps, IState> {
)}

<FormGroup fieldId='remove-tag' label={t`Current tags`}>
<LabelGroup
{...chipGroupProps()}
id='remove-tag'
defaultIsOpen={true}
>
<LabelGroup id='remove-tag' defaultIsOpen={true}>
{this.getCurrentTags().map((tag) => (
<Label
disabled={isSaving}
Expand Down
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export {
} from './patternfly-wrappers/compound-filter';
export { CopyURL } from './patternfly-wrappers/copy-url';
export { FileUpload } from './patternfly-wrappers/fileupload';
export { LabelGroup } from './patternfly-wrappers/label-group';
export { LinkTabs } from './patternfly-wrappers/link-tabs';
export { LoginForm } from './patternfly-wrappers/login-form';
export { Main } from './patternfly-wrappers/main';
Expand Down
6 changes: 3 additions & 3 deletions src/components/legacy-role-list/legacy-role-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import {
DataListItem,
DataListItemCells,
DataListItemRow,
LabelGroup,
} from '@patternfly/react-core';
import React from 'react';
import { Link } from 'react-router-dom';
import { LegacyRoleDetailType } from 'src/api';
import {
DateComponent,
DownloadCount,
LabelGroup,
Logo,
ProviderLink,
RoleRatings,
Tag,
} from 'src/components';
import { Paths, formatPath } from 'src/paths';
import { chipGroupProps, getProviderInfo } from 'src/utilities';
import { getProviderInfo } from 'src/utilities';
import './legacy-role-item.scss';

interface LegacyRoleProps {
Expand Down Expand Up @@ -69,7 +69,7 @@ export function LegacyRoleListItem({ role, show_thumbnail }: LegacyRoleProps) {
</div>
<div className='hub-entry'>{description}</div>
<div className='hub-entry'>
<LabelGroup {...chipGroupProps()}>
<LabelGroup>
{tags.map((tag, index) => (
<Tag key={index}>{tag}</Tag>
))}
Expand Down
Loading
0