Commit ac49ac1d authored by Florie Guibert's avatar Florie Guibert

Create Epic Board

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