-
Notifications
You must be signed in to change notification settings - Fork 43
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
👻 Convert sh & shg to refs on waves to match api #1425
Conversation
Signed-off-by: ibolton336 <[email protected]>
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1425 +/- ##
=======================================
Coverage 41.19% 41.19%
=======================================
Files 139 139
Lines 4372 4372
Branches 1007 1007
=======================================
Hits 1801 1801
Misses 2559 2559
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
It looks good and works, but a few style change suggestions to reduce some complexity.
client/src/app/pages/migration-waves/components/migration-wave-form.tsx
Outdated
Show resolved
Hide resolved
const payload: MigrationWave = { | ||
id: migrationWave.id, | ||
name: migrationWave.name, | ||
startDate: migrationWave.startDate, | ||
endDate: migrationWave.endDate, | ||
stakeholderGroups: migrationWave.stakeholderGroups, | ||
stakeholders: migrationWave.stakeholders, | ||
applications: applicationRefs || [], | ||
}; |
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.
If most things are the same, then spreading the object and only specifying the keys to be overridden is a bit more compact:
const payload: MigrationWave = {
...migrationWave,
applications: applicationRefs || [],
};
or
updateMigrationWave({ ...payload, applications: applicationRefs || [] });
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.
I tried this, but there are some things included inthe migrationWave we have stored from the api which break the put request when submitting. So I explicitly defined what was passed here.
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.
So weird. I wonder how many more json parse type errors we're going to hit this bug round.
Signed-off-by: ibolton336 <[email protected]>
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
Resolves: