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

feat: [#175114153] Force update birthplace FiscalCodeScreen #2277

Merged
merged 6 commits into from
Oct 13, 2020

Conversation

debiff
Copy link
Contributor

@debiff debiff commented Oct 9, 2020

Short description

This PR request the municipality props every time the FiscalCodeScreen is mounted. This allow the user to see change if the data in the backend change.

List of changes proposed in this pull request

  • ts/screens/profile/FiscalCodeScreen.tsx

ezgif com-gif-maker

@pagopa-github-bot pagopa-github-bot changed the title [#175114153] Force update birthplace FiscalCodeScreen feat: [#175114153] Force update birthplace FiscalCodeScreen Oct 9, 2020
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Oct 9, 2020

Affected stories

Generated by 🚫 dangerJS against bf6e630

@codecov-io
Copy link

codecov-io commented Oct 9, 2020

Codecov Report

Merging #2277 into master will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2277      +/-   ##
==========================================
- Coverage   47.95%   47.95%   -0.01%     
==========================================
  Files         560      560              
  Lines       16165    16166       +1     
  Branches     3222     2955     -267     
==========================================
  Hits         7752     7752              
- Misses       8371     8372       +1     
  Partials       42       42              
Impacted Files Coverage Δ
ts/screens/profile/FiscalCodeScreen.tsx 45.00% <0.00%> (+0.73%) ⬆️
ts/store/reducers/content.ts 57.47% <0.00%> (-1.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc20f19...bf6e630. Read the comment docs.

@debiff debiff requested a review from Undermaken October 12, 2020 09:19
@@ -232,11 +232,17 @@ export default function content(
};

case getType(contentMunicipalityLoad.request):
const codiceCatastale = state.municipality.codiceCatastale;
const municipalityData = state.municipality.data;
return {
...state,
municipality: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
municipality: {
municipality: {
codiceCatastale: pot.toLoading(codiceCatastale),
data: pot.toLoading(municipalityData)
}

we need to preserve the loading state
In that way the pot could be loading (noneLoading, if there is no value) and previous value (some, error, loading) if there is a value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it!

Just for knowledge my code can bring to some wrong behaviour?

Copy link
Contributor

@Undermaken Undermaken Oct 13, 2020

Choose a reason for hiding this comment

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

Yes it does. It doesn't represent correctly the request status (loading -> success / failure)
Only when the store is empty (isNone) the status will be right (noneLoading)
In all other cases (some, error) when a request starts we won't have the status loading.

This could be a problem if we have to show a loader in the meantime: it will be shown only under specific scenario

@Undermaken Undermaken merged commit 77adaee into master Oct 13, 2020
@Undermaken Undermaken deleted the 175114153-force-update-municipality branch October 13, 2020 17:16
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.

4 participants