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
633eb928
Commit
633eb928
authored
Dec 08, 2021
by
Sheldon Led
Committed by
Kushal Pandya
Dec 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pipelines usage_quotas pagination
parent
c1f3d5e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
ee/app/assets/javascripts/pages/groups/usage_quotas/index.js
ee/app/assets/javascripts/pages/groups/usage_quotas/index.js
+26
-0
No files found.
ee/app/assets/javascripts/pages/groups/usage_quotas/index.js
View file @
633eb928
import
$
from
'
jquery
'
;
import
SeatUsageApp
from
'
ee/seat_usage
'
;
import
initNamespaceStorage
from
'
ee/usage_quotas/storage/init_namespace_storage
'
;
import
LinkedTabs
from
'
~/lib/utils/bootstrap_linked_tabs
'
;
...
...
@@ -24,5 +25,30 @@ const initVueApps = () => {
}
};
/**
* This adds the current URL hash to the pagingation links so that the page
* opens in the correct tab. This happens because rails pagination doesn't add
* URL hash, and it does a full page load, and then LinkedTabs looses track
* of the opened page. Once we move pipelines to Vue, we won't need this hotfix.
*
* To be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/345373
*/
const
fixPipelinesPagination
=
()
=>
{
const
pipelinesQuotaTabLink
=
document
.
querySelector
(
'
#pipelines-quota
'
);
const
pipelinesQuotaTab
=
document
.
querySelector
(
'
#pipelines-quota-tab
'
);
$
(
document
).
on
(
'
shown.bs.tab
'
,
(
event
)
=>
{
if
(
event
.
target
.
id
===
pipelinesQuotaTabLink
.
id
)
{
const
pageLinks
=
pipelinesQuotaTab
.
querySelectorAll
(
'
.page-link
'
);
Array
.
from
(
pageLinks
).
forEach
((
pageLink
)
=>
{
// eslint-disable-next-line no-param-reassign
pageLink
.
href
=
pageLink
.
href
.
split
(
'
#
'
)[
0
].
concat
(
window
.
location
.
hash
);
});
}
});
};
fixPipelinesPagination
();
initVueApps
();
initLinkedTabs
();
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