Commit 32dd42f0 authored by Florie Guibert's avatar Florie Guibert

Merge boards Apollo client

Changelog: changed
parent 14d84f97
......@@ -146,7 +146,8 @@ export function getMoveData(state, params) {
}
export function moveItemListHelper(item, fromList, toList) {
const updatedItem = item;
const updatedItem = cloneDeep(item);
if (
toList.listType === ListType.label &&
!updatedItem.labels.find((label) => label.id === toList.label.id)
......
import { IntrospectionFragmentMatcher } from 'apollo-cache-inmemory';
import { IntrospectionFragmentMatcher, defaultDataIdFromObject } from 'apollo-cache-inmemory';
import createDefaultClient from '~/lib/graphql';
import introspectionQueryResultData from '~/sidebar/fragmentTypes.json';
......@@ -10,6 +10,11 @@ export const gqlClient = createDefaultClient(
{},
{
cacheConfig: {
dataIdFromObject: (object) => {
// eslint-disable-next-line no-underscore-dangle
return object.__typename === 'BoardList' ? object.iid : defaultDataIdFromObject(object);
},
fragmentMatcher,
},
assumeImmutableResults: true,
......
#import "~/graphql_shared/fragments/milestone.fragment.graphql"
#import "~/graphql_shared/fragments/user.fragment.graphql"
fragment IssueNode on Issue {
......@@ -16,10 +17,7 @@ fragment IssueNode on Issue {
webUrl
relativePosition
milestone {
expired
id
state
title
...MilestoneFragment
}
assignees {
nodes {
......
fragment MilestoneFragment on Milestone {
expired
id
state
title
}
......@@ -14,6 +14,7 @@ import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import { initRails } from '~/lib/utils/rails_ujs';
import * as popovers from '~/popovers';
import * as tooltips from '~/tooltips';
import { initHeaderSearchApp } from '~/header_search';
import initAlertHandler from './alert_handler';
import { removeFlashClickListener } from './flash';
import initTodoToggle from './header';
......@@ -35,7 +36,6 @@ import GlFieldErrors from './gl_field_errors';
import initUserPopovers from './user_popovers';
import initBroadcastNotifications from './broadcast_notification';
import { initTopNav } from './nav';
import { initHeaderSearchApp } from '~/header_search';
import 'ee_else_ce/main_ee';
import 'jh_else_ce/main_jh';
......
#import "~/graphql_shared/fragments/milestone.fragment.graphql"
#import "~/graphql_shared/fragments/user.fragment.graphql"
fragment IssueNode on Issue {
......@@ -26,10 +27,7 @@ fragment IssueNode on Issue {
}
}
milestone {
expired
id
state
title
...MilestoneFragment
}
labels {
nodes {
......
......@@ -119,6 +119,7 @@ RSpec.describe 'epics swimlanes', :js do
end
it 'between lists and epics' do
inspect_requests(inject_headers: { 'X-GITLAB-DISABLE-SQL-QUERY-LIMIT' => 'https://gitlab.com/gitlab-org/gitlab/-/issues/323426' }) do
wait_for_board_cards(1, 2)
wait_for_board_cards_in_second_epic(1, 1)
......@@ -129,6 +130,7 @@ RSpec.describe 'epics swimlanes', :js do
wait_for_board_cards_in_first_epic(2, 2)
end
end
end
context 'drag and drop list' do
let_it_be(:label2) { create(:label, project: project, name: 'Label 2') }
......
......@@ -21,9 +21,10 @@ import {
getMoveData,
updateListPosition,
} from '~/boards/boards_util';
import { gqlClient } from '~/boards/graphql';
import destroyBoardListMutation from '~/boards/graphql/board_list_destroy.mutation.graphql';
import issueCreateMutation from '~/boards/graphql/issue_create.mutation.graphql';
import actions, { gqlClient } from '~/boards/stores/actions';
import actions from '~/boards/stores/actions';
import * as types from '~/boards/stores/mutation_types';
import mutations from '~/boards/stores/mutations';
......
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