Commit 4b1b5b0d authored by Simon Knox's avatar Simon Knox

fix formatting

parent fe829def
......@@ -109,16 +109,11 @@
loadIssues(clearIssues = false) {
if (!this.showAddIssuesModal) return false;
return gl.boardService
.getBacklog(
Object.assign(
urlParamsToObject(this.filter.path),
{
page: this.page,
per: this.perPage,
},
),
)
return gl.boardService.getBacklog({
...urlParamsToObject(this.filter.path),
page: this.page,
per: this.perPage,
})
.then(res => res.data)
.then(data => {
if (clearIssues) {
......
......@@ -120,10 +120,10 @@ class List {
}
getIssues(emptyIssues = true) {
const data = Object.assign(
urlParamsToObject(gl.issueBoards.BoardsStore.filter.path),
{ page: this.page },
);
const data = {
...urlParamsToObject(gl.issueBoards.BoardsStore.filter.path),
page: this.page,
};
if (this.label && data.label_name) {
data.label_name = data.label_name.filter(label => label !== this.label.title);
......
......@@ -132,11 +132,9 @@ export const parseUrlPathname = url => {
return parsedUrl.pathname.charAt(0) === '/' ? parsedUrl.pathname : `/${parsedUrl.pathname}`;
};
function splitPath(path) {
return path
.replace(/^\?/, '')
.split('&');
}
const splitPath = (path = '') => path
.replace(/^\?/, '')
.split('&');
export const urlParamsToArray = (path = '') => splitPath(path)
.filter(param => param.length > 0)
......@@ -149,7 +147,9 @@ export const getUrlParamsArray = () => urlParamsToArray(window.location.search);
export const urlParamsToObject = (path = '') => splitPath(path)
.reduce((dataParam, filterParam) => {
if (filterParam === '') return dataParam;
if (filterParam === '') {
return dataParam;
}
const data = dataParam;
const paramSplit = filterParam.split('=');
......
......@@ -34,7 +34,9 @@ class BoardsStoreEE {
};
this.store.updateFiltersUrl = (replaceState = false) => {
if (!this.store.filter.path) return;
if (!this.store.filter.path) {
return;
}
if (replaceState) {
window.history.replaceState(null, null, `?${this.store.filter.path}`);
} else {
......
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