Skip to content

Commit 75f4e49

Browse files
committed
PAUSED: Use git resume to continue working. [skip ci]
1 parent 9c8e101 commit 75f4e49

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

src/components/legacy-role-list/legacy-role-item.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ interface LegacyRoleProps {
2929
export function LegacyRoleListItem({ role, show_thumbnail }: LegacyRoleProps) {
3030
const {
3131
description,
32-
github_user,
3332
modified,
3433
name,
3534
summary_fields: { namespace, versions, tags },
@@ -49,7 +48,7 @@ export function LegacyRoleListItem({ role, show_thumbnail }: LegacyRoleProps) {
4948
cells.push(
5049
<DataListCell isFilled={false} alignRight={false} key='ns'>
5150
<Logo
52-
alt={t`${github_user} logo`}
51+
alt={t`${namespace.name} logo`}
5352
image={namespace.avatar_url}
5453
size='70px'
5554
unlockWidth

src/containers/ansible-role/namespace-detail.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class NamespaceRoles extends React.Component<
101101
this.setState({ loading: true });
102102
LegacyRoleAPI.list({
103103
...params,
104-
github_user: namespace.name,
104+
github_user: namespace.name, // TODO?
105105
})
106106
.then(({ data: { count, results } }) =>
107107
this.setState({

src/containers/ansible-role/role-detail.tsx

+23-14
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ import { RouteProps, handleHttpError, withRouter } from 'src/utilities';
4343

4444
interface RoleMeta {
4545
addAlert: (alert: AlertType) => void;
46-
github_user: string;
4746
name: string;
47+
namespace: string;
4848
role: LegacyRoleDetailType;
4949
}
5050

@@ -54,7 +54,7 @@ interface RoleMetaReadme {
5454

5555
class RoleInstall extends React.Component<RoleMeta> {
5656
render() {
57-
const installCMD = `ansible-galaxy role install ${this.props.github_user}.${this.props.name}`;
57+
const installCMD = `ansible-galaxy role install ${this.props.namespace}.${this.props.name}`;
5858
return (
5959
<>
6060
<h1>
@@ -191,31 +191,33 @@ class RoleVersions extends React.Component<RoleMeta, RoleVersionsState> {
191191
interface RoleState {
192192
activeItem: string;
193193
alerts: AlertType[];
194-
github_user: string;
195194
loading: boolean;
196195
name: string;
196+
namespace: string;
197197
role: LegacyRoleDetailType;
198198
}
199199

200200
class AnsibleRoleDetail extends React.Component<RouteProps, RoleState> {
201201
constructor(props) {
202202
super(props);
203203

204-
const { username, name } = props.routeParams;
204+
const { username: namespace, name } = props.routeParams;
205205
this.state = {
206206
activeItem: 'install',
207207
alerts: [],
208-
github_user: username,
209208
loading: true,
210209
name,
210+
namespace,
211211
role: null,
212212
};
213213
}
214214

215215
componentDidMount() {
216+
const { name, namespace } = this.state;
217+
216218
LegacyRoleAPI.list({
217-
github_user: this.state.github_user,
218-
name: this.state.name,
219+
github_user: namespace, // TODO?
220+
name,
219221
page_size: 1,
220222
})
221223
.then(({ data: { results } }) =>
@@ -241,7 +243,14 @@ class AnsibleRoleDetail extends React.Component<RouteProps, RoleState> {
241243
}
242244

243245
render() {
244-
const { activeItem, alerts, github_user, loading, name, role } = this.state;
246+
const {
247+
activeItem,
248+
alerts,
249+
loading,
250+
name,
251+
namespace: namespaceName,
252+
role,
253+
} = this.state;
245254
if (loading) {
246255
return <LoadingPageWithHeader />;
247256
}
@@ -281,7 +290,7 @@ class AnsibleRoleDetail extends React.Component<RouteProps, RoleState> {
281290
const header_cells = [
282291
<DataListCell isFilled={false} alignRight={false} key='ns'>
283292
<Logo
284-
alt={t`${role.github_user} logo`}
293+
alt={t`${namespace.name} logo`}
285294
fallbackToDefault
286295
image={role.summary_fields.namespace.avatar_url}
287296
size='70px'
@@ -339,26 +348,26 @@ class AnsibleRoleDetail extends React.Component<RouteProps, RoleState> {
339348
return (
340349
<RoleInstall
341350
addAlert={addAlert}
342-
github_user={github_user}
343351
name={name}
352+
namespace={namespace.name}
344353
role={role}
345354
/>
346355
);
347356
} else if (activeItem === 'documentation') {
348357
return (
349358
<RoleDocs
350359
addAlert={addAlert}
351-
github_user={github_user}
352360
name={name}
361+
namespace={namespace.name}
353362
role={role}
354363
/>
355364
);
356365
} else if (activeItem === 'versions') {
357366
return (
358367
<RoleVersions
359368
addAlert={addAlert}
360-
github_user={github_user}
361369
name={name}
370+
namespace={namespace.name}
362371
role={role}
363372
/>
364373
);
@@ -373,13 +382,13 @@ class AnsibleRoleDetail extends React.Component<RouteProps, RoleState> {
373382
url: formatPath(Paths.legacyRoles),
374383
},
375384
{
376-
name: github_user,
385+
name: namespace.name,
377386
url: formatPath(Paths.legacyNamespace, { namespaceid: namespace.id }),
378387
},
379388
{
380389
name,
381390
url: formatPath(Paths.legacyRole, {
382-
username: github_user,
391+
username: namespace.name,
383392
name,
384393
}),
385394
},

src/containers/not-found/dispatch.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const Dispatch = ({ location, navigate }: RouteProps) => {
5252

5353
if (featureFlags.legacy_roles) {
5454
wait.push(
55-
LegacyRoleAPI.list({ github_user: namespace, name })
55+
LegacyRoleAPI.list({ github_user: namespace, name }) // TODO?
5656
.then(({ data: { results } }) => results || [])
5757
.catch(() => [])
5858
.then((r) => (setRoles(r), r)),

0 commit comments

Comments
 (0)