1
1
import { Trans , t } from '@lingui/macro' ;
2
2
import { Button } from '@patternfly/react-core' ;
3
3
import React , { Component } from 'react' ;
4
- import { MyDistributionAPI } from 'src/api' ;
5
4
import {
6
- Alert ,
7
5
AlertList ,
8
6
type AlertType ,
9
7
BaseHeader ,
@@ -14,12 +12,11 @@ import {
14
12
closeAlert ,
15
13
} from 'src/components' ;
16
14
import { AppContext } from 'src/loaders/app-context' ;
17
- import { type RouteProps , errorMessage , withRouter } from 'src/utilities' ;
15
+ import { type RouteProps , withRouter } from 'src/utilities' ;
18
16
import { getRepoURL } from 'src/utilities' ;
19
17
20
18
interface IState {
21
19
alerts : AlertType [ ] ;
22
- synclistBasePath ?: string ;
23
20
tokenData ?: {
24
21
access_token : string ;
25
22
expires_in : number ;
@@ -40,14 +37,12 @@ class TokenInsights extends Component<RouteProps, IState> {
40
37
41
38
this . state = {
42
39
alerts : [ ] ,
43
- synclistBasePath : null ,
44
40
tokenData : null ,
45
41
} ;
46
42
}
47
43
48
44
componentDidMount ( ) {
49
45
this . getTokenData ( ) ;
50
- this . getSynclistBasePath ( ) ;
51
46
}
52
47
53
48
getTokenData ( ) {
@@ -63,34 +58,8 @@ class TokenInsights extends Component<RouteProps, IState> {
63
58
. then ( ( { data : tokenData } ) => this . setState ( { tokenData } ) ) ;
64
59
}
65
60
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
-
92
61
render ( ) {
93
- const { alerts, synclistBasePath , tokenData } = this . state ;
62
+ const { alerts, tokenData } = this . state ;
94
63
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="${
95
64
tokenData ?. refresh_token ?? '{{ user_token }}'
96
65
} " --fail --silent --show-error --output /dev/null`;
@@ -196,21 +165,8 @@ class TokenInsights extends Component<RouteProps, IState> {
196
165
Synclists are deprecated in AAP 2.4 and will be removed in a
197
166
future release, use client-side < code > requirements.yml</ code > { ' ' }
198
167
instead.
199
- < br />
200
- If you're using sync toggles with AAP 2.3 or older, you
201
- will need to use a different URL:
202
168
</ Trans >
203
169
</ 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
- ) }
214
170
</ section >
215
171
< section className = 'body' >
216
172
< h2 > { t `SSO URL` } </ h2 >
0 commit comments