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

Add diff fields depends on the added/deleted/updated status #1424

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

bilalesi
Copy link
Contributor

@bilalesi bilalesi commented Oct 30, 2023

  1. fix the json to show the values with undefined using the replaced param of JSON.stringify
  2. fix the style of the diffing object using <pre/> tag
  3. return the diffing object with three different sub-categories of the diffing (added/deleted/updated)

Description

Screenshot 2023-10-31 at 08 34 10

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added necessary unit and integration tests.
  • I have added screenshots (if applicable), in the comment section.

@bilalesi bilalesi requested a review from Dinika October 30, 2023 13:19
@bilalesi bilalesi self-assigned this Oct 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (39dd257) 49.65% compared to head (1f24992) 49.56%.
Report is 86 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1424      +/-   ##
===========================================
- Coverage    49.65%   49.56%   -0.09%     
===========================================
  Files          249      249              
  Lines        11339    11346       +7     
  Branches      2652     2654       +2     
===========================================
- Hits          5630     5624       -6     
- Misses        5673     5687      +14     
+ Partials        36       35       -1     
Files Coverage Δ
src/shared/components/History/index.tsx 40.00% <0.00%> (-4.45%) ⬇️
src/shared/containers/HistoryContainer.tsx 30.00% <25.00%> (-2.00%) ⬇️

... and 2 files with indirect coverage changes

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

{JSON.stringify(
revision.changes,
(key, value) => {
return typeof value === 'undefined' ? null : value;
Copy link
Contributor

Choose a reason for hiding this comment

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

If it is the case that value can be null also then it may make sense to protect against that too (maybe using isNil from lodash). Otherwise this is good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here, we are checking if the key/value is exist in the object, basically the diff method, will assign the value undefined when it can not find it in the object, in the resource objects we will not find the null value, since null it's not available in python (mostly used here).

@bilalesi bilalesi merged commit 7fa48a3 into develop Oct 31, 2023
1 check passed
@bilalesi bilalesi deleted the feature/show-resource-revision branch October 31, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants