diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 9aaa516f89c8e96d31abbc02a49aa832df2ea16f..4cc34d2c98483922da20553f12f93a5f72e7f9e7 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -58,21 +58,6 @@ const busyBadge = memoize( ).outerHTML, ); -const agentBadge = memoize( - () => - renderVueComponentForLegacyJS( - GlBadge, - { - class: 'gl-ml-2', - props: { - variant: 'neutral', - size: 'sm', - }, - }, - s__('UserProfile|Agent'), - ).outerHTML, -); - // Re-export for existing imports elsewhere export { sortCommandsAlphaSafe } from '~/editor/quick_action_suggestions'; // Frequent quick actions prioritization is imported from shared module @@ -148,7 +133,6 @@ export function membersBeforeSave(members) { search: createMemberSearchString(member), icon: avatarIcon, availability: member?.availability, - compositeIdentityEnforced: member?.composite_identity_enforced, }; }); } @@ -505,7 +489,7 @@ class GfmAutoComplete { maxLen: 100, displayTpl(value) { let tmpl = GfmAutoComplete.Loading.template; - const { avatarTag, username, title, icon, availability, compositeIdentityEnforced } = value; + const { avatarTag, username, title, icon, availability } = value; if (username != null) { tmpl = GfmAutoComplete.Members.templateFunction({ avatarTag, @@ -513,7 +497,6 @@ class GfmAutoComplete { title, icon, availabilityStatus: availability && isUserBusy(availability) ? busyBadge() : '', - compositeIdentityEnforced, }); } return tmpl; @@ -1406,18 +1389,10 @@ GfmAutoComplete.Emoji = { }; // Team Members GfmAutoComplete.Members = { - templateFunction({ - avatarTag, - username, - title, - icon, - availabilityStatus, - compositeIdentityEnforced, - }) { - const compositeIdBadge = compositeIdentityEnforced ? agentBadge() : ''; + templateFunction({ avatarTag, username, title, icon, availabilityStatus }) { return `
  • ${avatarTag} ${username} ${escape( title, - )}${availabilityStatus}${compositeIdBadge} ${icon}
  • `; + )}${availabilityStatus} ${icon}`; }, nameOrUsernameStartsWith(member, query) { // `member.search` is a name:username string like `MargeSimpson msimpson` diff --git a/app/assets/javascripts/graphql_shared/queries/workspace_autocomplete_users.query.graphql b/app/assets/javascripts/graphql_shared/queries/workspace_autocomplete_users.query.graphql index 796797c569c49de3ee74d3fe9f35b7cfcf9c38d0..aa7ac960d37d4b2ab56554466aa55d592894031a 100644 --- a/app/assets/javascripts/graphql_shared/queries/workspace_autocomplete_users.query.graphql +++ b/app/assets/javascripts/graphql_shared/queries/workspace_autocomplete_users.query.graphql @@ -9,7 +9,6 @@ query workspaceAutocompleteUsersSearch( groupWorkspace: group(fullPath: $fullPath) @skip(if: $isProject) { id users: autocompleteUsers(search: $search) { - compositeIdentityEnforced @gl_introduced(version: "18.7.0") ...User ...UserAvailability } @@ -17,7 +16,6 @@ query workspaceAutocompleteUsersSearch( workspace: project(fullPath: $fullPath) { id users: autocompleteUsers(search: $search) { - compositeIdentityEnforced @gl_introduced(version: "18.7.0") ...User ...UserAvailability } diff --git a/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue b/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue index 85781d8520b818a39982c4ac9cbb8b84ef8287b9..826731f1467a624b183129470421eb61dbdd6f44 100644 --- a/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue +++ b/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue @@ -34,16 +34,12 @@ export default { isBusy() { return this.user?.status?.availability === AVAILABILITY_STATUS.BUSY; }, - isAgent() { - return this.user?.compositeIdentityEnforced; - }, hasCannotMergeIcon() { return this.issuableType === TYPE_MERGE_REQUEST && !this.user.canMerge; }, }, i18n: { busy: __('Busy'), - agent: __('Agent'), }, }; @@ -65,14 +61,9 @@ export default { :class="{ '!gl-left-6': selected }" :size="12" /> - -
    - + {{ $options.i18n.busy }} - - {{ $options.i18n.agent }} - -
    + diff --git a/app/services/concerns/users/participable_service.rb b/app/services/concerns/users/participable_service.rb index 60e8fdf2e06b13fcce287c48a1fde5f533595ade..51fcf9722239faab4958b94e88c7dab4693429db 100644 --- a/app/services/concerns/users/participable_service.rb +++ b/app/services/concerns/users/participable_service.rb @@ -91,8 +91,7 @@ def user_as_hash(user) username: user.username, name: user.name, avatar_url: user.avatar_url, - availability: lazy_user_availability(user).itself, # calling #itself to avoid returning a BatchLoader instance - composite_identity_enforced: user.composite_identity_enforced + availability: lazy_user_availability(user).itself # calling #itself to avoid returning a BatchLoader instance } end @@ -116,8 +115,7 @@ def org_user_detail_as_hash(org_user_detail) avatar_url: user.avatar_url, availability: lazy_user_availability(user).itself, # calling #itself to avoid returning a BatchLoader instance original_username: user.username, - original_displayname: user.name, - composite_identity_enforced: user.composite_identity_enforced + original_displayname: user.name } end diff --git a/ee/spec/services/groups/participants_service_spec.rb b/ee/spec/services/groups/participants_service_spec.rb index a2f76048abfb755a1b0bece3fafef45abefb6185..0142c0a27a679a2c7a08f2e2a115372ce33c9551 100644 --- a/ee/spec/services/groups/participants_service_spec.rb +++ b/ee/spec/services/groups/participants_service_spec.rb @@ -17,8 +17,7 @@ def user_to_autocompletable(user) username: user.username, name: user.name, avatar_url: user.avatar_url, - availability: user&.status&.availability, - composite_identity_enforced: user.composite_identity_enforced + availability: user&.status&.availability } end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index cc82c7ae14a5c6f0d4bbcc78c6d861e951297f0d..5ed9ae238573c0d604d4b3848582ce34b27acbb4 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -6835,9 +6835,6 @@ msgstr "" msgid "After you've reviewed these contribution guidelines, you'll be all set to" msgstr "" -msgid "Agent" -msgstr "" - msgid "Agent Information" msgstr "" @@ -73275,9 +73272,6 @@ msgstr "" msgid "UserProfile|Activity" msgstr "" -msgid "UserProfile|Agent" -msgstr "" - msgid "UserProfile|An error occurred loading the activity. Please refresh the page to try again." msgstr "" diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb index aad6568a4d83e83c6a071a1759d140a956823a9a..8c4571d8cc53103c2328c50e7acf287f3ebbcdfa 100644 --- a/spec/features/profiles/user_edit_profile_spec.rb +++ b/spec/features/profiles/user_edit_profile_spec.rb @@ -335,12 +335,11 @@ def select_emoji(emoji_name) end it 'shows author as busy in the assignee dropdown' do - expect(page).not_to have_css('[data-testid="busy-badge"]') - within_testid('work-item-assignees') do click_button('Edit') + select_listbox_item("#{user.name} Busy") - expect(page).to have_css('[data-testid="busy-badge"]') + expect(page).to have_link(user.name) end end end diff --git a/spec/frontend/gfm_auto_complete_spec.js b/spec/frontend/gfm_auto_complete_spec.js index 4662189ee6a2505c0efde84241bf5d1891f08760..301eee323aa28534d68d74e482192f49f3f6a759 100644 --- a/spec/frontend/gfm_auto_complete_spec.js +++ b/spec/frontend/gfm_auto_complete_spec.js @@ -639,30 +639,6 @@ describe('GfmAutoComplete', () => { }, ]); }); - - it('should include composite_identity_enforced field', () => { - expect( - membersBeforeSave([ - { - username: 'my-user', - name: 'My User', - avatar_url: './users.jpg', - type: 'User', - composite_identity_enforced: true, - }, - ]), - ).toEqual([ - { - username: 'my-user', - avatarTag: - 'my-user', - title: 'My User', - search: 'MyUser my-user', - icon: '', - compositeIdentityEnforced: true, - }, - ]); - }); }); describe('Issues.insertTemplateFunction', () => { @@ -782,37 +758,6 @@ describe('GfmAutoComplete', () => { ); }); - describe('when compositeIdentityEnforced is true', () => { - it('should add composite identity enforced badge', () => { - const result = GfmAutoComplete.Members.templateFunction({ - avatarTag: 'IMG', - username: 'my-user', - title: '', - icon: '', - availabilityStatus: '', - compositeIdentityEnforced: true, - }); - expect(result).toContain('IMG my-user'); - expect(result).toContain('Agent'); - expect(result).toContain('gl-badge'); - }); - }); - - describe('when compositeIdentityEnforced is false', () => { - it('should not add composite identity enforced badge if compositeIdentityEnforced is false', () => { - expect( - GfmAutoComplete.Members.templateFunction({ - avatarTag: 'IMG', - username: 'my-user', - title: '', - icon: '', - availabilityStatus: '', - compositeIdentityEnforced: false, - }), - ).toBe('
  • IMG my-user
  • '); - }); - }); - describe('nameOrUsernameStartsWith', () => { it.each` query | result diff --git a/spec/frontend/sidebar/components/assignees/sidebar_participant_spec.js b/spec/frontend/sidebar/components/assignees/sidebar_participant_spec.js index 264c72b1bdbd0881ee60ca1f0f33def09405576d..117eb2f765da399347c6edf31f6640ad56639b10 100644 --- a/spec/frontend/sidebar/components/assignees/sidebar_participant_spec.js +++ b/spec/frontend/sidebar/components/assignees/sidebar_participant_spec.js @@ -15,15 +15,12 @@ describe('Sidebar participant component', () => { const findAvatar = () => wrapper.findComponent(GlAvatarLabeled); const findIcon = () => wrapper.findComponent(GlIcon); - const findBusyBadge = () => wrapper.find('[data-testid="busy-badge"]'); - const findAgentBadge = () => wrapper.find('[data-testid="agent-badge"]'); const createComponent = ({ status = null, issuableType = TYPE_ISSUE, canMerge = false, selected = false, - compositeIdentityEnforced = false, } = {}) => { wrapper = shallowMount(SidebarParticipant, { propsData: { @@ -31,7 +28,6 @@ describe('Sidebar participant component', () => { ...user, canMerge, status, - compositeIdentityEnforced, }, issuableType, selected, @@ -42,37 +38,17 @@ describe('Sidebar participant component', () => { }); }; - describe('when is not busy and is not agent', () => { - it('does not show `Busy` status', () => { - createComponent(); - - expect(findAvatar().props('label')).toBe(user.name); - expect(findBusyBadge().exists()).toBe(false); - }); - - it('does not show agent badge', () => { - createComponent(); - - expect(findAgentBadge().exists()).toBe(false); - }); - }); - - describe('when is busy', () => { - it('shows `Busy` status', () => { - createComponent({ status: { availability: 'BUSY' } }); + it('does not show `Busy` status when user is not busy', () => { + createComponent(); - expect(findBusyBadge().exists()).toBe(true); - expect(findAgentBadge().exists()).toBe(false); - }); + expect(findAvatar().props('label')).toBe(user.name); + expect(wrapper.text()).not.toContain('Busy'); }); - describe('when is agent', () => { - it('renders agent badge', () => { - createComponent({ compositeIdentityEnforced: true }); + it('shows `Busy` status when user is busy', () => { + createComponent({ status: { availability: 'BUSY' } }); - expect(findAgentBadge().exists()).toBe(true); - expect(findBusyBadge().exists()).toBe(false); - }); + expect(wrapper.text()).toContain('Busy'); }); it('does not render a warning icon', () => { diff --git a/spec/frontend/sidebar/mock_data.js b/spec/frontend/sidebar/mock_data.js index d95a0458569a051884d6b2aee75397be8c4893f9..22c76218cd6121ffd80d16dd5386a35ba25fdd00 100644 --- a/spec/frontend/sidebar/mock_data.js +++ b/spec/frontend/sidebar/mock_data.js @@ -17,7 +17,6 @@ export const mockUser1 = createMockUser({ username: 'root', webUrl: '/root', webPath: '/root', - compositeIdentityEnforced: false, }); export const mockUserWithType1 = { @@ -32,7 +31,6 @@ export const mockUser2 = createMockUser({ username: 'rookie', webUrl: 'rookie', webPath: '/rookie', - compositeIdentityEnforced: false, }); export const mockUserWithType2 = { @@ -531,7 +529,6 @@ export const searchAutocompleteQueryResponse = { webUrl: 'root', webPath: '/root', status: null, - compositeIdentityEnforced: false, }, { id: '2', @@ -541,17 +538,6 @@ export const searchAutocompleteQueryResponse = { webUrl: 'rookie', webPath: '/rookie', status: null, - compositeIdentityEnforced: false, - }, - { - id: '3', - avatarUrl: '/avatar3', - name: 'root_external', - username: 'root_external', - webUrl: 'root_external', - webPath: '/root_external', - status: null, - compositeIdentityEnforced: false, }, ], }, @@ -728,9 +714,9 @@ export const projectAutocompleteMembersResponse = { null, null, // Remove duplicated entry https://gitlab.com/gitlab-org/gitlab/-/issues/327822 - { ...mockUser1, compositeIdentityEnforced: false }, - { ...mockUser1, compositeIdentityEnforced: false }, - { ...mockUser2, compositeIdentityEnforced: false }, + mockUser1, + mockUser1, + mockUser2, { __typename: 'UserCore', id: 'gid://gitlab/User/2', @@ -743,7 +729,6 @@ export const projectAutocompleteMembersResponse = { status: { availability: 'BUSY', }, - compositeIdentityEnforced: false, }, ], }, diff --git a/spec/frontend/work_items/components/work_item_bulk_edit/work_item_bulk_edit_assignee_spec.js b/spec/frontend/work_items/components/work_item_bulk_edit/work_item_bulk_edit_assignee_spec.js index 51e048f2a01673a4ea895e25f5ce0b77b8f7b8d0..94495f69de90fc4d45d07c0e23dccf361ab69a3a 100644 --- a/spec/frontend/work_items/components/work_item_bulk_edit/work_item_bulk_edit_assignee_spec.js +++ b/spec/frontend/work_items/components/work_item_bulk_edit/work_item_bulk_edit_assignee_spec.js @@ -152,7 +152,6 @@ describe('WorkItemBulkEditAssignee component', () => { webUrl: 'rookie', webPath: '/rookie', status: null, - compositeIdentityEnforced: false, }, ], }, diff --git a/spec/frontend/work_items/mock_data.js b/spec/frontend/work_items/mock_data.js index 301a3aee7e15f48601d541e8f7b331b6434e0d37..73671d238d51feb19347b6eebab0e2c3f83188e4 100644 --- a/spec/frontend/work_items/mock_data.js +++ b/spec/frontend/work_items/mock_data.js @@ -3777,7 +3777,6 @@ export const projectMembersAutocompleteResponseWithCurrentUser = { webUrl: 'rookie', webPath: '/rookie', status: null, - compositeIdentityEnforced: false, }, { __typename: 'AutocompletedUser', @@ -3789,7 +3788,6 @@ export const projectMembersAutocompleteResponseWithCurrentUser = { webUrl: '/root', webPath: '/root', status: null, - compositeIdentityEnforced: false, }, ], }, diff --git a/spec/services/groups/participants_service_spec.rb b/spec/services/groups/participants_service_spec.rb index 1d5a97759b3f14ffad046cda232421a7466d982e..168f8d9ba83f883acbd8223db5c49ea826d998fb 100644 --- a/spec/services/groups/participants_service_spec.rb +++ b/spec/services/groups/participants_service_spec.rb @@ -119,8 +119,7 @@ def user_to_autocompletable(user) username: user.username, name: user.name, avatar_url: user.avatar_url, - availability: user&.status&.availability, - composite_identity_enforced: user.composite_identity_enforced + availability: user&.status&.availability } end end diff --git a/spec/services/projects/participants_service_spec.rb b/spec/services/projects/participants_service_spec.rb index 0638419191478f141c86130e9d7e3285346768a9..78bda653d26b07fecb4760bc95bf7c082415b4fb 100644 --- a/spec/services/projects/participants_service_spec.rb +++ b/spec/services/projects/participants_service_spec.rb @@ -108,12 +108,6 @@ def run_service expect(participants.count { |p| p[:username] == noteable.author.username }).to eq 1 end - it 'includes composite_identity_enforced field for users' do - user_participants = run_service.select { |p| p[:type] == 'User' && !p[:original_username].present? } - - expect(user_participants).to all(include(:composite_identity_enforced)) - end - context 'when noteable.participants contains placeholder or import users' do let(:placeholder_user) { create(:user, :placeholder) } let(:import_user) { create(:user, :import_user) } @@ -138,8 +132,7 @@ def run_service name: org_user_detail.display_name, avatar_url: org_user_detail.user.avatar_url, original_username: org_user_detail.user.username, - original_displayname: org_user_detail.user.name, - composite_identity_enforced: org_user_detail.user.composite_identity_enforced + original_displayname: org_user_detail.user.name )) end