Merge pull request #10869 from AlexSCorey/10822-fixReactWarnings

Fixes several react warnings
This commit is contained in:
Kersom 2021-08-12 12:44:09 -04:00 committed by GitHub
commit 6a9de16cda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 5 deletions

View File

@ -89,6 +89,11 @@ function Lookup(props) {
}, [state.selectedItems, multiple]);
const clearQSParams = () => {
if (!history.location.search) {
// This prevents "Warning: Hash history cannot PUSH the same path;
// a new entry will not be added to the history stack" from appearing in the console.
return;
}
const parts = history.location.search.replace(/^\?/, '').split('&');
const ns = qsConfig.namespace;
const otherParts = parts.filter((param) => !param.startsWith(`${ns}.`));

View File

@ -256,8 +256,8 @@ function ActivityStream() {
renderToolbar={(props) => (
<DatalistToolbar {...props} qsConfig={QS_CONFIG} />
)}
renderRow={(streamItem) => (
<ActivityStreamListItem streamItem={streamItem} />
renderRow={(streamItem, index) => (
<ActivityStreamListItem key={index} streamItem={streamItem} />
)}
/>
</Card>

View File

@ -66,7 +66,7 @@ function InstanceGroup({ setBreadcrumb }) {
name: (
<>
<CaretLeftIcon />
{t`Back to instance groups`}
{t`Back to Instance Groups`}
</>
),
link: '/instance_groups',

View File

@ -32,7 +32,7 @@ describe('<InstanceGroup/>', () => {
test('should render expected tabs', async () => {
const expectedTabs = [
'Back to instance groups',
'Back to Instance Groups',
'Details',
'Instances',
'Jobs',

View File

@ -135,7 +135,10 @@ function OrganizationDetail({ organization }) {
value={
<ChipGroup numChips={5} totalChips={galaxy_credentials.length}>
{galaxy_credentials.map((credential) => (
<Link to={`/credentials/${credential.id}/details`}>
<Link
key={credential.id}
to={`/credentials/${credential.id}/details`}
>
<CredentialChip
credential={credential}
key={credential.id}