Skip to content

Commit afc37c1

Browse files
committed
Token insights - remove MyDistribution query, drop synclist url
reverts ansible#4198 / reapplies ansible#3708, ansible#3346, ansible#3893 (AAP 2.3 is EOL, no need to support it on cloud) keep 2.4 synclist deprecation notice
1 parent 2e337e3 commit afc37c1

File tree

3 files changed

+2
-54
lines changed

3 files changed

+2
-54
lines changed

src/api/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export { LegacyImportAPI } from './legacy-import';
2424
export { LegacyNamespaceAPI } from './legacy-namespace';
2525
export { LegacyRoleAPI } from './legacy-role';
2626
export { LegacySyncAPI } from './legacy-sync';
27-
export { MyDistributionAPI } from './my-distribution';
2827
export { MyNamespaceAPI } from './my-namespace';
2928
export { MySyncListAPI } from './my-synclist';
3029
export { NamespaceAPI } from './namespace';

src/api/my-distribution.ts

-7
This file was deleted.

src/containers/token/token-insights.tsx

+2-46
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { Trans, t } from '@lingui/macro';
22
import { Button } from '@patternfly/react-core';
33
import React, { Component } from 'react';
4-
import { MyDistributionAPI } from 'src/api';
54
import {
6-
Alert,
75
AlertList,
86
type AlertType,
97
BaseHeader,
@@ -14,12 +12,11 @@ import {
1412
closeAlert,
1513
} from 'src/components';
1614
import { AppContext } from 'src/loaders/app-context';
17-
import { type RouteProps, errorMessage, withRouter } from 'src/utilities';
15+
import { type RouteProps, withRouter } from 'src/utilities';
1816
import { getRepoURL } from 'src/utilities';
1917

2018
interface IState {
2119
alerts: AlertType[];
22-
synclistBasePath?: string;
2320
tokenData?: {
2421
access_token: string;
2522
expires_in: number;
@@ -40,14 +37,12 @@ class TokenInsights extends Component<RouteProps, IState> {
4037

4138
this.state = {
4239
alerts: [],
43-
synclistBasePath: null,
4440
tokenData: null,
4541
};
4642
}
4743

4844
componentDidMount() {
4945
this.getTokenData();
50-
this.getSynclistBasePath();
5146
}
5247

5348
getTokenData() {
@@ -63,34 +58,8 @@ class TokenInsights extends Component<RouteProps, IState> {
6358
.then(({ data: tokenData }) => this.setState({ tokenData }));
6459
}
6560

66-
getSynclistBasePath() {
67-
MyDistributionAPI.list()
68-
.then(({ data }) => {
69-
const syncDistro = data.data.find(({ base_path }) =>
70-
base_path.includes('synclist'),
71-
);
72-
this.setState({
73-
synclistBasePath: syncDistro?.base_path,
74-
});
75-
})
76-
.catch((e) => {
77-
const { status, statusText } = e.response;
78-
this.setState({
79-
synclistBasePath: null,
80-
alerts: [
81-
...this.state.alerts,
82-
{
83-
variant: 'danger',
84-
title: t`Server URL could not be displayed.`,
85-
description: errorMessage(status, statusText),
86-
},
87-
],
88-
});
89-
});
90-
}
91-
9261
render() {
93-
const { alerts, synclistBasePath, tokenData } = this.state;
62+
const { alerts, tokenData } = this.state;
9463
const renewTokenCmd = `curl https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token -d grant_type=refresh_token -d client_id="cloud-services" -d refresh_token="${
9564
tokenData?.refresh_token ?? '{{ user_token }}'
9665
}" --fail --silent --show-error --output /dev/null`;
@@ -196,21 +165,8 @@ class TokenInsights extends Component<RouteProps, IState> {
196165
Synclists are deprecated in AAP 2.4 and will be removed in a
197166
future release, use client-side <code>requirements.yml</code>{' '}
198167
instead.
199-
<br />
200-
If you&apos;re using sync toggles with AAP 2.3 or older, you
201-
will need to use a different URL:
202168
</Trans>
203169
</p>
204-
{synclistBasePath ? (
205-
<CopyURL url={getRepoURL(synclistBasePath)} />
206-
) : (
207-
<Alert
208-
variant='danger'
209-
isInline
210-
title={t`Synclist distribution was not found.`}
211-
className='hub-content-alert-fix'
212-
/>
213-
)}
214170
</section>
215171
<section className='body'>
216172
<h2>{t`SSO URL`}</h2>

0 commit comments

Comments
 (0)