Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-03-12 06:09:23 +00:00
parent f5703a054c
commit 8ccbb53e68
13 changed files with 247 additions and 162 deletions

View File

@ -18,7 +18,7 @@ Remove the `:feature_name` feature flag ...
### What can we monitor to detect problems with this?
<!-- Which dashboards from https://dashboards.gitlab.net are most relevant? Sentry errors reports can alse be useful to review -->
<!-- Which dashboards from https://dashboards.gitlab.net are most relevant? Sentry errors reports can also be useful to review -->
## Beta groups/projects

View File

@ -35,8 +35,7 @@ module Packages
end
def packages_for_namespace
projects = ::Project.in_namespace(@namespace.self_and_descendants.select(:id))
::Packages::Package.for_projects(projects.select(:id))
::Packages::Package.for_projects(@namespace.all_projects)
end
end
end

View File

@ -1,3 +1,3 @@
%li{ class: active_when(params[:id] == wiki_page.slug) }
= link_to wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.slug } do
= link_to wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.human_title } do
= wiki_page.human_title

View File

@ -0,0 +1,5 @@
---
title: Use `Namespace#all_projects` for NPM package finder
merge_request: 56415
author:
type: performance

View File

@ -33,14 +33,14 @@ Example response:
[
{
"id": 1,
"name:": "group issue board",
"name": "group issue board",
"group": {
"id": 5,
"name": "Documentcloud",
"web_url": "http://example.com/groups/documentcloud"
},
"milestone": {
"id": 12
"id": 12,
"title": "10.0"
},
"lists" : [
@ -85,14 +85,14 @@ Example response:
[
{
"id": 1,
"name:": "group issue board",
"name": "group issue board",
"group": {
"id": 5,
"name": "Documentcloud",
"web_url": "http://example.com/groups/documentcloud"
},
"milestone": {
"id": 12
"id": 12,
"title": "10.0"
},
"lists" : [
@ -150,14 +150,14 @@ Example response:
```json
{
"id": 1,
"name:": "group issue board",
"name": "group issue board",
"group": {
"id": 5,
"name": "Documentcloud",
"web_url": "http://example.com/groups/documentcloud"
},
"milestone": {
"id": 12
"id": 12,
"title": "10.0"
},
"lists" : [
@ -200,14 +200,14 @@ Example response:
```json
{
"id": 1,
"name:": "group issue board",
"name": "group issue board",
"group": {
"id": 5,
"name": "Documentcloud",
"web_url": "http://example.com/groups/documentcloud"
},
"milestone": {
"id": 12
"id": 12,
"title": "10.0"
},
"lists" : [

View File

@ -121,6 +121,7 @@ module QA
module Wiki
autoload :ProjectPage, 'qa/resource/wiki/project_page'
autoload :GroupPage, 'qa/resource/wiki/group_page'
end
end
@ -380,7 +381,6 @@ module QA
autoload :Edit, 'qa/page/project/wiki/edit'
autoload :Show, 'qa/page/project/wiki/show'
autoload :GitAccess, 'qa/page/project/wiki/git_access'
autoload :Sidebar, 'qa/page/project/wiki/sidebar'
autoload :List, 'qa/page/project/wiki/list'
end
@ -496,6 +496,9 @@ module QA
autoload :Snippet, 'qa/page/component/snippet'
autoload :NewSnippet, 'qa/page/component/new_snippet'
autoload :InviteMembersModal, 'qa/page/component/invite_members_modal'
autoload :Wiki, 'qa/page/component/wiki'
autoload :WikiSidebar, 'qa/page/component/wiki_sidebar'
autoload :WikiPageForm, 'qa/page/component/wiki_page_form'
module Issuable
autoload :Common, 'qa/page/component/issuable/common'

View File

@ -0,0 +1,74 @@
# frozen_string_literal: true
module QA
module Page
module Component
module Wiki
extend QA::Page::PageConcern
def self.included(base)
super
base.view 'app/views/shared/wikis/show.html.haml' do
element :wiki_page_title
element :wiki_page_content
element :edit_page_button
end
base.view 'app/views/shared/wikis/_main_links.html.haml' do
element :new_page_button
element :page_history_button
end
base.view 'app/views/shared/empty_states/_wikis.html.haml' do
element :create_first_page_link
end
base.view 'app/views/shared/empty_states/_wikis_layout.html.haml' do
element :svg_content
end
end
def click_create_your_first_page
# The svg takes a fraction of a second to load after which the
# "Create your first page" button shifts up a bit. This can cause
# webdriver to miss the hit so we wait for the svg to load before
# clicking the button.
within_element(:svg_content) do
has_element?(:js_lazy_loaded)
end
click_element(:create_first_page_link)
end
def click_new_page
click_element(:new_page_button)
end
def click_page_history
click_element(:page_history_button)
end
def click_edit
click_element(:edit_page_button)
end
def has_title?(title)
has_element?(:wiki_page_title, title)
end
def has_content?(content)
has_element?(:wiki_page_content, content)
end
def has_no_content?(content)
has_no_element?(:wiki_page_content, content)
end
def has_no_page?
has_element?(:create_first_page_link)
end
end
end
end
end

View File

@ -0,0 +1,52 @@
# frozen_string_literal: true
module QA
module Page
module Component
module WikiPageForm
extend QA::Page::PageConcern
def self.included(base)
super
base.view 'app/views/shared/wikis/_form.html.haml' do
element :wiki_title_textbox
element :wiki_content_textarea
element :wiki_message_textbox
element :save_changes_button
element :create_page_button
end
base.view 'app/assets/javascripts/pages/shared/wikis/components/delete_wiki_modal.vue' do
element :delete_button
end
end
def set_title(title)
fill_element(:wiki_title_textbox, title)
end
def set_content(content)
fill_element(:wiki_content_textarea, content)
end
def set_message(message)
fill_element(:wiki_message_textbox, message)
end
def click_save_changes
click_element(:save_changes_button)
end
def click_create_page
click_element(:create_page_button)
end
def delete_page
click_element(:delete_button, Page::Modal::DeleteWiki)
Page::Modal::DeleteWiki.perform(&:confirm_deletion)
end
end
end
end
end

View File

@ -0,0 +1,48 @@
# frozen_string_literal: true
module QA
module Page
module Component
module WikiSidebar
extend QA::Page::PageConcern
def self.included(base)
super
base.view 'app/views/shared/wikis/_sidebar.html.haml' do
element :clone_repository_link
element :view_all_pages_button
end
base.view 'app/views/shared/wikis/_sidebar_wiki_page.html.haml' do
element :wiki_page_link
end
base.view 'app/views/shared/wikis/_wiki_directory.html.haml' do
element :wiki_directory_content
end
end
def click_clone_repository
click_element(:clone_repository_link)
end
def click_view_all_pages
click_element(:view_all_pages_button)
end
def click_page_link(page_title)
click_element(:wiki_page_link, page_name: page_title)
end
def has_page_listed?(page_title)
has_element?(:wiki_page_link, page_name: page_title)
end
def has_directory?(directory)
has_element?(:wiki_directory_content, text: directory)
end
end
end
end
end

View File

@ -5,44 +5,8 @@ module QA
module Project
module Wiki
class Edit < Base
include Wiki::Sidebar
view 'app/views/shared/wikis/_form.html.haml' do
element :wiki_title_textbox
element :wiki_content_textarea
element :wiki_message_textbox
element :save_changes_button
element :create_page_button
end
view 'app/assets/javascripts/pages/shared/wikis/components/delete_wiki_modal.vue' do
element :delete_button
end
def set_title(title)
fill_element :wiki_title_textbox, title
end
def set_content(content)
fill_element :wiki_content_textarea, content
end
def set_message(message)
fill_element :wiki_message_textbox, message
end
def click_save_changes
click_element :save_changes_button
end
def click_create_page
click_element :create_page_button
end
def delete_page
click_element :delete_button, Page::Modal::DeleteWiki
Page::Modal::DeleteWiki.perform(&:confirm_deletion)
end
include Page::Component::WikiPageForm
include Page::Component::WikiSidebar
end
end
end

View File

@ -5,67 +5,9 @@ module QA
module Project
module Wiki
class Show < Base
include Wiki::Sidebar
include Component::LazyLoader
view 'app/views/shared/wikis/show.html.haml' do
element :wiki_page_title
element :wiki_page_content
element :edit_page_button
end
view 'app/views/shared/wikis/_main_links.html.haml' do
element :new_page_button
element :page_history_button
end
view 'app/views/shared/empty_states/_wikis.html.haml' do
element :create_first_page_link
end
view 'app/views/shared/empty_states/_wikis_layout.html.haml' do
element :svg_content
end
def click_create_your_first_page
# The svg takes a fraction of a second to load after which the
# "Create your first page" button shifts up a bit. This can cause
# webdriver to miss the hit so we wait for the svg to load before
# clicking the button.
within_element(:svg_content) do
has_element? :js_lazy_loaded
end
click_element :create_first_page_link
end
def click_new_page
click_element(:new_page_button)
end
def click_page_history
click_element(:page_history_button)
end
def click_edit
click_element(:edit_page_button)
end
def has_title?(title)
has_element?(:wiki_page_title, title)
end
def has_content?(content)
has_element?(:wiki_page_content, content)
end
def has_no_content?(content)
has_no_element?(:wiki_page_content, content)
end
def has_no_page?
has_element? :create_first_page_link
end
include Page::Component::Wiki
include Page::Component::WikiSidebar
include Page::Component::LazyLoader
end
end
end

View File

@ -1,50 +0,0 @@
# frozen_string_literal: true
module QA
module Page
module Project
module Wiki
module Sidebar
extend QA::Page::PageConcern
def self.included(base)
super
base.view 'app/views/shared/wikis/_sidebar.html.haml' do
element :clone_repository_link
element :view_all_pages_button
end
base.view 'app/views/shared/wikis/_sidebar_wiki_page.html.haml' do
element :wiki_page_link
end
base.view 'app/views/shared/wikis/_wiki_directory.html.haml' do
element :wiki_directory_content
end
end
def click_clone_repository
click_element(:clone_repository_link)
end
def click_view_all_pages
click_element(:view_all_pages_button)
end
def click_page_link(page_title)
click_element :wiki_page_link, page_name: page_title
end
def has_page_listed?(page_title)
has_element? :wiki_page_link, page_name: page_title
end
def has_directory?(directory)
has_element? :wiki_directory_content, text: directory
end
end
end
end
end
end

View File

@ -0,0 +1,48 @@
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
module Wiki
class GroupPage < Base
attribute :title
attribute :content
attribute :slug
attribute :group do
Group.fabricate_via_api! do |group|
group.path = "group-with-wiki-#{SecureRandom.hex(8)}"
end
end
def initialize
@title = 'Home'
@content = 'This wiki page is created via API'
end
def resource_web_url(resource)
super
rescue ResourceURLMissingError
"#{group.web_url}/-/wikis/#{slug}"
end
def api_get_path
"/groups/#{group.id}/wikis/#{slug}"
end
def api_post_path
"/groups/#{group.id}/wikis"
end
def api_post_body
{
id: group.id,
content: content,
title: title
}
end
end
end
end
end