Commit ac49ac1d authored by Florie Guibert's avatar Florie Guibert

Create Epic Board

Review feedback
parent cf27abe5
......@@ -199,16 +199,10 @@ export default {
/* eslint-enable @gitlab/require-i18n-strings */
},
mutationVariables() {
let variables = this.baseMutationVariables;
if (this.scopedIssueBoardFeatureEnabled) {
variables = {
...variables,
...this.boardScopeMutationVariables,
};
}
return variables;
return {
...this.baseMutationVariables,
...(this.scopedIssueBoardFeatureEnabled ? this.boardScopeMutationVariables : {}),
};
},
},
mounted() {
......@@ -264,7 +258,7 @@ export default {
try {
const url = await this.createOrUpdateBoard();
visitUrl(url);
} catch (e) {
} catch {
Flash(this.$options.i18n.saveErrorMessage);
} finally {
this.isLoading = false;
......
......@@ -14,17 +14,13 @@ export default {
return createEpicBoardMutation;
},
mutationVariables() {
let variables = this.baseMutationVariables;
// TODO: Epic board scope will be added in a future iteration: https://gitlab.com/gitlab-org/gitlab/-/issues/231389
if (this.scopedIssueBoardFeatureEnabled && !this.isEpicBoard) {
variables = {
...variables,
...this.boardScopeMutationVariables,
};
}
return variables;
return {
...this.baseMutationVariables,
...(this.scopedIssueBoardFeatureEnabled && !this.isEpicBoard
? this.boardScopeMutationVariables
: {}),
};
},
},
methods: {
......
......@@ -44,8 +44,9 @@ const defaultProps = {
describe('BoardForm', () => {
let wrapper;
let mutate;
let location;
const findModal = () => wrapper.find(GlModal);
const findModal = () => wrapper.findComponent(GlModal);
const findModalActionPrimary = () => findModal().props('actionPrimary');
const findFormWrapper = () => wrapper.find('[data-testid="board-form-wrapper"]');
const findDeleteConfirmation = () => wrapper.find('[data-testid="delete-confirmation-message"]');
......@@ -61,15 +62,10 @@ describe('BoardForm', () => {
const store = createStore();
const createComponent = (props, data) => {
const createComponent = (props) => {
wrapper = shallowMount(BoardForm, {
localVue,
propsData: { ...defaultProps, ...props },
data() {
return {
...data,
};
},
provide: {
rootPath: 'root',
},
......@@ -83,7 +79,8 @@ describe('BoardForm', () => {
});
};
beforeEach(() => {
beforeAll(() => {
location = window.location;
delete window.location;
});
......@@ -91,6 +88,7 @@ describe('BoardForm', () => {
wrapper.destroy();
wrapper = null;
mutate = null;
window.location = location;
});
describe('when creating a new epic board', () => {
......
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