Commit 6d12878d authored by Fatih Acet's avatar Fatih Acet

Merge branch '19161-non-helpful-flash-message-when-attaching-file-fails' into 'master'

Hacked in a better message for attachment network error

## What does this MR do?

Adds a better error message for when a user is uploading an attachment and they cannot reach the GitLab instance.

Now displays `Network error. Please check your connection.`.

## Are there points in the code the reviewer needs to double check?

As noted above, I think this is hacky, ideally this would be sent straight from the backend but if not then this should be handled globally?

/cc @fatihacet 

## Why was this MR needed?

Attachment upload UX

## What are the relevant issue numbers?

Closes #19161.

## Screenshots (if relevant)

*UPDATED:*

![Screen_Shot_2016-06-30_at_00.42.37](/uploads/b3b4044782dd4c4c17735e99acc45502/Screen_Shot_2016-06-30_at_00.42.37.png)

## Does this MR meet the acceptance criteria?

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
  - [ ] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4977
parents 025be2f8 b4676c33
...@@ -70,12 +70,12 @@ class @DropzoneInput ...@@ -70,12 +70,12 @@ class @DropzoneInput
pasteText response.link.markdown pasteText response.link.markdown
return return
error: (temp, errorMessage) -> error: (temp) ->
errorAlert = $(form).find('.error-alert') errorAlert = $(form).find('.error-alert')
checkIfMsgExists = errorAlert.children().length checkIfMsgExists = errorAlert.children().length
if checkIfMsgExists is 0 if checkIfMsgExists is 0
errorAlert.append divAlert errorAlert.append divAlert
$(".div-dropzone-alert").append btnAlert + errorMessage $(".div-dropzone-alert").append "#{btnAlert}Attaching the file failed."
return return
totaluploadprogress: (totalUploadProgress) -> totaluploadprogress: (totalUploadProgress) ->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment