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

fix formatting

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