Commit 99676bd2 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'psi-create-new-list' into 'master'

Add board_new_list feature flag and placeholder [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!52869
parents a0d465de 7dac22e9
<script>
import { GlButton } from '@gitlab/ui';
import { mapActions } from 'vuex';
export default {
components: {
GlButton,
},
methods: {
...mapActions(['setAddColumnFormVisibility']),
},
};
</script>
<template>
<span class="gl-ml-4">
<gl-button variant="success" @click="setAddColumnFormVisibility(true)"
>{{ __('Create list') }}
</gl-button>
</span>
</template>
...@@ -16,6 +16,7 @@ import { ...@@ -16,6 +16,7 @@ import {
getBoardsModalData, getBoardsModalData,
} from 'ee_else_ce/boards/ee_functions'; } from 'ee_else_ce/boards/ee_functions';
import BoardAddNewColumnTrigger from '~/boards/components/board_add_new_column_trigger.vue';
import BoardContent from '~/boards/components/board_content.vue'; import BoardContent from '~/boards/components/board_content.vue';
import BoardExtraActions from '~/boards/components/board_extra_actions.vue'; import BoardExtraActions from '~/boards/components/board_extra_actions.vue';
import createDefaultClient from '~/lib/graphql'; import createDefaultClient from '~/lib/graphql';
...@@ -288,6 +289,21 @@ export default () => { ...@@ -288,6 +289,21 @@ export default () => {
}, },
}); });
const createColumnTriggerEl = document.querySelector('.js-create-column-trigger');
if (createColumnTriggerEl) {
// eslint-disable-next-line no-new
new Vue({
el: createColumnTriggerEl,
components: {
BoardAddNewColumnTrigger,
},
store,
render(createElement) {
return createElement('board-add-new-column-trigger');
},
});
}
boardConfigToggle(boardsStore); boardConfigToggle(boardsStore);
const issueBoardsModal = document.getElementById('js-add-issues-btn'); const issueBoardsModal = document.getElementById('js-add-issues-btn');
......
...@@ -547,6 +547,10 @@ export default { ...@@ -547,6 +547,10 @@ export default {
} }
}, },
setAddColumnFormVisibility: ({ commit }, visible) => {
commit(types.SET_ADD_COLUMN_FORM_VISIBLE, visible);
},
fetchBacklog: () => { fetchBacklog: () => {
notImplemented(); notImplemented();
}, },
......
...@@ -42,3 +42,4 @@ export const RECEIVE_GROUP_PROJECTS_FAILURE = 'RECEIVE_GROUP_PROJECTS_FAILURE'; ...@@ -42,3 +42,4 @@ export const RECEIVE_GROUP_PROJECTS_FAILURE = 'RECEIVE_GROUP_PROJECTS_FAILURE';
export const SET_SELECTED_PROJECT = 'SET_SELECTED_PROJECT'; export const SET_SELECTED_PROJECT = 'SET_SELECTED_PROJECT';
export const ADD_BOARD_ITEM_TO_SELECTION = 'ADD_BOARD_ITEM_TO_SELECTION'; export const ADD_BOARD_ITEM_TO_SELECTION = 'ADD_BOARD_ITEM_TO_SELECTION';
export const REMOVE_BOARD_ITEM_FROM_SELECTION = 'REMOVE_BOARD_ITEM_FROM_SELECTION'; export const REMOVE_BOARD_ITEM_FROM_SELECTION = 'REMOVE_BOARD_ITEM_FROM_SELECTION';
export const SET_ADD_COLUMN_FORM_VISIBLE = 'SET_ADD_COLUMN_FORM_VISIBLE';
...@@ -270,4 +270,8 @@ export default { ...@@ -270,4 +270,8 @@ export default {
state.selectedBoardItems.filter((obj) => obj !== boardItem), state.selectedBoardItems.filter((obj) => obj !== boardItem),
); );
}, },
[mutationTypes.SET_ADD_COLUMN_FORM_VISIBLE]: (state, visible) => {
state.addColumnFormVisible = visible;
},
}; };
...@@ -24,6 +24,7 @@ export default () => ({ ...@@ -24,6 +24,7 @@ export default () => ({
}, },
selectedProject: {}, selectedProject: {},
error: undefined, error: undefined,
addColumnFormVisible: false,
// TODO: remove after ce/ee split of board_content.vue // TODO: remove after ce/ee split of board_content.vue
isShowingEpicsSwimlanes: false, isShowingEpicsSwimlanes: false,
}); });
...@@ -195,6 +195,9 @@ ...@@ -195,6 +195,9 @@
#js-board-labels-toggle #js-board-labels-toggle
.js-board-config{ data: { can_admin_list: user_can_admin_list, has_scope: board.scoped? } } .js-board-config{ data: { can_admin_list: user_can_admin_list, has_scope: board.scoped? } }
- if user_can_admin_list - if user_can_admin_list
- if Feature.enabled?(:board_new_list, board.resource_parent, default_enabled: :yaml)
.js-create-column-trigger{ data: board_list_data }
- else
= render 'shared/issuable/board_create_list_dropdown', board: board = render 'shared/issuable/board_create_list_dropdown', board: board
- if @project - if @project
#js-add-issues-btn.gl-ml-3{ data: { can_admin_list: can?(current_user, :admin_list, @project) } } #js-add-issues-btn.gl-ml-3{ data: { can_admin_list: can?(current_user, :admin_list, @project) } }
......
---
name: board_new_list
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52061
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/299366
milestone: '13.8'
type: development
group: group::project management
default_enabled: false
...@@ -40,6 +40,7 @@ RSpec.describe 'issue boards', :js do ...@@ -40,6 +40,7 @@ RSpec.describe 'issue boards', :js do
let(:project) { create(:project, :public, namespace: group) } let(:project) { create(:project, :public, namespace: group) }
before do before do
stub_feature_flags(board_new_list: false)
project.add_maintainer(user) project.add_maintainer(user)
group.add_reporter(user) group.add_reporter(user)
login_as(user) login_as(user)
......
...@@ -8311,6 +8311,9 @@ msgstr "" ...@@ -8311,6 +8311,9 @@ msgstr ""
msgid "Create iteration" msgid "Create iteration"
msgstr "" msgstr ""
msgid "Create list"
msgstr ""
msgid "Create lists from labels. Issues with that label appear in that list." msgid "Create lists from labels. Issues with that label appear in that list."
msgstr "" msgstr ""
......
...@@ -13,6 +13,8 @@ RSpec.describe 'Issue Boards', :js do ...@@ -13,6 +13,8 @@ RSpec.describe 'Issue Boards', :js do
let_it_be(:user2) { create(:user) } let_it_be(:user2) { create(:user) }
before do before do
stub_feature_flags(board_new_list: false)
project.add_maintainer(user) project.add_maintainer(user)
project.add_maintainer(user2) project.add_maintainer(user2)
......
...@@ -18,6 +18,7 @@ RSpec.describe 'Labels Hierarchy', :js do ...@@ -18,6 +18,7 @@ RSpec.describe 'Labels Hierarchy', :js do
before do before do
stub_feature_flags(graphql_board_lists: false) stub_feature_flags(graphql_board_lists: false)
stub_feature_flags(board_new_list: false)
grandparent.add_owner(user) grandparent.add_owner(user)
sign_in(user) sign_in(user)
...@@ -270,6 +271,10 @@ RSpec.describe 'Labels Hierarchy', :js do ...@@ -270,6 +271,10 @@ RSpec.describe 'Labels Hierarchy', :js do
end end
context 'creating boards lists' do context 'creating boards lists' do
before do
stub_feature_flags(board_new_list: false)
end
context 'on project boards' do context 'on project boards' do
let(:board) { create(:board, project: project_1) } let(:board) { create(:board, project: project_1) }
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
RSpec.shared_examples 'multiple issue boards' do RSpec.shared_examples 'multiple issue boards' do
context 'authorized user' do context 'authorized user' do
before do before do
stub_feature_flags(board_new_list: false)
parent.add_maintainer(user) parent.add_maintainer(user)
login_as(user) login_as(user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment