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

👻 Convert sh & shg to refs on waves to match api #1425

Merged
merged 4 commits into from
Oct 4, 2023

Conversation

ibolton336
Copy link
Member

@ibolton336 ibolton336 commented Oct 2, 2023

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (b8f95bd) 41.19% compared to head (1cc14a5) 41.19%.
Report is 1 commits behind head on main.

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           
Flag Coverage Δ
client 41.19% <ø> (ø)
server ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
client/src/app/api/models.ts 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@sjd78 sjd78 left a 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.

Comment on lines +167 to +175
const payload: MigrationWave = {
id: migrationWave.id,
name: migrationWave.name,
startDate: migrationWave.startDate,
endDate: migrationWave.endDate,
stakeholderGroups: migrationWave.stakeholderGroups,
stakeholders: migrationWave.stakeholders,
applications: applicationRefs || [],
};
Copy link
Member

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 || [] });

Copy link
Member Author

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.

Copy link
Member

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.

@ibolton336 ibolton336 requested a review from sjd78 October 3, 2023 23:57
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

LGTM

@sjd78 sjd78 merged commit 47bef2e into konveyor:main Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants