This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #470 from priley86/network-identification
[#455] use lan id and uid_ems to uniquely identify network (cherry picked from commit 2102048) https://bugzilla.redhat.com/show_bug.cgi?id=1599864
- Loading branch information
1 parent
ffa7fa8
commit 17e475e
Showing
15 changed files
with
147 additions
and
79 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
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
8 changes: 6 additions & 2 deletions
8
.../MappingWizard/components/MappingWizardNetworksStep/MappingWizardNetworksStepSelectors.js
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,8 +1,12 @@ | ||
export const groupByUidEms = (networks = []) => | ||
import { networkKey } from '../../../../../common/networkKey'; | ||
|
||
export const uniqueNetworks = (networks = []) => | ||
networks.reduce( | ||
(networksMap, network) => ({ | ||
...networksMap, | ||
[network.uid_ems]: networksMap[network.uid_ems] ? [...networksMap[network.uid_ems], network] : [network] | ||
[networkKey(network)]: networksMap[networkKey(network)] | ||
? [...networksMap[networkKey(network)], network] | ||
: [network] | ||
}), | ||
{} | ||
); |
6 changes: 3 additions & 3 deletions
6
...components/MappingWizardNetworksStep/__tests__/MappingWizardNetworksStepSelectors.test.js
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,8 +1,8 @@ | ||
import { sourceClusterNetworks } from '../mappingWizardNetworksStep.fixtures'; | ||
import { groupByUidEms } from '../MappingWizardNetworksStepSelectors'; | ||
import { uniqueNetworks } from '../MappingWizardNetworksStepSelectors'; | ||
|
||
test('groupByUidEms creates a mapping of networks organized by uid_ems', () => { | ||
test('uniqueNetworks creates a mapping of grouped networks', () => { | ||
const sourceNetworks = sourceClusterNetworks[0].lans; | ||
|
||
expect(groupByUidEms(sourceNetworks)).toMatchSnapshot(); | ||
expect(uniqueNetworks(sourceNetworks)).toMatchSnapshot(); | ||
}); |
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
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
Oops, something went wrong.