Commit bfed9bca authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents f425cba0 f0cff10a
...@@ -405,6 +405,7 @@ ...@@ -405,6 +405,7 @@
- <<: *if-security-merge-request - <<: *if-security-merge-request
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -483,6 +484,7 @@ ...@@ -483,6 +484,7 @@
- <<: *if-security-merge-request - <<: *if-security-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -700,6 +702,7 @@ ...@@ -700,6 +702,7 @@
changes: *db-patterns changes: *db-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *db-patterns changes: *db-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -716,6 +719,7 @@ ...@@ -716,6 +719,7 @@
changes: *db-patterns changes: *db-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *db-patterns changes: *db-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-unit: .rails:rules:as-if-foss-unit:
rules: rules:
...@@ -725,6 +729,7 @@ ...@@ -725,6 +729,7 @@
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -741,6 +746,7 @@ ...@@ -741,6 +746,7 @@
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-integration: .rails:rules:as-if-foss-integration:
rules: rules:
...@@ -750,6 +756,7 @@ ...@@ -750,6 +756,7 @@
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -766,6 +773,7 @@ ...@@ -766,6 +773,7 @@
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-system: .rails:rules:as-if-foss-system:
rules: rules:
...@@ -775,6 +783,7 @@ ...@@ -775,6 +783,7 @@
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -791,6 +800,7 @@ ...@@ -791,6 +800,7 @@
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:ee-and-foss-db-library-code: .rails:rules:ee-and-foss-db-library-code:
rules: rules:
......
= render 'shared/projects/list', projects: @projects, pipeline_status: Feature.enabled?(:dashboard_pipeline_status, default_enabled: true), user: current_user = render 'shared/projects/list', projects: @projects, pipeline_status: true, user: current_user
...@@ -40,5 +40,5 @@ ...@@ -40,5 +40,5 @@
- if runner.tags.present? - if runner.tags.present?
%p %p
- runner.tags.map(&:name).sort.each do |tag| - runner.tags.map(&:name).sort.each do |tag|
%span.badge.badge-primary %span.badge.gl-badge.sm.badge-pill.badge-primary
= tag = tag
---
title: Remove dashboard_pipeline_status feature flag
merge_request: 55472
author:
type: other
---
title: Apply new GitLab UI for badge in runners list
merge_request: 54766
author: Yogi (@yo)
type: changed
---
title: Do not expose user name if user is project bot
merge_request: 54022
author:
type: changed
---
name: dashboard_pipeline_status
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/22029
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/209061
milestone: '12.7'
type: development
group: group::continuous integration
default_enabled: true
...@@ -37,13 +37,14 @@ export default { ...@@ -37,13 +37,14 @@ export default {
this.reportDeleting(); this.reportDeleting();
try { try {
const { id } = this;
const { const {
data: { destroyComplianceFramework }, data: { destroyComplianceFramework },
} = await this.$apollo.mutate({ } = await this.$apollo.mutate({
mutation: deleteComplianceFrameworkMutation, mutation: deleteComplianceFrameworkMutation,
variables: { variables: {
input: { input: {
id: this.id, id,
}, },
}, },
awaitRefetchQueries: true, awaitRefetchQueries: true,
...@@ -62,7 +63,7 @@ export default { ...@@ -62,7 +63,7 @@ export default {
if (error) { if (error) {
this.reportError(new Error(error)); this.reportError(new Error(error));
} else { } else {
this.reportSuccess(); this.reportSuccess(id);
} }
} catch (error) { } catch (error) {
this.reportError(error); this.reportError(error);
...@@ -75,8 +76,8 @@ export default { ...@@ -75,8 +76,8 @@ export default {
Sentry.captureException(error); Sentry.captureException(error);
this.$emit('error'); this.$emit('error');
}, },
reportSuccess() { reportSuccess(id) {
this.$emit('delete'); this.$emit('delete', id);
}, },
show() { show() {
this.$refs.modal.show(); this.$refs.modal.show();
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
data() { data() {
return { return {
markedForDeletion: {}, markedForDeletion: {},
deletingFramework: null, deletingFrameworksIds: [],
complianceFrameworks: [], complianceFrameworks: [],
error: '', error: '',
message: '', message: '',
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
}, },
computed: { computed: {
isLoading() { isLoading() {
return this.$apollo.loading && !this.deletingFramework; return this.$apollo.loading && this.deletingFrameworksIds.length === 0;
}, },
hasLoaded() { hasLoaded() {
return !this.isLoading && !this.error; return !this.isLoading && !this.error;
...@@ -105,15 +105,18 @@ export default { ...@@ -105,15 +105,18 @@ export default {
onError() { onError() {
this.error = this.$options.i18n.deleteError; this.error = this.$options.i18n.deleteError;
}, },
onDelete() { onDelete(id) {
this.message = this.$options.i18n.deleteMessage; this.message = this.$options.i18n.deleteMessage;
this.deletingFramework = null; const idx = this.deletingFrameworksIds.indexOf(id);
if (idx > -1) {
this.deletingFrameworksIds.splice(idx, 1);
}
}, },
onDeleting() { onDeleting() {
this.deletingFramework = this.markedForDeletion; this.deletingFrameworksIds.push(this.markedForDeletion.id);
}, },
isDeleting(framework) { isDeleting(id) {
return this.deletingFramework === framework; return this.deletingFrameworksIds.includes(id);
}, },
}, },
i18n: { i18n: {
...@@ -153,7 +156,7 @@ export default { ...@@ -153,7 +156,7 @@ export default {
v-for="framework in complianceFrameworks" v-for="framework in complianceFrameworks"
:key="framework.parsedId" :key="framework.parsedId"
:framework="framework" :framework="framework"
:loading="isDeleting(framework)" :loading="isDeleting(framework.id)"
@delete="markForDeletion" @delete="markForDeletion"
/> />
</gl-tab> </gl-tab>
......
...@@ -117,7 +117,7 @@ describe('DeleteModal', () => { ...@@ -117,7 +117,7 @@ describe('DeleteModal', () => {
await waitForPromises(); await waitForPromises();
expect(wrapper.emitted('delete')).toHaveLength(1); expect(wrapper.emitted('delete')[0]).toEqual([frameworkFoundResponse.id]);
}); });
it('emits "error" event and reports to Sentry when there is a network error', async () => { it('emits "error" event and reports to Sentry when there is a network error', async () => {
......
...@@ -213,13 +213,18 @@ describe('List', () => { ...@@ -213,13 +213,18 @@ describe('List', () => {
expect(findDeleteModal().vm.show).toHaveBeenCalled(); expect(findDeleteModal().vm.show).toHaveBeenCalled();
}); });
describe('and the item is being deleted', () => { describe('and multiple items are being deleted', () => {
beforeEach(() => { beforeEach(() => {
findDeleteModal().vm.$emit('deleting'); findListItems().wrappers.forEach((listItem) => {
listItem.vm.$emit('delete', listItem.props('framework'));
findDeleteModal().vm.$emit('deleting');
});
}); });
it('sets "loading" to true on the marked list item', () => { it('sets "loading" to true on the deleting list items', () => {
expect(findListItem().props('loading')).toBe(true); expect(findListItems().wrappers.every((listItem) => listItem.props('loading'))).toBe(
true,
);
}); });
describe('and an error occurred', () => { describe('and an error occurred', () => {
...@@ -238,10 +243,14 @@ describe('List', () => { ...@@ -238,10 +243,14 @@ describe('List', () => {
describe('and the item was successfully deleted', () => { describe('and the item was successfully deleted', () => {
beforeEach(async () => { beforeEach(async () => {
findDeleteModal().vm.$emit('delete'); findDeleteModal().vm.$emit('delete', framework.id);
await waitForPromises(); await waitForPromises();
}); });
it('sets "loading" to false on the deleted list item', () => {
expect(findListItem().props('loading')).toBe(false);
});
it('shows the alert for the success message', () => { it('shows the alert for the success message', () => {
expect(findAlert().props('dismissible')).toBe(true); expect(findAlert().props('dismissible')).toBe(true);
expect(findAlert().props('variant')).toBe('info'); expect(findAlert().props('variant')).toBe('info');
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
module API module API
module Entities module Entities
class UserSafe < Grape::Entity class UserSafe < Grape::Entity
expose :id, :name, :username expose :id, :username
expose :name, unless: ->(user) { user.project_bot? && !options[:current_user].admin?}
end end
end end
end end
...@@ -198,14 +198,6 @@ RSpec.describe 'Dashboard Projects' do ...@@ -198,14 +198,6 @@ RSpec.describe 'Dashboard Projects' do
it_behaves_like 'hidden pipeline status' it_behaves_like 'hidden pipeline status'
end end
context 'when dashboard_pipeline_status is disabled' do
before do
stub_feature_flags(dashboard_pipeline_status: false)
end
it_behaves_like 'hidden pipeline status'
end
context "when last_pipeline is missing" do context "when last_pipeline is missing" do
before do before do
project.last_pipeline.delete project.last_pipeline.delete
......
...@@ -127,7 +127,7 @@ RSpec.describe 'Project members list' do ...@@ -127,7 +127,7 @@ RSpec.describe 'Project members list' do
it 'does not show form used to change roles and "Expiration date" or the remove user button' do it 'does not show form used to change roles and "Expiration date" or the remove user button' do
visit_members_page visit_members_page
page.within find_member_row(project_bot) do page.within find_username_row(project_bot) do
expect(page).not_to have_button('Maintainer') expect(page).not_to have_button('Maintainer')
expect(page).to have_field('Expiration date', disabled: true) expect(page).to have_field('Expiration date', disabled: true)
expect(page).not_to have_button('Remove member') expect(page).not_to have_button('Remove member')
......
...@@ -35,4 +35,22 @@ RSpec.describe API::Entities::User do ...@@ -35,4 +35,22 @@ RSpec.describe API::Entities::User do
expect(subject[:bot]).to eq(true) expect(subject[:bot]).to eq(true)
end end
end end
context 'with project bot user' do
let(:user) { create(:user, :project_bot) }
context 'when the requester is not an admin' do
it 'does not expose project bot user name' do
expect(subject).not_to include(:name)
end
end
context 'when the requester is an admin' do
let(:current_user) { create(:user, :admin) }
it 'exposes project bot user name' do
expect(subject).to include(:name)
end
end
end
end end
...@@ -41,6 +41,10 @@ module Spec ...@@ -41,6 +41,10 @@ module Spec
find_row(user.name) find_row(user.name)
end end
def find_username_row(user)
find_row(user.username)
end
def find_invited_member_row(email) def find_invited_member_row(email)
find_row(email) find_row(email)
end end
......
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