Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'not available' label for source mappings and disabled mappings issues #617

Merged

Conversation

sgratch
Copy link
Collaborator

@sgratch sgratch commented Jul 26, 2023

Fix two regression issues generated by a previous patch fix

Issue 1:

Before: all source mapping labels were displayed as 'Not available'.

After the fix: source storage and network mappings names should be displayed for all provider types.

Issues 2:

Before: when trying to choose an exisiting mapping via the plan wizard, all mapping options were disabled and therefore can't be chosen even if fits.

After the fix: suitable mapping options shoule be enabled for selection via the plan wizard.

@sgratch sgratch requested a review from yaacov July 26, 2023 17:03
@@ -24,12 +24,17 @@ import { getBuilderItemsFromMapping } from './MappingBuilder/helpers';
import { ProviderType } from 'legacy/src/common/constants';
import { getStorageTitle } from 'legacy/src/common/helpers';

const domainAndNameToName = (domainnAndName: string): string => {
const match = domainnAndName.match(/\/([-a-z0-9]*)\/?$/);
return match ? match[1] : domainnAndName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return match ? match[1] : domainnAndName;
return domainnAndNam.split('/')?.[1] || domainnAndNam;

can you try split ?

https://github.com/kubev2v/forklift/blob/main/pkg/controller/plan/adapter/ocp/validator.go#L155

…ssues

Fix two regression issues generated by a previous patch fix kubev2v#614

Issue 1:
Before: all source mapping labels were displayed as 'Not available'.
After the fix: source storage and network mappings names should be
displayed for all provider types.

Issues 2:
Before: when trying to choose an exisiting mapping via the plan wizard,
all mapping options were disabled and therefore can't be chosen even if
fits.
After the fix: fits mapping options shoule be enabled for selection via
the plan wizard.

Signed-off-by: Sharon Gratch <sgratch@redhat.com>
@sgratch sgratch force-pushed the fix_not_available_sources_and_disabled_maps branch from fe17e03 to 4d6769c Compare July 26, 2023 18:07
Copy link
Member

@yaacov yaacov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@yaacov yaacov added the enhancement Categorizes issue or PR as related to a new feature. label Jul 26, 2023
@yaacov yaacov added this to the 2.5.0 milestone Jul 26, 2023
@yaacov yaacov merged commit 6d87fd9 into kubev2v:main Jul 26, 2023
3 checks passed
@sonarcloud
Copy link

sonarcloud bot commented Jul 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants