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
a8789708
Commit
a8789708
authored
Aug 25, 2021
by
Natalia Tepluhina
Committed by
Natalia Tepluhina
Sep 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'remove-dashboard-split-button-project-select-low-usage' into 'master'"
This reverts merge request !68276
parent
9287b27a
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
153 additions
and
0 deletions
+153
-0
app/assets/javascripts/pages/admin/application_settings/index.js
...ets/javascripts/pages/admin/application_settings/index.js
+2
-0
app/assets/javascripts/pages/dashboard/issues/index.js
app/assets/javascripts/pages/dashboard/issues/index.js
+2
-0
app/assets/javascripts/pages/dashboard/merge_requests/index.js
...ssets/javascripts/pages/dashboard/merge_requests/index.js
+3
-0
app/assets/javascripts/pages/dashboard/milestones/index/index.js
...ets/javascripts/pages/dashboard/milestones/index/index.js
+3
-0
app/assets/javascripts/pages/groups/issues/index.js
app/assets/javascripts/pages/groups/issues/index.js
+2
-0
app/assets/javascripts/pages/groups/merge_requests/index.js
app/assets/javascripts/pages/groups/merge_requests/index.js
+2
-0
app/views/dashboard/issues.html.haml
app/views/dashboard/issues.html.haml
+4
-0
app/views/dashboard/merge_requests.html.haml
app/views/dashboard/merge_requests.html.haml
+4
-0
app/views/dashboard/milestones/index.html.haml
app/views/dashboard/milestones/index.html.haml
+6
-0
app/views/groups/issues.html.haml
app/views/groups/issues.html.haml
+2
-0
app/views/groups/merge_requests.html.haml
app/views/groups/merge_requests.html.haml
+2
-0
spec/features/dashboard/issues_spec.rb
spec/features/dashboard/issues_spec.rb
+34
-0
spec/features/dashboard/merge_requests_spec.rb
spec/features/dashboard/merge_requests_spec.rb
+18
-0
spec/features/dashboard/milestones_spec.rb
spec/features/dashboard/milestones_spec.rb
+14
-0
spec/features/groups/empty_states_spec.rb
spec/features/groups/empty_states_spec.rb
+14
-0
spec/features/groups/issues_spec.rb
spec/features/groups/issues_spec.rb
+22
-0
spec/features/groups/merge_requests_spec.rb
spec/features/groups/merge_requests_spec.rb
+19
-0
No files found.
app/assets/javascripts/pages/admin/application_settings/index.js
View file @
a8789708
import
initVariableList
from
'
~/ci_variable_list
'
;
import
projectSelect
from
'
~/project_select
'
;
import
initSearchSettings
from
'
~/search_settings
'
;
import
selfMonitor
from
'
~/self_monitor
'
;
import
initSettingsPanels
from
'
~/settings_panels
'
;
...
...
@@ -7,4 +8,5 @@ initVariableList('js-instance-variables');
selfMonitor
();
// Initialize expandable settings panels
initSettingsPanels
();
projectSelect
();
initSearchSettings
();
app/assets/javascripts/pages/dashboard/issues/index.js
View file @
a8789708
...
...
@@ -2,6 +2,7 @@ import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered
import
initManualOrdering
from
'
~/manual_ordering
'
;
import
{
FILTERED_SEARCH
}
from
'
~/pages/constants
'
;
import
initFilteredSearch
from
'
~/pages/search/init_filtered_search
'
;
import
projectSelect
from
'
~/project_select
'
;
initFilteredSearch
({
page
:
FILTERED_SEARCH
.
ISSUES
,
...
...
@@ -9,4 +10,5 @@ initFilteredSearch({
useDefaultState
:
true
,
});
projectSelect
();
initManualOrdering
();
app/assets/javascripts/pages/dashboard/merge_requests/index.js
View file @
a8789708
...
...
@@ -2,6 +2,7 @@ import addExtraTokensForMergeRequests from 'ee_else_ce/filtered_search/add_extra
import
IssuableFilteredSearchTokenKeys
from
'
~/filtered_search/issuable_filtered_search_token_keys
'
;
import
{
FILTERED_SEARCH
}
from
'
~/pages/constants
'
;
import
initFilteredSearch
from
'
~/pages/search/init_filtered_search
'
;
import
projectSelect
from
'
~/project_select
'
;
addExtraTokensForMergeRequests
(
IssuableFilteredSearchTokenKeys
,
true
);
...
...
@@ -10,3 +11,5 @@ initFilteredSearch({
filteredSearchTokenKeys
:
IssuableFilteredSearchTokenKeys
,
useDefaultState
:
true
,
});
projectSelect
();
app/assets/javascripts/pages/dashboard/milestones/index/index.js
0 → 100644
View file @
a8789708
import
projectSelect
from
'
~/project_select
'
;
projectSelect
();
app/assets/javascripts/pages/groups/issues/index.js
View file @
a8789708
...
...
@@ -4,6 +4,7 @@ import { mountIssuablesListApp } from '~/issues_list';
import
initManualOrdering
from
'
~/manual_ordering
'
;
import
{
FILTERED_SEARCH
}
from
'
~/pages/constants
'
;
import
initFilteredSearch
from
'
~/pages/search/init_filtered_search
'
;
import
projectSelect
from
'
~/project_select
'
;
const
ISSUE_BULK_UPDATE_PREFIX
=
'
issue_
'
;
...
...
@@ -17,6 +18,7 @@ initFilteredSearch({
useDefaultState
:
true
,
filteredSearchTokenKeys
:
IssuableFilteredSearchTokenKeys
,
});
projectSelect
();
initManualOrdering
();
if
(
gon
.
features
?.
vueIssuablesList
)
{
...
...
app/assets/javascripts/pages/groups/merge_requests/index.js
View file @
a8789708
...
...
@@ -3,6 +3,7 @@ import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered
import
issuableInitBulkUpdateSidebar
from
'
~/issuable_bulk_update_sidebar/issuable_init_bulk_update_sidebar
'
;
import
{
FILTERED_SEARCH
}
from
'
~/pages/constants
'
;
import
initFilteredSearch
from
'
~/pages/search/init_filtered_search
'
;
import
projectSelect
from
'
~/project_select
'
;
const
ISSUABLE_BULK_UPDATE_PREFIX
=
'
merge_request_
'
;
...
...
@@ -15,3 +16,4 @@ initFilteredSearch({
useDefaultState
:
true
,
filteredSearchTokenKeys
:
IssuableFilteredSearchTokenKeys
,
});
projectSelect
();
app/views/dashboard/issues.html.haml
View file @
a8789708
...
...
@@ -9,6 +9,10 @@
.page-title-holder.d-flex.align-items-center
%h1
.page-title
=
_
(
'Issues'
)
-
if
current_user
.page-title-controls
=
render
'shared/new_project_item_select'
,
path:
'issues/new'
,
label:
"New issue"
,
with_feature_enabled:
'issues'
,
type: :issues
.top-area
=
render
'shared/issuable/nav'
,
type: :issues
,
display_count:
!
@no_filters_set
.nav-controls
...
...
app/views/dashboard/merge_requests.html.haml
View file @
a8789708
...
...
@@ -7,6 +7,10 @@
.page-title-holder.d-flex.align-items-start.flex-column.flex-sm-row.align-items-sm-center
%h1
.page-title
=
_
(
'Merge requests'
)
-
if
current_user
.page-title-controls.ml-0.mb-3.ml-sm-auto.mb-sm-0
=
render
'shared/new_project_item_select'
,
path:
'merge_requests/new'
,
label:
"New merge request"
,
with_feature_enabled:
'merge_requests'
,
type: :merge_requests
.top-area
=
render
'shared/issuable/nav'
,
type: :merge_requests
,
display_count:
!
@no_filters_set
...
...
app/views/dashboard/milestones/index.html.haml
View file @
a8789708
...
...
@@ -6,6 +6,12 @@
.page-title-holder.d-flex.align-items-center
%h1
.page-title
=
_
(
'Milestones'
)
-
if
current_user
.page-title-controls
=
render
'shared/new_project_item_select'
,
path:
'-/milestones/new'
,
label:
'New milestone'
,
include_groups:
true
,
type: :milestones
.top-area
=
render
'shared/milestones_filter'
,
counts:
@milestone_states
.nav-controls
...
...
app/views/groups/issues.html.haml
View file @
a8789708
...
...
@@ -13,6 +13,8 @@
-
if
@can_bulk_update
=
render_if_exists
'shared/issuable/bulk_update_button'
,
type: :issues
=
render
'shared/new_project_item_select'
,
path:
'issues/new'
,
label:
"New issue"
,
type: :issues
,
with_feature_enabled:
'issues'
,
with_shared:
false
,
include_projects_in_subgroups:
true
=
render
'shared/issuable/search_bar'
,
type: :issues
-
if
@can_bulk_update
...
...
app/views/groups/merge_requests.html.haml
View file @
a8789708
...
...
@@ -12,6 +12,8 @@
-
if
@can_bulk_update
=
render_if_exists
'shared/issuable/bulk_update_button'
,
type: :merge_requests
=
render
'shared/new_project_item_select'
,
path:
'merge_requests/new'
,
label:
"New merge request"
,
type: :merge_requests
,
with_feature_enabled:
'merge_requests'
,
with_shared:
false
,
include_projects_in_subgroups:
true
=
render
'shared/issuable/search_bar'
,
type: :merge_requests
-
if
@can_bulk_update
...
...
spec/features/dashboard/issues_spec.rb
View file @
a8789708
...
...
@@ -46,4 +46,38 @@ RSpec.describe 'Dashboard Issues' do
it_behaves_like
"it has an RSS button with current_user's feed token"
it_behaves_like
"an autodiscoverable RSS feed with current_user's feed token"
end
describe
'new issue dropdown'
do
it
'shows projects only with issues feature enabled'
,
:js
do
find
(
'.new-project-item-select-button'
).
click
page
.
within
(
'.select2-results'
)
do
expect
(
page
).
to
have_content
(
project
.
full_name
)
expect
(
page
).
not_to
have_content
(
project_with_issues_disabled
.
full_name
)
end
end
it
'shows the new issue page'
,
:js
do
find
(
'.new-project-item-select-button'
).
click
wait_for_requests
project_path
=
"/
#{
project
.
full_path
}
"
project_json
=
{
name:
project
.
full_name
,
url:
project_path
}.
to_json
# simulate selection, and prevent overlap by dropdown menu
first
(
'.project-item-select'
,
visible:
false
)
execute_script
(
"$('.project-item-select').val('
#{
project_json
}
').trigger('change');"
)
find
(
'#select2-drop-mask'
,
visible:
false
)
execute_script
(
"$('#select2-drop-mask').remove();"
)
find
(
'.new-project-item-link'
).
click
expect
(
page
).
to
have_current_path
(
"
#{
project_path
}
/-/issues/new"
)
page
.
within
(
'#content-body'
)
do
expect
(
page
).
to
have_selector
(
'.issue-form'
)
end
end
end
end
spec/features/dashboard/merge_requests_spec.rb
View file @
a8789708
...
...
@@ -25,6 +25,24 @@ RSpec.describe 'Dashboard Merge Requests' do
expect
(
page
).
not_to
have_selector
(
'#js-dropdown-target-branch'
,
visible:
false
)
end
context
'new merge request dropdown'
do
let
(
:project_with_disabled_merge_requests
)
{
create
(
:project
,
:merge_requests_disabled
)
}
before
do
project_with_disabled_merge_requests
.
add_maintainer
(
current_user
)
visit
merge_requests_dashboard_path
end
it
'shows projects only with merge requests feature enabled'
,
:js
do
find
(
'.new-project-item-select-button'
).
click
page
.
within
(
'.select2-results'
)
do
expect
(
page
).
to
have_content
(
project
.
full_name
)
expect
(
page
).
not_to
have_content
(
project_with_disabled_merge_requests
.
full_name
)
end
end
end
context
'no merge requests exist'
do
it
'shows an empty state'
do
visit
merge_requests_dashboard_path
(
assignee_username:
current_user
.
username
)
...
...
spec/features/dashboard/milestones_spec.rb
View file @
a8789708
...
...
@@ -32,6 +32,20 @@ RSpec.describe 'Dashboard > Milestones' do
expect
(
page
).
to
have_content
(
group
.
name
)
expect
(
first
(
'.milestone'
)).
to
have_content
(
'Merge requests'
)
end
describe
'new milestones dropdown'
,
:js
do
it
'takes user to a new milestone page'
,
:js
do
find
(
'.new-project-item-select-button'
).
click
page
.
within
(
'.select2-results'
)
do
first
(
'.select2-result-label'
).
click
end
find
(
'.new-project-item-link'
).
click
expect
(
current_path
).
to
eq
(
new_group_milestone_path
(
group
))
end
end
end
describe
'with merge requests disabled'
do
...
...
spec/features/groups/empty_states_spec.rb
View file @
a8789708
...
...
@@ -92,6 +92,20 @@ RSpec.describe 'Group empty states' do
it
'displays an empty state'
do
expect
(
page
).
to
have_selector
(
'.empty-state'
)
end
it
"shows a new
#{
issuable_name
}
button"
do
within
'.empty-state'
do
expect
(
page
).
to
have_content
(
"create
#{
issuable_name
}
"
)
end
end
it
"the new
#{
issuable_name
}
button opens a project dropdown"
do
within
'.empty-state'
do
find
(
'.new-project-item-select-button'
).
click
end
expect
(
page
).
to
have_selector
(
'.ajax-project-dropdown'
)
end
end
end
...
...
spec/features/groups/issues_spec.rb
View file @
a8789708
...
...
@@ -131,6 +131,28 @@ RSpec.describe 'Group issues page' do
end
end
context
'projects with issues disabled'
do
describe
'issue dropdown'
do
let
(
:user_in_group
)
{
create
(
:group_member
,
:maintainer
,
user:
create
(
:user
),
group:
group
).
user
}
before
do
[
project
,
project_with_issues_disabled
].
each
{
|
project
|
project
.
add_maintainer
(
user_in_group
)
}
sign_in
(
user_in_group
)
visit
issues_group_path
(
group
)
end
it
'shows projects only with issues feature enabled'
,
:js
do
find
(
'.empty-state .js-lazy-loaded'
)
find
(
'.empty-state .new-project-item-link'
).
click
page
.
within
(
'.select2-results'
)
do
expect
(
page
).
to
have_content
(
project
.
full_name
)
expect
(
page
).
not_to
have_content
(
project_with_issues_disabled
.
full_name
)
end
end
end
end
context
'manual ordering'
,
:js
do
let
(
:user_in_group
)
{
create
(
:group_member
,
:maintainer
,
user:
create
(
:user
),
group:
group
).
user
}
...
...
spec/features/groups/merge_requests_spec.rb
View file @
a8789708
...
...
@@ -59,6 +59,23 @@ RSpec.describe 'Group merge requests page' do
end
end
describe
'new merge request dropdown'
do
let
(
:project_with_merge_requests_disabled
)
{
create
(
:project
,
:merge_requests_disabled
,
group:
group
)
}
before
do
visit
path
end
it
'shows projects only with merge requests feature enabled'
,
:js
do
find
(
'.new-project-item-link'
).
click
page
.
within
(
'.select2-results'
)
do
expect
(
page
).
to
have_content
(
project
.
name_with_namespace
)
expect
(
page
).
not_to
have_content
(
project_with_merge_requests_disabled
.
name_with_namespace
)
end
end
end
context
'empty state with no merge requests'
do
before
do
MergeRequest
.
delete_all
...
...
@@ -68,6 +85,7 @@ RSpec.describe 'Group merge requests page' do
visit
path
expect
(
page
).
to
have_selector
(
'.empty-state'
)
expect
(
page
).
to
have_link
(
'Select project to create merge request'
)
expect
(
page
).
not_to
have_selector
(
'.issues-filters'
)
end
...
...
@@ -77,6 +95,7 @@ RSpec.describe 'Group merge requests page' do
visit
path
expect
(
page
).
to
have_selector
(
'.empty-state'
)
expect
(
page
).
to
have_link
(
'Select project to create merge request'
)
expect
(
page
).
to
have_selector
(
'.issues-filters'
)
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