diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index 7f6febbcb1e..f7b103171db 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -745,7 +745,6 @@ Layout/LineLength: - 'ee/app/workers/geo/destroy_worker.rb' - 'ee/app/workers/geo/scheduler/scheduler_worker.rb' - 'ee/app/workers/geo/secondary/registry_consistency_worker.rb' - - 'ee/app/workers/geo/verification_worker.rb' - 'ee/app/workers/repository_update_mirror_worker.rb' - 'ee/app/workers/security/orchestration_policy_rule_schedule_namespace_worker.rb' - 'ee/app/workers/security/orchestration_policy_rule_schedule_worker.rb' @@ -1833,7 +1832,6 @@ Layout/LineLength: - 'ee/spec/workers/geo/secondary/registry_consistency_worker_spec.rb' - 'ee/spec/workers/geo/verification_batch_worker_spec.rb' - 'ee/spec/workers/geo/verification_timeout_worker_spec.rb' - - 'ee/spec/workers/geo/verification_worker_spec.rb' - 'ee/spec/workers/import_software_licenses_worker_spec.rb' - 'ee/spec/workers/incident_management/oncall_rotations/persist_all_rotations_shifts_job_spec.rb' - 'ee/spec/workers/incident_management/oncall_rotations/persist_shifts_job_spec.rb' diff --git a/.rubocop_todo/rspec/verified_doubles.yml b/.rubocop_todo/rspec/verified_doubles.yml index ea6c4d10c24..648b9d63f3b 100644 --- a/.rubocop_todo/rspec/verified_doubles.yml +++ b/.rubocop_todo/rspec/verified_doubles.yml @@ -173,7 +173,6 @@ RSpec/VerifiedDoubles: - 'ee/spec/workers/geo/verification_batch_worker_spec.rb' - 'ee/spec/workers/geo/verification_cron_worker_spec.rb' - 'ee/spec/workers/geo/verification_timeout_worker_spec.rb' - - 'ee/spec/workers/geo/verification_worker_spec.rb' - 'ee/spec/workers/iterations/cadences/create_iterations_worker_spec.rb' - 'ee/spec/workers/iterations/roll_over_issues_worker_spec.rb' - 'ee/spec/workers/ldap_group_sync_worker_spec.rb' diff --git a/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml b/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml index 482c3c2e4e5..508fe5a10ef 100644 --- a/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml +++ b/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml @@ -292,7 +292,6 @@ SidekiqLoadBalancing/WorkerDataConsistency: - 'ee/app/workers/geo/verification_cron_worker.rb' - 'ee/app/workers/geo/verification_state_backfill_worker.rb' - 'ee/app/workers/geo/verification_timeout_worker.rb' - - 'ee/app/workers/geo/verification_worker.rb' - 'ee/app/workers/gitlab_subscriptions/schedule_refresh_seats_worker.rb' - 'ee/app/workers/gitlab_subscriptions/trials/apply_trial_worker.rb' - 'ee/app/workers/group_saml_group_sync_worker.rb' diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 89f8a24e411..1c27267ba03 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -11,11 +11,7 @@ import { isUserBusy } from '~/set_status_modal/utils'; import SidebarMediator from '~/sidebar/sidebar_mediator'; import { currentAssignees, linkedItems } from '~/graphql_shared/issuable_client'; import { state } from '~/sidebar/components/reviewers/sidebar_reviewers.vue'; -import { - ISSUABLE_EPIC, - WORK_ITEMS_TYPE_MAP, - WORK_ITEM_TYPE_ENUM_EPIC, -} from '~/work_items/constants'; +import { ISSUABLE_EPIC, NAME_TO_ICON_MAP, WORK_ITEM_TYPE_NAME_EPIC } from '~/work_items/constants'; import AjaxCache from './lib/utils/ajax_cache'; import { spriteIcon } from './lib/utils/common_utils'; import { newDate } from './lib/utils/datetime_utility'; @@ -1259,7 +1255,7 @@ GfmAutoComplete.Issues = { }, templateFunction({ id, title, reference, iconName }) { const mappedIconName = - iconName === ISSUABLE_EPIC ? WORK_ITEMS_TYPE_MAP[WORK_ITEM_TYPE_ENUM_EPIC].icon : iconName; + iconName === ISSUABLE_EPIC ? NAME_TO_ICON_MAP[WORK_ITEM_TYPE_NAME_EPIC] : iconName; const icon = mappedIconName ? spriteIcon(mappedIconName, 'gl-fill-icon-subtle s16 gl-mr-2') : ''; diff --git a/app/assets/javascripts/graphql_shared/issuable_client.js b/app/assets/javascripts/graphql_shared/issuable_client.js index ad1d1e633e5..51ea0310844 100644 --- a/app/assets/javascripts/graphql_shared/issuable_client.js +++ b/app/assets/javascripts/graphql_shared/issuable_client.js @@ -14,6 +14,7 @@ import { WIDGET_TYPE_HIERARCHY, WIDGET_TYPE_LINKED_ITEMS, WIDGET_TYPE_ASSIGNEES, + WIDGET_TYPE_VULNERABILITIES, } from '~/work_items/constants'; import isExpandedHierarchyTreeChildQuery from '~/work_items/graphql/client/is_expanded_hierarchy_tree_child.query.graphql'; @@ -133,6 +134,15 @@ export const config = { }, }, }, + WorkItemWidgetVulnerabilities: { + fields: { + // If we add any key args, the relatedVulnerabilities field becomes relatedVulnerabilities({"first":50,"after":"xyz"}) and + // kills any possibility to handle it on the widget level without hardcoding a string. + relatedVulnerabilities: { + keyArgs: false, + }, + }, + }, WorkItem: { fields: { // Prevent `reference` from being transformed into `reference({"fullPath":true})` @@ -196,6 +206,25 @@ export const config = { }; } + // we want to concat next page of vulnerabilities work items within Vulnerabilities widget to the existing ones + if ( + incomingWidget?.type === WIDGET_TYPE_VULNERABILITIES && + context.variables.after && + incomingWidget.relatedVulnerabilities?.nodes + ) { + // concatPagination won't work because we were placing new widget here so we have to do this manually + return { + ...incomingWidget, + relatedVulnerabilities: { + ...incomingWidget.relatedVulnerabilities, + nodes: [ + ...existingWidget.relatedVulnerabilities.nodes, + ...incomingWidget.relatedVulnerabilities.nodes, + ], + }, + }; + } + // this ensures that we don’t override linkedItems.workItem when updating parent if (incomingWidget?.type === WIDGET_TYPE_LINKED_ITEMS) { if (!incomingWidget.linkedItems) { diff --git a/app/assets/javascripts/work_items/components/create_work_item_modal.vue b/app/assets/javascripts/work_items/components/create_work_item_modal.vue index d71b2aa5c37..cd34965a796 100644 --- a/app/assets/javascripts/work_items/components/create_work_item_modal.vue +++ b/app/assets/javascripts/work_items/components/create_work_item_modal.vue @@ -131,7 +131,7 @@ export default { return newWorkItemPath({ fullPath: this.fullPath, isGroup: this.isGroup, - workItemTypeName: NAME_TO_ENUM_MAP[this.selectedWorkItemTypeName], + workItemType: this.selectedWorkItemTypeName, query: this.newWorkItemPathQuery, }); }, diff --git a/app/assets/javascripts/work_items/components/work_item_created_updated.vue b/app/assets/javascripts/work_items/components/work_item_created_updated.vue index 0ae12607ded..0822d451b25 100644 --- a/app/assets/javascripts/work_items/components/work_item_created_updated.vue +++ b/app/assets/javascripts/work_items/components/work_item_created_updated.vue @@ -53,9 +53,6 @@ export default { workItemType() { return this.workItem?.workItemType?.name; }, - workItemIconName() { - return this.workItem?.workItemType?.iconName; - }, workItemMovedToWorkItemUrl() { return this.workItem?.movedToWorkItemUrl; }, @@ -120,7 +117,6 @@ export default { - + {{ rolledUpCount.countsByState.all }} diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_rolled_up_count_info.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_rolled_up_count_info.vue index 964a2c3c7ae..d6938a5d84e 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_rolled_up_count_info.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_rolled_up_count_info.vue @@ -32,7 +32,7 @@ export default { :key="rolledUpCount.workItemType.name" data-testid="rolled-up-type-info" > - + {{ rolledUpCount.countsByState.closed }}/{{ rolledUpCount.countsByState.all }} diff --git a/app/assets/javascripts/work_items/components/work_item_type_icon.vue b/app/assets/javascripts/work_items/components/work_item_type_icon.vue index 2d3e55382ba..ba8c9461810 100644 --- a/app/assets/javascripts/work_items/components/work_item_type_icon.vue +++ b/app/assets/javascripts/work_items/components/work_item_type_icon.vue @@ -1,6 +1,7 @@