2020-04-02 14:08:11 -04:00
|
|
|
<script>
|
2021-01-18 04:11:05 -05:00
|
|
|
import { mapGetters, mapActions, mapState } from 'vuex';
|
2020-08-17 17:09:56 -04:00
|
|
|
import BoardListHeader from 'ee_else_ce/boards/components/board_list_header.vue';
|
2021-01-18 04:11:05 -05:00
|
|
|
import { isListDraggable } from '../boards_util';
|
2021-02-01 10:08:56 -05:00
|
|
|
import BoardList from './board_list.vue';
|
2020-04-02 14:08:11 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2020-06-11 05:08:16 -04:00
|
|
|
BoardListHeader,
|
2020-11-16 01:09:20 -05:00
|
|
|
BoardList,
|
2020-04-02 14:08:11 -04:00
|
|
|
},
|
2021-01-12 07:10:49 -05:00
|
|
|
inject: {
|
|
|
|
boardId: {
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
},
|
2020-04-02 14:08:11 -04:00
|
|
|
props: {
|
|
|
|
list: {
|
|
|
|
type: Object,
|
|
|
|
default: () => ({}),
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
2020-09-17 05:09:32 -04:00
|
|
|
},
|
2020-04-02 14:08:11 -04:00
|
|
|
computed: {
|
2021-02-15 13:09:09 -05:00
|
|
|
...mapState(['filterParams', 'highlightedLists']),
|
2021-02-22 04:10:46 -05:00
|
|
|
...mapGetters(['getBoardItemsByList']),
|
2021-02-15 13:09:09 -05:00
|
|
|
highlighted() {
|
|
|
|
return this.highlightedLists.includes(this.list.id);
|
|
|
|
},
|
2021-02-22 04:10:46 -05:00
|
|
|
listItems() {
|
|
|
|
return this.getBoardItemsByList(this.list.id);
|
2021-01-18 04:11:05 -05:00
|
|
|
},
|
|
|
|
isListDraggable() {
|
|
|
|
return isListDraggable(this.list);
|
2020-09-15 05:09:30 -04:00
|
|
|
},
|
2020-04-02 14:08:11 -04:00
|
|
|
},
|
|
|
|
watch: {
|
2021-01-18 04:11:05 -05:00
|
|
|
filterParams: {
|
2020-04-02 14:08:11 -04:00
|
|
|
handler() {
|
2021-02-23 10:10:47 -05:00
|
|
|
if (this.list.id) {
|
|
|
|
this.fetchItemsForList({ listId: this.list.id });
|
|
|
|
}
|
2020-04-02 14:08:11 -04:00
|
|
|
},
|
|
|
|
deep: true,
|
2021-01-18 04:11:05 -05:00
|
|
|
immediate: true,
|
2020-04-02 14:08:11 -04:00
|
|
|
},
|
2021-02-23 10:10:47 -05:00
|
|
|
'list.id': {
|
|
|
|
handler(id) {
|
|
|
|
if (id) {
|
|
|
|
this.fetchItemsForList({ listId: this.list.id });
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2021-02-15 13:09:09 -05:00
|
|
|
highlighted: {
|
|
|
|
handler(highlighted) {
|
|
|
|
if (highlighted) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$el.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
immediate: true,
|
|
|
|
},
|
2020-04-02 14:08:11 -04:00
|
|
|
},
|
2021-01-18 04:11:05 -05:00
|
|
|
methods: {
|
2021-02-17 22:09:22 -05:00
|
|
|
...mapActions(['fetchItemsForList']),
|
2020-04-02 14:08:11 -04:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
:class="{
|
2021-01-18 04:11:05 -05:00
|
|
|
'is-draggable': isListDraggable,
|
|
|
|
'is-collapsed': list.collapsed,
|
|
|
|
'board-type-assignee': list.listType === 'assignee',
|
2020-04-02 14:08:11 -04:00
|
|
|
}"
|
|
|
|
:data-id="list.id"
|
2021-01-18 04:11:05 -05:00
|
|
|
class="board gl-display-inline-block gl-h-full gl-px-3 gl-vertical-align-top gl-white-space-normal is-expandable"
|
2020-04-02 14:08:11 -04:00
|
|
|
data-qa-selector="board_list"
|
|
|
|
>
|
2020-06-11 05:08:16 -04:00
|
|
|
<div
|
|
|
|
class="board-inner gl-display-flex gl-flex-direction-column gl-relative gl-h-full gl-rounded-base"
|
2021-02-15 13:09:09 -05:00
|
|
|
:class="{ 'board-column-highlighted': highlighted }"
|
2020-06-11 05:08:16 -04:00
|
|
|
>
|
2021-06-10 05:10:04 -04:00
|
|
|
<board-list-header :list="list" :disabled="disabled" />
|
|
|
|
<board-list ref="board-list" :disabled="disabled" :board-items="listItems" :list="list" />
|
2020-04-02 14:08:11 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|