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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
fa188469
Commit
fa188469
authored
May 20, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a few nice to have and updated changelog
parent
56b2f5e0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
3 deletions
+30
-3
CHANGELOG
CHANGELOG
+1
-0
app/helpers/todos_helper.rb
app/helpers/todos_helper.rb
+8
-2
app/models/project.rb
app/models/project.rb
+2
-0
app/models/todo.rb
app/models/todo.rb
+5
-0
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+1
-1
lib/gitlab/import_export/import_service.rb
lib/gitlab/import_export/import_service.rb
+13
-0
No files found.
CHANGELOG
View file @
fa188469
...
...
@@ -33,6 +33,7 @@ v 8.8.0 (unreleased)
- Fix Gravatar hint in user profile when Gravatar is disabled. !3988 (Artem Sidorenko)
- Expire repository exists? and has_visible_content? caches after a push if necessary
- Fix unintentional filtering bug in issues sorted by milestone due (Takuya Noguchi)
- GitLab project import and export functionality
v 8.7.4
- Fix always showing build notification message when switching between merge requests
...
...
app/helpers/todos_helper.rb
View file @
fa188469
...
...
@@ -9,8 +9,12 @@ module TodosHelper
def
todo_action_name
(
todo
)
case
todo
.
action
when
Todo
::
ASSIGNED
then
'assigned you'
when
Todo
::
MENTIONED
then
'mentioned you on'
when
Todo
::
ASSIGNED
then
'assigned you'
when
Todo
::
MENTIONED
then
'mentioned you on'
when
Todo
::
IMPORTED
then
'imported successfully'
end
end
...
...
@@ -27,6 +31,8 @@ module TodosHelper
if
todo
.
for_commit?
namespace_project_commit_path
(
todo
.
project
.
namespace
.
becomes
(
Namespace
),
todo
.
project
,
todo
.
target
,
anchor:
anchor
)
elsif
todo
.
for_project?
namespace_project_path
(
todo
.
project
.
namespace
,
todo
.
project
)
else
polymorphic_path
([
todo
.
project
.
namespace
.
becomes
(
Namespace
),
todo
.
project
,
todo
.
target
],
anchor:
anchor
)
...
...
app/models/project.rb
View file @
fa188469
...
...
@@ -94,6 +94,8 @@ class Project < ActiveRecord::Base
attr_accessor
:new_default_branch
attr_accessor
:old_path_with_namespace
alias_attribute
:title
,
:name
# Relations
belongs_to
:creator
,
foreign_key:
'creator_id'
,
class_name:
'User'
belongs_to
:group
,
->
{
where
(
type:
Group
)
},
foreign_key:
'namespace_id'
...
...
app/models/todo.rb
View file @
fa188469
...
...
@@ -19,6 +19,7 @@
class
Todo
<
ActiveRecord
::
Base
ASSIGNED
=
1
MENTIONED
=
2
IMPORTED
=
3
belongs_to
:author
,
class_name:
"User"
belongs_to
:note
...
...
@@ -58,6 +59,10 @@ class Todo < ActiveRecord::Base
target_type
==
"Commit"
end
def
for_project?
target_type
==
"Project"
end
# override to return commits, which are not active record
def
target
if
for_commit?
...
...
app/views/projects/edit.html.haml
View file @
fa188469
...
...
@@ -144,7 +144,7 @@
=
link_to
'Generate new export'
,
export_namespace_project_path
(
@project
.
namespace
,
@project
),
method: :post
,
class:
"btn btn-default"
=
link_to
'Download export'
,
download_export_namespace_project_path
(
@project
.
namespace
,
@project
),
=
link_to
'Download
latest
export'
,
download_export_namespace_project_path
(
@project
.
namespace
,
@project
),
method: :post
,
class:
"btn btn-default"
...
...
lib/gitlab/import_export/import_service.rb
View file @
fa188469
...
...
@@ -17,6 +17,7 @@ module Gitlab
Gitlab
::
ImportExport
::
Importer
.
import
(
archive_file:
@archive_file
,
shared:
@shared
)
if
[
restore_version
,
restore_project_tree
,
restore_repo
,
restore_wiki_repo
,
restore_uploads
].
all?
Todo
.
create
(
attributes_for_todo
)
project_tree
.
project
else
project_tree
.
project
.
destroy
if
project_tree
.
project
...
...
@@ -67,6 +68,18 @@ module Gitlab
def
wiki_repo_path
File
.
join
(
@shared
.
export_path
,
'project.wiki.bundle'
)
end
def
attributes_for_todo
{
user_id:
@current_user
.
id
,
project_id:
project_tree
.
project
.
id
,
target_type:
'Project'
,
target:
project_tree
.
project
,
action:
Todo
::
IMPORTED
,
author_id:
@current_user
.
id
,
state: :pending
,
target_id:
project_tree
.
project
.
id
}
end
end
end
end
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