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
5d10b7a7
Commit
5d10b7a7
authored
May 28, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
d20473c1
62e74d85
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
6 deletions
+46
-6
app/assets/javascripts/repository/index.js
app/assets/javascripts/repository/index.js
+6
-2
app/assets/javascripts/repository/utils/title.js
app/assets/javascripts/repository/utils/title.js
+7
-0
app/views/projects/_files.html.haml
app/views/projects/_files.html.haml
+1
-1
changelogs/unreleased/fix-import-param-ordering.yml
changelogs/unreleased/fix-import-param-ordering.yml
+5
-0
lib/gitlab/import_export/members_mapper.rb
lib/gitlab/import_export/members_mapper.rb
+1
-1
spec/frontend/repository/utils/title_spec.js
spec/frontend/repository/utils/title_spec.js
+15
-0
spec/lib/gitlab/import_export/members_mapper_spec.rb
spec/lib/gitlab/import_export/members_mapper_spec.rb
+11
-2
No files found.
app/assets/javascripts/repository/index.js
View file @
5d10b7a7
...
...
@@ -2,10 +2,12 @@ import Vue from 'vue';
import
createRouter
from
'
./router
'
;
import
App
from
'
./components/app.vue
'
;
import
apolloProvider
from
'
./graphql
'
;
import
{
setTitle
}
from
'
./utils/title
'
;
export
default
function
setupVueRepositoryList
()
{
const
el
=
document
.
getElementById
(
'
js-tree-list
'
);
const
{
projectPath
,
ref
}
=
el
.
dataset
;
const
{
projectPath
,
ref
,
fullName
}
=
el
.
dataset
;
const
router
=
createRouter
(
projectPath
,
ref
);
apolloProvider
.
clients
.
defaultClient
.
cache
.
writeData
({
data
:
{
...
...
@@ -14,9 +16,11 @@ export default function setupVueRepositoryList() {
},
});
router
.
afterEach
(({
params
:
{
pathMatch
}
})
=>
setTitle
(
pathMatch
,
ref
,
fullName
));
return
new
Vue
({
el
,
router
:
createRouter
(
projectPath
,
ref
)
,
router
,
apolloProvider
,
render
(
h
)
{
return
h
(
App
);
...
...
app/assets/javascripts/repository/utils/title.js
0 → 100644
View file @
5d10b7a7
// eslint-disable-next-line import/prefer-default-export
export
const
setTitle
=
(
pathMatch
,
ref
,
project
)
=>
{
const
path
=
pathMatch
.
replace
(
/^
\/
/
,
''
);
const
isEmpty
=
path
===
''
;
document
.
title
=
`
${
isEmpty
?
'
Files
'
:
path
}
·
${
ref
}
·
${
project
}
`
;
};
app/views/projects/_files.html.haml
View file @
5d10b7a7
...
...
@@ -18,7 +18,7 @@
=
render
'stat_anchor_list'
,
anchors:
@project
.
statistics_buttons
(
show_auto_devops_callout:
show_auto_devops_callout
)
-
if
vue_file_list
#js-tree-list
{
data:
{
project_path:
@project
.
full_path
,
ref:
ref
}
}
#js-tree-list
{
data:
{
project_path:
@project
.
full_path
,
full_name:
@project
.
name_with_namespace
,
ref:
ref
}
}
-
if
@tree
.
readme
=
render
"projects/tree/readme"
,
readme:
@tree
.
readme
-
else
...
...
changelogs/unreleased/fix-import-param-ordering.yml
0 → 100644
View file @
5d10b7a7
---
title
:
Fix order dependency with user params during imports
merge_request
:
28719
author
:
type
:
fixed
lib/gitlab/import_export/members_mapper.rb
View file @
5d10b7a7
...
...
@@ -63,7 +63,7 @@ module Gitlab
'source_id'
=>
@project
.
id
,
'importing'
=>
true
,
'access_level'
=>
[
member
[
'access_level'
],
ProjectMember
::
MAINTAINER
].
min
)
)
.
except
(
'user_id'
)
end
def
parsed_hash
(
member
)
...
...
spec/frontend/repository/utils/title_spec.js
0 → 100644
View file @
5d10b7a7
import
{
setTitle
}
from
'
~/repository/utils/title
'
;
describe
(
'
setTitle
'
,
()
=>
{
it
.
each
`
path | title
${
'
/
'
}
|
${
'
Files
'
}
${
'
app
'
}
|
${
'
app
'
}
${
'
app/assets
'
}
|
${
'
app/assets
'
}
${
'
app/assets/javascripts
'
}
|
${
'
app/assets/javascripts
'
}
`
(
'
sets document title as $title for $path
'
,
({
path
,
title
})
=>
{
setTitle
(
path
,
'
master
'
,
'
GitLab
'
);
expect
(
document
.
title
).
toEqual
(
`
${
title
}
· master · GitLab`
);
});
});
spec/lib/gitlab/import_export/members_mapper_spec.rb
View file @
5d10b7a7
...
...
@@ -12,7 +12,6 @@ describe Gitlab::ImportExport::MembersMapper do
"access_level"
=>
40
,
"source_id"
=>
14
,
"source_type"
=>
"Project"
,
"user_id"
=>
19
,
"notification_level"
=>
3
,
"created_at"
=>
"2016-03-11T10:21:44.822Z"
,
"updated_at"
=>
"2016-03-11T10:21:44.822Z"
,
...
...
@@ -25,7 +24,8 @@ describe Gitlab::ImportExport::MembersMapper do
"id"
=>
exported_user_id
,
"email"
=>
user2
.
email
,
"username"
=>
'test'
}
},
"user_id"
=>
19
},
{
"id"
=>
3
,
...
...
@@ -80,6 +80,15 @@ describe Gitlab::ImportExport::MembersMapper do
expect
(
ProjectMember
.
find_by_user_id
(
user2
.
id
).
access_level
).
to
eq
(
ProjectMember
::
MAINTAINER
)
end
it
'removes old user_id from member_hash to avoid conflict with user key'
do
expect
(
ProjectMember
).
to
receive
(
:create
)
.
twice
.
with
(
hash_excluding
(
'user_id'
))
.
and_call_original
members_mapper
.
map
end
context
'user is not an admin'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
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