All files / app/assets/javascripts/boards/components board_column.vue

87.5% Statements 7/8
100% Branches 1/1
62.5% Functions 5/8
87.5% Lines 7/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98      5x                                                       4x           4x     4x           4x 1x 1x                                                                                                  
<script>
import BoardListHeader from 'ee_else_ce/boards/components/board_list_header.vue';
import { isListDraggable } from '../boards_util';
import BoardList from './board_list.vue';
 
export default {
  components: {
    BoardListHeader,
    BoardList,
  },
  props: {
    list: {
      type: Object,
      default: () => ({}),
      required: false,
    },
    boardId: {
      type: String,
      required: true,
    },
    filters: {
      type: Object,
      required: true,
    },
    highlightedLists: {
      type: Array,
      required: false,
      default: () => [],
    },
  },
  data() {
    return {
      showNewForm: false,
    };
  },
  computed: {
    highlighted() {
      return this.highlightedLists.includes(this.list.id);
    },
    isListDraggable() {
      return isListDraggable(this.list);
    },
  },
  watch: {
    highlighted: {
      handler(highlighted) {
        if (highlighted) {
          this.$nextTick(() => {
            this.$el.scrollIntoView({ behavior: 'smooth', block: 'start' });
          });
        }
      },
      immediate: true,
    },
  },
  methods: {
    toggleNewForm() {
      this.showNewForm = !this.showNewForm;
    },
  },
};
</script>
 
<template>
  <div
    :class="{
      'is-draggable': isListDraggable,
      'is-collapsed gl-w-10': list.collapsed,
      'board-type-assignee': list.listType === 'assignee',
    }"
    :data-list-id="list.id"
    class="board gl-display-inline-block gl-h-full gl-px-3 gl-vertical-align-top gl-white-space-normal is-expandable"
    data-testid="board-list"
  >
    <div
      class="gl-display-flex gl-flex-direction-column gl-relative gl-h-full gl-rounded-base gl-bg-gray-50"
      :class="{ 'board-column-highlighted': highlighted }"
    >
      <board-list-header
        :list="list"
        :filter-params="filters"
        :board-id="boardId"
        @toggleNewForm="toggleNewForm"
        @setActiveList="$emit('setActiveList', $event)"
      />
      <board-list
        ref="board-list"
        :board-id="boardId"
        :list="list"
        :filter-params="filters"
        :show-new-form="showNewForm"
        @toggleNewForm="toggleNewForm"
        @setFilters="$emit('setFilters', $event)"
      />
    </div>
  </div>
</template>