debian-mirror-gitlab/app/assets/javascripts/boards/components/board_column.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

91 lines
2.2 KiB
Vue
Raw Normal View History

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