Commit bfed9bca authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents f425cba0 f0cff10a
......@@ -405,6 +405,7 @@
- <<: *if-security-merge-request
changes: *code-backstage-patterns
- <<: *if-merge-request-title-as-if-foss
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request
changes: *ci-patterns
......@@ -483,6 +484,7 @@
- <<: *if-security-merge-request
changes: *code-qa-patterns
- <<: *if-merge-request-title-as-if-foss
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request
changes: *ci-patterns
......@@ -700,6 +702,7 @@
changes: *db-patterns
- <<: *if-merge-request-title-as-if-foss
changes: *db-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request
changes: *ci-patterns
......@@ -716,6 +719,7 @@
changes: *db-patterns
- <<: *if-merge-request-title-as-if-foss
changes: *db-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-unit:
rules:
......@@ -725,6 +729,7 @@
changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request
changes: *ci-patterns
......@@ -741,6 +746,7 @@
changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-integration:
rules:
......@@ -750,6 +756,7 @@
changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request
changes: *ci-patterns
......@@ -766,6 +773,7 @@
changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-system:
rules:
......@@ -775,6 +783,7 @@
changes: *code-backstage-patterns
- <<: *if-merge-request-title-as-if-foss
changes: *code-backstage-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request
changes: *ci-patterns
......@@ -791,6 +800,7 @@
changes: *code-backstage-patterns
- <<: *if-merge-request-title-as-if-foss
changes: *code-backstage-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:ee-and-foss-db-library-code:
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 @@
- if runner.tags.present?
%p
- runner.tags.map(&:name).sort.each do |tag|
%span.badge.badge-primary
%span.badge.gl-badge.sm.badge-pill.badge-primary
= 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 {
this.reportDeleting();
try {
const { id } = this;
const {
data: { destroyComplianceFramework },
} = await this.$apollo.mutate({
mutation: deleteComplianceFrameworkMutation,
variables: {
input: {
id: this.id,
id,
},
},
awaitRefetchQueries: true,
......@@ -62,7 +63,7 @@ export default {
if (error) {
this.reportError(new Error(error));
} else {
this.reportSuccess();
this.reportSuccess(id);
}
} catch (error) {
this.reportError(error);
......@@ -75,8 +76,8 @@ export default {
Sentry.captureException(error);
this.$emit('error');
},
reportSuccess() {
this.$emit('delete');
reportSuccess(id) {
this.$emit('delete', id);
},
show() {
this.$refs.modal.show();
......
......@@ -39,7 +39,7 @@ export default {
data() {
return {
markedForDeletion: {},
deletingFramework: null,
deletingFrameworksIds: [],
complianceFrameworks: [],
error: '',
message: '',
......@@ -70,7 +70,7 @@ export default {
},
computed: {
isLoading() {
return this.$apollo.loading && !this.deletingFramework;
return this.$apollo.loading && this.deletingFrameworksIds.length === 0;
},
hasLoaded() {
return !this.isLoading && !this.error;
......@@ -105,15 +105,18 @@ export default {
onError() {
this.error = this.$options.i18n.deleteError;
},
onDelete() {
onDelete(id) {
this.message = this.$options.i18n.deleteMessage;
this.deletingFramework = null;
const idx = this.deletingFrameworksIds.indexOf(id);
if (idx > -1) {
this.deletingFrameworksIds.splice(idx, 1);
}
},
onDeleting() {
this.deletingFramework = this.markedForDeletion;
this.deletingFrameworksIds.push(this.markedForDeletion.id);
},
isDeleting(framework) {
return this.deletingFramework === framework;
isDeleting(id) {
return this.deletingFrameworksIds.includes(id);
},
},
i18n: {
......@@ -153,7 +156,7 @@ export default {
v-for="framework in complianceFrameworks"
:key="framework.parsedId"
:framework="framework"
:loading="isDeleting(framework)"
:loading="isDeleting(framework.id)"
@delete="markForDeletion"
/>
</gl-tab>
......
......@@ -117,7 +117,7 @@ describe('DeleteModal', () => {
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 () => {
......
......@@ -213,13 +213,18 @@ describe('List', () => {
expect(findDeleteModal().vm.show).toHaveBeenCalled();
});
describe('and the item is being deleted', () => {
describe('and multiple items are being deleted', () => {
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', () => {
expect(findListItem().props('loading')).toBe(true);
it('sets "loading" to true on the deleting list items', () => {
expect(findListItems().wrappers.every((listItem) => listItem.props('loading'))).toBe(
true,
);
});
describe('and an error occurred', () => {
......@@ -238,10 +243,14 @@ describe('List', () => {
describe('and the item was successfully deleted', () => {
beforeEach(async () => {
findDeleteModal().vm.$emit('delete');
findDeleteModal().vm.$emit('delete', framework.id);
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', () => {
expect(findAlert().props('dismissible')).toBe(true);
expect(findAlert().props('variant')).toBe('info');
......
......@@ -3,7 +3,8 @@
module API
module Entities
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
......@@ -198,14 +198,6 @@ RSpec.describe 'Dashboard Projects' do
it_behaves_like 'hidden pipeline status'
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
before do
project.last_pipeline.delete
......
......@@ -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
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).to have_field('Expiration date', disabled: true)
expect(page).not_to have_button('Remove member')
......
......@@ -35,4 +35,22 @@ RSpec.describe API::Entities::User do
expect(subject[:bot]).to eq(true)
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
......@@ -41,6 +41,10 @@ module Spec
find_row(user.name)
end
def find_username_row(user)
find_row(user.username)
end
def find_invited_member_row(email)
find_row(email)
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