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
64b0ed0c
Commit
64b0ed0c
authored
Sep 27, 2019
by
Jesse Hall
Committed by
Clement Ho
Sep 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #24832, naming a project "shared" will not open the "Shared Projects" tab
parent
3ab72627
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
4 deletions
+20
-4
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+2
-0
app/assets/javascripts/pages/groups/shared/group_details.js
app/assets/javascripts/pages/groups/shared/group_details.js
+3
-4
changelogs/unreleased/53041-groups-named-shared.yml
changelogs/unreleased/53041-groups-named-shared.yml
+5
-0
spec/javascripts/lib/utils/common_utils_spec.js
spec/javascripts/lib/utils/common_utils_spec.js
+10
-0
No files found.
app/assets/javascripts/lib/utils/common_utils.js
View file @
64b0ed0c
...
...
@@ -15,6 +15,8 @@ export const getPagePath = (index = 0) => {
return
page
.
split
(
'
:
'
)[
index
];
};
export
const
getDashPath
=
(
path
=
window
.
location
.
pathname
)
=>
path
.
split
(
'
/-/
'
)[
1
]
||
null
;
export
const
isInGroupsPage
=
()
=>
getPagePath
()
===
'
groups
'
;
export
const
isInProjectPage
=
()
=>
getPagePath
()
===
'
projects
'
;
...
...
app/assets/javascripts/pages/groups/shared/group_details.js
View file @
64b0ed0c
/* eslint-disable no-new */
import
{
getPagePath
}
from
'
~/lib/utils/common_utils
'
;
import
{
getPagePath
,
getDashPath
}
from
'
~/lib/utils/common_utils
'
;
import
{
ACTIVE_TAB_SHARED
,
ACTIVE_TAB_ARCHIVED
}
from
'
~/groups/constants
'
;
import
NewGroupChild
from
'
~/groups/new_group_child
'
;
import
notificationsDropdown
from
'
~/notifications_dropdown
'
;
...
...
@@ -12,9 +12,8 @@ import GroupTabs from './group_tabs';
export
default
function
initGroupDetails
(
actionName
=
'
show
'
)
{
const
newGroupChildWrapper
=
document
.
querySelector
(
'
.js-new-project-subgroup
'
);
const
loadableActions
=
[
ACTIVE_TAB_SHARED
,
ACTIVE_TAB_ARCHIVED
];
const
paths
=
window
.
location
.
pathname
.
split
(
'
/
'
);
const
subpath
=
paths
[
paths
.
length
-
1
];
let
action
=
loadableActions
.
includes
(
subpath
)
?
subpath
:
getPagePath
(
1
);
const
dashPath
=
getDashPath
();
let
action
=
loadableActions
.
includes
(
dashPath
)
?
dashPath
:
getPagePath
(
1
);
if
(
actionName
&&
action
===
actionName
)
{
action
=
'
show
'
;
// 'show' resets GroupTabs to default action through base class
}
...
...
changelogs/unreleased/53041-groups-named-shared.yml
0 → 100644
View file @
64b0ed0c
---
title
:
Naming a project "shared" will no longer automatically open the "Shared Projects" tab.
merge_request
:
16847
author
:
Jesse Hall @jessehall3
type
:
fixed
spec/javascripts/lib/utils/common_utils_spec.js
View file @
64b0ed0c
...
...
@@ -943,4 +943,14 @@ describe('common_utils', () => {
expect
(
commonUtils
.
isScopedLabel
({
title
:
'
foobar
'
})).
toBe
(
false
);
});
});
describe
(
'
getDashPath
'
,
()
=>
{
it
(
'
returns the path following /-/
'
,
()
=>
{
expect
(
commonUtils
.
getDashPath
(
'
/some/-/url-with-dashes-/
'
)).
toEqual
(
'
url-with-dashes-/
'
);
});
it
(
'
returns null when no path follows /-/
'
,
()
=>
{
expect
(
commonUtils
.
getDashPath
(
'
/some/url
'
)).
toEqual
(
null
);
});
});
});
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