Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
8f016fe5fb
commit
3d7e272e43
18 changed files with 146 additions and 56 deletions
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { GlButton, GlCard, GlSprintf } from '@gitlab/ui';
|
||||
import { GlAvatar, GlButton, GlCard, GlSprintf } from '@gitlab/ui';
|
||||
import ExperimentTracking from '~/experimentation/experiment_tracking';
|
||||
import { mergeUrlParams } from '~/lib/utils/url_utility';
|
||||
import { s__, sprintf } from '~/locale';
|
||||
|
@ -7,6 +7,7 @@ import { HELLO_WORLD_TEMPLATE_KEY } from '../../constants';
|
|||
|
||||
export default {
|
||||
components: {
|
||||
GlAvatar,
|
||||
GlButton,
|
||||
GlCard,
|
||||
GlSprintf,
|
||||
|
@ -109,11 +110,12 @@ export default {
|
|||
class="gl-display-flex gl-align-items-center gl-justify-content-space-between gl-border-b-solid gl-border-b-1 gl-border-b-gray-100 gl-pb-3 gl-pt-3"
|
||||
>
|
||||
<div class="gl-display-flex gl-flex-direction-row gl-align-items-center">
|
||||
<img
|
||||
width="64"
|
||||
height="64"
|
||||
<gl-avatar
|
||||
:src="template.logo"
|
||||
class="gl-mr-6"
|
||||
:size="64"
|
||||
class="gl-mr-6 gl-bg-white dark-mode-override"
|
||||
shape="rect"
|
||||
:alt="template.name"
|
||||
data-testid="template-logo"
|
||||
/>
|
||||
<div class="gl-flex-direction-row">
|
||||
|
|
|
@ -62,6 +62,12 @@
|
|||
.pipeline-tags .label-container {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.dark-mode-override {
|
||||
.gl-dark & {
|
||||
background-color: $white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Mini Pipelines
|
||||
|
|
|
@ -34,38 +34,38 @@ module Ci
|
|||
# and will be cleaned up with https://gitlab.com/gitlab-org/gitlab/-/issues/326299
|
||||
def experiment_suggested_ci_templates
|
||||
[
|
||||
{ name: 'Android', logo: image_path('illustrations/logos/android.svg') },
|
||||
{ name: 'Bash', logo: image_path('illustrations/logos/bash.svg') },
|
||||
{ name: 'C++', logo: image_path('illustrations/logos/c_plus_plus.svg') },
|
||||
{ name: 'Clojure', logo: image_path('illustrations/logos/clojure.svg') },
|
||||
{ name: 'Composer', logo: image_path('illustrations/logos/composer.svg') },
|
||||
{ name: 'Crystal', logo: image_path('illustrations/logos/crystal.svg') },
|
||||
{ name: 'Dart', logo: image_path('illustrations/logos/dart.svg') },
|
||||
{ name: 'Django', logo: image_path('illustrations/logos/django.svg') },
|
||||
{ name: 'Docker', logo: image_path('illustrations/logos/docker.svg') },
|
||||
{ name: 'Elixir', logo: image_path('illustrations/logos/elixir.svg') },
|
||||
{ name: 'iOS-Fastlane', logo: image_path('illustrations/logos/fastlane.svg') },
|
||||
{ name: 'Flutter', logo: image_path('illustrations/logos/flutter.svg') },
|
||||
{ name: 'Go', logo: image_path('illustrations/logos/go_logo.svg') },
|
||||
{ name: 'Gradle', logo: image_path('illustrations/logos/gradle.svg') },
|
||||
{ name: 'Grails', logo: image_path('illustrations/logos/grails.svg') },
|
||||
{ name: 'dotNET', logo: image_path('illustrations/logos/dotnet.svg') },
|
||||
{ name: 'Julia', logo: image_path('illustrations/logos/julia.svg') },
|
||||
{ name: 'Laravel', logo: image_path('illustrations/logos/laravel.svg') },
|
||||
{ name: 'LaTeX', logo: image_path('illustrations/logos/latex.svg') },
|
||||
{ name: 'Maven', logo: image_path('illustrations/logos/maven.svg') },
|
||||
{ name: 'Mono', logo: image_path('illustrations/logos/mono.svg') },
|
||||
{ name: 'Nodejs', logo: image_path('illustrations/logos/node_js.svg') },
|
||||
{ name: 'npm', logo: image_path('illustrations/logos/npm.svg') },
|
||||
{ name: 'OpenShift', logo: image_path('illustrations/logos/openshift.svg') },
|
||||
{ name: 'Packer', logo: image_path('illustrations/logos/packer.svg') },
|
||||
{ name: 'PHP', logo: image_path('illustrations/logos/php.svg') },
|
||||
{ name: 'Python', logo: image_path('illustrations/logos/python.svg') },
|
||||
{ name: 'Ruby', logo: image_path('illustrations/logos/ruby.svg') },
|
||||
{ name: 'Rust', logo: image_path('illustrations/logos/rust.svg') },
|
||||
{ name: 'Scala', logo: image_path('illustrations/logos/scala.svg') },
|
||||
{ name: 'Swift', logo: image_path('illustrations/logos/swift.svg') },
|
||||
{ name: 'Terraform', logo: image_path('illustrations/logos/terraform.svg') }
|
||||
{ name: 'Android', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/android.svg') },
|
||||
{ name: 'Bash', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/bash.svg') },
|
||||
{ name: 'C++', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/c_plus_plus.svg') },
|
||||
{ name: 'Clojure', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/clojure.svg') },
|
||||
{ name: 'Composer', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/composer.svg') },
|
||||
{ name: 'Crystal', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/crystal.svg') },
|
||||
{ name: 'Dart', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/dart.svg') },
|
||||
{ name: 'Django', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/django.svg') },
|
||||
{ name: 'Docker', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/docker.svg') },
|
||||
{ name: 'Elixir', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/elixir.svg') },
|
||||
{ name: 'iOS-Fastlane', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/fastlane.svg') },
|
||||
{ name: 'Flutter', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/flutter.svg') },
|
||||
{ name: 'Go', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/go_logo.svg') },
|
||||
{ name: 'Gradle', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/gradle.svg') },
|
||||
{ name: 'Grails', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/grails.svg') },
|
||||
{ name: 'dotNET', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/dotnet.svg') },
|
||||
{ name: 'Julia', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/julia.svg') },
|
||||
{ name: 'Laravel', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/laravel.svg') },
|
||||
{ name: 'LaTeX', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/latex.svg') },
|
||||
{ name: 'Maven', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/maven.svg') },
|
||||
{ name: 'Mono', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/mono.svg') },
|
||||
{ name: 'Nodejs', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/node_js.svg') },
|
||||
{ name: 'npm', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/npm.svg') },
|
||||
{ name: 'OpenShift', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/openshift.svg') },
|
||||
{ name: 'Packer', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/packer.svg') },
|
||||
{ name: 'PHP', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/php.svg') },
|
||||
{ name: 'Python', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/python.svg') },
|
||||
{ name: 'Ruby', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/ruby.svg') },
|
||||
{ name: 'Rust', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/rust.svg') },
|
||||
{ name: 'Scala', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/scala.svg') },
|
||||
{ name: 'Swift', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/swift.svg') },
|
||||
{ name: 'Terraform', logo: image_path('illustrations/third-party-logos/ci_cd-template-logos/terraform.svg') }
|
||||
]
|
||||
end
|
||||
|
||||
|
|
|
@ -128,10 +128,7 @@
|
|||
.card-header
|
||||
= html_escape(_("%{group_name} group members")) % { group_name: "<strong>#{html_escape(@group.name)}</strong>".html_safe }
|
||||
%span.badge.badge-pill= @group.users_count
|
||||
.float-right
|
||||
= link_to group_group_members_path(@group), class: 'btn btn-default gl-button btn-sm' do
|
||||
= sprite_icon('pencil-square', css_class: 'gl-icon')
|
||||
= _('Manage access')
|
||||
= render 'shared/members/manage_access_button', path: group_group_members_path(@group)
|
||||
%ul.content-list.group-users-list.content-list.members-list
|
||||
= render partial: 'shared/members/member',
|
||||
collection: @members, as: :member,
|
||||
|
|
|
@ -180,10 +180,7 @@
|
|||
%strong= @group.name
|
||||
= _('group members')
|
||||
%span.badge.badge-pill= @group_members.size
|
||||
.float-right
|
||||
= link_to admin_group_path(@group), class: 'btn btn-default gl-button btn-sm' do
|
||||
= sprite_icon('pencil-square', css_class: 'gl-icon')
|
||||
= _('Manage access')
|
||||
= render 'shared/members/manage_access_button', path: group_group_members_path(@group)
|
||||
%ul.content-list.members-list
|
||||
= render partial: 'shared/members/member',
|
||||
collection: @group_members, as: :member,
|
||||
|
@ -194,17 +191,14 @@
|
|||
.card-footer
|
||||
= paginate @group_members, param_name: 'group_members_page', theme: 'gitlab'
|
||||
|
||||
= render 'shared/members/requests', membership_source: @project, group: @group, requesters: @requesters, force_mobile_view: true
|
||||
= render 'shared/members/requests', membership_source: @project, group: @group, requesters: @requesters
|
||||
|
||||
.card
|
||||
.card-header
|
||||
%strong= @project.name
|
||||
= _('project members')
|
||||
%span.badge.badge-pill= @project.users.size
|
||||
.float-right
|
||||
= link_to project_project_members_path(@project), class: 'btn btn-default gl-button btn-sm' do
|
||||
= sprite_icon('pencil-square', css_class: 'gl-icon')
|
||||
= _('Manage access')
|
||||
= render 'shared/members/manage_access_button', path: project_project_members_path(@project)
|
||||
%ul.content-list.project_members.members-list
|
||||
= render partial: 'shared/members/member',
|
||||
collection: @project_members, as: :member,
|
||||
|
|
7
app/views/shared/members/_manage_access_button.html.haml
Normal file
7
app/views/shared/members/_manage_access_button.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
- path = local_assigns.fetch(:path, nil)
|
||||
|
||||
.gl-float-right
|
||||
= link_to path, class: 'btn btn-default btn-sm gl-button' do
|
||||
= sprite_icon('pencil-square', css_class: 'gl-icon gl-button-icon')
|
||||
%span.gl-button-text
|
||||
= _('Manage access')
|
|
@ -1,20 +1,20 @@
|
|||
- membership_source = local_assigns.fetch(:membership_source)
|
||||
- requesters = local_assigns.fetch(:requesters)
|
||||
- force_mobile_view = local_assigns.fetch(:force_mobile_view, false)
|
||||
- group = local_assigns.fetch(:group)
|
||||
- current_user_is_group_owner = group && group.has_owner?(current_user)
|
||||
|
||||
- return if requesters.empty?
|
||||
|
||||
.card.gl-mt-3{ class: ('card-mobile' if force_mobile_view ) }
|
||||
.card.gl-mt-3{ data: { testid: 'access-requests' } }
|
||||
.card-header
|
||||
= _("Users requesting access to")
|
||||
%strong= membership_source.name
|
||||
%span.badge.badge-pill= requesters.size
|
||||
= render 'shared/members/manage_access_button', path: membership_source.is_a?(Project) ? project_project_members_path(@project, tab: 'access_requests') : group_group_members_path(@group, tab: 'access_requests')
|
||||
%ul.content-list.members-list
|
||||
= render partial: 'shared/members/member',
|
||||
collection: requesters, as: :member,
|
||||
locals: { membership_source: membership_source,
|
||||
group: group,
|
||||
force_mobile_view: force_mobile_view,
|
||||
show_controls: false,
|
||||
current_user_is_group_owner: current_user_is_group_owner }
|
||||
|
|
17
db/migrate/20210615064342_add_issue_id_to_requirement.rb
Normal file
17
db/migrate/20210615064342_add_issue_id_to_requirement.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIssueIdToRequirement < ActiveRecord::Migration[6.1]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
def up
|
||||
with_lock_retries do
|
||||
add_column :requirements, :issue_id, :bigint, null: true
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
remove_column :requirements, :issue_id
|
||||
end
|
||||
end
|
||||
end
|
17
db/migrate/20210616110748_add_issue_index_to_requirement.rb
Normal file
17
db/migrate/20210616110748_add_issue_index_to_requirement.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIssueIndexToRequirement < ActiveRecord::Migration[6.1]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = 'index_requirements_on_issue_id'
|
||||
|
||||
def up
|
||||
add_concurrent_index :requirements, :issue_id, name: INDEX_NAME, unique: true
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :requirements, INDEX_NAME
|
||||
end
|
||||
end
|
|
@ -0,0 +1,19 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIssueRequirementForeignKey < ActiveRecord::Migration[6.1]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
TARGET_TABLE = :requirements
|
||||
|
||||
def up
|
||||
add_concurrent_foreign_key TARGET_TABLE, :issues, column: :issue_id
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
remove_foreign_key_if_exists(TARGET_TABLE, column: :issue_id)
|
||||
end
|
||||
end
|
||||
end
|
1
db/schema_migrations/20210615064342
Normal file
1
db/schema_migrations/20210615064342
Normal file
|
@ -0,0 +1 @@
|
|||
509f30d8772e24efc52c5aa12ebcde084f7ded8d228109bbbdda2f21d3235512
|
1
db/schema_migrations/20210616110748
Normal file
1
db/schema_migrations/20210616110748
Normal file
|
@ -0,0 +1 @@
|
|||
8207eb9917b4d02f39cd9e9eca9ec0e001266b25b3378f09e4e8c27ff22b6e73
|
1
db/schema_migrations/20210616111311
Normal file
1
db/schema_migrations/20210616111311
Normal file
|
@ -0,0 +1 @@
|
|||
fd014b505ecd162c232da23a10c34dc4b1f1dbe8fe357a0f20585479b25d50bc
|
|
@ -17477,6 +17477,7 @@ CREATE TABLE requirements (
|
|||
title_html text,
|
||||
description text,
|
||||
description_html text,
|
||||
issue_id bigint,
|
||||
CONSTRAINT check_785ae25b9d CHECK ((char_length(description) <= 10000))
|
||||
);
|
||||
|
||||
|
@ -24504,6 +24505,8 @@ CREATE INDEX index_requirements_on_author_id ON requirements USING btree (author
|
|||
|
||||
CREATE INDEX index_requirements_on_created_at ON requirements USING btree (created_at);
|
||||
|
||||
CREATE UNIQUE INDEX index_requirements_on_issue_id ON requirements USING btree (issue_id);
|
||||
|
||||
CREATE INDEX index_requirements_on_project_id ON requirements USING btree (project_id);
|
||||
|
||||
CREATE UNIQUE INDEX index_requirements_on_project_id_and_iid ON requirements USING btree (project_id, iid) WHERE (project_id IS NOT NULL);
|
||||
|
@ -25828,6 +25831,9 @@ ALTER TABLE ONLY experiment_subjects
|
|||
ALTER TABLE ONLY merge_request_diffs
|
||||
ADD CONSTRAINT fk_8483f3258f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY requirements
|
||||
ADD CONSTRAINT fk_85044baef0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY ci_pipelines
|
||||
ADD CONSTRAINT fk_86635dbd80 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
|
||||
|
||||
|
|
|
@ -22111,9 +22111,6 @@ msgstr ""
|
|||
msgid "No repository"
|
||||
msgstr ""
|
||||
|
||||
msgid "No required pipeline"
|
||||
msgstr ""
|
||||
|
||||
msgid "No runner executable"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -132,6 +132,19 @@ RSpec.describe 'Admin Groups' do
|
|||
|
||||
expect(page).to have_text(note_text)
|
||||
end
|
||||
|
||||
context 'when group has open access requests' do
|
||||
let!(:access_request) { create(:group_member, :access_request, group: group) }
|
||||
|
||||
it 'shows access requests with link to manage access' do
|
||||
visit admin_group_path(group)
|
||||
|
||||
page.within '[data-testid="access-requests"]' do
|
||||
expect(page).to have_content access_request.user.name
|
||||
expect(page).to have_link 'Manage access', href: group_group_members_path(group, tab: 'access_requests')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'group edit' do
|
||||
|
|
|
@ -52,6 +52,8 @@ RSpec.describe "Admin::Projects" do
|
|||
end
|
||||
|
||||
describe "GET /admin/projects/:namespace_id/:id" do
|
||||
let!(:access_request) { create(:project_member, :access_request, project: project) }
|
||||
|
||||
before do
|
||||
expect(project).to be_persisted
|
||||
|
||||
|
@ -67,6 +69,15 @@ RSpec.describe "Admin::Projects" do
|
|||
expect(page).to have_content(project.creator.name)
|
||||
expect(page).to have_content(project.id)
|
||||
end
|
||||
|
||||
context 'when project has open access requests' do
|
||||
it 'shows access requests with link to manage access' do
|
||||
page.within '[data-testid="access-requests"]' do
|
||||
expect(page).to have_content access_request.user.name
|
||||
expect(page).to have_link 'Manage access', href: project_project_members_path(project, tab: 'access_requests')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'transfer project' do
|
||||
|
|
|
@ -55,6 +55,7 @@ issues:
|
|||
- note_authors
|
||||
- issue_email_participants
|
||||
- test_reports
|
||||
- requirement
|
||||
events:
|
||||
- author
|
||||
- project
|
||||
|
|
Loading…
Reference in a new issue