Skip to content

Display an error banner on network error on start-/stop work.. #1681

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

Merged
merged 2 commits into from
Jul 25, 2018
Merged

Display an error banner on network error on start-/stop work.. #1681

merged 2 commits into from
Jul 25, 2018

Conversation

pinkiebell
Copy link
Contributor

...instead of showing nothing.

Related #1678

@codecov
Copy link

codecov bot commented Jul 10, 2018

Codecov Report

Merging #1681 into master will decrease coverage by 0.76%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1681      +/-   ##
==========================================
- Coverage   29.15%   28.39%   -0.77%     
==========================================
  Files         134      128       -6     
  Lines       10060    10157      +97     
  Branches     1319     1347      +28     
==========================================
- Hits         2933     2884      -49     
- Misses       7022     7172     +150     
+ Partials      105      101       -4
Impacted Files Coverage Δ
app/gas/utils.py 35.38% <0%> (-35.59%) ⬇️
app/dashboard/tokens.py 69.23% <0%> (-30.77%) ⬇️
app/dashboard/admin.py 68.96% <0%> (-9.42%) ⬇️
app/economy/models.py 85.45% <0%> (-8.3%) ⬇️
app/dashboard/helpers.py 17.56% <0%> (-8.23%) ⬇️
app/dashboard/models.py 50.83% <0%> (-5.3%) ⬇️
app/retail/views.py 33.33% <0%> (-3.45%) ⬇️
app/dashboard/utils.py 23.88% <0%> (-2.24%) ⬇️
app/dashboard/router.py 32.77% <0%> (-1.44%) ⬇️
app/avatar/models.py 42.85% <0%> (-0.74%) ⬇️
... and 35 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 bea5089...13bbe34. Read the comment docs.

@@ -266,7 +266,11 @@ var mutate_interest = function(bounty_pk, direction, data) {
}
return false;
}).fail(function(result) {
alert(result.responseJSON.error);
_alert('Network or API error. Please reload the page and try again.', 'error');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use gettext() to ensure translation

Copy link
Contributor

@SaptakS SaptakS left a comment

Choose a reason for hiding this comment

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

Fixed the issue with translation. LGTM

@SaptakS SaptakS merged commit 11a3150 into gitcoinco:master Jul 25, 2018
@owocki
Copy link
Contributor

owocki commented Aug 1, 2018

Display an error banner on network error on start-/stop work instead of showing nothing

I wasnt around to review this before.. but it seems clear to me from before this PR that there was an alert() that displayed the error before. Why does the title of this ticket allege 'showing nothing' ?

@pinkiebell
Copy link
Contributor Author

@owocki
We failed silently on network errors before.
In case of API errors, well you are right, we should show the error message to the user.
The reason I did a console.log was because that happened only on 'glitches'.
At least I assumed that back then ;)

@owocki
Copy link
Contributor

owocki commented Aug 1, 2018

We failed silently on network errors before.

Maybe we should check and see if the response has any error code in it and if it does, show an alert with the error message in it. If not, show a generic error msg

@pinkiebell
Copy link
Contributor Author

@owocki #1918

@PixelantDesign
The red banner with possible messages:
'error': _('You must be authenticated via github to use this feature!'),
'error': _(f'There is already someone working on this bounty.'),
'error': _(f'You may only work on max of {num_issues} issues at once.'),
'error': _('Because a staff member has had to remove you from a bounty in the past, you are unable to start'
'more work at this time. Please leave a message on slack if you feel this message is in error.'),
'error': _('You have already started work on this bounty!'),

shad-k added a commit to shad-k/web that referenced this pull request Aug 12, 2018
* put reasons above the other two modules

* gitcoinco#1854

* css: minor refactor

* token approvals

* fix for email not being sent

* retail: added template tag matches

- matches tag does a regex match
- updated nav to use matches to display network status on
  explorer, issue, bounty - create + submit + payout pages

* code refactor + clean up

- removed redundant uris
- reindent code
- fixed uneven padding of network banner on tip page

* send2: convert CRLF -> LF

* isort fixes

* console error, responseJSON did not exist

* change name of missing image

* fix for exception in bounty.additional_funding_summary_sentence()

* funder stale email

* linter stinter

* days

* Fix linting issues and docstyle all teh thingz

* Fix bad variable out of scope reference in render_bounty_startwork_expired email

* restructure: landing

- renamed index -> funder
- moved funder related templates into it's own folder
- added heading to top contributors

* restructure: dashboard

- renamed _dashboard -> dashboard
- renamed dashboard.html -> dasboard/index.html

* onboard: prettified metamask wallet address

* Sentry integration (gitcoinco#1846)

* Sentry integration - deprecate rollbar

* Imports are hard

* dbl quotez

* Single quotes

* Fix travis

* Forgot to save this file xD

* Add middleware and wsgi handler

* Logging adjustments for Sentry

* Fix gitcoinco#1898 - Adjust ordering of mailchimp args and cast envvars to str

* Merge branch 'master' into restructure

* gitcoinco@dead551#diff-8d7b20d795398cf2b0e792ee8c1a165c

* space in sentence

* Update presskit copy (gitcoinco#1900)

* Fix sentry release script revision handling

* add no a token page

* disabled metamask

* stickler hate me

* add item to menu

* dashboard: remove tech stack filter

* fixes press kit

* add no a token page

* blank

* Solve conflicts

* sitemap fixes

* disabled metamask

* stickler hate me

* i have grammar OCD

* bad link

* Fix gitcoin logo

* documentation about chain of custody

* cahin of custoyddyyyyyyyyyy

* Modify raven handling

* Add sentry request feedback on error

* Extending expiration backend code added

* Some minor changes

* Adds cancel button

* Adds alert notifying extending of expiration

* Fixes linting issues

* expiration: final touches

- stickler fixes
- show current expiration in modal
- add stopwatch icon
- extra css

* Fixes travis

* shared.js/mutate_interest: Show a generic message on network errors.

followup 3960c6
PR gitcoinco#1681

* Round up millisecond position

* Moderators v1 (gitcoinco#1903)

* Ref gitcoinco#1669 - Base escalation/interest statuses and handling

* Moderation changes

* Add faucet change to perms

* No mod

* Fix mig for local

* Update mod handling throughout remaining views and check gh closures

* Whoops

* Fix some tests

* Fix some pytest cases

* Fix more tests

* indent fix

* More test changes

* Add property back to tips method

* Fix gitcoinco#1919 - Catch attribute error if the keywords prop isn't a string

* Adjust Raven JS to no longer load async

* Revert "Adjust Raven JS to no longer load async"

This reverts commit 37d4584.

* Fix funding/details path

* Adjust github details field

* gh dict

* catch on gh details

* Remove temporarily

* Disable url dict

* Disable GH funcs

* Display project length in issue details page

* Fix GH token usage

* translation tags and clarification on lcoalhost

* facebook verify

* facebook verify

* Revert "facebook verify"

This reverts commit 50b7ebb.

* Revert "facebook verify"

This reverts commit 51f5e54.

* Adjust saving of gh issue details

* sync geth stopgap fix

* Adjust default limit on bounty router

* Revert "Adjust default limit on bounty router"

This reverts commit a7d872c.

* stopgap fix

* fixes

* runs make fix on master branhc

* sync mail fix to make it less aggressive

* Adjust yapf to no longer touch settings.py

* Update precommit yapf config

* fix for sync_listener

* linting sync_geth

* copy updates

* merge migration

* Adjust gh state checks

* Update gh state

* Updates to gh pulling...

* GH Pulling adjustments

* meta tags

* title

* no ico life

* conflicts

* fix for https://gitcoincore.slack.com/archives/CC24APWGN/p1533245102000397

* prod bug

* prod bug

* prod bug

* prod bug

* graphs r fun

* fix for not being able to ERC20 approve tokens

* fix for leaderboards

* eslint

* adjusts hourly rate distribution calculation criteria

* Switching tree section

* landing: css + refactor

* lander video switcharooooooooooooO

* joe dominance was busttedd

* shared: updated what_is_gitcoin

* added branding style to terms page

* changed style of headers on terms page, moved terms.txt into terms.html, added blocktrans tag

* Confirming Auto-translation (gitcoinco#1916)

* Update makefile with build/push/login and add OCI compliant labels

* terms: moved to internal css + mt-4 -> mt-5

* Adjust sentry to use split projects

* Fix config

* Adjust fe sentry template

* Sentry adjustments

* livestream 8/3

* Sentry adjustments

* livestream 8/3 (gitcoinco#1930)

* Show Just 1 Alert Banner for ERC20 Token

Fixes gitcoinco#1566

* allow trailing slah for profile (gitcoinco#1931)

* Improve tip slack notification (gitcoinco#1929)

* Improve tip slack notification

* Remove title var and simply check tip.github_url

* Add new lines

* Adjust sentry raven JS

* Adjust sentry raven JS

* Revert profile url change

* Revert "Adjust sentry raven JS"

This reverts commit 5432bc4.

* Revert "Adjust sentry raven JS"

This reverts commit 25e9987.

* Sentry adjustments

* Final sentry js adjustments!

* tip receive is eth

* nonce value

* bounty: restructure pages

* Fix gitcoinco#1949 - Adjust getattr for profile

* prod debugging; dupe emails

* prod debugging of dupe emails

* prod debugging of dupe emails

* remove dupe to_email

* dupe email fix

* dupe email fix

* dupe email fix

* reverts debug code

* fix for bad preferred profile addresses

* fix for https://sentry.gitcoin.co/gitcoin/gitcoin-prod-frontend/issues/278/

* http 404 on hidden prfiles

* SEO fixes, linting

* content type for robots.txt

* SEO stuff

* sync_geth latest disabler

* Fix isort / travis

* what_is_gitcoin : revert to old design (gitcoinco#1957)

* fix gitcoinco#1921

* Fix gitcoinco#1934 - Resolve funded total in profile (gitcoinco#1935)

* fix for https://sentry.gitcoin.co/gitcoin/gitcoin-prod-backend/issues/321/?referrer=slack

* support for https://sentry.gitcoin.co/gitcoin/gitcoin-prod-backend/issues/320/?referrer=slack

* disqus url now canonical

* funder stale args

* very small copy change

* smarter funder stale emails

* fix for ipfs hashes not existing

* fix for being redirected to old bounty id upon submission

* copy updates

* handler for not sending funder stale emails if n email

* puts the right network linkn on the web3 waiter

* metamask reloader

* explorer:  ensure results from latest api call are served to the user (gitcoinco#1941)

* explorer: abort pending request for fetchingBounties

* added review feedback

* Upgrade django to 2.1, modify field defaults, and address deprecations (gitcoinco#1915)

* Upgrade django to 2.1 and address deprecations

* Remove commented out imports

* fix: sticker issue

* Update reqs

* Remove unused import

* Fix gitcoinco#1972 - Strip characters from stdbounties_id and check isdigit

* replaced misspelled 'deonomination' with 'denomination' throughout the codebase (gitcoinco#1974)

* dashboard: uri cleanup (gitcoinco#1971)

* img: removed unused images

* Resolve outdated deps in package-lock.json

* Upgrade FE npm deps

* Upgrade FE npm deps

* Pin raven

* starts to track gas guzzlers, for later inclusion in the gitcoin gas station

* Error: insufficient funds for gas * price + value

* gas guzzlers

* linter

* gas guzzlers

* fix for slack not showing UP

* newsletter 8/10

* copy updates

* does tip receive math in BigNumber, bc JS rounding issues

* share link not edit link

* Update profile check to getattr

* fix for https://gitcoincore.slack.com/archives/CAXQ7PT60/p1533912000000126

* satisfy linter

* press

* Split create_new_bounty kwargs building and check if once (gitcoinco#1892)

* Split create_new_bounty kwargs building and check if once

* Update to_dict to use model_to_dict form helper

* Fix import - whoops

* Adjust to dict handling via supermodel method

* keep an eye on unsubscribes in preferences

* keep an eye on unsubscribes in preferences

* fixes label on gas guzzler page, and adds an admin view for vizuailzations

* Minor tweaks to action plan textarea (gitcoinco#1856)

* Clear example action plan when the textarea is focused

* Fix minor typo

* hack: trailing slash for profile (gitcoinco#1937)

* start work : update placeholder

* added feedback
@pinkiebell pinkiebell deleted the 1678 branch October 30, 2018 08:27
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