Draft: Increase max page size of child items to 1000
What does this MR do and why?
Increase the max_page_size
on Child items widget of work items in the backend.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
No visual changes
How to set up and validate locally
Prerequisites:
- Enable the OKRs feature as mentioned in the OKRs docs (e.g.
::Feature.enabled?(:okrs_mvc, Project.find(<PROJECT_ID>))
and the namespace must have Ultimate plan). - Enable Epic work items
Feature.enable(:namespace_level_work_items)
Feature.enable(:work_item_epics)
Steps to verify:
-
Login with any user
-
Go to any Groups > Epics
-
Create a Epic
-
Run the following script
parent_epic = Epic.last # Epic.last for last created epic parent_epic_work_item = parent_epic.work_item project = Project.find(27) # project where you want to create the issues in user = User.where(username: 'root').first # the user you want to create the work item with (0..105).each do |i| WorkItems::CreateService.new(container: project, perform_spam_check: false, current_user: user, params: { title: "Work item #{i}" }, widget_params: { hierarchy_widget: { parent: parent_epic_work_item } } ).execute end
-
Apply the diff for frontend changes
diff --git a/app/assets/javascripts/graphql_shared/issuable_client.js b/app/assets/javascripts/graphql_shared/issuable_client.js index 903cd27232acc64..35e0363f473f3b3 100644 --- a/app/assets/javascripts/graphql_shared/issuable_client.js +++ b/app/assets/javascripts/graphql_shared/issuable_client.js @@ -80,6 +80,15 @@ export const config = { }, }, }, + WorkItemWidgetHierarchy: { + fields: { + // If we add any key args, the children field becomes children({"first":10}) and + // kills any possibility to handle it on the widget level without hardcoding a string. + children: { + keyArgs: false, + }, + }, + }, WorkItem: { fields: { // widgets policy because otherwise the subscriptions invalidate the cache diff --git a/app/assets/javascripts/work_items/graphql/work_item_tree.query.graphql b/app/assets/javascripts/work_items/graphql/work_item_tree.query.graphql index 7784ae61580853e..9e9a47ef9de54e7 100644 --- a/app/assets/javascripts/work_items/graphql/work_item_tree.query.graphql +++ b/app/assets/javascripts/work_items/graphql/work_item_tree.query.graphql @@ -23,7 +23,7 @@ query workItemTreeQuery($id: WorkItemID!) { parent { id } - children { + children(first: 1000) { nodes { id iid diff --git a/app/assets/javascripts/work_items/graphql/work_item_widgets.fragment.graphql b/app/assets/javascripts/work_items/graphql/work_item_widgets.fragment.graphql index 76ce3de770ee35f..d7f458a8022511c 100644 --- a/app/assets/javascripts/work_items/graphql/work_item_widgets.fragment.graphql +++ b/app/assets/javascripts/work_items/graphql/work_item_widgets.fragment.graphql @@ -69,7 +69,7 @@ fragment WorkItemWidgets on WorkItemWidget { iconName } } - children { + children(first: 1000) { nodes { id iid diff --git a/ee/app/assets/javascripts/work_items/graphql/work_item_widgets.fragment.graphql b/ee/app/assets/javascripts/work_items/graphql/work_item_widgets.fragment.graphql index fdc9262b62031e1..705458170ada8d5 100644 --- a/ee/app/assets/javascripts/work_items/graphql/work_item_widgets.fragment.graphql +++ b/ee/app/assets/javascripts/work_items/graphql/work_item_widgets.fragment.graphql @@ -79,7 +79,7 @@ fragment WorkItemWidgets on WorkItemWidget { iconName } } - children { + children(first: 1000) { nodes { id iid
-
Go to Epic detail page
-
Check if 105 items are loaded
Related to #463881 (closed)
Edited by Rajan Mistry