From bcd06906eb0ae95abbe19a11c4e915f2f231892c Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Thu, 15 Feb 2024 02:11:50 +0000 Subject: [PATCH] Remove deprecated synclist, including 2.4 synclist deprecation notice No-Issue --- src/api/index.ts | 2 - src/api/my-synclist.ts | 11 ---- src/api/response-types/synclists.ts | 9 --- src/components/collection-card.tsx | 4 -- src/components/collection-list-item.tsx | 3 - src/components/collection-list.tsx | 1 - src/containers/search/search.scss | 4 -- src/containers/search/search.tsx | 80 +------------------------ src/containers/token/token-insights.tsx | 7 --- src/utilities/translate-locked-role.ts | 1 - src/utilities/translate-task.ts | 3 - 11 files changed, 2 insertions(+), 123 deletions(-) delete mode 100644 src/api/my-synclist.ts delete mode 100644 src/api/response-types/synclists.ts diff --git a/src/api/index.ts b/src/api/index.ts index a6368945e9..db9d90b977 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -25,7 +25,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'; @@ -74,7 +73,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, diff --git a/src/api/my-synclist.ts b/src/api/my-synclist.ts deleted file mode 100644 index 9202448c64..0000000000 --- a/src/api/my-synclist.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { HubAPI } from './hub'; - -class API extends HubAPI { - apiPath = '_ui/v1/my-synclists/'; - - curate(id) { - return this.http.post(this.apiPath + id + '/curate/', {}); - } -} - -export const MySyncListAPI = new API(); diff --git a/src/api/response-types/synclists.ts b/src/api/response-types/synclists.ts deleted file mode 100644 index d9f76ec354..0000000000 --- a/src/api/response-types/synclists.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class SyncListType { - id: number; - name: string; - policy: 'include' | 'exclude'; - collections: { namespace: string; name: string }[]; - namespaces: string[]; - users: string[]; - groups: string[]; -} diff --git a/src/components/collection-card.tsx b/src/components/collection-card.tsx index 5afe8f9dc7..693a41c7f9 100644 --- a/src/components/collection-card.tsx +++ b/src/components/collection-card.tsx @@ -3,7 +3,6 @@ import { Button, Card, CardBody, - CardFooter, CardHeader, Text, TextContent, @@ -25,7 +24,6 @@ import { convertContentSummaryCounts, namespaceTitle } from 'src/utilities'; interface IProps extends CollectionVersionSearch { displaySignatures: boolean; - footer?: ReactNode; menu?: ReactNode; } @@ -61,7 +59,6 @@ export const CollectionCard = ({ is_signed, displaySignatures, menu, - footer, }: IProps) => { const nsTitle = namespaceTitle( namespace || { name: collection_version.namespace }, @@ -134,7 +131,6 @@ export const CollectionCard = ({ renderTypeCount(k, contentSummary.contents[k]), )} - {footer && {footer}} ); }; diff --git a/src/components/collection-list-item.tsx b/src/components/collection-list-item.tsx index 9411745496..a63a64cf37 100644 --- a/src/components/collection-list-item.tsx +++ b/src/components/collection-list-item.tsx @@ -33,7 +33,6 @@ interface IProps { displaySignatures: boolean; dropdownMenu?: ReactNode | null; showNamespace?: boolean; - synclistSwitch?: ReactNode | null; uploadButton?: ReactNode | null; } @@ -48,7 +47,6 @@ export const CollectionListItem = ({ displaySignatures, dropdownMenu, showNamespace, - synclistSwitch, uploadButton, }: IProps) => { const cells = []; @@ -135,7 +133,6 @@ export const CollectionListItem = ({ direction={{ default: 'column' }} alignItems={{ default: 'alignItemsFlexStart' }} > - {synclistSwitch && {synclistSwitch}} {uploadButton || dropdownMenu ? ( {uploadButton} diff --git a/src/components/collection-list.tsx b/src/components/collection-list.tsx index 97ac40628f..ed70953323 100644 --- a/src/components/collection-list.tsx +++ b/src/components/collection-list.tsx @@ -12,7 +12,6 @@ import { ParamHelper } from 'src/utilities'; interface IProps { collectionControls: (collection) => { dropdownMenu?: ReactNode | null; - synclistSwitch?: ReactNode | null; uploadButton?: ReactNode | null; }; collections: CollectionVersionSearch[]; diff --git a/src/containers/search/search.scss b/src/containers/search/search.scss index fca7510be3..ebe7601886 100644 --- a/src/containers/search/search.scss +++ b/src/containers/search/search.scss @@ -36,10 +36,6 @@ margin-top: -17px; margin-bottom: -17px; } - - .sync-toggle { - margin-right: 10px; - } } .empty { diff --git a/src/containers/search/search.tsx b/src/containers/search/search.tsx index cd097e5508..4a4b8ee198 100644 --- a/src/containers/search/search.tsx +++ b/src/containers/search/search.tsx @@ -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, @@ -55,7 +53,6 @@ interface IState { namespace?: string; }; loading: boolean; - synclist: SyncListType; alerts: AlertType[]; updateCollection: CollectionVersionSearch; showImportModal: boolean; @@ -99,7 +96,6 @@ class Search extends Component { params, count: 0, loading: true, - synclist: undefined, alerts: [], updateCollection: null, showImportModal: false, @@ -118,10 +114,6 @@ class Search extends Component { private load() { this.queryCollections(); - - if (IS_INSIGHTS) { - this.getSynclist(); - } } private addAlert(alert: AlertType) { @@ -306,10 +298,6 @@ class Search extends Component { { return dropdownMenu; } - private renderSyncToogle(name: string, namespace: string): ReactNode { - const { synclist } = this.state; - - if (!synclist) { - return null; - } - - return ( - this.toggleCollectionSync(name, namespace)} - /> - ); - } - private checkUploadPrivilleges(collection) { const addAlert = () => { this.setState({ @@ -475,34 +445,6 @@ class Search extends Component { }); } - 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 (
@@ -517,10 +459,6 @@ class Search extends Component { .display_signatures } showNamespace - synclistSwitch={this.renderSyncToogle( - c.collection_version.name, - c.collection_version.namespace, - )} {...this.renderMenu(true, c)} /> ))} @@ -530,20 +468,6 @@ class Search extends Component { ); } - 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({ diff --git a/src/containers/token/token-insights.tsx b/src/containers/token/token-insights.tsx index e7dd721dc7..daca127899 100644 --- a/src/containers/token/token-insights.tsx +++ b/src/containers/token/token-insights.tsx @@ -160,13 +160,6 @@ class TokenInsights extends Component {

-

- - Synclists are deprecated in AAP 2.4 and will be removed in a - future release, use client-side requirements.yml{' '} - instead. - -

{t`SSO URL`}

diff --git a/src/utilities/translate-locked-role.ts b/src/utilities/translate-locked-role.ts index 2618cbe9fe..152ac37e69 100644 --- a/src/utilities/translate-locked-role.ts +++ b/src/utilities/translate-locked-role.ts @@ -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; diff --git a/src/utilities/translate-task.ts b/src/utilities/translate-task.ts index 8e373f4b68..34ff283a9c 100644 --- a/src/utilities/translate-task.ts +++ b/src/utilities/translate-task.ts @@ -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`,