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
d7ec3b79
Commit
d7ec3b79
authored
Sep 13, 2021
by
Coung Ngo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reviewer suggestions
parent
fb3b8945
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
52 deletions
+46
-52
app/assets/javascripts/issues_list/components/issues_list_app.vue
...ts/javascripts/issues_list/components/issues_list_app.vue
+2
-1
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+17
-20
app/views/projects/issues/index.html.haml
app/views/projects/issues/index.html.haml
+1
-1
ee/app/helpers/ee/issues_helper.rb
ee/app/helpers/ee/issues_helper.rb
+20
-24
ee/spec/helpers/ee/issues_helper_spec.rb
ee/spec/helpers/ee/issues_helper_spec.rb
+4
-4
spec/helpers/issues_helper_spec.rb
spec/helpers/issues_helper_spec.rb
+2
-2
No files found.
app/assets/javascripts/issues_list/components/issues_list_app.vue
View file @
d7ec3b79
...
...
@@ -14,6 +14,7 @@ import getIssuesCountsQuery from 'ee_else_ce/issues_list/queries/get_issues_coun
import
createFlash
from
'
~/flash
'
;
import
{
TYPE_USER
}
from
'
~/graphql_shared/constants
'
;
import
{
convertToGraphQLId
,
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
ITEM_TYPE
}
from
'
~/groups/constants
'
;
import
CsvImportExportButtons
from
'
~/issuable/components/csv_import_export_buttons.vue
'
;
import
IssuableByEmail
from
'
~/issuable/components/issuable_by_email.vue
'
;
import
IssuableList
from
'
~/issuable_list/components/issuable_list_root.vue
'
;
...
...
@@ -235,7 +236,7 @@ export default {
};
},
namespace
()
{
return
this
.
isProject
?
'
project
'
:
'
group
'
;
return
this
.
isProject
?
ITEM_TYPE
.
PROJECT
:
ITEM_TYPE
.
GROUP
;
},
hasSearch
()
{
return
this
.
searchQuery
||
Object
.
keys
(
this
.
urlFilterParams
).
length
;
...
...
app/helpers/issues_helper.rb
View file @
d7ec3b79
...
...
@@ -203,48 +203,45 @@ module IssuesHelper
}
end
def
issues_list_data
(
project
,
current_user
,
find
er
)
def
common_issues_list_data
(
namespace
,
current_us
er
)
{
autocomplete_award_emojis_path:
autocomplete_award_emojis_path
,
calendar_path:
url_for
(
safe_params
.
merge
(
calendar_url_options
)),
empty_state_svg_path:
image_path
(
'illustrations/issues.svg'
),
full_path:
namespace
.
full_path
,
is_signed_in:
current_user
.
present?
.
to_s
,
jira_integration_path:
help_page_url
(
'integration/jira/issues'
,
anchor:
'view-jira-issues'
),
rss_path:
url_for
(
safe_params
.
merge
(
rss_url_options
)),
sign_in_path:
new_user_session_path
}
end
def
project_issues_list_data
(
project
,
current_user
,
finder
)
common_issues_list_data
(
project
,
current_user
).
merge
(
can_bulk_update:
can?
(
current_user
,
:admin_issue
,
project
).
to_s
,
can_edit:
can?
(
current_user
,
:admin_project
,
project
).
to_s
,
can_import_issues:
can?
(
current_user
,
:import_issues
,
@project
).
to_s
,
email:
current_user
&
.
notification_email
,
emails_help_page_path:
help_page_path
(
'development/emails'
,
anchor:
'email-namespace'
),
empty_state_svg_path:
image_path
(
'illustrations/issues.svg'
),
export_csv_path:
export_csv_project_issues_path
(
project
),
full_path:
project
.
full_path
,
has_any_issues:
project_issues
(
project
).
exists?
.
to_s
,
import_csv_issues_path:
import_csv_namespace_project_issues_path
,
initial_email:
project
.
new_issuable_address
(
current_user
,
'issue'
),
is_project:
true
.
to_s
,
is_signed_in:
current_user
.
present?
.
to_s
,
jira_integration_path:
help_page_url
(
'integration/jira/issues'
,
anchor:
'view-jira-issues'
),
markdown_help_path:
help_page_path
(
'user/markdown'
),
max_attachment_size:
number_to_human_size
(
Gitlab
::
CurrentSettings
.
max_attachment_size
.
megabytes
),
new_issue_path:
new_project_issue_path
(
project
,
issue:
{
milestone_id:
finder
.
milestones
.
first
.
try
(
:id
)
}),
project_import_jira_path:
project_import_jira_path
(
project
),
quick_actions_help_path:
help_page_path
(
'user/project/quick_actions'
),
reset_path:
new_issuable_address_project_path
(
project
,
issuable_type:
'issue'
),
rss_path:
url_for
(
safe_params
.
merge
(
rss_url_options
)),
show_new_issue_link:
show_new_issue_link?
(
project
).
to_s
,
sign_in_path:
new_user_session_path
}
show_new_issue_link:
show_new_issue_link?
(
project
).
to_s
)
end
def
group_issues_list_data
(
group
,
current_user
,
issues
)
{
autocomplete_award_emojis_path:
autocomplete_award_emojis_path
,
calendar_path:
url_for
(
safe_params
.
merge
(
calendar_url_options
)),
empty_state_svg_path:
image_path
(
'illustrations/issues.svg'
),
full_path:
group
.
full_path
,
has_any_issues:
issues
.
to_a
.
any?
.
to_s
,
is_signed_in:
current_user
.
present?
.
to_s
,
jira_integration_path:
help_page_url
(
'integration/jira/issues'
,
anchor:
'view-jira-issues'
),
rss_path:
url_for
(
safe_params
.
merge
(
rss_url_options
)),
sign_in_path:
new_user_session_path
}
common_issues_list_data
(
group
,
current_user
).
merge
(
has_any_issues:
issues
.
to_a
.
any?
.
to_s
)
end
# Overridden in EE
...
...
app/views/projects/issues/index.html.haml
View file @
d7ec3b79
...
...
@@ -14,7 +14,7 @@
project_path:
@project
.
full_path
}
}
-
if
Feature
.
enabled?
(
:vue_issues_list
,
@project
&
.
group
,
default_enabled: :yaml
)
.js-issues-list
{
data:
issues_list_data
(
@project
,
current_user
,
finder
)
}
.js-issues-list
{
data:
project_
issues_list_data
(
@project
,
current_user
,
finder
)
}
-
if
@can_bulk_update
=
render
'shared/issuable/bulk_update_sidebar'
,
type: :issues
-
elsif
project_issues
(
@project
).
exists?
...
...
ee/app/helpers/ee/issues_helper.rb
View file @
d7ec3b79
...
...
@@ -42,39 +42,35 @@ module EE
actions
end
override
:issues_list_data
def
issues_list_data
(
project
,
current_user
,
find
er
)
data
=
super
.
merge!
(
has_blocked_issues_feature:
project
.
feature_available?
(
:blocked_issues
).
to_s
,
has_issuable_health_status_feature:
project
.
feature_available?
(
:issuable_health_status
).
to_s
,
has_issue_weights_feature:
project
.
feature_available?
(
:issue_weights
).
to_s
,
has_iterations_feature:
project
.
feature_available?
(
:iterations
).
to_s
,
has_multiple_issue_assignees_feature:
project
.
feature_available?
(
:multiple_issue_assignees
).
to_s
override
:
common_
issues_list_data
def
common_issues_list_data
(
namespace
,
current_us
er
)
super
.
merge
(
has_blocked_issues_feature:
namespace
.
feature_available?
(
:blocked_issues
).
to_s
,
has_issuable_health_status_feature:
namespace
.
feature_available?
(
:issuable_health_status
).
to_s
,
has_issue_weights_feature:
namespace
.
feature_available?
(
:issue_weights
).
to_s
,
has_iterations_feature:
namespace
.
feature_available?
(
:iterations
).
to_s
,
has_multiple_issue_assignees_feature:
namespace
.
feature_available?
(
:multiple_issue_assignees
).
to_s
)
end
override
:project_issues_list_data
def
project_issues_list_data
(
project
,
current_user
,
finder
)
super
.
tap
do
|
data
|
if
project
.
feature_available?
(
:epics
)
&&
project
.
group
data
[
:group_epics_path
]
=
group_epics_path
(
project
.
group
,
format: :json
)
end
data
end
end
override
:group_issues_list_data
def
group_issues_list_data
(
group
,
current_user
,
issues
)
data
=
super
.
merge!
(
can_bulk_update:
(
can?
(
current_user
,
:admin_issue
,
group
)
&&
group
.
feature_available?
(
:group_bulk_edit
)).
to_s
,
has_blocked_issues_feature:
group
.
feature_available?
(
:blocked_issues
).
to_s
,
has_issuable_health_status_feature:
group
.
feature_available?
(
:issuable_health_status
).
to_s
,
has_issue_weights_feature:
group
.
feature_available?
(
:issue_weights
).
to_s
,
has_iterations_feature:
group
.
feature_available?
(
:iterations
).
to_s
,
has_multiple_issue_assignees_feature:
group
.
feature_available?
(
:multiple_issue_assignees
).
to_s
)
super
.
tap
do
|
data
|
data
[
:can_bulk_update
]
=
(
can?
(
current_user
,
:admin_issue
,
group
)
&&
group
.
feature_available?
(
:group_bulk_edit
)).
to_s
if
group
.
feature_available?
(
:epics
)
data
[
:group_epics_path
]
=
group_epics_path
(
group
,
format: :json
)
end
data
end
end
end
end
ee/spec/helpers/ee/issues_helper_spec.rb
View file @
d7ec3b79
...
...
@@ -124,7 +124,7 @@ RSpec.describe EE::IssuesHelper do
end
end
describe
'#issues_list_data'
do
describe
'#
project_
issues_list_data'
do
let
(
:current_user
)
{
double
.
as_null_object
}
let
(
:finder
)
{
double
.
as_null_object
}
...
...
@@ -150,14 +150,14 @@ RSpec.describe EE::IssuesHelper do
group_epics_path:
group_epics_path
(
project
.
group
,
format: :json
)
}
expect
(
helper
.
issues_list_data
(
project
,
current_user
,
finder
)).
to
include
(
expected
)
expect
(
helper
.
project_
issues_list_data
(
project
,
current_user
,
finder
)).
to
include
(
expected
)
end
context
'when project does not have group'
do
let
(
:project_with_no_group
)
{
create
:project
}
it
'does not return group_epics_path'
do
expect
(
helper
.
issues_list_data
(
project_with_no_group
,
current_user
,
finder
)).
not_to
include
(
:group_epics_path
)
expect
(
helper
.
project_
issues_list_data
(
project_with_no_group
,
current_user
,
finder
)).
not_to
include
(
:group_epics_path
)
end
end
end
...
...
@@ -176,7 +176,7 @@ RSpec.describe EE::IssuesHelper do
has_multiple_issue_assignees_feature:
'false'
}
result
=
helper
.
issues_list_data
(
project
,
current_user
,
finder
)
result
=
helper
.
project_
issues_list_data
(
project
,
current_user
,
finder
)
expect
(
result
).
to
include
(
expected
)
expect
(
result
).
not_to
include
(
:group_epics_path
)
...
...
spec/helpers/issues_helper_spec.rb
View file @
d7ec3b79
...
...
@@ -332,11 +332,11 @@ RSpec.describe IssuesHelper do
sign_in_path:
new_user_session_path
}
expect
(
helper
.
issues_list_data
(
project
,
current_user
,
finder
)).
to
include
(
expected
)
expect
(
helper
.
project_
issues_list_data
(
project
,
current_user
,
finder
)).
to
include
(
expected
)
end
end
describe
'#issues_list_data'
do
describe
'#
project_
issues_list_data'
do
context
'when user is signed in'
do
it_behaves_like
'issues list data'
do
let
(
:current_user
)
{
double
.
as_null_object
}
...
...
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