Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
773da9b4
Commit
773da9b4
authored
Oct 12, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move filterpath setup to EE store
parent
67d01c10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
57 deletions
+63
-57
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+1
-57
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
+62
-0
No files found.
app/assets/javascripts/boards/boards_bundle.js
View file @
773da9b4
...
...
@@ -68,13 +68,7 @@ $(() => {
rootPath
:
$boardApp
.
dataset
.
rootPath
,
bulkUpdatePath
:
$boardApp
.
dataset
.
bulkUpdatePath
,
detailIssue
:
Store
.
detail
,
milestoneId
:
parseInt
(
$boardApp
.
dataset
.
boardMilestoneId
,
10
),
milestoneTitle
:
$boardApp
.
dataset
.
boardMilestoneTitle
,
weight
:
parseInt
(
$boardApp
.
dataset
.
boardWeight
,
10
),
assigneeUsername
:
$boardApp
.
dataset
.
boardAssigneeUsername
,
labels
:
JSON
.
parse
(
$boardApp
.
dataset
.
labels
||
[]),
defaultAvatar
:
$boardApp
.
dataset
.
defaultAvatar
,
cantEdit
:
[],
},
computed
:
{
detailIssueVisible
()
{
...
...
@@ -82,56 +76,6 @@ $(() => {
},
},
created
()
{
const
updateFilterPath
=
(
key
,
value
)
=>
{
if
(
!
value
)
return
;
const
querystring
=
`
${
key
}
=
${
value
}
`
;
Store
.
filter
.
path
=
[
querystring
].
concat
(
Store
.
filter
.
path
.
split
(
'
&
'
).
filter
(
param
=>
param
.
match
(
new
RegExp
(
`^
${
key
}
=(.*)$`
,
'
g
'
))
===
null
)
).
join
(
'
&
'
);
};
if
(
this
.
milestoneId
!==
-
1
)
{
let
milestoneTitle
=
this
.
milestoneTitle
;
if
(
this
.
milestoneId
===
0
)
{
milestoneTitle
=
'
No+Milestone
'
;
}
updateFilterPath
(
'
milestone_title
'
,
milestoneTitle
);
this
.
cantEdit
.
push
(
'
milestone
'
);
}
let
weight
=
this
.
weight
;
if
(
weight
!==
-
1
)
{
if
(
weight
===
0
)
{
weight
=
'
No+Weight
'
;
}
updateFilterPath
(
'
weight
'
,
weight
);
this
.
cantEdit
.
push
(
'
weight
'
);
}
updateFilterPath
(
'
assignee_username
'
,
this
.
assigneeUsername
);
if
(
this
.
assigneeUsername
)
{
this
.
cantEdit
.
push
(
'
assignee
'
);
}
const
filterPath
=
gl
.
issueBoards
.
BoardsStore
.
filter
.
path
.
split
(
'
&
'
);
this
.
labels
.
forEach
((
label
)
=>
{
const
labelTitle
=
encodeURIComponent
(
label
.
title
);
const
param
=
`label_name[]=
${
labelTitle
}
`
;
const
labelIndex
=
filterPath
.
indexOf
(
param
);
if
(
labelIndex
===
-
1
)
{
filterPath
.
push
(
param
);
}
this
.
cantEdit
.
push
({
name
:
'
label
'
,
value
:
label
.
title
,
});
});
Store
.
filter
.
path
=
filterPath
.
join
(
'
&
'
);
Store
.
updateFiltersUrl
(
true
);
gl
.
boardService
=
new
BoardService
({
boardsEndpoint
:
this
.
boardsEndpoint
,
listsEndpoint
:
this
.
listsEndpoint
,
...
...
@@ -147,7 +91,7 @@ $(() => {
eventHub
.
$off
(
'
updateTokens
'
,
this
.
updateTokens
);
},
mounted
()
{
this
.
filterManager
=
new
FilteredSearchBoards
(
Store
.
filter
,
true
,
this
.
cantEdit
);
this
.
filterManager
=
new
FilteredSearchBoards
(
Store
.
filter
,
true
,
Store
.
cantEdit
);
this
.
filterManager
.
setup
();
Store
.
disabled
=
this
.
disabled
;
...
...
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
View file @
773da9b4
...
...
@@ -11,6 +11,68 @@ class BoardsStoreEE {
this
.
store
.
removePromotionState
=
()
=>
{
this
.
removePromotion
();
};
this
.
store
.
boardConfig
=
{
milestoneId
:
parseInt
(
this
.
$boardApp
.
dataset
.
boardMilestoneId
,
10
),
milestoneTitle
:
this
.
$boardApp
.
dataset
.
boardMilestoneTitle
,
assigneeUsername
:
this
.
$boardApp
.
dataset
.
boardAssigneeUsername
,
labels
:
JSON
.
parse
(
this
.
$boardApp
.
dataset
.
labels
||
[]),
weight
:
parseInt
(
this
.
$boardApp
.
dataset
.
boardWeight
,
10
),
};
this
.
store
.
cantEdit
=
[];
this
.
initBoardFilters
();
}
initBoardFilters
()
{
const
updateFilterPath
=
(
key
,
value
)
=>
{
if
(
!
value
)
return
;
const
querystring
=
`
${
key
}
=
${
value
}
`
;
this
.
store
.
filter
.
path
=
[
querystring
].
concat
(
this
.
store
.
filter
.
path
.
split
(
'
&
'
).
filter
(
param
=>
param
.
match
(
new
RegExp
(
`^
${
key
}
=(.*)$`
,
'
g
'
))
===
null
)
).
join
(
'
&
'
);
};
let
milestoneTitle
=
this
.
store
.
boardConfig
.
milestoneTitle
;
if
(
this
.
store
.
boardConfig
.
milestoneId
!==
-
1
)
{
if
(
this
.
store
.
boardConfig
.
milestoneId
===
0
)
{
milestoneTitle
=
'
No+Milestone
'
;
}
updateFilterPath
(
'
milestone_title
'
,
milestoneTitle
);
this
.
store
.
cantEdit
.
push
(
'
milestone
'
);
}
let
weight
=
this
.
store
.
boardConfig
.
weight
;
if
(
weight
!==
-
1
)
{
if
(
weight
===
0
)
{
weight
=
'
No+Weight
'
;
}
updateFilterPath
(
'
weight
'
,
weight
);
this
.
store
.
cantEdit
.
push
(
'
weight
'
);
}
updateFilterPath
(
'
assignee_username
'
,
this
.
store
.
boardConfig
.
assigneeUsername
);
if
(
this
.
store
.
boardConfig
.
assigneeUsername
)
{
this
.
store
.
cantEdit
.
push
(
'
assignee
'
);
}
const
filterPath
=
this
.
store
.
filter
.
path
.
split
(
'
&
'
);
this
.
store
.
boardConfig
.
labels
.
forEach
((
label
)
=>
{
const
labelTitle
=
encodeURIComponent
(
label
.
title
);
const
param
=
`label_name[]=
${
labelTitle
}
`
;
const
labelIndex
=
filterPath
.
indexOf
(
param
);
if
(
labelIndex
===
-
1
)
{
filterPath
.
push
(
param
);
}
this
.
store
.
cantEdit
.
push
({
name
:
'
label
'
,
value
:
label
.
title
,
});
});
this
.
store
.
filter
.
path
=
filterPath
.
join
(
'
&
'
);
this
.
store
.
updateFiltersUrl
(
true
);
}
shouldAddPromotionState
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment