diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/views/shared | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/views/shared')
51 files changed, 268 insertions, 112 deletions
diff --git a/app/views/shared/_broadcast_message.html.haml b/app/views/shared/_broadcast_message.html.haml index 7be11b0fb81..7aaae3a88f3 100644 --- a/app/views/shared/_broadcast_message.html.haml +++ b/app/views/shared/_broadcast_message.html.haml @@ -8,5 +8,5 @@ = render_broadcast_message(message) .gl-flex-grow-1.gl-flex-basis-0.gl-text-right - if (message.notification? || message.dismissable?) && opts[:preview].blank? - %button.broadcast-message-dismiss.js-dismiss-current-broadcast-notification.btn.btn-link.gl-button{ 'aria-label' => _('Close'), :type => 'button', data: { id: message.id, expire_date: message.ends_at.iso8601 } } - = sprite_icon('close', size: 16, css_class: 'gl-icon gl-text-white gl-mx-3!') + %button.js-dismiss-current-broadcast-notification.btn.btn-link.gl-button{ 'aria-label' => _('Close'), :type => 'button', data: { id: message.id, expire_date: message.ends_at.iso8601 } } + = sprite_icon('close', size: 16, css_class: "gl-icon gl-mx-3! #{is_banner ? 'gl-text-white' : 'gl-text-gray-700'}") diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml index 7d328728332..b1f53e4d0f6 100644 --- a/app/views/shared/_file_highlight.html.haml +++ b/app/views/shared/_file_highlight.html.haml @@ -1,16 +1,17 @@ #blob-content.file-content.code.js-syntax-highlight + - offset = defined?(first_line_number) ? first_line_number : 1 .line-numbers - if blob.data.present? - link_icon = sprite_icon('link', size: 12) - link = blob_link if defined?(blob_link) - blob.data.each_line.each_with_index do |_, index| - - offset = defined?(first_line_number) ? first_line_number : 1 - i = index + offset -# We're not using `link_to` because it is too slow once we get to thousands of lines. %a.diff-line-num{ href: "#{link}#L#{i}", id: "L#{i}", 'data-line-number' => i } = link_icon = i - .blob-content{ data: { blob_id: blob.id, path: blob.path } } + - highlight = defined?(highlight_line) && highlight_line ? highlight_line - offset : nil + .blob-content{ data: { blob_id: blob.id, path: blob.path, highlight_line: highlight, qa_selector: 'file_content' } } %pre.code.highlight %code = blob.present.highlight diff --git a/app/views/shared/_issuable_meta_data.html.haml b/app/views/shared/_issuable_meta_data.html.haml index f21ec45eefb..352d51dbb8e 100644 --- a/app/views/shared/_issuable_meta_data.html.haml +++ b/app/views/shared/_issuable_meta_data.html.haml @@ -6,7 +6,7 @@ - if issuable_mr > 0 %li.issuable-mr.gl-display-none.gl-display-sm-block.has-tooltip{ title: _('Related merge requests') } - = image_tag('icon-merge-request-unmerged.svg', class: 'icon-merge-request-unmerged') + = sprite_icon('merge-request', css_class: "gl-vertical-align-middle") = issuable_mr - if upvotes > 0 diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index 1dadb4384b9..4b09e8de896 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -34,10 +34,7 @@ label_title: label.title, label_color: label.color, label_text_color: label.text_color, - group_name: label.project.group.name, - target: '#promote-label-modal', - container: 'body', - toggle: 'modal' } } + group_name: label.project.group.name } } = _('Promote to group label') - if can?(current_user, :admin_label, label) %li diff --git a/app/views/shared/_label_row.html.haml b/app/views/shared/_label_row.html.haml index 9c9ac5f7b2c..252f9c26f06 100644 --- a/app/views/shared/_label_row.html.haml +++ b/app/views/shared/_label_row.html.haml @@ -5,9 +5,9 @@ .label-name.gl-flex-shrink-0.gl-mt-2.gl-mr-3 = render_label(label, tooltip: false) -.label-description.gl-flex-grow-1.gl-overflow-hidden - .gl-display-flex.gl-align-items-center.gl-flex-wrap.gl-mt-2 - .description-text.gl-flex-grow-1.gl-overflow-hidden +.label-description.gl-overflow-hidden.gl-w-full + .gl-display-flex.gl-align-items-stretch.gl-flex-wrap.gl-mt-2 + .gl-flex-basis-half.gl-flex-grow-1.gl-overflow-hidden.gl-mr-2 - if label.description.present? = markdown_field(label, :description) - elsif show_labels_full_path?(@project, @group) diff --git a/app/views/shared/_ping_consent.html.haml b/app/views/shared/_ping_consent.html.haml index ded9b55056a..d0f1e4d7221 100644 --- a/app/views/shared/_ping_consent.html.haml +++ b/app/views/shared/_ping_consent.html.haml @@ -1,12 +1,14 @@ - if session[:ask_for_usage_stats_consent] - .ping-consent-message.alert.alert-warning.flex-alert - - settings_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer" class="alert-link">'.html_safe % { url: metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings') } - - info_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer" class="alert-link">'.html_safe % { url: help_page_path('user/admin_area/settings/usage_statistics.md') } - .alert-message - = s_('To help improve GitLab, we would like to periodically collect usage information. This can be changed at any time in %{settings_link_start}Settings%{link_end}. %{info_link_start}More Information%{link_end}').html_safe % { settings_link_start: settings_link_start, info_link_start: info_link_start, link_end: '</a>'.html_safe } - .alert-link-group + .ping-consent-message.gl-alert.gl-alert-info + = sprite_icon('information-o', css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') + %button.js-close.gl-alert-dismiss{ type: 'button', 'aria-label' => _('Dismiss') } + = sprite_icon('close', css_class: 'gl-icon') + .gl-alert-body + - docs_link = link_to _('collect usage information'), help_page_path('user/admin_area/settings/usage_statistics.md'), class: 'gl-link' + - settings_link = link_to _('your settings'), metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), class: 'gl-link' + = s_('To help improve GitLab, we would like to periodically %{docs_link}. This can be changed at any time in %{settings_link}.').html_safe % { docs_link: docs_link, settings_link: settings_link } + .gl-alert-actions.gl-mt-3 - send_usage_data_path = admin_application_settings_path(application_setting: { version_check_enabled: 1, usage_ping_enabled: 1 }) - not_now_path = admin_application_settings_path(application_setting: { version_check_enabled: 0, usage_ping_enabled: 0 }) - = link_to _("Send usage data"), send_usage_data_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': true, 'data-ping-enabled': true, class: 'alert-link js-usage-consent-action' - | - = link_to _('Not now'), not_now_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': false, 'data-ping-enabled': false, class: 'hide-ping-consent-message alert-link js-usage-consent-action' + = link_to _("Send usage data"), send_usage_data_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': true, 'data-ping-enabled': true, class: 'js-usage-consent-action alert-link btn gl-button btn-info' + = link_to _("Don't send usage data"), not_now_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': false, 'data-ping-enabled': false, class: 'js-usage-consent-action alert-link btn gl-button btn-default gl-ml-2' diff --git a/app/views/shared/_remote_mirror_update_button.html.haml b/app/views/shared/_remote_mirror_update_button.html.haml index 54bd4ba04a0..70b72f74ab3 100644 --- a/app/views/shared/_remote_mirror_update_button.html.haml +++ b/app/views/shared/_remote_mirror_update_button.html.haml @@ -1,6 +1,6 @@ - if remote_mirror.update_in_progress? - %button.btn.disabled{ type: 'button', data: { toggle: 'tooltip', container: 'body', qa_selector: 'updating_button' }, title: _('Updating') } - = icon("refresh spin") + %button.btn.btn-icon.gl-button.disabled{ type: 'button', data: { toggle: 'tooltip', container: 'body', qa_selector: 'updating_button' }, title: _('Updating') } + = sprite_icon("retry", css_class: "spin") - elsif remote_mirror.enabled? - = link_to update_now_project_mirror_path(@project, sync_remote: true), method: :post, class: "btn qa-update-now-button rspec-update-now-button", data: { toggle: 'tooltip', container: 'body' }, title: _('Update now') do - = icon("refresh") + = link_to update_now_project_mirror_path(@project, sync_remote: true), method: :post, class: "btn btn-icon gl-button qa-update-now-button rspec-update-now-button", data: { toggle: 'tooltip', container: 'body' }, title: _('Update now') do + = sprite_icon("retry") diff --git a/app/views/shared/access_tokens/_form.html.haml b/app/views/shared/access_tokens/_form.html.haml index 820a6cbd15d..f206a2152c2 100644 --- a/app/views/shared/access_tokens/_form.html.haml +++ b/app/views/shared/access_tokens/_form.html.haml @@ -13,7 +13,7 @@ .row .form-group.col-md-6 = f.label :name, _('Name'), class: 'label-bold' - = f.text_field :name, class: 'form-control', required: true, data: { qa_selector: 'access_token_name_field' } + = f.text_field :name, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'access_token_name_field' } .row .form-group.col-md-6 @@ -23,8 +23,7 @@ = render_if_exists 'personal_access_tokens/callout_max_personal_access_token_lifetime' .js-access-tokens-expires-at - %expires-at-field - = f.text_field :expires_at, class: 'datepicker form-control gl-datepicker-input', placeholder: 'YYYY-MM-DD', autocomplete: 'off', inputmode: 'none', data: { qa_selector: 'expiry_date_field' } + = f.text_field :expires_at, class: 'datepicker gl-datepicker-input form-control gl-form-input', placeholder: 'YYYY-MM-DD', autocomplete: 'off' .form-group = f.label :scopes, _('Scopes'), class: 'label-bold' diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml index c3137120034..ce48691166b 100644 --- a/app/views/shared/boards/_show.html.haml +++ b/app/views/shared/boards/_show.html.haml @@ -15,10 +15,9 @@ %script#js-board-modal-filter{ type: "text/x-template" }= render "shared/issuable/search_bar", type: :boards_modal, show_sorting_dropdown: false %script#js-board-promotion{ type: "text/x-template" }= render_if_exists "shared/promotions/promote_issue_board" += render 'shared/issuable/search_bar', type: :boards, board: board #board-app.boards-app.position-relative{ "v-cloak" => "true", data: board_data, ":class" => "{ 'is-compact': detailIssueVisible }" } - = render 'shared/issuable/search_bar', type: :boards, board: board - - - if Feature.enabled?(:boards_with_swimlanes, current_board_parent) || Feature.enabled?(:graphql_board_lists, current_board_parent) + - if Feature.enabled?(:boards_with_swimlanes, current_board_parent, default_enabled: true) || Feature.enabled?(:graphql_board_lists, current_board_parent) %board-content{ "v-cloak" => "true", "ref" => "board_content", ":lists" => "state.lists", diff --git a/app/views/shared/boards/components/sidebar/_assignee.html.haml b/app/views/shared/boards/components/sidebar/_assignee.html.haml index af6a519a967..e22a7807b3b 100644 --- a/app/views/shared/boards/components/sidebar/_assignee.html.haml +++ b/app/views/shared/boards/components/sidebar/_assignee.html.haml @@ -23,7 +23,7 @@ %button.dropdown-menu-toggle.js-user-search.js-author-search.js-multiselect.js-save-user-data.js-issue-board-sidebar{ type: 'button', ref: 'assigneeDropdown', data: board_sidebar_user_data, ":data-issuable-id" => "issue.iid" } = dropdown_options[:title] - = icon("chevron-down") + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-select.dropdown-menu-user.dropdown-menu-selectable.dropdown-menu-author = dropdown_title("Assign to") = dropdown_filter("Search users") diff --git a/app/views/shared/boards/components/sidebar/_due_date.html.haml b/app/views/shared/boards/components/sidebar/_due_date.html.haml index d8ed3b13bf1..ab4d22ac03d 100644 --- a/app/views/shared/boards/components/sidebar/_due_date.html.haml +++ b/app/views/shared/boards/components/sidebar/_due_date.html.haml @@ -24,7 +24,7 @@ %button.dropdown-menu-toggle.js-due-date-select.js-issue-boards-due-date{ type: 'button', data: { toggle: 'dropdown', field_name: "issue[due_date]", ability_name: "issue" } } %span.dropdown-toggle-text= _("Due date") - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-menu-due-date = dropdown_title(_('Due date')) = dropdown_content do diff --git a/app/views/shared/boards/components/sidebar/_labels.html.haml b/app/views/shared/boards/components/sidebar/_labels.html.haml index 61f3ebcdba4..5af52d4de23 100644 --- a/app/views/shared/boards/components/sidebar/_labels.html.haml +++ b/app/views/shared/boards/components/sidebar/_labels.html.haml @@ -27,7 +27,7 @@ data: label_dropdown_data(@project, namespace_path: @namespace_path, field_name: "issue[label_names][]") } %span.dropdown-toggle-text {{ labelDropdownTitle }} - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable.dropdown-extended-height = render partial: "shared/issuable/label_page_default" - if can?(current_user, :admin_label, current_board_parent) diff --git a/app/views/shared/boards/components/sidebar/_milestone.html.haml b/app/views/shared/boards/components/sidebar/_milestone.html.haml index 2c894e9b1b3..6143f1d5afe 100644 --- a/app/views/shared/boards/components/sidebar/_milestone.html.haml +++ b/app/views/shared/boards/components/sidebar/_milestone.html.haml @@ -21,7 +21,7 @@ ":data-issuable-id" => "issue.iid", ":data-project-id" => "issue.project_id" } = _("Milestone") - = icon("chevron-down") + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-select.dropdown-menu-selectable = dropdown_title(_("Assign milestone")) = dropdown_filter(_("Search milestones")) diff --git a/app/views/shared/form_elements/_apply_template_warning.html.haml b/app/views/shared/form_elements/_apply_template_warning.html.haml index b1edfba6df4..73be0c741dc 100644 --- a/app/views/shared/form_elements/_apply_template_warning.html.haml +++ b/app/views/shared/form_elements/_apply_template_warning.html.haml @@ -1,6 +1,5 @@ -.form-group.row.js-template-warning.mb-0.hidden.js-issuable-template-warning{ :class => ("gl-mb-5!" if issuable.supports_issue_type? && can?(current_user, :admin_issue, @project)) } - .offset-sm-2.col-sm-10 - +.form-group.row.js-template-warning.hidden.js-issuable-template-warning + .col-sm-12 .warning_message.mb-0{ role: 'alert' } %btn.js-close-btn.js-dismiss-btn.close{ type: "button", "aria-hidden": true, "aria-label": _("Close") } = sprite_icon("close") diff --git a/app/views/shared/form_elements/_description.html.haml b/app/views/shared/form_elements/_description.html.haml index 413df29da77..7f4aed5d1f7 100644 --- a/app/views/shared/form_elements/_description.html.haml +++ b/app/views/shared/form_elements/_description.html.haml @@ -14,6 +14,9 @@ - if model.is_a?(Issuable) = render 'shared/issuable/form/template_selector', issuable: model + + = render 'shared/form_elements/apply_template_warning', issuable: model + = render layout: 'shared/md_preview', locals: { url: preview_url, referenced_users: true } do = render 'shared/zen', f: form, attr: :description, classes: 'note-textarea qa-issuable-form-description rspec-issuable-form-description', diff --git a/app/views/shared/groups/_empty_state.html.haml b/app/views/shared/groups/_empty_state.html.haml index f6b3a49eacb..1d3bc1d6959 100644 --- a/app/views/shared/groups/_empty_state.html.haml +++ b/app/views/shared/groups/_empty_state.html.haml @@ -1,8 +1,13 @@ -.group-empty-state.row.align-items-center.justify-content-center - .icon.text-center.order-md-2 +.row.gl-align-items-center.gl-justify-content-center + .order-md-2 = custom_icon("icon_empty_groups") - .text-content.m-0.order-md-1 + .text-content.order-md-1{ class: 'gl-m-0!' } %h4= s_("GroupsEmptyState|A group is a collection of several projects.") %p= s_("GroupsEmptyState|If you organize your projects under a group, it works like a folder.") %p= s_("GroupsEmptyState|You can manage your group member’s permissions and access to each project in the group.") + - if invite_group_members?(@group) + = link_to _('Invite your team'), + group_group_members_path(@group), + class: 'gl-button btn btn-success-secondary', + data: { track_event: 'click_invite_team_group_empty_state', track_label: 'invite_team_group_empty_state' } diff --git a/app/views/shared/groups/_search_form.html.haml b/app/views/shared/groups/_search_form.html.haml index 49b812baefc..a574394694d 100644 --- a/app/views/shared/groups/_search_form.html.haml +++ b/app/views/shared/groups/_search_form.html.haml @@ -1,2 +1,2 @@ = form_tag request.path, method: :get, class: "group-filter-form js-group-filter-form", id: 'group-filter-form' do |f| - = search_field_tag :filter, params[:filter], placeholder: s_('GroupsTree|Search by name'), class: 'group-filter-form-field form-control js-groups-list-filter qa-groups-filter', spellcheck: false, id: 'group-filter-form-field', tabindex: "2" + = search_field_tag :filter, params[:filter], placeholder: s_('GroupsTree|Search by name'), class: 'group-filter-form-field form-control js-groups-list-filter qa-groups-filter', spellcheck: false, id: 'group-filter-form-field' diff --git a/app/views/shared/issuable/_close_reopen_button.html.haml b/app/views/shared/issuable/_close_reopen_button.html.haml index 8365bc6f863..3453db9f209 100644 --- a/app/views/shared/issuable/_close_reopen_button.html.haml +++ b/app/views/shared/issuable/_close_reopen_button.html.haml @@ -21,5 +21,6 @@ - else = render 'shared/issuable/close_reopen_report_toggle', issuable: issuable, warn_before_close: add_blocked_class - else - = link_to _('Report abuse'), new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)), - class: 'd-none d-md-block btn btn-grouped btn-close-color', title: _('Report abuse') + - unless issuable.is_a?(MergeRequest) && issuable.merged? + = link_to _('Report abuse'), new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)), + class: 'd-none d-md-block btn btn-grouped btn-close-color', title: _('Report abuse') diff --git a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml index df441e6d0af..48d1e146629 100644 --- a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml +++ b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml @@ -21,7 +21,7 @@ data: { text: _("Close %{display_issuable_type}") % { display_issuable_type: display_issuable_type }, url: close_issuable_path(issuable), button_class: "#{button_class} btn-close", toggle_class: "#{toggle_class} btn-close-color" } } %button.btn.btn-transparent - = icon('check', class: 'icon') + = sprite_icon('check', css_class: 'icon') .description %strong.title = _('Close') @@ -31,7 +31,7 @@ data: { text: _("Reopen %{display_issuable_type}") % { display_issuable_type: display_issuable_type }, url: reopen_issuable_path(issuable), button_class: "#{button_class} btn-reopen", toggle_class: "#{toggle_class} btn-reopen-color" } } %button.btn.btn-transparent - = icon('check', class: 'icon') + = sprite_icon('check', css_class: 'icon') .description %strong.title = _('Reopen') diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 728b527f499..c0aba0eef7f 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -20,8 +20,6 @@ = render 'shared/issuable/form/title', issuable: issuable, form: form, has_wip_commits: commits && commits.detect(&:work_in_progress?) #js-suggestions{ data: { project_path: @project.full_path } } -= render 'shared/form_elements/apply_template_warning', issuable: issuable - = render 'shared/issuable/form/type_selector', issuable: issuable, form: form = render 'shared/form_elements/description', model: issuable, form: form, project: project diff --git a/app/views/shared/issuable/_label_dropdown.html.haml b/app/views/shared/issuable/_label_dropdown.html.haml index 535af522c1a..08883bb3372 100644 --- a/app/views/shared/issuable/_label_dropdown.html.haml +++ b/app/views/shared/issuable/_label_dropdown.html.haml @@ -26,7 +26,7 @@ - apply_is_default_styles = (selected.nil? || selected.empty?) && !no_default_styles %span.dropdown-toggle-text{ class: ("is-default" if apply_is_default_styles) } = multi_label_name(selected, label_name) - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable.dropdown-extended-height = render partial: "shared/issuable/label_page_default", locals: { title: dropdown_title, show_footer: show_footer, show_create: show_create } - if show_create && project && can?(current_user, :admin_label, project) diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index ae79d5e3c3e..00b235809ed 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -96,6 +96,7 @@ %li.filter-dropdown-item %button.btn.btn-link.js-data-value{ type: 'button' } {{title}} + = render_if_exists 'shared/issuable/filter_iteration', type: type #js-dropdown-release.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } @@ -181,7 +182,7 @@ = render 'shared/issuable/board_create_list_dropdown', board: board - if @project #js-add-issues-btn.gl-ml-3{ data: { can_admin_list: can?(current_user, :admin_list, @project) } } - - if current_user && Feature.enabled?(:boards_with_swimlanes, @group) + - if current_user && Feature.enabled?(:boards_with_swimlanes, @group, default_enabled: true) #js-board-epics-swimlanes-toggle #js-toggle-focus-btn - elsif is_not_boards_modal_or_productivity_analytics && show_sorting_dropdown diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 458703ebc5f..1f20c1a30aa 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -96,24 +96,14 @@ %button.dropdown-menu-toggle.js-due-date-select{ type: 'button', data: { toggle: 'dropdown', field_name: "#{issuable_type}[due_date]", ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], display: 'static' } } %span.dropdown-toggle-text = _('Due date') - = icon('chevron-down', 'aria-hidden': 'true') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-menu-due-date = dropdown_title(_('Due date')) = dropdown_content do .js-due-date-calendar - .js-sidebar-labels{ data: { allow_label_create: issuable_sidebar.dig(:current_user, :can_admin_label).to_s, - allow_scoped_labels: issuable_sidebar[:scoped_labels_available].to_s, - can_edit: can_edit_issuable.to_s, - iid: issuable_sidebar[:iid], - issuable_type: issuable_type, - labels_fetch_path: issuable_sidebar[:project_labels_path], - labels_manage_path: project_labels_path(@project), - labels_update_path: issuable_sidebar[:issuable_json_path], - project_issues_path: issuable_sidebar[:project_issuables_path], - project_path: @project.full_path, - selected_labels: issuable_sidebar[:labels].to_json } } + .js-sidebar-labels{ data: sidebar_labels_data(issuable_sidebar, @project) } = render_if_exists 'shared/issuable/sidebar_weight', issuable_sidebar: issuable_sidebar diff --git a/app/views/shared/issuable/_sort_dropdown.html.haml b/app/views/shared/issuable/_sort_dropdown.html.haml index 81dbecb430b..f60be3f3e4a 100644 --- a/app/views/shared/issuable/_sort_dropdown.html.haml +++ b/app/views/shared/issuable/_sort_dropdown.html.haml @@ -7,7 +7,7 @@ .btn-group{ role: 'group' } %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } = sort_title - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort %li = sortable_item(sort_title_priority, page_filter_path(sort: sort_value_priority), sort_title) diff --git a/app/views/shared/issuable/csv_export/_button.html.haml b/app/views/shared/issuable/csv_export/_button.html.haml new file mode 100644 index 00000000000..3584c9c1ed5 --- /dev/null +++ b/app/views/shared/issuable/csv_export/_button.html.haml @@ -0,0 +1,4 @@ +- if current_user + %button.csv_download_link.btn.gl-button.has-tooltip{ title: _('Export as CSV'), + data: { toggle: 'modal', target: ".#{issuable_type}-export-modal", qa_selector: 'export_as_csv_button' } } + = sprite_icon('export') diff --git a/app/views/shared/issuable/csv_export/_modal.html.haml b/app/views/shared/issuable/csv_export/_modal.html.haml new file mode 100644 index 00000000000..4a4c6b90cd9 --- /dev/null +++ b/app/views/shared/issuable/csv_export/_modal.html.haml @@ -0,0 +1,29 @@ +- class_name = "#{issuable_type.dasherize}-export-modal" +- if current_user + .modal.issuable-export-modal{ class: class_name } + .modal-dialog + .modal-content{ data: { qa_selector: "export_issuable_modal" } } + .modal-header + %h3 + = _("Export %{issuable_type}" % { issuable_type: issuable_type.humanize(capitalize: false) }) + .svg-content.import-export-svg-container + = image_tag 'illustrations/export-import.svg', role: "presentation", class: 'illustration' + %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } + = sprite_icon('close', css_class: 'gl-icon') + .modal-body + - issuable_count = issuables_count_for_state(issuable_type.to_sym, params[:state]) + - unless issuable_count == -1 # The count timed out + .modal-subheader + = sprite_icon('check', css_class: 'gl-icon gl-color-green-400') + %strong.gl-ml-3 + - if issuable_type.eql?('merge_requests') + = n_("%{count} merge request selected", "%{count} merge requests selected", issuable_count) % { count: issuable_count } + - else + = n_("%{count} issue selected", "%{count} issues selected", issuable_count) % { count: issuable_count } + .modal-text + = html_escape(_('The CSV export will be created in the background. Once finished, it will be sent to %{strong_open}%{email}%{strong_close} in an attachment.')) % { email: @current_user.notification_email, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } + .modal-footer + - if issuable_type.eql?('merge_requests') + = link_to _("Export merge requests"), export_csv_project_merge_requests_path(@project, request.query_parameters), method: :post, class: 'btn gl-button btn-success', data: { track_label: "export_merge_requests_csv", track_event: "click_button", track_value: "" } + - else + = link_to _('Export issues'), export_csv_project_issues_path(@project, request.query_parameters), method: :post, class: 'btn gl-button btn-success', data: { track_label: "export_issues_csv", track_event: "click_button", track_value: "", qa_selector: "export_issues_button" } diff --git a/app/views/shared/issuable/form/_type_selector.html.haml b/app/views/shared/issuable/form/_type_selector.html.haml index 3347966f39a..5d64c15d9f9 100644 --- a/app/views/shared/issuable/form/_type_selector.html.haml +++ b/app/views/shared/issuable/form/_type_selector.html.haml @@ -8,7 +8,7 @@ %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' } %span.dropdown-toggle-text.is-default = issuable.issue_type.capitalize || _("Select type") - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-menu-selectable.dropdown-select .dropdown-title.gl-display-flex %span.gl-ml-auto diff --git a/app/views/shared/issue_type/_details_content.html.haml b/app/views/shared/issue_type/_details_content.html.haml new file mode 100644 index 00000000000..7c1ec332ba4 --- /dev/null +++ b/app/views/shared/issue_type/_details_content.html.haml @@ -0,0 +1,31 @@ +- related_branches_path = related_branches_project_issue_path(@project, issuable) + +.issue-details.issuable-details + .detail-page-description.content-block + #js-issuable-app{ data: { initial: issuable_initial_data(issuable).to_json} } + .title-container + %h2.title= markdown_field(issuable, :title) + - if issuable.description.present? + .description + .md= markdown_field(issuable, :description) + + = edited_time_ago_with_tooltip(issuable, placement: 'bottom', html_class: 'issue-edited-ago js-issue-edited-ago') + + = render 'shared/issue_type/sentry_stack_trace', issuable: issuable + + = render 'projects/issues/design_management' + + = render_if_exists 'projects/issues/related_issues' + + #js-related-merge-requests{ data: { endpoint: expose_path(api_v4_projects_issues_related_merge_requests_path(id: @project.id, issue_iid: issuable.iid)), project_namespace: @project.namespace.path, project_path: @project.path } } + + - if can?(current_user, :download_code, @project) + - add_page_startup_api_call related_branches_path + #related-branches{ data: { url: related_branches_path } } + -# This element is filled in using JavaScript. + + = render 'shared/issue_type/emoji_block', issuable: issuable + + = render 'projects/issues/discussion' + += render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @issue.assignees diff --git a/app/views/shared/issue_type/_details_header.html.haml b/app/views/shared/issue_type/_details_header.html.haml new file mode 100644 index 00000000000..ea4df288839 --- /dev/null +++ b/app/views/shared/issue_type/_details_header.html.haml @@ -0,0 +1,55 @@ +- can_update_issue = can?(current_user, :update_issue, issuable) +- can_reopen_issue = can?(current_user, :reopen_issue, issuable) +- can_report_spam = issuable.submittable_as_spam_by?(current_user) +- can_create_issue = show_new_issue_link?(@project) +- display_issuable_type = issuable_display_type(issuable) +- new_issuable_params = ({ issuable_template: 'incident', issue: { issue_type: 'incident' } } if issuable.incident?) + +.detail-page-header + .detail-page-header-body + .issuable-status-box.status-box.status-box-issue-closed{ class: issue_status_visibility(issuable, status_box: :closed) } + = sprite_icon('mobile-issue-close', css_class: 'gl-display-block gl-display-sm-none!') + .gl-display-none.gl-display-sm-block! + = issue_closed_text(issuable, current_user) + .issuable-status-box.status-box.status-box-open{ class: issue_status_visibility(issuable, status_box: :open) } + = sprite_icon('issue-open-m', css_class: 'gl-display-block gl-display-sm-none!') + %span.gl-display-none.gl-display-sm-block! + = _('Open') + + .issuable-meta + #js-issuable-header-warnings + = issuable_meta(issuable, @project, display_issuable_type) + + %a.btn.gl-button.btn-default.float-right.gl-display-block.d-sm-none.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" } + = sprite_icon('chevron-double-lg-left') + + - if Feature.enabled?(:vue_issue_header, @project, default_enabled: true) + .js-issue-header-actions{ data: issue_header_actions_data(@project, issuable, current_user) } + - else + .detail-page-header-actions.js-issuable-actions.js-issuable-buttons{ data: { "action": "close-reopen" } } + .clearfix.issue-btn-group.dropdown + %button.btn.gl-button.btn-default.float-left.gl-display-md-none{ type: "button", data: { toggle: "dropdown" } } + = _('Options') + = icon('caret-down') + .dropdown-menu.dropdown-menu-right + %ul + - unless current_user == issuable.author + %li= link_to _('Report abuse'), new_abuse_report_path(user_id: issuable.author.id, ref_url: issue_url(issuable)) + - if can_update_issue + %li= link_to _('Close %{display_issuable_type}') % { display_issuable_type: display_issuable_type }, issue_path(issuable, issue: { state_event: :close }, format: 'json'), class: "btn-close js-btn-issue-action #{issue_button_visibility(issuable, true)}", title: _('Close %{display_issuable_type}') % { display_issuable_type: display_issuable_type }, data: { endpoint: close_reopen_issuable_path(issuable) } + - if can_reopen_issue + %li= link_to _('Reopen %{display_issuable_type}') % { display_issuable_type: display_issuable_type }, issue_path(issuable, issue: { state_event: :reopen }, format: 'json'), class: "btn-reopen js-btn-issue-action #{issue_button_visibility(issuable, false)}", title: _('Reopen %{display_issuable_type}') % { display_issuable_type: display_issuable_type }, data: { endpoint: close_reopen_issuable_path(issuable) } + - if can_report_spam + %li= link_to _('Submit as spam'), mark_as_spam_project_issue_path(@project, issuable), method: :post, class: 'btn-spam', title: 'Submit as spam' + - if can_create_issue + - if can_update_issue || can_report_spam + %li.divider + %li= link_to _('New %{display_issuable_type}') % { display_issuable_type: display_issuable_type }, new_project_issue_path(@project, new_issuable_params), id: 'new_%{display_issuable_type}_link' % { display_issuable_type: display_issuable_type } + + = render 'shared/issuable/close_reopen_button', issuable: issuable, can_update: can_update_issue, can_reopen: can_reopen_issue, warn_before_close: defined?(issuable.blocked?) && issuable.blocked? + + - if can_report_spam + = link_to _('Submit as spam'), mark_as_spam_project_issue_path(@project, issuable), method: :post, class: 'gl-display-none gl-display-md-block gl-button btn btn-grouped btn-spam', title: 'Submit as spam' + - if can_create_issue + = link_to new_project_issue_path(@project, new_issuable_params), class: 'gl-display-none gl-display-md-block gl-button btn btn-grouped btn-success btn-inverted', title: _('New %{display_issuable_type}') % { display_issuable_type: display_issuable_type }, id: 'new_%{display_issuable_type}_link' % { display_issuable_type: display_issuable_type } do + = _('New %{display_issuable_type}') % { display_issuable_type: display_issuable_type } diff --git a/app/views/shared/issue_type/_emoji_block.html.haml b/app/views/shared/issue_type/_emoji_block.html.haml new file mode 100644 index 00000000000..42d149b2ab3 --- /dev/null +++ b/app/views/shared/issue_type/_emoji_block.html.haml @@ -0,0 +1,9 @@ +.content-block.emoji-block.emoji-block-sticky + .row.gl-m-0.gl-justify-content-space-between + .js-noteable-awards + = render 'award_emoji/awards_block', awardable: issuable, inline: true + .new-branch-col + = render_if_exists "projects/issues/timeline_toggle", issuable: issuable + #js-vue-sort-issue-discussions + #js-vue-discussion-filter{ data: { default_filter: current_user&.notes_filter_for(issuable), notes_filters: UserPreference.notes_filters.to_json } } + = render 'new_branch' if show_new_branch_button? diff --git a/app/views/shared/issue_type/_sentry_stack_trace.html.haml b/app/views/shared/issue_type/_sentry_stack_trace.html.haml new file mode 100644 index 00000000000..40b29a74b53 --- /dev/null +++ b/app/views/shared/issue_type/_sentry_stack_trace.html.haml @@ -0,0 +1,4 @@ +- return unless issuable.sentry_issue.present? +- add_page_specific_style 'page_bundles/error_tracking_details' + +#js-sentry-error-stack-trace{ data: error_details_data(@project, issuable.sentry_issue.sentry_issue_identifier) } diff --git a/app/views/shared/members/_filter_2fa_dropdown.html.haml b/app/views/shared/members/_filter_2fa_dropdown.html.haml index a2bc5e9ecdf..8187a9bde15 100644 --- a/app/views/shared/members/_filter_2fa_dropdown.html.haml +++ b/app/views/shared/members/_filter_2fa_dropdown.html.haml @@ -1,7 +1,7 @@ - filter = params[:two_factor] || 'everyone' - filter_options = { 'everyone' => _('Everyone'), 'enabled' => _('Enabled'), 'disabled' => _('Disabled') } -.dropdown.inline.member-filter-2fa-dropdown - = dropdown_toggle(filter_options[filter], { toggle: 'dropdown' }) +.dropdown.inline.member-filter-2fa-dropdown{ data: { testid: 'member-filter-2fa-dropdown' } } + = dropdown_toggle(filter_options[filter], { toggle: 'dropdown', testid: 'dropdown-toggle' }) %ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable %li.dropdown-header = _("Filter by two-factor authentication") diff --git a/app/views/shared/members/_invite_group.html.haml b/app/views/shared/members/_invite_group.html.haml index a87a4c6a45c..5e3a6918ab2 100644 --- a/app/views/shared/members/_invite_group.html.haml +++ b/app/views/shared/members/_invite_group.html.haml @@ -13,7 +13,7 @@ = label_tag group_access_field, _("Max access level"), class: "label-bold" .select-wrapper = select_tag group_access_field, options_for_select(access_levels, default_access_level), data: { qa_selector: 'group_access_field' }, class: "form-control select-control" - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "gl-icon gl-absolute gl-top-3 gl-right-3 gl-text-gray-200") .form-text.text-muted.gl-mb-3 - permissions_docs_path = help_page_path('user/permissions') - link_start = %q{<a href="%{url}">}.html_safe % { url: permissions_docs_path } diff --git a/app/views/shared/members/_invite_member.html.haml b/app/views/shared/members/_invite_member.html.haml index 5f9046b3dcb..59b0600e2dd 100644 --- a/app/views/shared/members/_invite_member.html.haml +++ b/app/views/shared/members/_invite_member.html.haml @@ -5,7 +5,7 @@ - import_path = local_assigns[:import_path] .row .col-sm-12 - = form_tag submit_url, class: 'invite-users-form', method: :post do + = form_tag submit_url, class: 'invite-users-form', data: { testid: 'invite-users-form' }, method: :post do .form-group = label_tag :user_ids, _("GitLab member or Email address"), class: "label-bold" = users_select_tag(:user_ids, multiple: true, class: 'input-clamp qa-member-select-field', scope: :all, email_user: true, placeholder: 'Search for members to update or invite') @@ -13,7 +13,7 @@ = label_tag :access_level, _("Choose a role permission"), class: "label-bold" .select-wrapper = select_tag :access_level, options_for_select(access_levels, default_access_level), class: "form-control project-access-select select-control" - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "gl-icon gl-absolute gl-top-3 gl-right-3 gl-text-gray-200") .form-text.text-muted.gl-mb-3 - permissions_docs_path = help_page_path('user/permissions') - link_start = %q{<a href="%{url}">}.html_safe % { url: permissions_docs_path } diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml index 164d38986ec..e294936f82c 100644 --- a/app/views/shared/members/_member.html.haml +++ b/app/views/shared/members/_member.html.haml @@ -2,6 +2,9 @@ - show_controls = local_assigns.fetch(:show_controls, true) - force_mobile_view = local_assigns.fetch(:force_mobile_view, false) - member = local_assigns.fetch(:member) +- current_user_is_group_owner = local_assigns.fetch(:current_user_is_group_owner, false) +- membership_source = local_assigns.fetch(:membership_source) +- group = local_assigns.fetch(:group) - user = local_assigns.fetch(:user, member.user) - source = member.source - override = member.try(:override) @@ -25,13 +28,13 @@ = render 'shared/members/its_you_badge', user: user, current_user: current_user - = render_if_exists 'shared/members/ee/license_badge', user: user, group: @group + = render_if_exists 'shared/members/ee/license_badge', user: user, group: group, current_user_is_group_owner: current_user_is_group_owner = render 'shared/members/blocked_badge', user: user = render 'shared/members/two_factor_auth_badge', user: user - - if source.instance_of?(Group) && source != @group + - if source.instance_of?(Group) && source != membership_source · = link_to source.full_name, source, class: "gl-display-inline-block inline-link" @@ -57,10 +60,9 @@ = link_to member.created_by.name, user_path(member.created_by) = time_ago_with_tooltip(member.created_at) - if show_roles - - current_resource = @project || @group .controls.member-controls.align-items-center = render_if_exists 'shared/members/ee/ldap_tag', can_override: member.can_override? - - if show_controls && member.source == current_resource + - if show_controls && member.source == membership_source - if member.can_resend_invite? = link_to sprite_icon('paper-airplane'), polymorphic_path([:resend_invite, member]), @@ -88,7 +90,7 @@ class: ("is-active" if member.access_level == role_id), data: { id: role_id, el_id: dom_id(member), qa_selector: "#{role.downcase}_access_level_link" } = render_if_exists 'shared/members/ee/revert_ldap_group_sync_option', - group: @group, + group: group, member: member, can_override: member.can_override? .clearable-input.member-form-control{ class: [("d-sm-inline-block" unless force_mobile_view)] } @@ -105,12 +107,12 @@ - if member.can_approve? = link_to polymorphic_path([:approve_access_request, member]), method: :post, - class: "btn btn-success align-self-center m-0 mb-2 #{'mb-sm-0 ml-sm-2' unless force_mobile_view}", + class: "btn btn-success btn-icon gl-button align-self-center m-0 mb-2 #{'mb-sm-0 ml-sm-2' unless force_mobile_view}", title: _('Grant access') do %span{ class: ('d-block d-sm-none' unless force_mobile_view) } = _('Grant access') - unless force_mobile_view - = icon('check inverse', class: 'd-none d-sm-block') + = sprite_icon('check', css_class: 'd-none d-sm-block') - if member.can_remove? - if current_user == user @@ -125,8 +127,8 @@ = _("Delete") - unless force_mobile_view = sprite_icon('remove', css_class: 'd-none d-sm-block gl-icon') - = render_if_exists 'shared/members/ee/override_member_buttons', group: @group, member: member, user: user, action: :edit, can_override: member.can_override? + = render_if_exists 'shared/members/ee/override_member_buttons', group: group, member: member, user: user, action: :edit, can_override: member.can_override? - else %span.member-access-text.user-access-role= member.human_access -= render_if_exists 'shared/members/ee/override_member_buttons', group: @group, member: member, user: user, action: :confirm, can_override: member.can_override? += render_if_exists 'shared/members/ee/override_member_buttons', group: group, member: member, user: user, action: :confirm, can_override: member.can_override? diff --git a/app/views/shared/members/_requests.html.haml b/app/views/shared/members/_requests.html.haml index e1e7aa36a78..3aa43ed1922 100644 --- a/app/views/shared/members/_requests.html.haml +++ b/app/views/shared/members/_requests.html.haml @@ -1,6 +1,8 @@ - membership_source = local_assigns.fetch(:membership_source) - requesters = local_assigns.fetch(:requesters) - force_mobile_view = local_assigns.fetch(:force_mobile_view, false) +- group = local_assigns.fetch(:group) +- current_user_is_group_owner = group && group.has_owner?(current_user) - return if requesters.empty? @@ -10,4 +12,9 @@ %strong= membership_source.name %span.badge.badge-pill= requesters.size %ul.content-list.members-list - = render partial: 'shared/members/member', collection: requesters, as: :member, locals: { force_mobile_view: force_mobile_view } + = render partial: 'shared/members/member', + collection: requesters, as: :member, + locals: { membership_source: membership_source, + group: group, + force_mobile_view: force_mobile_view, + current_user_is_group_owner: current_user_is_group_owner } diff --git a/app/views/shared/members/_search_field.html.haml b/app/views/shared/members/_search_field.html.haml index e70cb063324..b1e3134f7aa 100644 --- a/app/views/shared/members/_search_field.html.haml +++ b/app/views/shared/members/_search_field.html.haml @@ -2,5 +2,5 @@ .search-control-wrap.gl-relative = search_field_tag name, params[name], { placeholder: _('Search'), class: 'form-control', spellcheck: false } - %button.user-search-btn.border-left.gl-display-flex.gl-align-items-center.gl-justify-content-center{ type: 'submit', 'aria': { label: _('Submit search') } } + %button.user-search-btn.border-left.gl-display-flex.gl-align-items-center.gl-justify-content-center{ type: 'submit', 'aria': { label: _('Submit search') }, data: { testid: 'user-search-submit' } } = sprite_icon('search') diff --git a/app/views/shared/members/_sort_dropdown.html.haml b/app/views/shared/members/_sort_dropdown.html.haml index 606d3bcdfa8..682e3a0433b 100644 --- a/app/views/shared/members/_sort_dropdown.html.haml +++ b/app/views/shared/members/_sort_dropdown.html.haml @@ -1,5 +1,5 @@ -.dropdown.inline.qa-user-sort-dropdown - = dropdown_toggle(member_sort_options_hash[@sort], { toggle: 'dropdown' }) +.dropdown.inline.qa-user-sort-dropdown{ data: { testid: 'user-sort-dropdown' } } + = dropdown_toggle(member_sort_options_hash[@sort], { toggle: 'dropdown', testid: 'dropdown-toggle' }) %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable %li.dropdown-header = _("Sort by") @@ -8,12 +8,12 @@ = link_to filter_group_project_member_path(sort: value), class: ("is-active" if @sort == value) do = title %li.divider - %li{ data: { 'qa-selector': 'filter-members-with-inherited-permissions' } } + %li{ data: { testid: 'filter-members-with-inherited-permissions' } } = link_to filter_group_project_member_path(with_inherited_permissions: nil), class: ("is-active" unless params[:with_inherited_permissions].present?) do = _("Show all members") - %li{ data: { 'qa-selector': 'filter-members-with-inherited-permissions' } } + %li{ data: { testid: 'filter-members-with-inherited-permissions' } } = link_to filter_group_project_member_path(with_inherited_permissions: 'exclude'), class: ("is-active" if params[:with_inherited_permissions] == 'exclude') do = _("Show only direct members") - %li{ data: { 'qa-selector': 'filter-members-with-inherited-permissions' } } + %li{ data: { testid: 'filter-members-with-inherited-permissions' } } = link_to filter_group_project_member_path(with_inherited_permissions: 'only'), class: ("is-active" if params[:with_inherited_permissions] == 'only') do = _("Show only inherited members") diff --git a/app/views/shared/milestones/_delete_button.html.haml b/app/views/shared/milestones/_delete_button.html.haml index 7a813e110c4..09c783a0b24 100644 --- a/app/views/shared/milestones/_delete_button.html.haml +++ b/app/views/shared/milestones/_delete_button.html.haml @@ -1,6 +1,6 @@ - milestone_url = @milestone.project_milestone? ? project_milestone_path(@project, @milestone) : group_milestone_path(@group, @milestone) -%button.js-delete-milestone-button.btn.btn-grouped.btn-danger{ data: { milestone_id: @milestone.id, +%button.js-delete-milestone-button.btn.gl-button.btn-grouped.btn-danger{ data: { milestone_id: @milestone.id, milestone_title: markdown_field(@milestone, :title), milestone_url: milestone_url, milestone_issue_count: @milestone.issues.count, diff --git a/app/views/shared/milestones/_header.html.haml b/app/views/shared/milestones/_header.html.haml index ea90b674b34..93da319fce7 100644 --- a/app/views/shared/milestones/_header.html.haml +++ b/app/views/shared/milestones/_header.html.haml @@ -11,10 +11,10 @@ .milestone-buttons - if can?(current_user, :admin_milestone, @group || @project) - = link_to _('Edit'), edit_milestone_path(milestone), class: 'btn btn-grouped' + = link_to _('Edit'), edit_milestone_path(milestone), class: 'btn gl-button btn-grouped' - if milestone.project_milestone? && milestone.project.group - %button.js-promote-project-milestone-button.btn.btn-grouped{ data: { toggle: 'modal', + %button.js-promote-project-milestone-button.btn.gl-button.btn-grouped{ data: { toggle: 'modal', target: '#promote-milestone-modal', milestone_title: milestone.title, group_name: milestone.project.group.name, @@ -26,11 +26,11 @@ #promote-milestone-modal - if milestone.active? - = link_to _('Close milestone'), update_milestone_path(milestone, { state_event: :close }), method: :put, class: 'btn btn-grouped btn-close' + = link_to _('Close milestone'), update_milestone_path(milestone, { state_event: :close }), method: :put, class: 'btn gl-button btn-grouped btn-close' - else - = link_to _('Reopen milestone'), update_milestone_path(milestone, { state_event: :activate }), method: :put, class: 'btn btn-grouped btn-reopen' + = link_to _('Reopen milestone'), update_milestone_path(milestone, { state_event: :activate }), method: :put, class: 'btn gl-button btn-grouped btn-reopen' = render 'shared/milestones/delete_button' - %button.btn.btn-default.btn-grouped.float-right.d-block.d-sm-none.js-sidebar-toggle{ type: 'button' } + %button.btn.gl-button.btn-default.btn-grouped.float-right.d-block.d-sm-none.js-sidebar-toggle{ type: 'button' } = sprite_icon('chevron-double-lg-left') diff --git a/app/views/shared/milestones/_labels_tab.html.haml b/app/views/shared/milestones/_labels_tab.html.haml index 3b4d29ca7b0..a419e749f35 100644 --- a/app/views/shared/milestones/_labels_tab.html.haml +++ b/app/views/shared/milestones/_labels_tab.html.haml @@ -7,8 +7,8 @@ %span.prepend-description-left = markdown_field(label, :description) - .float-right.d-none.d-lg-block.d-xl-block - = link_to milestones_issues_path(options.merge(state: 'opened')), class: 'btn btn-transparent btn-action' do + .float-right.d-none.d-lg-block + = link_to milestones_issues_path(options.merge(state: 'opened')), class: 'btn gl-button btn-default-tertiary btn-action' do - pluralize milestone_issues_by_label_count(@milestone, label, state: :opened), _('open issue') - = link_to milestones_issues_path(options.merge(state: 'closed')), class: 'btn btn-transparent btn-action' do + = link_to milestones_issues_path(options.merge(state: 'closed')), class: 'btn gl-button btn-default-tertiary btn-action' do - pluralize milestone_issues_by_label_count(@milestone, label, state: :closed), _('closed issue') diff --git a/app/views/shared/milestones/_milestone.html.haml b/app/views/shared/milestones/_milestone.html.haml index f28aa406784..1597a011a45 100644 --- a/app/views/shared/milestones/_milestone.html.haml +++ b/app/views/shared/milestones/_milestone.html.haml @@ -46,7 +46,7 @@ .milestone-actions.d-flex.justify-content-sm-start.justify-content-md-end - if @project # if in milestones list on project level - if can_admin_group_milestones? - %button.js-promote-project-milestone-button.btn.btn-blank.btn-sm.btn-grouped.has-tooltip{ title: s_('Milestones|Promote to Group Milestone'), + %button.js-promote-project-milestone-button.btn.gl-button.btn-default-tertiary.btn-sm.btn-grouped.has-tooltip{ title: s_('Milestones|Promote to Group Milestone'), disabled: true, type: 'button', data: { url: promote_project_milestone_path(milestone.project, milestone), @@ -59,6 +59,6 @@ - if can?(current_user, :admin_milestone, milestone) - if milestone.closed? - = link_to s_('Milestones|Reopen Milestone'), milestone_path(milestone, milestone: { state_event: :activate }), method: :put, class: "btn btn-sm btn-grouped btn-reopen" + = link_to s_('Milestones|Reopen Milestone'), milestone_path(milestone, milestone: { state_event: :activate }), method: :put, class: "btn gl-button btn-sm btn-grouped btn-reopen" - else - = link_to s_('Milestones|Close Milestone'), milestone_path(milestone, milestone: { state_event: :close }), method: :put, class: "btn btn-sm btn-grouped btn-close" + = link_to s_('Milestones|Close Milestone'), milestone_path(milestone, milestone: { state_event: :close }), method: :put, class: "btn gl-button btn-warning-secondary btn-sm btn-grouped btn-close" diff --git a/app/views/shared/notes/_comment_button.html.haml b/app/views/shared/notes/_comment_button.html.haml index e151e55d0d2..45af4b51b27 100644 --- a/app/views/shared/notes/_comment_button.html.haml +++ b/app/views/shared/notes/_comment_button.html.haml @@ -10,7 +10,7 @@ %ul#resolvable-comment-menu.dropdown-menu.dropdown-open-top{ data: { dropdown: true } } %li#comment.droplab-item-selected{ data: { value: '', 'submit-text' => _('Comment'), 'close-text' => _("Comment & close %{noteable_name}") % { noteable_name: noteable_name }, 'reopen-text' => _("Comment & reopen %{noteable_name}") % { noteable_name: noteable_name } } } %button.btn.btn-transparent - = icon('check', class: 'icon') + = sprite_icon('check', css_class: 'icon') .description %strong= _("Comment") %p @@ -20,7 +20,7 @@ %li#discussion{ data: { value: 'DiscussionNote', 'submit-text' => _('Start thread'), 'close-text' => _("Start thread & close %{noteable_name}") % { noteable_name: noteable_name }, 'reopen-text' => _("Start thread & reopen %{noteable_name}") % { noteable_name: noteable_name } } } %button.btn.btn-transparent - = icon('check', class: 'icon') + = sprite_icon('check', css_class: 'icon') .description %strong= _("Start thread") %p diff --git a/app/views/shared/notes/_hints.html.haml b/app/views/shared/notes/_hints.html.haml index 3703cca2290..a03e8446f5d 100644 --- a/app/views/shared/notes/_hints.html.haml +++ b/app/views/shared/notes/_hints.html.haml @@ -23,13 +23,20 @@ = sprite_icon('media', css_class: 'gl-icon gl-vertical-align-text-bottom') %span.uploading-error-message -# Populated by app/assets/javascripts/dropzone_input.js - %button.retry-uploading-link{ type: 'button' }= _("Try again") - or - %button.attach-new-file.markdown-selector{ type: 'button' }= _("attach a new file") + %button.btn.gl-button.btn-link.gl-vertical-align-baseline.retry-uploading-link + %span.gl-button-text + = _("Try again") + = _("or") + %button.btn.gl-button.btn-link.attach-new-file.markdown-selector.gl-vertical-align-baseline + %span.gl-button-text + = _("attach a new file") + = _(".") - %button.btn.markdown-selector.button-attach-file.btn-link{ type: 'button' } + %button.btn.gl-button.btn-link.button-attach-file.markdown-selector.button-attach-file.gl-vertical-align-text-bottom = sprite_icon('media') - %span.text-attach-file<> + %span.gl-button-text = _("Attach a file") - %button.btn.btn-default.btn-sm.hide.button-cancel-uploading-files{ type: 'button' }= _("Cancel") + %button.btn.gl-button.btn-link.button-cancel-uploading-files.gl-vertical-align-baseline.hide + %span.gl-button-text + = _("Cancel") diff --git a/app/views/shared/notes/_note.html.haml b/app/views/shared/notes/_note.html.haml index 97ed2852871..f1352be28e3 100644 --- a/app/views/shared/notes/_note.html.haml +++ b/app/views/shared/notes/_note.html.haml @@ -72,7 +72,7 @@ = image_tag note.attachment.url, class: 'note-image-attach' .attachment = link_to note.attachment.url, target: '_blank' do - = icon('paperclip') + = sprite_icon('paperclip') = note.attachment_identifier = link_to delete_attachment_project_note_path(note.project, note), title: _('Delete this attachment'), method: :delete, remote: true, data: { confirm: _('Are you sure you want to remove the attachment?') }, class: 'danger js-note-attachment-delete' do diff --git a/app/views/shared/notes/_notes_with_form.html.haml b/app/views/shared/notes/_notes_with_form.html.haml index 9baa340376b..1b03225d48d 100644 --- a/app/views/shared/notes/_notes_with_form.html.haml +++ b/app/views/shared/notes/_notes_with_form.html.haml @@ -19,7 +19,7 @@ = render "shared/notes/form", view: diff_view, supports_autocomplete: autocomplete - elsif !current_user .disabled-comment.text-center.gl-mt-3 - - link_to_register = link_to(_("register"), new_session_path(:user, redirect_to_referer: 'yes', anchor: 'register-pane'), class: 'js-register-link') + - link_to_register = link_to(_("register"), new_user_registration_path(redirect_to_referer: 'yes'), class: 'js-register-link') - link_to_sign_in = link_to(_("sign in"), new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-sign-in-link') = _("Please %{link_to_register} or %{link_to_sign_in} to comment").html_safe % { link_to_register: link_to_register, link_to_sign_in: link_to_sign_in } - elsif discussion_locked diff --git a/app/views/shared/notifications/_custom_notifications.html.haml b/app/views/shared/notifications/_custom_notifications.html.haml index 51b7da7dee8..946e3c67dcf 100644 --- a/app/views/shared/notifications/_custom_notifications.html.haml +++ b/app/views/shared/notifications/_custom_notifications.html.haml @@ -30,4 +30,5 @@ %label.form-check-label{ for: field_id } %strong = notification_event_name(event) - .fa.custom-notification-event-loading.spinner + %span.spinner.is-loading.gl-vertical-align-middle.gl-display-none + = sprite_icon('check', css_class: 'is-done gl-display-none gl-vertical-align-middle gl-text-green-600') diff --git a/app/views/shared/notifications/_new_button.html.haml b/app/views/shared/notifications/_new_button.html.haml index fbcfec5fd96..14f4b04ef78 100644 --- a/app/views/shared/notifications/_new_button.html.haml +++ b/app/views/shared/notifications/_new_button.html.haml @@ -1,4 +1,5 @@ - btn_class = local_assigns.fetch(:btn_class, '') +- dropdown_container_class = local_assigns.fetch(:dropdown_container_class, '') - emails_disabled = local_assigns.fetch(:emails_disabled, false) - if notification_setting @@ -8,8 +9,8 @@ - else - button_title = _("Notification setting - %{notification_title}") % { notification_title: notification_title(notification_setting.level) } - .js-notification-dropdown.notification-dropdown.home-panel-action-button.gl-mt-3.gl-mr-3.dropdown.inline - = form_for notification_setting, remote: true, html: { class: "inline notification-form no-label" } do |f| + .js-notification-dropdown.notification-dropdown.home-panel-action-button.gl-mt-3.dropdown.inline{ class: dropdown_container_class } + = form_for notification_setting, remote: true, html: { class: "notification-form no-label" } do |f| = hidden_setting_source_input(notification_setting) = hidden_field_tag "hide_label", true = f.hidden_field :level, class: "notification_setting_level" diff --git a/app/views/shared/projects/_search_form.html.haml b/app/views/shared/projects/_search_form.html.haml index 7b76d6d789b..e96a9152c80 100644 --- a/app/views/shared/projects/_search_form.html.haml +++ b/app/views/shared/projects/_search_form.html.haml @@ -7,7 +7,6 @@ class: "project-filter-form-field form-control #{form_field_classes}", spellcheck: false, id: 'project-filter-form-field', - tabindex: "2", autofocus: local_assigns[:autofocus] - if local_assigns[:icon] diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index 9c60201412c..c5234f14090 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -78,6 +78,18 @@ %strong= s_('Webhooks|Deployment events') %p.text-muted.ml-1 = s_('Webhooks|This URL is triggered when a deployment starts, finishes, fails, or is canceled') + %li + = form.check_box :feature_flag_events, class: 'form-check-input' + = form.label :feature_flag_events, class: 'list-label form-check-label ml-1' do + %strong= s_('Webhooks|Feature Flag events') + %p.text-muted.ml-1 + = s_('Webhooks|This URL is triggered when a feature flag is turned on or off') + %li + = form.check_box :releases_events, class: 'form-check-input' + = form.label :releases_events, class: 'list-label form-check-label ml-1' do + %strong= s_('Webhooks|Releases events') + %p.text-muted.ml-1 + = s_('Webhooks|This URL is triggered when a release is created/updated') .form-group = form.label :enable_ssl_verification, s_('Webhooks|SSL verification'), class: 'label-bold checkbox' .form-check diff --git a/app/views/shared/wikis/_sidebar.html.haml b/app/views/shared/wikis/_sidebar.html.haml index 893661755ab..c0ed7b4c6f2 100644 --- a/app/views/shared/wikis/_sidebar.html.haml +++ b/app/views/shared/wikis/_sidebar.html.haml @@ -1,7 +1,7 @@ %aside.right-sidebar.right-sidebar-expanded.wiki-sidebar.js-wiki-sidebar.js-right-sidebar{ data: { "offset-top" => "50", "spy" => "affix" } } .sidebar-container .block.wiki-sidebar-header.gl-mb-3.w-100 - %a.gutter-toggle.float-right.d-block.d-sm-block.d-md-none.js-sidebar-wiki-toggle{ href: "#" } + %a.gutter-toggle.float-right.d-block.d-md-none.js-sidebar-wiki-toggle{ href: "#" } = sprite_icon('chevron-double-lg-right', css_class: 'gl-icon') - if @wiki.container.is_a?(Project) |