diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 17:16:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 17:16:28 +0300 |
commit | e4384360a16dd9a19d4d2d25d0ef1f2b862ed2a6 (patch) | |
tree | 2fcdfa7dcdb9db8f5208b2562f4b4e803d671243 /app/assets/javascripts/work_items/utils.js | |
parent | ffda4e7bcac36987f936b4ba515995a6698698f0 (diff) |
Add latest changes from gitlab-org/gitlab@16-2-stable-eev16.2.0-rc42
Diffstat (limited to 'app/assets/javascripts/work_items/utils.js')
-rw-r--r-- | app/assets/javascripts/work_items/utils.js | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/app/assets/javascripts/work_items/utils.js b/app/assets/javascripts/work_items/utils.js index 13fc521464f..81dbe56b2ea 100644 --- a/app/assets/javascripts/work_items/utils.js +++ b/app/assets/javascripts/work_items/utils.js @@ -1,20 +1,10 @@ -import { uniqueId } from 'lodash'; -import { - WIDGET_TYPE_HIERARCHY, - WIDGET_TYPE_CURRENT_USER_TODOS, - CURRENT_USER_TODOS_TYPENAME, - TODO_CONNECTION_TYPENAME, - TODO_EDGE_TYPENAME, - TODO_TYPENAME, - WORK_ITEM_TYPENAME, - WORK_ITEM_UPDATE_PAYLOAD_TYPENAME, -} from '~/work_items/constants'; +import { WIDGET_TYPE_HIERARCHY } from '~/work_items/constants'; export const findHierarchyWidgets = (widgets) => widgets?.find((widget) => widget.type === WIDGET_TYPE_HIERARCHY); export const findHierarchyWidgetChildren = (workItem) => - findHierarchyWidgets(workItem?.widgets)?.children.nodes; + findHierarchyWidgets(workItem?.widgets)?.children?.nodes || []; const autocompleteSourcesPath = (autocompleteType, fullPath, workItemIid) => { return `${ @@ -32,38 +22,3 @@ export const markdownPreviewPath = (fullPath, iid) => `${ gon.relative_url_root || '' }/${fullPath}/preview_markdown?target_type=WorkItem&target_id=${iid}`; - -export const getWorkItemTodoOptimisticResponse = ({ workItem, pendingTodo }) => { - const todo = pendingTodo - ? [ - { - node: { - id: -uniqueId(), - state: 'pending', - __typename: TODO_TYPENAME, - }, - __typename: TODO_EDGE_TYPENAME, - }, - ] - : []; - return { - workItemUpdate: { - errors: [], - workItem: { - ...workItem, - widgets: [ - { - type: WIDGET_TYPE_CURRENT_USER_TODOS, - currentUserTodos: { - edges: todo, - __typename: TODO_CONNECTION_TYPENAME, - }, - __typename: CURRENT_USER_TODOS_TYPENAME, - }, - ], - __typename: WORK_ITEM_TYPENAME, - }, - __typename: WORK_ITEM_UPDATE_PAYLOAD_TYPENAME, - }, - }; -}; |