@@ -5,32 +5,50 @@ import produce from 'immer';
5
5
import Draggable from ' vuedraggable' ;
6
6
import BoardAddNewColumn from ' ee_else_ce/boards/components/board_add_new_column.vue' ;
7
7
import BoardAddNewColumnTrigger from ' ~/boards/components/board_add_new_column_trigger.vue' ;
8
+ import glFeatureFlagsMixin from ' ~/vue_shared/mixins/gl_feature_flags_mixin' ;
9
+ import WorkItemDrawer from ' ~/work_items/components/work_item_drawer.vue' ;
8
10
import { s__ } from ' ~/locale' ;
9
11
import { defaultSortableOptions , DRAG_DELAY } from ' ~/sortable/constants' ;
12
+ import { mapWorkItemWidgetsToIssueFields } from ' ~/issues/list/utils' ;
10
13
import {
11
14
DraggableItemTypes ,
12
15
flashAnimationDuration ,
13
16
listsQuery ,
14
17
updateListQueries ,
15
18
ListType ,
19
+ listIssuablesQueries ,
20
+ DEFAULT_BOARD_LIST_ITEMS_SIZE ,
16
21
} from ' ee_else_ce/boards/constants' ;
17
22
import { calculateNewPosition } from ' ee_else_ce/boards/boards_util' ;
18
23
import { setError } from ' ../graphql/cache_updates' ;
19
24
import BoardColumn from ' ./board_column.vue' ;
25
+ import BoardDrawerWrapper from ' ./board_drawer_wrapper.vue' ;
20
26
21
27
export default {
22
28
draggableItemTypes: DraggableItemTypes,
23
29
components: {
24
30
BoardAddNewColumn,
25
31
BoardAddNewColumnTrigger,
26
32
BoardColumn,
33
+ BoardDrawerWrapper,
27
34
BoardContentSidebar : () => import (' ~/boards/components/board_content_sidebar.vue' ),
28
35
EpicBoardContentSidebar : () =>
29
36
import (' ee_component/boards/components/epic_board_content_sidebar.vue' ),
30
37
EpicsSwimlanes : () => import (' ee_component/boards/components/epics_swimlanes.vue' ),
31
38
GlAlert,
39
+ WorkItemDrawer,
32
40
},
33
- inject: [' boardType' , ' canAdminList' , ' isIssueBoard' , ' isEpicBoard' , ' disabled' , ' issuableType' ],
41
+ mixins: [glFeatureFlagsMixin ()],
42
+ inject: [
43
+ ' boardType' ,
44
+ ' canAdminList' ,
45
+ ' isIssueBoard' ,
46
+ ' isEpicBoard' ,
47
+ ' disabled' ,
48
+ ' issuableType' ,
49
+ ' isGroupBoard' ,
50
+ ' fullPath' ,
51
+ ],
34
52
props: {
35
53
boardId: {
36
54
type: String ,
@@ -108,6 +126,9 @@ export default {
108
126
const closedList = this .boardListsToUse .find ((list ) => list .listType === ListType .closed );
109
127
return closedList? .id || ' ' ;
110
128
},
129
+ issuesDrawerEnabled () {
130
+ return this .glFeatures .issuesListDrawer ;
131
+ },
111
132
},
112
133
methods: {
113
134
afterFormEnters () {
@@ -193,6 +214,24 @@ export default {
193
214
});
194
215
}
195
216
},
217
+ updateBoardCard (workItem , activeCard ) {
218
+ const { cache } = this .$apollo .provider .clients .defaultClient ;
219
+
220
+ const variables = {
221
+ id: activeCard .listId ,
222
+ filters: this .filterParams ,
223
+ fullPath: this .fullPath ,
224
+ boardId: this .boardId ,
225
+ isGroup: this .isGroupBoard ,
226
+ isProject: ! this .isGroupBoard ,
227
+ first: DEFAULT_BOARD_LIST_ITEMS_SIZE ,
228
+ };
229
+
230
+ cache .updateQuery (
231
+ { query: listIssuablesQueries[this .issuableType ].query , variables },
232
+ (boardList ) => mapWorkItemWidgetsToIssueFields (boardList, workItem, true ),
233
+ );
234
+ },
196
235
},
197
236
};
198
237
< / script>
@@ -283,9 +322,34 @@ export default {
283
322
/ >
284
323
< / div>
285
324
< / epics- swimlanes>
325
+ < board- drawer- wrapper
326
+ v- if = " issuesDrawerEnabled"
327
+ : backlog- list- id= " backlogListId"
328
+ : closed- list- id= " closedListId"
329
+ >
330
+ < template
331
+ #default= " {
332
+ activeIssuable,
333
+ onDrawerClosed,
334
+ onAttributeUpdated,
335
+ onIssuableDeleted,
336
+ onStateUpdated,
337
+ }"
338
+ >
339
+ < work- item- drawer
340
+ : open= " Boolean(activeIssuable && activeIssuable.iid)"
341
+ : active- item= " activeIssuable"
342
+ @close= " onDrawerClosed"
343
+ @work- item- updated= " updateBoardCard($event, activeIssuable)"
344
+ @workItemDeleted= " onIssuableDeleted(activeIssuable)"
345
+ @attributesUpdated= " onAttributeUpdated"
346
+ @workItemStateUpdated= " onStateUpdated"
347
+ / >
348
+ < / template>
349
+ < / board- drawer- wrapper>
286
350
287
351
< board- content- sidebar
288
- v- if = " isIssueBoard"
352
+ v- if = " isIssueBoard && !issuesDrawerEnabled "
289
353
: backlog- list- id= " backlogListId"
290
354
: closed- list- id= " closedListId"
291
355
data- testid= " issue-boards-sidebar"
0 commit comments