diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/views/shared | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/views/shared')
52 files changed, 197 insertions, 282 deletions
diff --git a/app/views/shared/_alert_info.html.haml b/app/views/shared/_alert_info.html.haml new file mode 100644 index 00000000000..e47c100909a --- /dev/null +++ b/app/views/shared/_alert_info.html.haml @@ -0,0 +1,6 @@ +.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 + = body diff --git a/app/views/shared/_choose_avatar_button.html.haml b/app/views/shared/_choose_avatar_button.html.haml index caf2bdce899..e3f2e1aa436 100644 --- a/app/views/shared/_choose_avatar_button.html.haml +++ b/app/views/shared/_choose_avatar_button.html.haml @@ -1 +1 @@ -= render 'shared/file_picker_button', f: f, field: :avatar, help_text: _("The maximum file size allowed is 200KB.") += render 'shared/file_picker_button', f: f, field: :avatar, help_text: _("Max file size is 200 KB.") diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index 9ec8d3c18cd..fd52f7f40d2 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -1,24 +1,22 @@ -- project = project || @project - .git-clone-holder.js-git-clone-holder.input-group .input-group-prepend - if allowed_protocols_present? .input-group-text.clone-dropdown-btn.btn %span.js-clone-dropdown-label - = enabled_project_button(project, enabled_protocol) + = enabled_protocol_button(container, enabled_protocol) - else %a#clone-dropdown.input-group-text.btn.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } } %span.js-clone-dropdown-label = default_clone_protocol.upcase - = icon('caret-down') + = sprite_icon('chevron-down') %ul.dropdown-menu.dropdown-menu-selectable.clone-options-dropdown %li - = ssh_clone_button(project) + = ssh_clone_button(container) %li - = http_clone_button(project) - = render_if_exists 'shared/kerberos_clone_button', project: project + = http_clone_button(container) + = render_if_exists 'shared/kerberos_clone_button', container: container - = text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Project clone URL') } + = text_field_tag :clone_url, default_url_to_repo(container), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Repository clone URL') } .input-group-append - = clipboard_button(target: '#project_clone', title: _("Copy URL"), class: "input-group-text btn-default btn-clipboard") + = clipboard_button(target: '#clone_url', title: _("Copy URL"), class: "input-group-text btn-default btn-clipboard") diff --git a/app/views/shared/_file_picker_button.html.haml b/app/views/shared/_file_picker_button.html.haml index 7c9a3bd3d31..8c10e4958b9 100644 --- a/app/views/shared/_file_picker_button.html.haml +++ b/app/views/shared/_file_picker_button.html.haml @@ -1,5 +1,7 @@ +- classes = local_assigns.fetch(:classes, '') + %span.js-filepicker - %button.btn.js-filepicker-button{ type: 'button' }= _("Choose file…") + %button.btn.js-filepicker-button{ type: 'button', class: classes }= _("Choose file…") %span.file_name.js-filepicker-filename= _("No file chosen") = f.file_field field, class: "js-filepicker-input hidden" - if help_text.present? diff --git a/app/views/shared/_group_form.html.haml b/app/views/shared/_group_form.html.haml index ca603eed703..c3fac5cd464 100644 --- a/app/views/shared/_group_form.html.haml +++ b/app/views/shared/_group_form.html.haml @@ -47,11 +47,3 @@ = f.label :id, class: 'label-bold' do = _("Group ID") = f.text_field :id, class: 'form-control', readonly: true - -.row - .form-group.group-description-holder.col-sm-8 - = f.label :description, class: 'label-bold' do - = _("Group description") - %span (optional) - = f.text_area :description, maxlength: 250, - class: 'form-control js-gfm-input', rows: 4 diff --git a/app/views/shared/_group_form_description.html.haml b/app/views/shared/_group_form_description.html.haml new file mode 100644 index 00000000000..9a895cee884 --- /dev/null +++ b/app/views/shared/_group_form_description.html.haml @@ -0,0 +1,5 @@ +.row + .form-group.group-description-holder.col-sm-8 + = f.label :description, _('Group description (optional)'), class: 'label-bold' + = f.text_area :description, maxlength: 250, + class: 'form-control js-gfm-input', rows: 4 diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml index 0f38d0e3b39..57575f89803 100644 --- a/app/views/shared/_issues.html.haml +++ b/app/views/shared/_issues.html.haml @@ -1,7 +1,6 @@ - if @issues.to_a.any? - .card.card-without-border - %ul.content-list.issues-list.issuable-list{ class: ("manual-ordering" if @sort == 'relative_position'), data: { group_full_path: @group&.full_path } } - = render partial: 'projects/issues/issue', collection: @issues + %ul.content-list.issues-list.issuable-list{ class: ("manual-ordering" if @sort == 'relative_position'), data: { group_full_path: @group&.full_path } } + = render partial: 'projects/issues/issue', collection: @issues = paginate @issues, theme: "gitlab" - else = render 'shared/empty_states/issues' diff --git a/app/views/shared/_md_preview.html.haml b/app/views/shared/_md_preview.html.haml index c7c36d79fa0..0976defea1b 100644 --- a/app/views/shared/_md_preview.html.haml +++ b/app/views/shared/_md_preview.html.haml @@ -28,7 +28,7 @@ - if referenced_users .referenced-users.hide %span - = icon("exclamation-triangle") + = sprite_icon('warning-solid') You are about to add %strong %span.js-referenced-users-count 0 diff --git a/app/views/shared/_merge_requests.html.haml b/app/views/shared/_merge_requests.html.haml index d280df8b370..dc8efa3e734 100644 --- a/app/views/shared/_merge_requests.html.haml +++ b/app/views/shared/_merge_requests.html.haml @@ -1,7 +1,6 @@ - if @merge_requests.to_a.any? - .card.card-without-border - %ul.content-list.mr-list.issuable-list - = render partial: 'projects/merge_requests/merge_request', collection: @merge_requests + %ul.content-list.mr-list.issuable-list + = render partial: 'projects/merge_requests/merge_request', collection: @merge_requests = paginate @merge_requests, theme: "gitlab" diff --git a/app/views/shared/_milestones_sort_dropdown.html.haml b/app/views/shared/_milestones_sort_dropdown.html.haml index 06da990e071..29c01343358 100644 --- a/app/views/shared/_milestones_sort_dropdown.html.haml +++ b/app/views/shared/_milestones_sort_dropdown.html.haml @@ -5,7 +5,7 @@ = milestone_sort_options_hash[@sort] - else = sort_title_due_date_soon - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-sort %li = link_to page_filter_path(sort: sort_value_due_date_soon) do diff --git a/app/views/shared/_no_password.html.haml b/app/views/shared/_no_password.html.haml index 76ae63ca5e8..9c1e5a49b44 100644 --- a/app/views/shared/_no_password.html.haml +++ b/app/views/shared/_no_password.html.haml @@ -5,7 +5,7 @@ = sprite_icon('close', size: 16, css_class: 'gl-icon') .gl-alert-body - translation_params = { protocol: gitlab_config.protocol.upcase, set_password_link: link_to_set_password } - - set_password_message = _("You won't be able to pull or push project code via %{protocol} until you %{set_password_link} on your account") % translation_params + - set_password_message = _("You won't be able to pull or push repositories via %{protocol} until you %{set_password_link} on your account") % translation_params = set_password_message.html_safe .gl-alert-actions = link_to _('Remind later'), '#', class: 'hide-no-password-message btn gl-alert-action btn-info btn-md gl-button' diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index a083a772233..0a7fa2a3c1e 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -4,7 +4,7 @@ %button{ class: 'gl-alert-dismiss hide-no-ssh-message', type: 'button', 'aria-label': _('Dismiss') } = sprite_icon('close', css_class: 'gl-icon s16') .gl-alert-body - = s_("MissingSSHKeyWarningLink|You won't be able to pull or push project code via SSH until you add an SSH key to your profile").html_safe + = s_("MissingSSHKeyWarningLink|You won't be able to pull or push repositories via SSH until you add an SSH key to your profile") .gl-alert-actions = link_to s_('MissingSSHKeyWarningLink|Add SSH key'), profile_keys_path, class: "btn gl-alert-action btn-warning btn-md new-gl-button" = link_to s_("MissingSSHKeyWarningLink|Don't show again"), profile_path(user: {hide_no_ssh_key: true}), method: :put, role: 'button', class: 'btn gl-alert-action btn-md btn-warning gl-button btn-warning-secondary' diff --git a/app/views/shared/_service_settings.html.haml b/app/views/shared/_service_settings.html.haml index 647421a8fbe..194e0eb57f2 100644 --- a/app/views/shared/_service_settings.html.haml +++ b/app/views/shared/_service_settings.html.haml @@ -9,5 +9,5 @@ .service-settings - if @default_integration - .js-vue-default-integration-settings{ data: integration_form_data(@default_integration) } - .js-vue-integration-settings{ data: integration_form_data(integration) } + .js-vue-default-integration-settings{ data: integration_form_data(@default_integration, group: @group) } + .js-vue-integration-settings{ data: integration_form_data(integration, group: @group) } diff --git a/app/views/shared/_web_ide_button.html.haml b/app/views/shared/_web_ide_button.html.haml index 75f5b8647f2..f9c6afcbc32 100644 --- a/app/views/shared/_web_ide_button.html.haml +++ b/app/views/shared/_web_ide_button.html.haml @@ -1,8 +1,8 @@ - type = blob ? 'blob' : 'tree' -.d-inline-block{ data: { options: web_ide_button_data(blob: blob).to_json }, id: "js-#{type}-web-ide-link" } +.d-inline-block{ data: { options: web_ide_button_data({ blob: blob }).to_json }, id: "js-#{type}-web-ide-link" } -- if show_edit_button? +- if show_edit_button?({ blob: blob }) = render 'shared/confirm_fork_modal', fork_path: fork_and_edit_path(@project, @ref, @path), type: 'edit' - if show_web_ide_button? = render 'shared/confirm_fork_modal', fork_path: ide_fork_and_edit_path(@project, @ref, @path), type: 'webide' diff --git a/app/views/shared/access_tokens/_table.html.haml b/app/views/shared/access_tokens/_table.html.haml index 255ec9995db..50daa400e6c 100644 --- a/app/views/shared/access_tokens/_table.html.haml +++ b/app/views/shared/access_tokens/_table.html.haml @@ -42,7 +42,7 @@ = _('In %{time_to_now}') % { time_to_now: distance_of_time_in_words_to_now(token.expires_at) } - else %span.token-never-expires-label= _('Never') - %td= token.scopes.present? ? token.scopes.join(', ') : html_escape_once(_('<no scopes selected>')).html_safe + %td= token.scopes.present? ? token.scopes.join(', ') : _('no scopes selected') %td= link_to _('Revoke'), revoke_route_helper.call(token), method: :put, class: 'btn btn-danger float-right qa-revoke-button', data: { confirm: _('Are you sure you want to revoke this %{type}? This action cannot be undone.') % { type: type } } - else .settings-message.text-center diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml index ce48691166b..e4222d8a4fe 100644 --- a/app/views/shared/boards/_show.html.haml +++ b/app/views/shared/boards/_show.html.haml @@ -13,27 +13,15 @@ - content_for :page_specific_javascripts do %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 }" } - - 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", - ":can-admin-list" => can_admin_list, - ":disabled" => "disabled" } - - else - .boards-list.w-100.py-3.px-2.text-nowrap{ data: { qa_selector: "boards_list" } } - .boards-app-loading.w-100.text-center{ "v-if" => "loading" } - = loading_icon(css_class: 'gl-mb-3') - %board{ "v-cloak" => "true", - "v-for" => "list in state.lists", - "ref" => "board", - ":can-admin-list" => can_admin_list, - ":list" => "list", - ":disabled" => "disabled", - ":key" => "list.id" } + %board-content{ "v-cloak" => "true", + "ref" => "board_content", + ":lists" => "state.lists", + ":can-admin-list" => can_admin_list, + ":disabled" => "disabled", + data: { qa_selector: "boards_list" } } = render "shared/boards/components/sidebar", group: group %board-settings-sidebar{ ":can-admin-list" => can_admin_list } - if @project diff --git a/app/views/shared/deploy_tokens/_table.html.haml b/app/views/shared/deploy_tokens/_table.html.haml index ad73442807e..361471af0ad 100644 --- a/app/views/shared/deploy_tokens/_table.html.haml +++ b/app/views/shared/deploy_tokens/_table.html.haml @@ -23,7 +23,7 @@ In #{distance_of_time_in_words_to_now(token.expires_at)} - else %span.token-never-expires-label= _('Never') - %td= token.scopes.present? ? token.scopes.join(", ") : html_escape_once(_('<no scopes selected>')).html_safe + %td= token.scopes.present? ? token.scopes.join(', ') : _('no scopes selected') %td= link_to s_('DeployTokens|Revoke'), "#", class: "btn btn-danger float-right", data: { toggle: "modal", target: "#revoke-modal-#{token.id}"} = render 'shared/deploy_tokens/revoke_modal', token: token, group_or_project: group_or_project - else diff --git a/app/views/shared/groups/_dropdown.html.haml b/app/views/shared/groups/_dropdown.html.haml index 9d2d3ce20c7..75c34102935 100644 --- a/app/views/shared/groups/_dropdown.html.haml +++ b/app/views/shared/groups/_dropdown.html.haml @@ -1,24 +1,17 @@ - options_hash = local_assigns.fetch(:options_hash, groups_sort_options_hash) - show_archive_options = local_assigns.fetch(:show_archive_options, false) -- if @sort.present? - - default_sort_by = @sort -- else - - if params[:sort] - - default_sort_by = params[:sort] - - else - - default_sort_by = sort_value_recently_created .dropdown.inline.js-group-filter-dropdown-wrap.gl-mr-3 %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' } %span.dropdown-label - = options_hash[default_sort_by] - = icon('chevron-down') + = options_hash[project_list_sort_by] + = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable %li.dropdown-header = _("Sort by") - options_hash.each do |value, title| %li.js-filter-sort-order - = link_to filter_groups_path(sort: value), class: ("is-active" if default_sort_by == value) do + = link_to filter_groups_path(sort: value), class: ("is-active" if project_list_sort_by == value) do = title - if show_archive_options %li.divider diff --git a/app/views/shared/groups/_visibility_level.html.haml b/app/views/shared/groups/_visibility_level.html.haml new file mode 100644 index 00000000000..1a13de9b76a --- /dev/null +++ b/app/views/shared/groups/_visibility_level.html.haml @@ -0,0 +1,3 @@ += f.label :visibility_level, class: 'label-bold' do + = _('Visibility level') +.js-visibility-level-dropdown{ data: { visibility_level_options: visibility_level_options(@group).to_json, default_level: f.object.visibility_level } } diff --git a/app/views/shared/icons/_icon_mattermost.svg b/app/views/shared/icons/_icon_mattermost.svg index d1c541523ab..3cf10851003 100644 --- a/app/views/shared/icons/_icon_mattermost.svg +++ b/app/views/shared/icons/_icon_mattermost.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><path d="M250.05 34c1.9.04 3.8.11 5.6.2l-29.79 35.51c-.07.01-.15.03-.23.04C149.26 84.1 98.22 146.5 98.22 222.97c0 41.56 23.07 90.5 59.75 119.1 28.61 22.32 64.29 36.9 101.21 36.9 93.4 0 160.15-68.61 160.15-156 0-34.91-15.99-72.77-41.76-100.76l-1.63-47.39c54.45 39.15 89.95 103.02 90.06 175.17v.01c0 119.29-96.7 216-216 216-119.29 0-216-96.71-216-216S130.71 34 250 34h.05zm64.1 20.29c.66-.04 1.32.03 1.96.25 3.01 1 3.85 3.57 3.93 6.45l3.84 146.88c.76 28.66-17.16 68.44-60.39 68.56-30.97.08-63.68-20.83-63.68-60.13.01-14.73 5.61-31.26 19.25-48.11l90.03-111.18c1.15-1.42 3.08-2.58 5.06-2.72z"/></svg> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 500 500"><path d="M250.05 34c1.9.04 3.8.11 5.6.2l-29.79 35.51c-.07.01-.15.03-.23.04C149.26 84.1 98.22 146.5 98.22 222.97c0 41.56 23.07 90.5 59.75 119.1 28.61 22.32 64.29 36.9 101.21 36.9 93.4 0 160.15-68.61 160.15-156 0-34.91-15.99-72.77-41.76-100.76l-1.63-47.39c54.45 39.15 89.95 103.02 90.06 175.17v.01c0 119.29-96.7 216-216 216-119.29 0-216-96.71-216-216S130.71 34 250 34h.05zm64.1 20.29c.66-.04 1.32.03 1.96.25 3.01 1 3.85 3.57 3.93 6.45l3.84 146.88c.76 28.66-17.16 68.44-60.39 68.56-30.97.08-63.68-20.83-63.68-60.13.01-14.73 5.61-31.26 19.25-48.11l90.03-111.18c1.15-1.42 3.08-2.58 5.06-2.72z"/></svg> diff --git a/app/views/shared/integrations/_index.html.haml b/app/views/shared/integrations/_index.html.haml index 2f299ad5c89..edc85f04d91 100644 --- a/app/views/shared/integrations/_index.html.haml +++ b/app/views/shared/integrations/_index.html.haml @@ -1,4 +1,4 @@ -%table.table.b-table.gl-table.mt-3{ role: 'table', 'aria-busy': false, 'aria-colcount': 4 } +%table.table.b-table.gl-table{ role: 'table', 'aria-busy': false, 'aria-colcount': 4 } %colgroup %col %col @@ -15,11 +15,10 @@ - integrations.each do |integration| - activated_label = (integration.activated? ? s_("ProjectService|%{service_title}: status on") : s_("ProjectService|%{service_title}: status off")) % { service_title: integration.title } %tr{ role: 'row' } - %td{ role: 'cell', 'aria-colindex': 1, 'aria-label': activated_label } + %td{ role: 'cell', 'aria-colindex': 1, 'aria-label': activated_label, title: activated_label } = boolean_to_icon integration.operating? %td{ role: 'cell', 'aria-colindex': 2 } - = link_to scoped_edit_integration_path(integration), { data: { qa_selector: "#{integration.to_param}_link" } } do - %strong= integration.title + = link_to integration.title, scoped_edit_integration_path(integration), class: 'gl-font-weight-bold', data: { qa_selector: "#{integration.to_param}_link" } %td.d-none.d-sm-table-cell{ role: 'cell', 'aria-colindex': 3 } = integration.description %td{ role: 'cell', 'aria-colindex': 4 } diff --git a/app/views/shared/issuable/_bulk_update_sidebar.html.haml b/app/views/shared/issuable/_bulk_update_sidebar.html.haml index 09abe9e89c4..2f30958c877 100644 --- a/app/views/shared/issuable/_bulk_update_sidebar.html.haml +++ b/app/views/shared/issuable/_bulk_update_sidebar.html.haml @@ -1,5 +1,5 @@ - type = local_assigns.fetch(:type) -- bulk_issue_health_status_flag = Feature.enabled?(:bulk_update_health_status, @project&.group, default_enabled: true) && type == :issues && @project&.group&.feature_available?(:issuable_health_status) +- bulk_issue_health_status_flag = type == :issues && @project&.group&.feature_available?(:issuable_health_status) - epic_bulk_edit_flag = @project&.group&.feature_available?(:epics) && type == :issues %aside.issues-bulk-update.js-right-sidebar.right-sidebar{ "aria-live" => "polite", data: { 'signed-in': current_user.present? } } diff --git a/app/views/shared/issuable/_close_reopen_button.html.haml b/app/views/shared/issuable/_close_reopen_button.html.haml deleted file mode 100644 index 3453db9f209..00000000000 --- a/app/views/shared/issuable/_close_reopen_button.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -- is_current_user = issuable_author_is_current_user(issuable) -- display_issuable_type = issuable_display_type(issuable) -- are_close_and_open_buttons_hidden = issuable_button_hidden?(issuable, true) && issuable_button_hidden?(issuable, false) -- add_blocked_class = false -- if defined? warn_before_close - - add_blocked_class = warn_before_close - -- if is_current_user && !issuable.is_a?(MergeRequest) - - if can_update - %button{ class: "d-none d-md-block btn btn-grouped btn-close js-btn-issue-action #{issuable_button_visibility(issuable, true)} #{(add_blocked_class ? 'btn-issue-blocked' : '')}", - data: { remote: 'true', endpoint: close_issuable_path(issuable), qa_selector: 'close_issue_button' } } - = _("Close %{display_issuable_type}") % { display_issuable_type: display_issuable_type } - - if can_reopen - %button{ class: "d-none d-md-block btn btn-grouped btn-reopen js-btn-issue-action #{issuable_button_visibility(issuable, false)}", - data: { remote: 'true', endpoint: reopen_issuable_path(issuable), qa_selector: 'reopen_issue_button' } } - = _("Reopen %{display_issuable_type}") % { display_issuable_type: display_issuable_type } -- else - - if can_update && !are_close_and_open_buttons_hidden - - if issuable.is_a?(MergeRequest) - = render 'shared/issuable/close_reopen_draft_report_toggle', issuable: issuable - - else - = render 'shared/issuable/close_reopen_report_toggle', issuable: issuable, warn_before_close: add_blocked_class - - else - - 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_draft_report_toggle.html.haml b/app/views/shared/issuable/_close_reopen_draft_report_toggle.html.haml deleted file mode 100644 index bdb53dfe323..00000000000 --- a/app/views/shared/issuable/_close_reopen_draft_report_toggle.html.haml +++ /dev/null @@ -1,37 +0,0 @@ -- display_issuable_type = issuable_display_type(issuable) -- button_action_class = issuable.closed? ? 'btn-default' : 'btn-warning btn-warning-secondary' -- button_class = "btn gl-button #{!issuable.closed? && 'js-draft-toggle-button'}" -- toggle_class = "btn gl-button dropdown-toggle" - -.float-left.btn-group.gl-ml-3.issuable-close-dropdown.d-none.d-md-inline-flex.js-issuable-close-dropdown - = link_to issuable.closed? ? reopen_issuable_path(issuable) : toggle_draft_issuable_path(issuable), method: :put, class: "#{button_class} #{button_action_class}" do - - if issuable.closed? - = _('Reopen') - = display_issuable_type - - else - = issuable.work_in_progress? ? _('Mark as ready') : _('Mark as draft') - - - if !issuable.closed? || !issuable_author_is_current_user(issuable) - = button_tag type: 'button', class: "#{toggle_class} #{button_action_class}", data: { 'toggle' => 'dropdown' } do - %span.sr-only= _('Toggle dropdown') - = sprite_icon "angle-down", size: 12 - - %ul.js-issuable-close-menu.dropdown-menu.dropdown-menu-right - - if issuable.open? - %li - = link_to close_issuable_path(issuable), method: :put do - .description - %strong.title - = _('Close') - = display_issuable_type - - - unless issuable_author_is_current_user(issuable) - - unless issuable.closed? - %li.divider.droplab-item-ignore - - %li.report-item - %a.report-abuse-link{ href: new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)) } - .description - %strong.title= _('Report abuse') - %p.text - = _('Report %{display_issuable_type} that are abusive, inappropriate or spam.') % { display_issuable_type: display_issuable_type.pluralize } diff --git a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml deleted file mode 100644 index 48d1e146629..00000000000 --- a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml +++ /dev/null @@ -1,47 +0,0 @@ -- display_issuable_type = issuable_display_type(issuable) -- button_action = issuable.closed? ? 'reopen' : 'close' -- display_button_action = button_action.capitalize -- button_responsive_class = 'd-none d-md-block' -- button_class = "#{button_responsive_class} btn btn-grouped js-issuable-close-button js-btn-issue-action issuable-close-button" -- toggle_class = "#{button_responsive_class} btn btn-nr dropdown-toggle js-issuable-close-toggle" -- add_blocked_class = false -- if defined? warn_before_close - - add_blocked_class = !issuable.closed? && warn_before_close - -.float-left.btn-group.gl-ml-3.issuable-close-dropdown.droplab-dropdown.js-issuable-close-dropdown - %button{ class: "#{button_class} btn-#{button_action} #{(add_blocked_class ? 'btn-issue-blocked' : '')}", data: { testid: 'close-issue-button', qa_selector: 'close_issue_button', endpoint: close_reopen_issuable_path(issuable) } } - #{display_button_action} #{display_issuable_type} - - = button_tag type: 'button', class: "#{toggle_class} btn-#{button_action}-color", - data: { 'dropdown-trigger' => '#issuable-close-menu' }, 'aria-label' => _('Toggle dropdown') do - = icon('caret-down', class: 'toggle-icon icon') - - %ul#issuable-close-menu.js-issuable-close-menu.dropdown-menu{ data: { dropdown: true } } - %li.close-item{ class: "#{issuable_button_visibility(issuable, true) || 'droplab-item-selected'}", - 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 - = sprite_icon('check', css_class: 'icon') - .description - %strong.title - = _('Close') - = display_issuable_type - - %li.reopen-item{ class: "#{issuable_button_visibility(issuable, false) || 'droplab-item-selected'}", - 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 - = sprite_icon('check', css_class: 'icon') - .description - %strong.title - = _('Reopen') - = display_issuable_type - - %li.divider.droplab-item-ignore - - %li.report-item{ data: { text: _('Report abuse'), button_class: "#{button_class} btn-close-color", toggle_class: "#{toggle_class} btn-close-color", method: '' } } - %a.report-abuse-link{ :href => new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)) } - .description - %strong.title= _('Report abuse') - %p.text - = _('Report %{display_issuable_type} that are abusive, inappropriate or spam.') % { display_issuable_type: display_issuable_type.pluralize } diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index c0aba0eef7f..552f83906e1 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -32,7 +32,7 @@ = form.label :confidential, class: 'form-check-label' do This issue is confidential and should only be visible to team members with at least Reporter access. -= render 'shared/issuable/form/metadata', issuable: issuable, form: form, project: project += render 'shared/issuable/form/metadata', issuable: issuable, form: form, project: project, presenter: presenter = render_if_exists 'shared/issuable/approvals', issuable: issuable, presenter: presenter, form: form @@ -88,3 +88,6 @@ = form.hidden_field :issue_type = form.hidden_field :lock_version + +- if @vulnerability_id + = hidden_field_tag 'vulnerability_id', @vulnerability_id diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index 00b235809ed..79d86500bd9 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -75,6 +75,22 @@ = render 'shared/issuable/user_dropdown_item', user: User.new(username: '{{username}}', name: '{{name}}'), avatar: { lazy: true, url: '{{avatar_url}}' } + #js-dropdown-reviewer.filtered-search-input-dropdown-menu.dropdown-menu + %ul{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'None' } } + %button.btn.btn-link{ type: 'button' } + = _('None') + %li.filter-dropdown-item{ data: { value: 'Any' } } + %button.btn.btn-link{ type: 'button' } + = _('Any') + %li.divider.droplab-item-ignore + - if current_user + = render 'shared/issuable/user_dropdown_item', + user: current_user + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + = render 'shared/issuable/user_dropdown_item', + user: User.new(username: '{{username}}', name: '{{name}}'), + avatar: { lazy: true, url: '{{avatar_url}}' } = render_if_exists 'shared/issuable/approver_dropdown' = render_if_exists 'shared/issuable/approved_by_dropdown' #js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu @@ -182,7 +198,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, default_enabled: true) + - if current_user #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 1f20c1a30aa..cd265c10451 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -25,7 +25,7 @@ .block.assignee.qa-assignee-block = render "shared/issuable/sidebar_assignees", issuable_sidebar: issuable_sidebar, assignees: assignees, signed_in: signed_in - - if Feature.enabled?(:merge_request_reviewers, @project) && reviewers + - if Feature.enabled?(:merge_request_reviewers, @project, default_enabled: true) && reviewers .block.reviewer.qa-reviewer-block = render "shared/issuable/sidebar_reviewers", issuable_sidebar: issuable_sidebar, reviewers: reviewers, signed_in: signed_in @@ -58,7 +58,7 @@ = f.hidden_field 'milestone_id', value: milestone[:id], id: nil = dropdown_tag('Milestone', options: { title: _('Assign milestone'), toggle_class: 'js-milestone-select js-extra-options', filter: true, dropdown_class: 'dropdown-menu-selectable', placeholder: _('Search milestones'), data: { show_no: true, field_name: "#{issuable_type}[milestone_id]", project_id: issuable_sidebar[:project_id], issuable_id: issuable_sidebar[:id], ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], use_id: true, default_no: true, selected: milestone[:title], null_default: true, display: 'static' }}) - if @project.group.present? - = render_if_exists 'shared/issuable/iteration_select', { can_edit: can_edit_issuable, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type } + = render_if_exists 'shared/issuable/iteration_select', can_edit: can_edit_issuable, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type - if issuable_sidebar[:supports_time_tracking] #issuable-time-tracker.block diff --git a/app/views/shared/issuable/form/_branch_chooser.html.haml b/app/views/shared/issuable/form/_branch_chooser.html.haml index 94fa43746e2..a425f5f810e 100644 --- a/app/views/shared/issuable/form/_branch_chooser.html.haml +++ b/app/views/shared/issuable/form/_branch_chooser.html.haml @@ -2,7 +2,7 @@ - form = local_assigns.fetch(:form) - return unless issuable.is_a?(MergeRequest) -- return if issuable.closed_without_fork? +- return if issuable.closed_or_merged_without_fork? - source_title, target_title = format_mr_branch_names(@merge_request) diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml index e29627304b4..7233e671caa 100644 --- a/app/views/shared/issuable/form/_merge_params.html.haml +++ b/app/views/shared/issuable/form/_merge_params.html.haml @@ -2,7 +2,7 @@ - project = local_assigns.fetch(:project) - return unless issuable.is_a?(MergeRequest) -- return if issuable.closed_without_fork? +- return if issuable.closed_or_merged_without_fork? .form-group.row .col-sm-2.col-form-label.pt-sm-0 diff --git a/app/views/shared/issuable/form/_metadata.html.haml b/app/views/shared/issuable/form/_metadata.html.haml index 459eb112e4f..366e819d252 100644 --- a/app/views/shared/issuable/form/_metadata.html.haml +++ b/app/views/shared/issuable/form/_metadata.html.haml @@ -1,5 +1,6 @@ - project = local_assigns.fetch(:project) - issuable = local_assigns.fetch(:issuable) +- presenter = local_assigns.fetch(:presenter) - return unless can?(current_user, :"admin_#{issuable.to_ability_name}", issuable.project) @@ -14,7 +15,7 @@ - if issuable.allows_reviewers? .form-group.row.merge-request-reviewer - = render "shared/issuable/form/metadata_issuable_reviewer", issuable: issuable, form: form, has_due_date: has_due_date + = render "shared/issuable/form/metadata_issuable_reviewer", issuable: issuable, form: form, has_due_date: has_due_date, presenter: presenter = render_if_exists "shared/issuable/form/epic", issuable: issuable, form: form, project: project diff --git a/app/views/shared/issuable/form/_metadata_issuable_assignee.html.haml b/app/views/shared/issuable/form/_metadata_issuable_assignee.html.haml index 60dc893d9f9..b437ee1ec5f 100644 --- a/app/views/shared/issuable/form/_metadata_issuable_assignee.html.haml +++ b/app/views/shared/issuable/form/_metadata_issuable_assignee.html.haml @@ -1,4 +1,4 @@ -= form.label :assignee_id, "Assignee", class: "col-form-label #{has_due_date ? "col-md-2 col-lg-4" : "col-sm-2"}" += form.label :assignee_id, issuable.allows_multiple_assignees? ? _('Assignees') : _('Assignee'), class: "col-form-label #{has_due_date ? "col-md-2 col-lg-4" : "col-sm-2"}" .col-sm-10{ class: ("col-md-8" if has_due_date) } .issuable-form-select-holder.selectbox - issuable.assignees.each do |assignee| diff --git a/app/views/shared/issuable/form/_metadata_issuable_reviewer.html.haml b/app/views/shared/issuable/form/_metadata_issuable_reviewer.html.haml index a8b033bba36..a0df007f8ca 100644 --- a/app/views/shared/issuable/form/_metadata_issuable_reviewer.html.haml +++ b/app/views/shared/issuable/form/_metadata_issuable_reviewer.html.haml @@ -1,5 +1,5 @@ -= form.label :reviewer_id, "Reviewer", class: "col-form-label #{has_due_date ? "col-md-2 col-lg-4" : "col-sm-2"}" -.col-sm-10{ class: ("col-md-8" if has_due_date) } += form.label :reviewer_id, issuable.allows_multiple_reviewers? ? _('Reviewers') : _('Reviewer'), class: "col-form-label #{has_due_date ? "col-md-2 col-lg-4" : "col-sm-2"}" +.col-sm-10.gl-mb-2{ class: ("col-md-8" if has_due_date) } .issuable-form-select-holder.selectbox - issuable.reviewers.each do |reviewer| = hidden_field_tag "#{issuable.to_ability_name}[reviewer_ids][]", reviewer.id, id: nil, data: { meta: reviewer.name, avatar_url: reviewer.avatar_url, name: reviewer.name, username: reviewer.username } @@ -7,4 +7,6 @@ - if issuable.reviewers.empty? = hidden_field_tag "#{issuable.to_ability_name}[reviewer_ids][]", 0, id: nil, data: { meta: '' } - = dropdown_tag(users_dropdown_label(issuable.reviewers), options: reviewers_dropdown_options(issuable.to_ability_name)) + = dropdown_tag(users_dropdown_label(issuable.reviewers), options: reviewers_dropdown_options(issuable.to_ability_name, issuable.iid, issuable.target_branch)) + - if Feature.enabled?(:mr_collapsed_approval_rules, @project) + = render_if_exists 'shared/issuable/approver_suggestion', issuable: issuable, presenter: presenter diff --git a/app/views/shared/issuable/form/_type_selector.html.haml b/app/views/shared/issuable/form/_type_selector.html.haml index 5d64c15d9f9..67bc4019a82 100644 --- a/app/views/shared/issuable/form/_type_selector.html.haml +++ b/app/views/shared/issuable/form/_type_selector.html.haml @@ -13,7 +13,7 @@ .dropdown-title.gl-display-flex %span.gl-ml-auto = _("Select type") - %button.dropdown-title-button.dropdown-menu-close.gl-ml-auto{ "aria-label" => _('Close') } + %button.dropdown-title-button.dropdown-menu-close.gl-ml-auto{ type: 'button', "aria-label" => _('Close') } = sprite_icon('close', size: 16, css_class: 'dropdown-menu-close-icon') .dropdown-content %ul diff --git a/app/views/shared/issue_type/_details_header.html.haml b/app/views/shared/issue_type/_details_header.html.haml index ea4df288839..d6226760ba5 100644 --- a/app/views/shared/issue_type/_details_header.html.haml +++ b/app/views/shared/issue_type/_details_header.html.haml @@ -1,10 +1,3 @@ -- 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) } @@ -18,38 +11,9 @@ .issuable-meta #js-issuable-header-warnings - = issuable_meta(issuable, @project, display_issuable_type) + = issuable_meta(issuable, @project) %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 } + .js-issue-header-actions{ data: issue_header_actions_data(@project, issuable, current_user) } diff --git a/app/views/shared/labels/_sort_dropdown.html.haml b/app/views/shared/labels/_sort_dropdown.html.haml index 07e96eea062..cfc00bd41ca 100644 --- a/app/views/shared/labels/_sort_dropdown.html.haml +++ b/app/views/shared/labels/_sort_dropdown.html.haml @@ -2,7 +2,7 @@ .dropdown.inline %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } } = 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-sort %li - label_sort_options_hash.each do |value, title| diff --git a/app/views/shared/members/_group.html.haml b/app/views/shared/members/_group.html.haml index 42e12d92a7d..d98ba074687 100644 --- a/app/views/shared/members/_group.html.haml +++ b/app/views/shared/members/_group.html.haml @@ -27,7 +27,7 @@ data: { toggle: "dropdown", field_name: "group_link[group_access]" } } %span.dropdown-toggle-text = group_link.human_access - = icon("chevron-down") + = sprite_icon("chevron-down", css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-select.dropdown-menu-right.dropdown-menu-selectable = dropdown_title(_("Change permissions")) .dropdown-content diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml index e294936f82c..79bbb74d601 100644 --- a/app/views/shared/members/_member.html.haml +++ b/app/views/shared/members/_member.html.haml @@ -79,7 +79,7 @@ data: { toggle: "dropdown", field_name: "#{f.object_name}[access_level]", qa_selector: "access_level_dropdown" } } %span.dropdown-toggle-text = member.human_access - = icon("chevron-down") + = sprite_icon("chevron-down", css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-select.dropdown-menu-right.dropdown-menu-selectable = dropdown_title(_("Change permissions")) .dropdown-content diff --git a/app/views/shared/milestones/_header.html.haml b/app/views/shared/milestones/_header.html.haml index 93da319fce7..19ca00ce482 100644 --- a/app/views/shared/milestones/_header.html.haml +++ b/app/views/shared/milestones/_header.html.haml @@ -28,7 +28,7 @@ - if milestone.active? = 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 gl-button btn-grouped btn-reopen' + = link_to _('Reopen milestone'), update_milestone_path(milestone, { state_event: :activate }), method: :put, class: 'btn gl-button btn-grouped' = render 'shared/milestones/delete_button' diff --git a/app/views/shared/milestones/_milestone.html.haml b/app/views/shared/milestones/_milestone.html.haml index 1597a011a45..92ac6929e6a 100644 --- a/app/views/shared/milestones/_milestone.html.haml +++ b/app/views/shared/milestones/_milestone.html.haml @@ -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 gl-button 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" - else = 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 45af4b51b27..eb03608e18a 100644 --- a/app/views/shared/notes/_comment_button.html.haml +++ b/app/views/shared/notes/_comment_button.html.haml @@ -1,11 +1,11 @@ - noteable_name = @note.noteable.human_class_name .float-left.btn-group.gl-mr-3.droplab-dropdown.comment-type-dropdown.js-comment-type-dropdown - %input.btn.btn-nr.btn-success.js-comment-button.js-comment-submit-button{ type: 'submit', value: _('Comment'), data: { qa_selector: 'comment_button' } } + %input.btn.btn-success.js-comment-button.js-comment-submit-button{ type: 'submit', value: _('Comment'), data: { qa_selector: 'comment_button' } } - if @note.can_be_discussion_note? - = button_tag type: 'button', class: 'btn btn-nr dropdown-toggle btn-success js-note-new-discussion js-disable-on-submit', data: { 'dropdown-trigger' => '#resolvable-comment-menu' }, 'aria-label' => _('Open comment type dropdown') do - = icon('caret-down', class: 'toggle-icon') + = button_tag type: 'button', class: 'btn dropdown-toggle btn-success js-note-new-discussion js-disable-on-submit', data: { 'dropdown-trigger' => '#resolvable-comment-menu' }, 'aria-label' => _('Open comment type dropdown') do + = sprite_icon('chevron-down') %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 } } } diff --git a/app/views/shared/notes/_edit_form.html.haml b/app/views/shared/notes/_edit_form.html.haml index 79feb12bed5..d783fa0d777 100644 --- a/app/views/shared/notes/_edit_form.html.haml +++ b/app/views/shared/notes/_edit_form.html.haml @@ -9,6 +9,6 @@ .note-form-actions.clearfix .settings-message.note-edit-warning.js-finish-edit-warning = _("Finish editing this message first!") - = submit_tag _('Save comment'), class: 'btn btn-nr btn-success js-comment-save-button', data: { qa_selector: 'save_comment_button' } - %button.btn.btn-nr.btn-cancel.note-edit-cancel{ type: 'button' } + = submit_tag _('Save comment'), class: 'btn btn-success js-comment-save-button', data: { qa_selector: 'save_comment_button' } + %button.btn.btn-cancel.note-edit-cancel{ type: 'button' } = _("Cancel") diff --git a/app/views/shared/notes/_form.html.haml b/app/views/shared/notes/_form.html.haml index f1686417f8d..2cf074b9d3f 100644 --- a/app/views/shared/notes/_form.html.haml +++ b/app/views/shared/notes/_form.html.haml @@ -38,7 +38,5 @@ .note-form-actions.clearfix = render partial: 'shared/notes/comment_button' - = yield(:note_actions) - %a.btn.btn-cancel.js-close-discussion-note-form.hide{ role: "button", data: { cancel_text: _("Cancel") } } = _('Cancel') diff --git a/app/views/shared/notifications/_button.html.haml b/app/views/shared/notifications/_button.html.haml index d7b53810f76..e12531b8a8d 100644 --- a/app/views/shared/notifications/_button.html.haml +++ b/app/views/shared/notifications/_button.html.haml @@ -20,8 +20,8 @@ %button.dropdown-new.btn.btn-default.btn-icon.gl-button.has-tooltip.notifications-btn.text-left#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), display: 'static' } } = sprite_icon("notifications", css_class: "js-notification-loading") = notification_title(notification_setting.level) - %button.btn.dropdown-toggle.d-flex{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } } - = icon('caret-down') + %button.btn.dropdown-toggle.gl-display-flex.gl-align-items-center{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } } + = sprite_icon('chevron-down') .sr-only Toggle dropdown - else %button.dropdown-new.btn.btn-default.btn-icon.gl-button.has-tooltip.notifications-btn#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } } @@ -29,7 +29,7 @@ = sprite_icon("notifications", css_class: "js-notification-loading") = notification_title(notification_setting.level) .float-right - = icon("caret-down") + = sprite_icon("chevron-down") = render "shared/notifications/notification_dropdown", notification_setting: notification_setting diff --git a/app/views/shared/projects/_sort_dropdown.html.haml b/app/views/shared/projects/_sort_dropdown.html.haml index f5f940db189..3e810dc6f08 100644 --- a/app/views/shared/projects/_sort_dropdown.html.haml +++ b/app/views/shared/projects/_sort_dropdown.html.haml @@ -5,7 +5,7 @@ .btn-group.w-100.dropdown.js-project-filter-dropdown-wrap{ role: "group" } %button#sort-projects-dropdown.btn.btn-default.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } = toggle_text - = 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 %li.dropdown-header = _("Sort by") diff --git a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml index eafc402f210..cb954c20b48 100644 --- a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml +++ b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml @@ -1,3 +1,5 @@ +- select_mode_for_dropdown = Feature.enabled?(:deploy_keys_on_protected_branches, protected_branch.project) ? 'js-multiselect' : '' + - merge_access_levels = protected_branch.merge_access_levels.for_role - push_access_levels = protected_branch.push_access_levels.for_role @@ -23,7 +25,7 @@ %td.push_access_levels-container = hidden_field_tag "allowed_to_push_#{protected_branch.id}", push_access_levels.first&.access_level = dropdown_tag( (push_access_levels.first&.humanize || 'Select') , - options: { toggle_class: 'js-allowed-to-push', dropdown_class: 'dropdown-menu-selectable js-allowed-to-push-container capitalize-header', + options: { toggle_class: "js-allowed-to-push #{select_mode_for_dropdown}", dropdown_class: 'dropdown-menu-selectable js-allowed-to-push-container capitalize-header', data: { field_name: "allowed_to_push_#{protected_branch.id}", preselected_items: access_levels_data(push_access_levels) }}) - if user_push_access_levels.any? %p.small diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index c5234f14090..c37a34f9be8 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -10,89 +10,91 @@ = s_('Webhooks|Use this token to validate received payloads. It will be sent with the request in the X-Gitlab-Token HTTP header.') .form-group = form.label :url, s_('Webhooks|Trigger'), class: 'label-bold' - %ul.list-unstyled.prepend-left-20 + %ul.list-unstyled.gl-ml-6 %li = form.check_box :push_events, class: 'form-check-input' - = form.label :push_events, class: 'list-label form-check-label ml-1' do + = form.label :push_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Push events') = form.text_field :push_events_branch_filter, class: 'form-control', placeholder: 'Branch name or wildcard pattern to trigger on (leave blank for all)' - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered by a push to the repository') %li = form.check_box :tag_push_events, class: 'form-check-input' - = form.label :tag_push_events, class: 'list-label form-check-label ml-1' do + = form.label :tag_push_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Tag push events') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when a new tag is pushed to the repository') %li = form.check_box :note_events, class: 'form-check-input' - = form.label :note_events, class: 'list-label form-check-label ml-1' do + = form.label :note_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Comments') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when someone adds a comment') %li = form.check_box :confidential_note_events, class: 'form-check-input' - = form.label :confidential_note_events, class: 'list-label form-check-label ml-1' do + = form.label :confidential_note_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Confidential Comments') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when someone adds a comment on a confidential issue') %li = form.check_box :issues_events, class: 'form-check-input' - = form.label :issues_events, class: 'list-label form-check-label ml-1' do + = form.label :issues_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Issues events') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when an issue is created/updated/merged') %li = form.check_box :confidential_issues_events, class: 'form-check-input' - = form.label :confidential_issues_events, class: 'list-label form-check-label ml-1' do + = form.label :confidential_issues_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Confidential Issues events') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when a confidential issue is created/updated/merged') + - if @group + = render_if_exists 'groups/hooks/member_events', form: form %li = form.check_box :merge_requests_events, class: 'form-check-input' - = form.label :merge_requests_events, class: 'list-label form-check-label ml-1' do + = form.label :merge_requests_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Merge request events') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when a merge request is created/updated/merged') %li = form.check_box :job_events, class: 'form-check-input' - = form.label :job_events, class: 'list-label form-check-label ml-1' do + = form.label :job_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Job events') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when the job status changes') %li = form.check_box :pipeline_events, class: 'form-check-input' - = form.label :pipeline_events, class: 'list-label form-check-label ml-1' do + = form.label :pipeline_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Pipeline events') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when the pipeline status changes') %li = form.check_box :wiki_page_events, class: 'form-check-input' - = form.label :wiki_page_events, class: 'list-label form-check-label ml-1' do + = form.label :wiki_page_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Wiki Page events') - %p.text-muted.ml-1 + %p.text-muted.gl-ml-1 = s_('Webhooks|This URL will be triggered when a wiki page is created/updated') %li = form.check_box :deployment_events, class: 'form-check-input' - = form.label :deployment_events, class: 'list-label form-check-label ml-1' do + = form.label :deployment_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Deployment events') - %p.text-muted.ml-1 + %p.text-muted.gl-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 + = form.label :feature_flag_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Feature Flag events') - %p.text-muted.ml-1 + %p.text-muted.gl-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 + = form.label :releases_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Releases events') - %p.text-muted.ml-1 + %p.text-muted.gl-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 = form.check_box :enable_ssl_verification, class: 'form-check-input' - = form.label :enable_ssl_verification, class: 'form-check-label ml-1' do + = form.label :enable_ssl_verification, class: 'form-check-label gl-ml-1' do %strong= s_('Webhooks|Enable SSL verification') diff --git a/app/views/shared/web_hooks/_test_button.html.haml b/app/views/shared/web_hooks/_test_button.html.haml index fc24e425ab6..c46b8a99886 100644 --- a/app/views/shared/web_hooks/_test_button.html.haml +++ b/app/views/shared/web_hooks/_test_button.html.haml @@ -5,7 +5,7 @@ .hook-test-button.dropdown.inline> %button.btn{ 'data-toggle' => 'dropdown', class: button_class } = _('Test') - = icon('caret-down') + = sprite_icon('chevron-down') %ul.dropdown-menu.dropdown-menu-right{ role: 'menu' } - triggers.each_value do |event| %li diff --git a/app/views/shared/wikis/_form.html.haml b/app/views/shared/wikis/_form.html.haml index dde1b3afa2d..b6504c7a17e 100644 --- a/app/views/shared/wikis/_form.html.haml +++ b/app/views/shared/wikis/_form.html.haml @@ -36,7 +36,7 @@ .col-sm-10 .select-wrapper = f.select :format, options_for_select(Wiki::MARKUPS, {selected: @page.format}), {}, class: 'form-control select-control' - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: 'gl-absolute gl-top-3 gl-right-3 gl-text-gray-200') .form-group.row .col-sm-2.col-form-label= f.label :content, class: 'control-label-full-width' diff --git a/app/views/shared/wikis/_sidebar.html.haml b/app/views/shared/wikis/_sidebar.html.haml index c0ed7b4c6f2..a906bf7aa63 100644 --- a/app/views/shared/wikis/_sidebar.html.haml +++ b/app/views/shared/wikis/_sidebar.html.haml @@ -4,17 +4,19 @@ %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) - - git_access_url = wiki_path(@wiki, action: :git_access) - = link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '', data: { qa_selector: 'clone_repository_link' } do - = sprite_icon('download', css_class: 'gl-mr-2') - %span= _("Clone repository") + - git_access_url = wiki_path(@wiki, action: :git_access) + = link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '', data: { qa_selector: 'clone_repository_link' } do + = sprite_icon('download', css_class: 'gl-mr-2') + %span= _("Clone repository") + + - if @sidebar_error.present? + = render 'shared/alert_info', body: s_('Wiki|The sidebar failed to load. You can reload the page to try again.') .blocks-container .block.block-first.w-100 - if @sidebar_page = render_wiki_content(@sidebar_page) - - else + - elsif @sidebar_wiki_entries %ul.wiki-pages = render @sidebar_wiki_entries, context: 'sidebar' .block.w-100 diff --git a/app/views/shared/wikis/git_access.html.haml b/app/views/shared/wikis/git_access.html.haml new file mode 100644 index 00000000000..2542860c742 --- /dev/null +++ b/app/views/shared/wikis/git_access.html.haml @@ -0,0 +1,37 @@ +- @content_class = "limit-container-width" unless fluid_layout +- page_title s_("WikiClone|Git Access"), _("Wiki") +- add_page_specific_style 'page_bundles/wiki' + +.wiki-page-header.top-area.has-sidebar-toggle.py-3.flex-column.flex-lg-row + = wiki_sidebar_toggle_button + + .git-access-header.w-100.d-flex.flex-column.justify-content-center + %span + = _("Clone repository") + %strong= @wiki.full_path + + .pt-3.pt-lg-0.w-100 + = render "shared/clone_panel", container: @wiki + +.wiki-git-access + %h3= s_("WikiClone|Install Gollum") + %pre.dark + :preserve + gem install gollum + + %h3= s_("WikiClone|Clone your wiki") + %pre.dark + :preserve + git clone #{ content_tag(:span, h(default_url_to_repo(@wiki)), class: 'clone')} + cd #{h @wiki.path} + + %h3= s_("WikiClone|Start Gollum and edit locally") + %pre.dark + :preserve + gollum + == Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin + >> Thin web server (v1.5.0 codename Knife) + >> Maximum connections set to 1024 + >> Listening on 0.0.0.0:4567, CTRL+C to stop + += render 'shared/wikis/sidebar' diff --git a/app/views/shared/wikis/git_error.html.haml b/app/views/shared/wikis/git_error.html.haml new file mode 100644 index 00000000000..dab3b940b9a --- /dev/null +++ b/app/views/shared/wikis/git_error.html.haml @@ -0,0 +1,14 @@ +- if @page + - wiki_page_title @page + +- add_page_specific_style 'page_bundles/wiki' + +- git_access_url = wiki_path(@wiki, action: :git_access) + +.wiki-page-header.top-area.gl-flex-direction-column.gl-lg-flex-direction-row + .gl-mt-5.gl-mb-3 + .gl-display-flex.gl-justify-content-space-between + %h2.gl-mt-0.gl-mb-5{ data: { qa_selector: 'wiki_page_title', testid: 'wiki_page_title' } }= @page ? @page.human_title : _('Failed to retrieve page') + .js-wiki-page-content.md.gl-pt-2{ data: { qa_selector: 'wiki_page_content', testid: 'wiki_page_content' } } + = _('The page could not be displayed because it timed out.') + = html_escape(_('You can view the source or %{linkStart}%{cloneIcon} clone the repository%{linkEnd}')) % { linkStart: "<a href=\"#{git_access_url}\">".html_safe, linkEnd: '</a>'.html_safe, cloneIcon: sprite_icon('download', css_class: 'gl-mr-2').html_safe } |