diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-06-21 15:31:39 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-06-21 15:31:39 +0000 |
commit | 179783f1ce0ce16913199a84e65ebea5fb4422ec (patch) | |
tree | 5df3ecad4b3c5544c635e888cf3ced75eb41ef8a | |
parent | 15a87f3129635354f5c1978e76ce0b3f6a91c34a (diff) | |
parent | 62d16e515f6e9c82d3342172d77681472fecfa15 (diff) | |
download | gitlab-ce-179783f1ce0ce16913199a84e65ebea5fb4422ec.tar.gz |
Merge branch 'notification-dropdown-active-fix' into 'master'
Fixed issue with notification dropdown not updating active
## What does this MR do?
This fixes an issue where the notification dropdown wouldn't correctly update the selected notification type in the dropdown. I've also added a spinner to show the action is happening & removed the flash message for success.
## What are the relevant issue numbers?
Closes #18480
## Screenshots (if relevant)
![notifications](/uploads/5ed5055d180c12450cea77543ae5f44e/notifications.gif)
See merge request !4615
-rw-r--r-- | app/assets/javascripts/notifications_dropdown.js.coffee | 7 | ||||
-rw-r--r-- | app/assets/javascripts/project.js.coffee | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/projects.scss | 3 | ||||
-rw-r--r-- | app/views/profiles/notifications/show.html.haml | 2 | ||||
-rw-r--r-- | features/steps/profile/notifications.rb | 4 | ||||
-rw-r--r-- | features/steps/project/project.rb | 4 |
6 files changed, 10 insertions, 11 deletions
diff --git a/app/assets/javascripts/notifications_dropdown.js.coffee b/app/assets/javascripts/notifications_dropdown.js.coffee index 74d2298c1fa..0bbd082c156 100644 --- a/app/assets/javascripts/notifications_dropdown.js.coffee +++ b/app/assets/javascripts/notifications_dropdown.js.coffee @@ -1,5 +1,5 @@ class @NotificationsDropdown - $ -> + constructor: -> $(document) .off 'click', '.update-notification' .on 'click', '.update-notification', (e) -> @@ -18,7 +18,8 @@ class @NotificationsDropdown .off 'ajax:success', '.notification-form' .on 'ajax:success', '.notification-form', (e, data) -> if data.saved - new Flash('Notification settings saved', 'notice') - $(e.currentTarget).closest('.notification-dropdown').replaceWith(data.html) + $(e.currentTarget) + .closest('.notification-dropdown') + .replaceWith(data.html) else new Flash('Failed to save new settings', 'alert') diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee index 54c539d5f9b..96e10dd7e8a 100644 --- a/app/assets/javascripts/project.js.coffee +++ b/app/assets/javascripts/project.js.coffee @@ -35,7 +35,6 @@ class @Project $(@).parents('.no-password-message').remove() e.preventDefault() - @projectSelectDropdown() projectSelectDropdown: -> diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 346badf6d86..d3e59d7fdb9 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -101,7 +101,8 @@ .notifications-btn { - .fa-bell { + .fa-bell, + .fa-spinner { margin-right: 6px; } diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml index 5afd83a522e..f77738f97f5 100644 --- a/app/views/profiles/notifications/show.html.haml +++ b/app/views/profiles/notifications/show.html.haml @@ -28,7 +28,7 @@ = label_tag :global_notification_level, "Global notification level", class: "label-light" %br .clearfix - .form-group.pull-left + .form-group.pull-left.global-notification-setting = render 'shared/notifications/button', notification_setting: @global_notification_setting, left_align: true .clearfix diff --git a/features/steps/profile/notifications.rb b/features/steps/profile/notifications.rb index 979f4692d5a..7e339443b75 100644 --- a/features/steps/profile/notifications.rb +++ b/features/steps/profile/notifications.rb @@ -15,8 +15,6 @@ class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps end step 'I should see Notification saved message' do - page.within '.flash-container' do - expect(page).to have_content 'Notification settings saved' - end + expect(page).to have_content 'On mention' end end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index 98b57e5cbfb..76fefee9254 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -134,8 +134,8 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see Notification saved message' do - page.within '.flash-container' do - expect(page).to have_content 'Notification settings saved' + page.within '#notifications-button' do + expect(page).to have_content 'On mention' end end |