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(Bonus Pagamenti Digitali): [#177306957] Add ko service error screen #2904

Merged
merged 12 commits into from
Mar 17, 2021

Conversation

debiff
Copy link
Contributor

@debiff debiff commented Mar 16, 2021

Short description

This PR show the ko service error screen if there is at least one KO in the searchRequestMetadata field of the privative card research response.

List of changes proposed in this pull request

  • Add PrivativeKoServiceError screen
  • Add SearchPrivativeCardScreen tests

@pagopa-github-bot pagopa-github-bot changed the title [#177306957] Add ko service error screen feat(Bonus Pagamenti Digitali): [#177306957] Add ko service error screen Mar 16, 2021
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Mar 16, 2021

Affected stories

  • 🌟 #177306957: Come CIT se provo a ricercare la mia carta privativa ed almeno uno dei centri applicativi mi restituisce KO, devo visualizzare una schermata che mi informi del disservizio

Generated by 🚫 dangerJS against 7dedf31

@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #2904 (7dedf31) into master (3fc099b) will increase coverage by 0.38%.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2904      +/-   ##
==========================================
+ Coverage   57.99%   58.37%   +0.38%     
==========================================
  Files         882      883       +1     
  Lines       24221    24245      +24     
  Branches     4466     4467       +1     
==========================================
+ Hits        14047    14154     +107     
+ Misses      10084     9999      -85     
- Partials       90       92       +2     
Impacted Files Coverage Δ
...g/privative/screens/add/AddPrivativeCardScreen.tsx 81.57% <ø> (+18.42%) ⬆️
...g/privative/screens/search/LoadPrivativeSearch.tsx 73.91% <ø> (+23.91%) ⬆️
...rivative/screens/search/ko/PrivativeKoNotFound.tsx 85.18% <ø> (+11.11%) ⬆️
...privative/screens/search/ko/PrivativeKoTimeout.tsx 80.55% <ø> (+19.44%) ⬆️
...tive/screens/search/ko/PrivativeKoServiceError.tsx 88.46% <88.46%> (ø)
...ative/screens/search/SearchPrivativeCardScreen.tsx 100.00% <100.00%> (+55.10%) ⬆️
...oarding/privative/store/reducers/addedPrivative.ts 71.42% <0.00%> (+9.52%) ⬆️
...arding/privative/store/reducers/addingPrivative.ts 70.00% <0.00%> (+10.00%) ⬆️
... and 8 more

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 3fc099b...7dedf31. Read the comment docs.

@@ -36,9 +34,6 @@ const LoadPrivativeSearch = (props: Props): React.ReactElement | null => {
const { privativeSelected } = props;

if (privativeSelected === undefined) {
showToast(I18n.t("global.genericError"), "danger");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it ok to give no UI feedback if privativeSelected is undefined?
(I could have a low context on this story)

Copy link
Contributor Author

@debiff debiff Mar 16, 2021

Choose a reason for hiding this comment

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

This screen is managed by SearchPrivativeCardScreen.

The case in which you arrive in this screen with privativeSelected === undefined is not expected, so this is an extra layer of safety.

I removed this functions in the component because they're already called by SearchPrivativeCardScreen with the same condition and the SearchPrivativeCardScreen is the only screen that use LoadPrivativeSearch.

if (privativeSelected === undefined) {
showToast(I18n.t("global.genericError"), "danger");
void mixpanelTrack("PRIVATIVE_NO_QUERY_PARAMS_ERROR");
props.cancel();
} else {

Do you think there is a better way to manage it?

@fabriziofff fabriziofff merged commit f7276c6 into master Mar 17, 2021
@fabriziofff fabriziofff deleted the 177306957-ko-service-error-screen branch January 21, 2022 11:44
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