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
f4e4a9ad
Commit
f4e4a9ad
authored
Sep 04, 2018
by
Simon Knox
Committed by
Phil Hughes
Sep 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Weight Feature in Community Edition buggy in board view"
parent
cbf5b26d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
10 deletions
+58
-10
ee/app/assets/javascripts/boards/components/board.js
ee/app/assets/javascripts/boards/components/board.js
+11
-0
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
+4
-0
ee/app/helpers/ee/boards_helper.rb
ee/app/helpers/ee/boards_helper.rb
+1
-0
ee/app/views/shared/boards/components/_list_weight.html.haml
ee/app/views/shared/boards/components/_list_weight.html.haml
+4
-3
ee/app/views/shared/boards/components/sidebar/_weight.html.haml
.../views/shared/boards/components/sidebar/_weight.html.haml
+8
-7
ee/spec/features/boards/boards_spec.rb
ee/spec/features/boards/boards_spec.rb
+15
-0
ee/spec/features/boards/sidebar_spec.rb
ee/spec/features/boards/sidebar_spec.rb
+15
-0
No files found.
ee/app/assets/javascripts/boards/components/board.js
View file @
f4e4a9ad
...
...
@@ -2,14 +2,25 @@ import '~/boards/components/board';
import
{
__
,
n__
,
sprintf
}
from
'
~/locale
'
;
import
boardPromotionState
from
'
ee/boards/components/board_promotion_state
'
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
base
=
gl
.
issueBoards
.
Board
;
gl
.
issueBoards
.
Board
=
base
.
extend
({
data
()
{
return
{
weightFeatureAvailable
:
Store
.
weightFeatureAvailable
,
};
},
components
:
{
boardPromotionState
,
},
computed
:
{
counterTooltip
()
{
if
(
!
this
.
weightFeatureAvailable
)
{
// call computed property from base component (CE board.js)
return
base
.
options
.
computed
.
counterTooltip
.
call
(
this
);
}
const
{
issuesSize
,
totalWeight
}
=
this
.
list
;
return
sprintf
(
__
(
`
${
n__
(
'
%d issue
'
,
'
%d issues
'
,
issuesSize
)}
with %{totalWeight} total weight`
),
...
...
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
View file @
f4e4a9ad
...
...
@@ -5,6 +5,7 @@ import { __ } from '~/locale';
import
BoardService
from
'
ee/boards/services/board_service
'
;
import
sidebarEventHub
from
'
~/sidebar/event_hub
'
;
import
createFlash
from
'
~/flash
'
;
import
{
convertPermissionToBoolean
}
from
'
~/lib/utils/common_utils
'
;
class
BoardsStoreEE
{
initEESpecific
(
boardsStore
)
{
...
...
@@ -29,6 +30,9 @@ class BoardsStoreEE {
weight
:
parseInt
(
this
.
$boardApp
.
dataset
.
boardWeight
,
10
),
};
this
.
store
.
cantEdit
=
[];
this
.
store
.
weightFeatureAvailable
=
convertPermissionToBoolean
(
this
.
$boardApp
.
dataset
.
weightFeatureAvailable
,
);
this
.
initBoardFilters
();
}
};
...
...
ee/app/helpers/ee/boards_helper.rb
View file @
f4e4a9ad
...
...
@@ -27,6 +27,7 @@ module EE
labels:
board
.
labels
.
to_json
(
only:
[
:id
,
:title
,
:color
,
:text_color
]
),
board_weight:
board
.
weight
,
focus_mode_available:
parent
.
feature_available?
(
:issue_board_focus_mode
),
weight_feature_available:
parent
.
feature_available?
(
:issue_weights
).
to_s
,
show_promotion:
show_feature_promotion
}
...
...
ee/app/views/shared/boards/components/_list_weight.html.haml
View file @
f4e4a9ad
%span
.d-inline-flex.ml-2
-
if
(
@group
||
@project
)
&
.
feature_available?
(
:issue_weights
)
%span
.d-inline-flex.ml-2
%icon
.mr-1
{
name:
"scale"
}
{{ list.totalWeight }}
ee/app/views/shared/boards/components/sidebar/_weight.html.haml
View file @
f4e4a9ad
%weight
{
":fetching"
=>
"issue.isFetching && issue.isFetching.weight"
,
-
if
(
@project
||
@group
)
&
.
feature_available?
(
:issue_weights
)
%weight
{
":fetching"
=>
"issue.isFetching && issue.isFetching.weight"
,
":loading"
=>
"issue.isLoading && issue.isLoading.weight"
,
":weight"
=>
"issue.weight"
,
":weight-options"
=>
Issue
.
weight_options
,
...
...
ee/spec/features/boards/boards_spec.rb
View file @
f4e4a9ad
...
...
@@ -124,6 +124,21 @@ describe 'issue boards', :js do
expect
(
badge
(
from
)).
to
have_content
(
'3'
)
expect
(
badge
(
to
)).
to
have_content
(
'2'
)
end
context
'unlicensed'
do
before
do
stub_licensed_features
(
issue_weights:
false
)
visit_board_page
end
it
'hides weight'
do
backlog
=
board
.
lists
.
first
badge
(
backlog
).
hover
tooltip
=
find
(
"#
#{
badge
(
backlog
)[
'aria-describedby'
]
}
"
)
expect
(
tooltip
.
text
).
to
eq
(
'2 issues'
)
end
end
end
def
badge
(
list
)
...
...
ee/spec/features/boards/sidebar_spec.rb
View file @
f4e4a9ad
...
...
@@ -232,5 +232,20 @@ describe 'Issue Boards', :js do
end
end
end
context
'unlicensed'
do
before
do
stub_licensed_features
(
issue_weights:
false
)
visit
project_board_path
(
project
,
board
)
wait_for_requests
end
it
'hides weight'
do
click_card
(
card1
)
wait_for_requests
expect
(
page
).
not_to
have_selector
(
'.js-weight-weight-label'
)
end
end
end
end
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