PlanDetails: Refactor using IPlan object #620
Conversation
🚀 Deployed Preview: http://konveyor-forklift-ui-pr-620-preview.surge.sh ✨ Compare with current main branch: http://konveyor-forklift-ui-preview.surge.sh |
Codecov Report
@@ Coverage Diff @@
## main #620 +/- ##
==========================================
+ Coverage 59.23% 59.29% +0.06%
==========================================
Files 144 144
Lines 4776 4771 -5
Branches 1312 1313 +1
==========================================
Hits 2829 2829
+ Misses 1909 1904 -5
Partials 38 38
Continue to review full report at Codecov.
|
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comment to address later.
const plan: IPlan = generatePlan( | ||
forms, | ||
{ | ||
name: (networkMapping?.metadata as IMetaObjectMeta).name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generateMappings
won't produce a mapping with a metadata.name
field if the wizard has no existing mapping being edited or no new mapping name being entered (instead it will use the generateName
field). this as IMetaObjectMeta
assertion here prevents TS from catching this. So this name
field will be undefined in that case...
However, that doesn't really matter here because the plan.spec.map
that is generated here isn't being used at all. So honestly we could just pass { name: '', namespace: '' }
for these mapping refs instead. If so we should probably leave a comment explaining that real mappings are not necessary for this ephemeral plan object.
I'm going to merge anyway so I can prevent merge conflicts with #597, but we should probably clean this up later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Using
generatePlan
andgenerateMappings
to create a non resilientIPlan
object to feedPlandDetails
instead of fields.