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

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

64 lines
1.7 KiB
Vue
Raw Normal View History

2021-11-11 11:23:49 +05:30
<script>
2022-07-23 23:45:48 +05:30
import { mapGetters } from 'vuex';
2023-05-27 22:25:52 +05:30
import { refreshCurrentPage, queryToObject } from '~/lib/utils/url_utility';
2021-11-11 11:23:49 +05:30
import BoardContent from '~/boards/components/board_content.vue';
import BoardSettingsSidebar from '~/boards/components/board_settings_sidebar.vue';
2022-06-21 17:19:12 +05:30
import BoardTopBar from '~/boards/components/board_top_bar.vue';
2021-11-11 11:23:49 +05:30
export default {
components: {
BoardContent,
BoardSettingsSidebar,
2022-06-21 17:19:12 +05:30
BoardTopBar,
2021-11-11 11:23:49 +05:30
},
2023-05-27 22:25:52 +05:30
inject: ['initialBoardId', 'initialFilterParams'],
2023-04-23 21:23:45 +05:30
data() {
return {
boardId: this.initialBoardId,
2023-05-27 22:25:52 +05:30
filterParams: { ...this.initialFilterParams },
isShowingEpicsSwimlanes: Boolean(queryToObject(window.location.search).group_by),
2023-04-23 21:23:45 +05:30
};
},
2021-11-11 11:23:49 +05:30
computed: {
...mapGetters(['isSidebarOpen']),
2023-05-27 22:25:52 +05:30
isSwimlanesOn() {
return (gon?.licensed_features?.swimlanes && this.isShowingEpicsSwimlanes) ?? false;
},
2021-11-11 11:23:49 +05:30
},
2022-07-23 23:45:48 +05:30
created() {
window.addEventListener('popstate', refreshCurrentPage);
2021-11-11 11:23:49 +05:30
},
2022-07-23 23:45:48 +05:30
destroyed() {
window.removeEventListener('popstate', refreshCurrentPage);
2021-11-11 11:23:49 +05:30
},
2023-04-23 21:23:45 +05:30
methods: {
switchBoard(id) {
this.boardId = id;
},
2023-05-27 22:25:52 +05:30
setFilters(filters) {
const filterParams = { ...filters };
if (filterParams.groupBy) delete filterParams.groupBy;
this.filterParams = filterParams;
},
2023-04-23 21:23:45 +05:30
},
2021-11-11 11:23:49 +05:30
};
</script>
<template>
<div class="boards-app gl-relative" :class="{ 'is-compact': isSidebarOpen }">
2023-05-27 22:25:52 +05:30
<board-top-bar
:board-id="boardId"
:is-swimlanes-on="isSwimlanesOn"
@switchBoard="switchBoard"
@setFilters="setFilters"
@toggleSwimlanes="isShowingEpicsSwimlanes = $event"
/>
<board-content
:board-id="boardId"
:is-swimlanes-on="isSwimlanesOn"
:filter-params="filterParams"
/>
2021-11-11 11:23:49 +05:30
<board-settings-sidebar />
</div>
</template>