-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No-Issue Signed-off-by: James Tanner <tanner.jc@gmail.com>
- Loading branch information
Showing
6 changed files
with
61 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 20 additions & 31 deletions
51
src/components/legacy-namespace-list/legacy-namespace-provider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,30 @@ | ||
import React from 'react'; | ||
import { | ||
Text, | ||
TextContent, | ||
TextVariants | ||
} from '@patternfly/react-core'; | ||
import { Trans } from '@lingui/macro'; | ||
import { Text, TextContent, TextVariants } from '@patternfly/react-core'; | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
|
||
interface IProps { | ||
id: number; | ||
name: string; | ||
url: string; | ||
id: number; | ||
name: string; | ||
url: string; | ||
} | ||
|
||
export class ProviderLink extends React.Component<IProps> { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render () { | ||
|
||
const { | ||
id, | ||
name, | ||
url, | ||
} = this.props; | ||
render() { | ||
const { id, name, url } = this.props; | ||
|
||
return ( | ||
<TextContent> | ||
<Text component={TextVariants.small}> | ||
<Trans> | ||
Provided by <Link to={url}>{name}</Link> | ||
</Trans> | ||
</Text> | ||
</TextContent> | ||
) | ||
} | ||
return ( | ||
<TextContent> | ||
<Text component={TextVariants.small}> | ||
<Trans> | ||
Provided by <Link to={url}>{name}</Link> | ||
</Trans> | ||
</Text> | ||
</TextContent> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
export function getProviderInfo(data) { | ||
console.log('DATA', data); | ||
|
||
console.log('DATA', data); | ||
let provider = null; | ||
|
||
let provider = null; | ||
if (data.summary_fields.hasOwnProperty('provider_namespace')) { | ||
// role summary | ||
provider = data.summary_fields.provider_namespace; | ||
} else if (data.summary_fields.hasOwnProperty('provider_namespaces')) { | ||
// legacy namespace summary | ||
provider = data.summary_fields.provider_namespaces[0]; | ||
} | ||
|
||
if (data.summary_fields.hasOwnProperty('provider_namespace')) { | ||
// role summary | ||
provider = data.summary_fields.provider_namespace; | ||
} else if (data.summary_fields.hasOwnProperty('provider_namespaces')) { | ||
// legacy namespace summary | ||
provider = data.summary_fields.provider_namespaces[0]; | ||
} | ||
|
||
console.log('FINAL PROVIDER', provider); | ||
|
||
if (provider === null || provider === undefined) { | ||
return { | ||
'id': null, | ||
'name': null, | ||
'url': null, | ||
} | ||
} | ||
console.log('FINAL PROVIDER', provider); | ||
|
||
if (provider === null || provider === undefined) { | ||
return { | ||
'id': provider.id, | ||
'name': provider.name, | ||
'url': `/namespaces/${provider.name}` | ||
} | ||
id: null, | ||
name: null, | ||
url: null, | ||
}; | ||
} | ||
|
||
return { | ||
id: provider.id, | ||
name: provider.name, | ||
url: `/namespaces/${provider.name}`, | ||
}; | ||
} |