Commit 7915c41e authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 495c22d1
...@@ -380,8 +380,3 @@ Performance/ChainArrayAllocation: ...@@ -380,8 +380,3 @@ Performance/ChainArrayAllocation:
- 'lib/gitlab/import_export/**/*' - 'lib/gitlab/import_export/**/*'
- 'ee/lib/gitlab/import_export/**/*' - 'ee/lib/gitlab/import_export/**/*'
- 'ee/lib/ee/gitlab/import_export/**/*' - 'ee/lib/ee/gitlab/import_export/**/*'
# https://gitlab.com/gitlab-org/gitlab/-/issues/212541
RSpec/RepeatedExample:
Exclude:
- 'spec/features/merge_request/user_posts_diff_notes_spec.rb'
...@@ -14,15 +14,18 @@ export default { ...@@ -14,15 +14,18 @@ export default {
}, },
successLabel: { successLabel: {
type: String, type: String,
required: true, required: false,
default: 'successful',
}, },
failureLabel: { failureLabel: {
type: String, type: String,
required: true, required: false,
default: 'failed',
}, },
neutralLabel: { neutralLabel: {
type: String, type: String,
required: true, required: false,
default: 'neutral',
}, },
successCount: { successCount: {
type: Number, type: Number,
...@@ -36,6 +39,11 @@ export default { ...@@ -36,6 +39,11 @@ export default {
type: Number, type: Number,
required: true, required: true,
}, },
hideTooltips: {
type: Boolean,
required: false,
default: false,
},
}, },
computed: { computed: {
neutralCount() { neutralCount() {
...@@ -87,7 +95,7 @@ export default { ...@@ -87,7 +95,7 @@ export default {
return `width: ${percent}%;`; return `width: ${percent}%;`;
}, },
getTooltip(label, count) { getTooltip(label, count) {
return `${label}: ${count}`; return this.hideTooltips ? '' : `${label}: ${count}`;
}, },
}, },
}; };
......
...@@ -62,6 +62,14 @@ ...@@ -62,6 +62,14 @@
.gl-h-32 { height: px-to-rem($grid-size * 4); } .gl-h-32 { height: px-to-rem($grid-size * 4); }
.gl-h-64 { height: px-to-rem($grid-size * 8); } .gl-h-64 { height: px-to-rem($grid-size * 8); }
.gl-shim-h-2 {
height: px-to-rem(4px);
}
.gl-shim-w-5 {
width: px-to-rem(16px);
}
.gl-text-purple { color: $purple; } .gl-text-purple { color: $purple; }
.gl-text-gray-800 { color: $gray-800; } .gl-text-gray-800 { color: $gray-800; }
.gl-bg-purple-light { background-color: $purple-light; } .gl-bg-purple-light { background-color: $purple-light; }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
- else - else
.form-actions .form-actions
= f.submit _('Save changes'), class: "btn btn-success" = f.submit _('Save changes'), class: "btn btn-success", data: { qa_selector: 'save_changes_button' }
= link_to _('Cancel'), admin_group_path(@group), class: "btn btn-cancel" = link_to _('Cancel'), admin_group_path(@group), class: "btn btn-cancel"
= render_if_exists 'ldap_group_links/ldap_syncrhonizations', group: @group = render_if_exists 'ldap_group_links/ldap_syncrhonizations', group: @group
- group = local_assigns.fetch(:group) - group = local_assigns.fetch(:group)
- css_class = 'no-description' if group.description.blank? - css_class = 'no-description' if group.description.blank?
%li.group-row.py-3{ class: css_class } %li.group-row.py-3{ class: css_class, data: { qa_selector: 'group_row_content' } }
.controls .controls
= link_to _('Edit'), admin_group_edit_path(group), id: "edit_#{dom_id(group)}", class: 'btn' = link_to _('Edit'), admin_group_edit_path(group), id: "edit_#{dom_id(group)}", class: 'btn'
= link_to _('Delete'), [:admin, group], data: { confirm: _("Are you sure you want to remove %{group_name}?") % { group_name: group.name } }, method: :delete, class: 'btn btn-remove' = link_to _('Delete'), [:admin, group], data: { confirm: _("Are you sure you want to remove %{group_name}?") % { group_name: group.name } }, method: :delete, class: 'btn btn-remove'
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
.avatar-container.rect-avatar.s40 .avatar-container.rect-avatar.s40
= group_icon(group, class: "avatar s40 d-none d-sm-block") = group_icon(group, class: "avatar s40 d-none d-sm-block")
.title .title
= link_to [:admin, group], class: 'group-name' do = link_to [:admin, group], class: 'group-name', data: { qa_selector: 'group_name_link' } do
= group.full_name = group.full_name
- if group.description.present? - if group.description.present?
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
.search-holder .search-holder
- project_name = params[:name].present? ? params[:name] : nil - project_name = params[:name].present? ? params[:name] : nil
.search-field-holder .search-field-holder
= search_field_tag :name, project_name, class: "form-control search-text-input js-search-input", autofocus: true, spellcheck: false, placeholder: 'Search by name' = search_field_tag :name, project_name, class: "form-control search-text-input js-search-input", autofocus: true, spellcheck: false, placeholder: 'Search by name', data: { qa_selector: 'group_search_field' }
= icon("search", class: "search-icon") = icon("search", class: "search-icon")
= render "shared/groups/dropdown", options_hash: admin_groups_sort_options_hash = render "shared/groups/dropdown", options_hash: admin_groups_sort_options_hash
= link_to new_admin_group_path, class: "btn btn-success" do = link_to new_admin_group_path, class: "btn btn-success" do
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%h3.page-title %h3.page-title
= _('Group: %{group_name}') % { group_name: @group.full_name } = _('Group: %{group_name}') % { group_name: @group.full_name }
= link_to admin_group_edit_path(@group), class: "btn float-right" do = link_to admin_group_edit_path(@group), class: "btn float-right", data: { qa_selector: 'edit_group_link' } do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
= _('Edit') = _('Edit')
%hr %hr
......
...@@ -28,11 +28,11 @@ ...@@ -28,11 +28,11 @@
%span %span
= _('Projects') = _('Projects')
= nav_link(controller: :users) do = nav_link(controller: :users) do
= link_to admin_users_path, title: _('Users') , data: { qa_selector: 'users_overview_link' } do = link_to admin_users_path, title: _('Users'), data: { qa_selector: 'users_overview_link' } do
%span %span
= _('Users') = _('Users')
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to admin_groups_path, title: _('Groups') do = link_to admin_groups_path, title: _('Groups'), data: { qa_selector: 'groups_overview_link' } do
%span %span
= _('Groups') = _('Groups')
= nav_link path: 'jobs#index' do = nav_link path: 'jobs#index' do
......
---
title: Support Asciidoc docname attribute
merge_request: 22313
author: Jouke Witteveen
type: added
---
title: Fix duplicate spec in user post diff notes
merge_request: 28859
author: Rajendra Kadam
type: added
...@@ -769,7 +769,7 @@ To indicate the steps of navigation through the UI: ...@@ -769,7 +769,7 @@ To indicate the steps of navigation through the UI:
a valid name for an illustration is `devops_diagram_v11_1.png`. a valid name for an illustration is `devops_diagram_v11_1.png`.
- Keep all file names in lower case. - Keep all file names in lower case.
- Consider using PNG images instead of JPEG. - Consider using PNG images instead of JPEG.
- Compress all images with <https://pngquant.org/> or similar tool. - [Compress all PNG images](#compress-images).
- Compress gifs with <https://ezgif.com/optimize> or similar tool. - Compress gifs with <https://ezgif.com/optimize> or similar tool.
- Images should be used (only when necessary) to _illustrate_ the description - Images should be used (only when necessary) to _illustrate_ the description
of a process, not to _replace_ it. of a process, not to _replace_ it.
...@@ -796,6 +796,35 @@ directly to an HTML `img` tag: ...@@ -796,6 +796,35 @@ directly to an HTML `img` tag:
<img src="path/to/image.jpg" alt="Alt text (required)" class="image-noshadow"> <img src="path/to/image.jpg" alt="Alt text (required)" class="image-noshadow">
``` ```
### Compress images
You should always compress any new images you add to the documentation. One
known tool is [`pngquant`](https://pngquant.org/), which is cross-platform and
open source. Install it by visiting the official website and following the
instructions for your OS.
GitLab has a [raketask](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/tasks/pngquant.rake)
that you can use to automate the process. In the root directory of your local
copy of `https://gitlab.com/gitlab-org/gitlab`, run in a terminal:
- Before compressing, if you want, check that all documentation PNG images have
been compressed:
```shell
bundle exec rake pngquant:lint
```
- Compress all documentation PNG images using `pngquant`:
```shell
bundle exec rake pngquant:compress
```
The only caveat is that the task runs on all images under `doc/`, not only the
ones you might have included in a merge request. In that case, you can run the
compress task and only commit the images that are relevant to your merge
request.
## Videos ## Videos
Adding GitLab's existing YouTube video tutorials to the documentation is Adding GitLab's existing YouTube video tutorials to the documentation is
......
...@@ -327,6 +327,8 @@ but commented out to help encourage others to add to it in the future. --> ...@@ -327,6 +327,8 @@ but commented out to help encourage others to add to it in the future. -->
|dependency_scanning_jobs|counts|| |dependency_scanning_jobs|counts||
|license_management_jobs|counts|| |license_management_jobs|counts||
|sast_jobs|counts|| |sast_jobs|counts||
|status_page_projects|counts|monitor|
|status_page_issues|counts|monitor|
|epics_deepest_relationship_level|counts|| |epics_deepest_relationship_level|counts||
|operations_dashboard_default_dashboard|counts|| |operations_dashboard_default_dashboard|counts||
|operations_dashboard_users_with_projects_added|counts|| |operations_dashboard_users_with_projects_added|counts||
......
...@@ -91,6 +91,8 @@ stem:[sqrt(4) = 2] ...@@ -91,6 +91,8 @@ stem:[sqrt(4) = 2]
### Attributes ### Attributes
**User-defined attributes**
```asciidoc ```asciidoc
// define attributes in the document header // define attributes in the document header
:name: value :name: value
...@@ -104,6 +106,15 @@ C{pp} is not required, only Ruby. ...@@ -104,6 +106,15 @@ C{pp} is not required, only Ruby.
Use a leading backslash to output a word enclosed in curly braces, like \{name}. Use a leading backslash to output a word enclosed in curly braces, like \{name}.
``` ```
**Environment attributes**
GitLab sets the following environment attributes:
| Attribute | Description |
| :-------------- | :--------------------------------------------------------------------------------------------------------------------- |
| `docname` | Root name of the source document (no leading path or file extension). |
| `outfilesuffix` | File extension corresponding to the backend output (defaults to `.adoc` to make inter-document cross references work). |
### Links ### Links
```asciidoc ```asciidoc
......
...@@ -25,6 +25,19 @@ module Gitlab ...@@ -25,6 +25,19 @@ module Gitlab
'max-include-depth' => MAX_INCLUDE_DEPTH 'max-include-depth' => MAX_INCLUDE_DEPTH
}.freeze }.freeze
def self.path_attrs(path)
return {} unless path
{
# Set an empty docname if the path is a directory
'docname' => if path[-1] == ::File::SEPARATOR
''
else
::File.basename(path, '.*')
end
}
end
# Public: Converts the provided Asciidoc markup into HTML. # Public: Converts the provided Asciidoc markup into HTML.
# #
# input - the source text in Asciidoc format # input - the source text in Asciidoc format
...@@ -35,9 +48,10 @@ module Gitlab ...@@ -35,9 +48,10 @@ module Gitlab
include_processor ::Gitlab::Asciidoc::IncludeProcessor.new(context) include_processor ::Gitlab::Asciidoc::IncludeProcessor.new(context)
end end
extra_attrs = path_attrs(context[:requested_path])
asciidoc_opts = { safe: :secure, asciidoc_opts = { safe: :secure,
backend: :gitlab_html5, backend: :gitlab_html5,
attributes: DEFAULT_ADOC_ATTRS, attributes: DEFAULT_ADOC_ATTRS.merge(extra_attrs),
extensions: extensions } extensions: extensions }
context[:pipeline] = :ascii_doc context[:pipeline] = :ascii_doc
......
...@@ -9314,9 +9314,6 @@ msgstr "" ...@@ -9314,9 +9314,6 @@ msgstr ""
msgid "GeoNodes|Not checksummed" msgid "GeoNodes|Not checksummed"
msgstr "" msgstr ""
msgid "GeoNodes|Out of sync"
msgstr ""
msgid "GeoNodes|Pausing replication stops the sync process. Are you sure?" msgid "GeoNodes|Pausing replication stops the sync process. Are you sure?"
msgstr "" msgstr ""
...@@ -9365,9 +9362,6 @@ msgstr "" ...@@ -9365,9 +9362,6 @@ msgstr ""
msgid "GeoNodes|Sync settings" msgid "GeoNodes|Sync settings"
msgstr "" msgstr ""
msgid "GeoNodes|Synced"
msgstr ""
msgid "GeoNodes|Unused slots" msgid "GeoNodes|Unused slots"
msgstr "" msgstr ""
...@@ -13772,6 +13766,9 @@ msgstr "" ...@@ -13772,6 +13766,9 @@ msgstr ""
msgid "Now you can access the merge request navigation tabs at the top, where they’re easier to find." msgid "Now you can access the merge request navigation tabs at the top, where they’re easier to find."
msgstr "" msgstr ""
msgid "Number of %{itemTitle}"
msgstr ""
msgid "Number of Elasticsearch replicas" msgid "Number of Elasticsearch replicas"
msgstr "" msgstr ""
...@@ -16441,6 +16438,9 @@ msgstr "" ...@@ -16441,6 +16438,9 @@ msgstr ""
msgid "Query is valid" msgid "Query is valid"
msgstr "" msgstr ""
msgid "Queued"
msgstr ""
msgid "Quick actions can be used in the issues description and comment boxes." msgid "Quick actions can be used in the issues description and comment boxes."
msgstr "" msgstr ""
...@@ -19568,6 +19568,9 @@ msgstr "" ...@@ -19568,6 +19568,9 @@ msgstr ""
msgid "Sync information" msgid "Sync information"
msgstr "" msgstr ""
msgid "Synced"
msgstr ""
msgid "System" msgid "System"
msgstr "" msgstr ""
......
...@@ -369,6 +369,12 @@ module QA ...@@ -369,6 +369,12 @@ module QA
autoload :Index, 'qa/page/admin/overview/users/index' autoload :Index, 'qa/page/admin/overview/users/index'
autoload :Show, 'qa/page/admin/overview/users/show' autoload :Show, 'qa/page/admin/overview/users/show'
end end
module Groups
autoload :Index, 'qa/page/admin/overview/groups/index'
autoload :Show, 'qa/page/admin/overview/groups/show'
autoload :Edit, 'qa/page/admin/overview/groups/edit'
end
end end
end end
......
...@@ -16,9 +16,7 @@ module QA ...@@ -16,9 +16,7 @@ module QA
element :admin_sidebar_monitoring_submenu_content element :admin_sidebar_monitoring_submenu_content
element :admin_sidebar_overview_submenu_content element :admin_sidebar_overview_submenu_content
element :users_overview_link element :users_overview_link
end element :groups_overview_link
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
element :integration_settings_link element :integration_settings_link
end end
...@@ -76,6 +74,12 @@ module QA ...@@ -76,6 +74,12 @@ module QA
end end
end end
def go_to_groups_overview
within_submenu(:admin_sidebar_overview_submenu_content) do
click_element :groups_overview_link
end
end
private private
def hover_element(element) def hover_element(element)
......
# frozen_string_literal: true
module QA
module Page
module Admin
module Overview
module Groups
class Edit < QA::Page::Base
view 'app/views/admin/groups/_form.html.haml' do
element :save_changes_button, required: true
end
def click_save_changes_button
click_element :save_changes_button, Groups::Show
end
end
end
end
end
end
end
QA::Page::Admin::Overview::Groups::Edit.prepend_if_ee('QA::EE::Page::Admin::Overview::Groups::Edit')
# frozen_string_literal: true
module QA
module Page
module Admin
module Overview
module Groups
class Index < QA::Page::Base
view 'app/views/admin/groups/index.html.haml' do
element :group_search_field, required: true
end
view 'app/views/admin/groups/_group.html.haml' do
element :group_row_content
element :group_name_link
end
def search_group(group_name)
find_element(:group_search_field).set(group_name).send_keys(:return)
end
def click_group(group_name)
within_element(:group_row_content, text: group_name) do
click_element(:group_name_link)
end
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module Page
module Admin
module Overview
module Groups
class Show < QA::Page::Base
view 'app/views/admin/groups/show.html.haml' do
element :edit_group_link, required: true
end
def click_edit_group_link
click_element :edit_group_link, Groups::Edit
end
end
end
end
end
end
end
...@@ -23,6 +23,10 @@ module QA ...@@ -23,6 +23,10 @@ module QA
SUPPORTED_FEATURES SUPPORTED_FEATURES
end end
def dot_com?
Runtime::Scenario.gitlab_address.include?(".com")
end
def additional_repository_storage def additional_repository_storage
ENV['QA_ADDITIONAL_REPOSITORY_STORAGE'] ENV['QA_ADDITIONAL_REPOSITORY_STORAGE']
end end
......
...@@ -340,4 +340,18 @@ describe QA::Runtime::Env do ...@@ -340,4 +340,18 @@ describe QA::Runtime::Env do
end end
end end
end end
describe '.dot_com?' do
it 'returns true when url has .com' do
QA::Runtime::Scenario.define(:gitlab_address, "https://staging.gitlab.com")
expect(described_class.dot_com?).to be_truthy
end
it 'returns false when url does not have .com' do
QA::Runtime::Scenario.define(:gitlab_address, "https://gitlab.test")
expect(described_class.dot_com?).to be_falsy
end
end
end end
...@@ -66,12 +66,7 @@ describe 'Merge request > User posts diff notes', :js do ...@@ -66,12 +66,7 @@ describe 'Merge request > User posts diff notes', :js do
end end
context 'with a match line' do context 'with a match line' do
it 'does not allow commenting on the left side' do it 'does not allow commenting' do
line_holder = find('.match', match: :first).find(:xpath, '..')
match_should_not_allow_commenting(line_holder)
end
it 'does not allow commenting on the right side' do
line_holder = find('.match', match: :first).find(:xpath, '..') line_holder = find('.match', match: :first).find(:xpath, '..')
match_should_not_allow_commenting(line_holder) match_should_not_allow_commenting(line_holder)
end end
......
...@@ -68,8 +68,20 @@ describe('StackedProgressBarComponent', () => { ...@@ -68,8 +68,20 @@ describe('StackedProgressBarComponent', () => {
}); });
describe('getTooltip', () => { describe('getTooltip', () => {
it('returns label string based on label and count provided', () => { describe('when hideTooltips is false', () => {
expect(vm.getTooltip('Synced', 10)).toBe('Synced: 10'); it('returns label string based on label and count provided', () => {
expect(vm.getTooltip('Synced', 10)).toBe('Synced: 10');
});
});
describe('when hideTooltips is true', () => {
beforeEach(() => {
vm = createComponent({ hideTooltips: true });
});
it('returns an empty string', () => {
expect(vm.getTooltip('Synced', 10)).toBe('');
});
}); });
}); });
}); });
......
...@@ -46,6 +46,27 @@ module Gitlab ...@@ -46,6 +46,27 @@ module Gitlab
end end
end end
context "with requested path" do
input = <<~ADOC
Document name: {docname}.
ADOC
it "ignores {docname} when not available" do
expect(render(input, {})).to include(input.strip)
end
[
['/', '', 'root'],
['README', 'README', 'just a filename'],
['doc/api/', '', 'a directory'],
['doc/api/README.adoc', 'README', 'a complete path']
].each do |path, basename, desc|
it "sets {docname} for #{desc}" do
expect(render(input, { requested_path: path })).to include(": #{basename}.")
end
end
end
context "XSS" do context "XSS" do
items = { items = {
'link with extra attribute' => { 'link with extra attribute' => {
......
...@@ -786,10 +786,10 @@ ...@@ -786,10 +786,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.117.0.tgz#05239ddcf529c62ca29e1ec1a25a7e24efb98207" resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.117.0.tgz#05239ddcf529c62ca29e1ec1a25a7e24efb98207"
integrity sha512-dGy/VWuRAFCTZX3Yqu1+RnAHTSUWafteIk/RMfUCN9B/EMbYzjhYsNy0NLVoZ23Rj/KGv1bUGHvyQCoPP6VzpA== integrity sha512-dGy/VWuRAFCTZX3Yqu1+RnAHTSUWafteIk/RMfUCN9B/EMbYzjhYsNy0NLVoZ23Rj/KGv1bUGHvyQCoPP6VzpA==
"@gitlab/ui@11.0.3": "@gitlab/ui@11.1.0":
version "11.0.3" version "11.1.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-11.0.3.tgz#7ef5aa78e8b3226c189487cb1d131859180bf539" resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-11.1.0.tgz#72dd6d4309909fd1874f8abc42be8365e875822e"
integrity sha512-BCV0+3xJCiBOvdpDlDm6YMnsAP1l4L03e5y0Nqtw8T6hITCL86eGTs0IEPzmE/v2x+03sK4QSHa6rf0dqlvwDg== integrity sha512-lmHTIUIYuUSGiisvnndhpUASvXZokP8/1LBfws9qkbEFPnMIvJAxGRHo3F7dLjcDBCvy4xepgDFFjI6HNFhLWA==
dependencies: dependencies:
"@babel/standalone" "^7.0.0" "@babel/standalone" "^7.0.0"
"@gitlab/vue-toasted" "^1.3.0" "@gitlab/vue-toasted" "^1.3.0"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment