Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
knowledgebase-front
Manage
Activity
Members
Labels
Plan
Issues
19
Issue boards
Milestones
Wiki
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Applications
Knowledge Base
knowledgebase-front
Commits
6bf143fd
Commit
6bf143fd
authored
4 years ago
by
Maxime
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: uncomment url block in js
#269
parent
89717aac
No related branches found
Branches containing commit
No related tags found
1 merge request
!265
Q-a fixes - batch 1
Pipeline
#9523
failed with stage
in 1 hour
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scripts/dispatch-space-n-user.js
+20
-20
20 additions, 20 deletions
src/scripts/dispatch-space-n-user.js
with
20 additions
and
20 deletions
src/scripts/dispatch-space-n-user.js
+
20
−
20
View file @
6bf143fd
...
...
@@ -74,27 +74,27 @@ class CoopStarterLoginComponent extends HTMLElement {
}
}
}
//If the url asked pointed to a resource
/*
if (window.location.href.indexOf('resource-detail') > -1) {
var newUrl = window.location.href.replace(/\/([a-z]+)-dashboard\/([a-z]+)-resource-detail/, `/${userPrefix}-dashboard/${userPrefix}-resource-detail`)
//If the url asked pointed to a resource
if
(
window
.
location
.
href
.
indexOf
(
'
resource-detail
'
)
>
-
1
)
{
var
newUrl
=
window
.
location
.
href
.
replace
(
/
\/([
a-z
]
+
)
-dashboard
\/([
a-z
]
+
)
-resource-detail/
,
`/
${
userPrefix
}
-dashboard/
${
userPrefix
}
-resource-detail`
)
// If the url is different after the treatment, we reload with the good url
if (newUrl !== window.location.href) {
var newRoute = new URL(newUrl).pathname.replace(/^\/([a-z]{2})\//, "");
window.dispatchEvent(
new CustomEvent('requestNavigation', {
detail: {
route: newRoute.split(/\/(.*?)\//)[1],
resource: { "@id": this.decodeId(newRoute.split(/@(.+)/)[1]) }
}
})
);
window.location.href = newUrl;
// loader.toggleAttribute('hidden', true);
} else {
loader.toggleAttribute('hidden', true);
}
} else {
*/
// If the url is different after the treatment, we reload with the good url
if
(
newUrl
!==
window
.
location
.
href
)
{
var
newRoute
=
new
URL
(
newUrl
).
pathname
.
replace
(
/^
\/([
a-z
]{2})\/
/
,
""
);
window
.
dispatchEvent
(
new
CustomEvent
(
'
requestNavigation
'
,
{
detail
:
{
route
:
newRoute
.
split
(
/
\/(
.*
?)\/
/
)[
1
],
resource
:
{
"
@id
"
:
this
.
decodeId
(
newRoute
.
split
(
/@
(
.+
)
/
)[
1
])
}
}
})
);
window
.
location
.
href
=
newUrl
;
// loader.toggleAttribute('hidden', true);
}
else
{
loader
.
toggleAttribute
(
'
hidden
'
,
true
);
}
}
else
{
// User is a contributor
if
(
userPrefix
===
"
contributor
"
)
{
loader
.
toggleAttribute
(
'
hidden
'
,
true
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment