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
fd90ea14
Commit
fd90ea14
authored
Mar 03, 2021
by
Minh Nguyen
Committed by
Phil Hughes
Mar 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show nested environments when change tab, page
parent
5ba19ff5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
4 deletions
+29
-4
app/assets/javascripts/environments/mixins/environments_pagination_api_mixin.js
.../environments/mixins/environments_pagination_api_mixin.js
+2
-0
changelogs/unreleased/show-nested-env.yml
changelogs/unreleased/show-nested-env.yml
+5
-0
spec/frontend/environments/environments_app_spec.js
spec/frontend/environments/environments_app_spec.js
+10
-2
spec/frontend/environments/folder/environments_folder_view_spec.js
...tend/environments/folder/environments_folder_view_spec.js
+12
-2
No files found.
app/assets/javascripts/environments/mixins/environments_pagination_api_mixin.js
View file @
fd90ea14
...
@@ -16,6 +16,7 @@ export default {
...
@@ -16,6 +16,7 @@ export default {
let
params
=
{
let
params
=
{
scope
,
scope
,
page
:
'
1
'
,
page
:
'
1
'
,
nested
:
true
,
};
};
params
=
this
.
onChangeWithFilter
(
params
);
params
=
this
.
onChangeWithFilter
(
params
);
...
@@ -27,6 +28,7 @@ export default {
...
@@ -27,6 +28,7 @@ export default {
/* URLS parameters are strings, we need to parse to match types */
/* URLS parameters are strings, we need to parse to match types */
let
params
=
{
let
params
=
{
page
:
Number
(
page
).
toString
(),
page
:
Number
(
page
).
toString
(),
nested
:
true
,
};
};
if
(
this
.
scope
)
{
if
(
this
.
scope
)
{
...
...
changelogs/unreleased/show-nested-env.yml
0 → 100644
View file @
fd90ea14
---
title
:
Show nested environments when change tab, page
merge_request
:
55167
author
:
type
:
changed
spec/frontend/environments/environments_app_spec.js
View file @
fd90ea14
...
@@ -97,13 +97,21 @@ describe('Environment', () => {
...
@@ -97,13 +97,21 @@ describe('Environment', () => {
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
wrapper
.
find
(
'
.gl-pagination li:nth-child(3) .page-link
'
).
trigger
(
'
click
'
);
wrapper
.
find
(
'
.gl-pagination li:nth-child(3) .page-link
'
).
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
'
available
'
,
page
:
'
2
'
});
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
'
available
'
,
page
:
'
2
'
,
nested
:
true
,
});
});
});
it
(
'
should make an API request when using tabs
'
,
()
=>
{
it
(
'
should make an API request when using tabs
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
findEnvironmentsTabStopped
().
trigger
(
'
click
'
);
findEnvironmentsTabStopped
().
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
'
stopped
'
,
page
:
'
1
'
});
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
'
stopped
'
,
page
:
'
1
'
,
nested
:
true
,
});
});
});
it
(
'
should not make the same API request when clicking on the current scope tab
'
,
()
=>
{
it
(
'
should not make the same API request when clicking on the current scope tab
'
,
()
=>
{
...
...
spec/frontend/environments/folder/environments_folder_view_spec.js
View file @
fd90ea14
...
@@ -103,13 +103,18 @@ describe('Environments Folder View', () => {
...
@@ -103,13 +103,18 @@ describe('Environments Folder View', () => {
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
wrapper
.
vm
.
scope
,
scope
:
wrapper
.
vm
.
scope
,
page
:
'
10
'
,
page
:
'
10
'
,
nested
:
true
,
});
});
});
});
it
(
'
should make an API request when using tabs
'
,
()
=>
{
it
(
'
should make an API request when using tabs
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
findEnvironmentsTabStopped
().
trigger
(
'
click
'
);
findEnvironmentsTabStopped
().
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
'
stopped
'
,
page
:
'
1
'
});
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
'
stopped
'
,
page
:
'
1
'
,
nested
:
true
,
});
});
});
});
});
});
});
...
@@ -161,7 +166,11 @@ describe('Environments Folder View', () => {
...
@@ -161,7 +166,11 @@ describe('Environments Folder View', () => {
it
(
'
should set page to 1
'
,
()
=>
{
it
(
'
should set page to 1
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
wrapper
.
vm
.
onChangeTab
(
'
stopped
'
);
wrapper
.
vm
.
onChangeTab
(
'
stopped
'
);
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
'
stopped
'
,
page
:
'
1
'
});
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
'
stopped
'
,
page
:
'
1
'
,
nested
:
true
,
});
});
});
});
});
...
@@ -172,6 +181,7 @@ describe('Environments Folder View', () => {
...
@@ -172,6 +181,7 @@ describe('Environments Folder View', () => {
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
expect
(
wrapper
.
vm
.
updateContent
).
toHaveBeenCalledWith
({
scope
:
wrapper
.
vm
.
scope
,
scope
:
wrapper
.
vm
.
scope
,
page
:
'
4
'
,
page
:
'
4
'
,
nested
:
true
,
});
});
});
});
});
});
...
...
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