Skip to content

Commit

Permalink
Remove deprecated synclist, including 2.4 synclist deprecation notice
Browse files Browse the repository at this point in the history
No-Issue
  • Loading branch information
himdel committed Apr 29, 2024
1 parent f0fb683 commit 12b8dff
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 123 deletions.
2 changes: 0 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export { LegacyNamespaceAPI } from './legacy-namespace';
export { LegacyRoleAPI } from './legacy-role';
export { LegacySyncAPI } from './legacy-sync';
export { MyNamespaceAPI } from './my-namespace';
export { MySyncListAPI } from './my-synclist';
export { NamespaceAPI } from './namespace';
export { PulpAPI } from './pulp';
export { AnsibleRemoteType } from './response-types/ansible-remote';
Expand Down Expand Up @@ -73,7 +72,6 @@ export { PulpStatus } from './response-types/pulp';
export { RemoteType } from './response-types/remote';
export { GroupRoleType, RoleType } from './response-types/role';
export { SettingsType } from './response-types/settings';
export { SyncListType } from './response-types/synclists';
export { TaskType } from './response-types/task';
export {
GroupType,
Expand Down
11 changes: 0 additions & 11 deletions src/api/my-synclist.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/api/response-types/synclists.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/components/collection-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Button,
Card,
CardBody,
CardFooter,
CardHeader,
Text,
TextContent,
Expand All @@ -25,7 +24,6 @@ import { convertContentSummaryCounts, namespaceTitle } from 'src/utilities';

interface IProps extends CollectionVersionSearch {
displaySignatures: boolean;
footer?: ReactNode;
menu?: ReactNode;
}

Expand Down Expand Up @@ -61,7 +59,6 @@ export const CollectionCard = ({
is_signed,
displaySignatures,
menu,
footer,
}: IProps) => {
const nsTitle = namespaceTitle(
namespace || { name: collection_version.namespace },
Expand Down Expand Up @@ -134,7 +131,6 @@ export const CollectionCard = ({
renderTypeCount(k, contentSummary.contents[k]),
)}
</CardBody>
{footer && <CardFooter>{footer}</CardFooter>}
</Card>
);
};
Expand Down
3 changes: 0 additions & 3 deletions src/components/collection-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ interface IProps {
displaySignatures: boolean;
dropdownMenu?: ReactNode | null;
showNamespace?: boolean;
synclistSwitch?: ReactNode | null;
uploadButton?: ReactNode | null;
}

Expand All @@ -48,7 +47,6 @@ export const CollectionListItem = ({
displaySignatures,
dropdownMenu,
showNamespace,
synclistSwitch,
uploadButton,
}: IProps) => {
const cells = [];
Expand Down Expand Up @@ -135,7 +133,6 @@ export const CollectionListItem = ({
direction={{ default: 'column' }}
alignItems={{ default: 'alignItemsFlexStart' }}
>
{synclistSwitch && <FlexItem>{synclistSwitch}</FlexItem>}
{uploadButton || dropdownMenu ? (
<FlexItem>
{uploadButton}
Expand Down
1 change: 0 additions & 1 deletion src/components/collection-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { ParamHelper } from 'src/utilities';
interface IProps {
collectionControls: (collection) => {
dropdownMenu?: ReactNode | null;
synclistSwitch?: ReactNode | null;
uploadButton?: ReactNode | null;
};
collections: CollectionVersionSearch[];
Expand Down
4 changes: 0 additions & 4 deletions src/containers/search/search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
margin-top: -17px;
margin-bottom: -17px;
}

.sync-toggle {
margin-right: 10px;
}
}

.empty {
Expand Down
80 changes: 2 additions & 78 deletions src/containers/search/search.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { t } from '@lingui/macro';
import { Button, DataList, Switch } from '@patternfly/react-core';
import React, { Component, type ReactNode } from 'react';
import { Button, DataList } from '@patternfly/react-core';
import React, { Component } from 'react';
import { Navigate } from 'react-router-dom';
import {
CollectionAPI,
CollectionVersionAPI,
type CollectionVersionSearch,
MyNamespaceAPI,
MySyncListAPI,
type SyncListType,
} from 'src/api';
import {
AlertList,
Expand Down Expand Up @@ -55,7 +53,6 @@ interface IState {
namespace?: string;
};
loading: boolean;
synclist: SyncListType;
alerts: AlertType[];
updateCollection: CollectionVersionSearch;
showImportModal: boolean;
Expand Down Expand Up @@ -99,7 +96,6 @@ class Search extends Component<RouteProps, IState> {
params,
count: 0,
loading: true,
synclist: undefined,
alerts: [],
updateCollection: null,
showImportModal: false,
Expand All @@ -118,10 +114,6 @@ class Search extends Component<RouteProps, IState> {

private load() {
this.queryCollections();

if (IS_INSIGHTS) {
this.getSynclist();
}
}

private addAlert(alert: AlertType) {
Expand Down Expand Up @@ -306,10 +298,6 @@ class Search extends Component<RouteProps, IState> {
<CollectionCard
key={i}
{...c}
footer={this.renderSyncToogle(
c.collection_version.name,
c.collection_version.namespace,
)}
menu={this.renderMenu(false, c)}
displaySignatures={
(this.context as IAppContextType).featureFlags
Expand Down Expand Up @@ -422,24 +410,6 @@ class Search extends Component<RouteProps, IState> {
return dropdownMenu;
}

private renderSyncToogle(name: string, namespace: string): ReactNode {
const { synclist } = this.state;

if (!synclist) {
return null;
}

return (
<Switch
id={namespace + '.' + name}
className='sync-toggle'
label={t`Sync`}
isChecked={this.isCollectionSynced(name, namespace)}
onChange={() => this.toggleCollectionSync(name, namespace)}
/>
);
}

private checkUploadPrivilleges(collection) {
const addAlert = () => {
this.setState({
Expand Down Expand Up @@ -475,34 +445,6 @@ class Search extends Component<RouteProps, IState> {
});
}

private toggleCollectionSync(name: string, namespace: string) {
const synclist = { ...this.state.synclist };

const colIndex = synclist.collections.findIndex(
(el) => el.name === name && el.namespace === namespace,
);

if (colIndex < 0) {
synclist.collections.push({ name: name, namespace: namespace });
} else {
synclist.collections.splice(colIndex, 1);
}

MySyncListAPI.update(synclist.id, synclist).then((response) => {
this.setState({ synclist: response.data });
MySyncListAPI.curate(synclist.id).then(() => null);
});
}

private isCollectionSynced(name: string, namespace: string): boolean {
const { synclist } = this.state;
const found = synclist.collections.find(
(el) => el.name === name && el.namespace === namespace,
);

return synclist.policy === 'include' ? !!found : !found;
}

private renderList(collections) {
return (
<div className='list-container'>
Expand All @@ -517,10 +459,6 @@ class Search extends Component<RouteProps, IState> {
.display_signatures
}
showNamespace
synclistSwitch={this.renderSyncToogle(
c.collection_version.name,
c.collection_version.namespace,
)}
{...this.renderMenu(true, c)}
/>
))}
Expand All @@ -530,20 +468,6 @@ class Search extends Component<RouteProps, IState> {
);
}

private getSynclist() {
MySyncListAPI.list().then((result) => {
// ignore results if more than 1 is returned
// TODO: should we throw an error for this or just ignore it?
if (result.data.meta.count === 1) {
this.setState({ synclist: result.data.data[0] });
} else {
console.error(
`my-synclist returned ${result.data.meta.count} synclists`,
);
}
});
}

private queryCollections() {
this.setState({ loading: true }, () => {
CollectionVersionAPI.list({
Expand Down
7 changes: 0 additions & 7 deletions src/containers/token/token-insights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,6 @@ class TokenInsights extends Component<RouteProps, IState> {
</Trans>
</p>
<CopyURL url={getRepoURL('validated')} />
<p style={{ paddingTop: 'var(--pf-v5-global--spacer--md)' }}>
<Trans>
Synclists are deprecated in AAP 2.4 and will be removed in a
future release, use client-side <code>requirements.yml</code>{' '}
instead.
</Trans>
</p>
</section>
<section className='body'>
<h2>{t`SSO URL`}</h2>
Expand Down
1 change: 0 additions & 1 deletion src/utilities/translate-locked-role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const translateLockedRole = (name, description) =>
'galaxy.execution_environment_namespace_owner': t`Create and update execution environments under existing container namespaces.`,
'galaxy.execution_environment_publisher': t`Push and change execution environments.`,
'galaxy.group_admin': t`View, add, remove and change groups.`,
'galaxy.synclist_owner': t`View, add, remove and change synclists.`,
'galaxy.task_admin': t`View and cancel any task.`,
'galaxy.user_admin': t`View, add, remove and change users.`,
})[name] || description;
3 changes: 0 additions & 3 deletions src/utilities/translate-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ import { t } from '@lingui/macro';

export const translateTask = (name) =>
({
'galaxy_ng.app.tasks.curate_all_synclist_repository': t`Curate all synclist repositories`,
'galaxy_ng.app.tasks.curate_synclist_repository': t`Curate synclist repository`,
'galaxy_ng.app.tasks.import_and_auto_approve': t`Import and auto approve`,
'galaxy_ng.app.tasks.import_and_move_to_staging': t`Import and move to staging`,
'galaxy_ng.app.tasks.promotion._remove_content_from_repository': t`Remove content from repository`,
'galaxy_ng.app.tasks.publishing.import_and_auto_approve': t`Import and auto approve`,
'galaxy_ng.app.tasks.synclist.curate_synclist_repository_batch': t`Curate synclist repository batch`,
'pulp_ansible.app.tasks.collections.collection_sync': t`Collections sync`,
'pulp_ansible.app.tasks.collections.import_collection': t`Import collection`,
'pulp_ansible.app.tasks.collections.sync': t`Collections sync`,
Expand Down

0 comments on commit 12b8dff

Please sign in to comment.