Commit db9e1635 authored by Fatih Acet's avatar Fatih Acet

Merge branch '25510-fix-notifications-dropdown-alignment' into 'master'

Fix alignment for notification settings ajax response

## What does this MR do?

Fixes a issue where an AJAX call to change your global notification settings will return an html partial which has the incorrect dropdown alignment class, in some cases causing the dropdown menu to become obscured on the left side of the screen.

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

## Screenshots (if relevant)

See issue #25510 for a screenshot of the problem and steps to reproduce.

## Does this MR meet the acceptance criteria?

- [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) 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
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Closes #25510

See merge request !8024
parents 87f3a66c 097c283a
.notification-list-item {
line-height: 34px;
.dropdown-menu {
@extend .dropdown-menu-align-right;
}
}
.notification {
......
......@@ -188,6 +188,10 @@
margin-left: 10px;
}
.notification-dropdown .dropdown-menu {
@extend .dropdown-menu-align-right;
}
.download-button {
@media (max-width: $screen-md-max) {
margin-left: 0;
......
......@@ -30,7 +30,7 @@
%br
.clearfix
.form-group.pull-left.global-notification-setting
= render 'shared/notifications/button', notification_setting: @global_notification_setting, left_align: true
= render 'shared/notifications/button', notification_setting: @global_notification_setting
.clearfix
......
- left_align = local_assigns[:left_align]
- if notification_setting
.dropdown.notification-dropdown
= form_for notification_setting, remote: true, html: { class: "inline notification-form" } do |f|
......@@ -19,7 +18,7 @@
= notification_title(notification_setting.level)
= icon("caret-down")
= render "shared/notifications/notification_dropdown", notification_setting: notification_setting, left_align: left_align
= render "shared/notifications/notification_dropdown", notification_setting: notification_setting
= content_for :scripts_body do
= render "shared/notifications/custom_notifications", notification_setting: notification_setting
- left_align = local_assigns[:left_align]
%ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-selectable.dropdown-menu-large{ role: "menu", class: [notifications_menu_identifier("dropdown", notification_setting), ("dropdown-menu-align-right" unless left_align)] }
%ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-selectable.dropdown-menu-large{ role: "menu", class: [notifications_menu_identifier("dropdown", notification_setting)] }
- NotificationSetting.levels.each_key do |level|
- next if level == "custom"
- next if level == "global" && notification_setting.source.nil?
......
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