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
937b8d03
Commit
937b8d03
authored
Nov 29, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔨
More refactor into Geo Clone UI code
parent
babcc5d5
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
33 deletions
+21
-33
app/assets/javascripts/geo_clone_dialog.js.es6
app/assets/javascripts/geo_clone_dialog.js.es6
+3
-3
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+1
-1
app/helpers/ee_gitlab_routing_helper.rb
app/helpers/ee_gitlab_routing_helper.rb
+16
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+0
-7
app/models/ee/project.rb
app/models/ee/project.rb
+0
-19
app/models/project.rb
app/models/project.rb
+0
-1
changelogs/unreleased-ee/789-geo-clone-ui.yml
changelogs/unreleased-ee/789-geo-clone-ui.yml
+1
-2
No files found.
app/assets/javascripts/geo_clone_dialog.js.es6
View file @
937b8d03
//= require vue
//= require vue
/* global modal */
/* global modal
Vue
*/
(() => {
(() => {
Vue.component('geo-clone-dialog', {
Vue.component('geo-clone-dialog', {
name: 'geo-clone-dialog',
name: 'geo-clone-dialog',
...
@@ -28,11 +28,11 @@
...
@@ -28,11 +28,11 @@
<h3>{{title}}</h3>
<h3>{{title}}</h3>
</div>
</div>
<div class="modal-body">
<div class="modal-body">
<p><strong>Step1.</strong> Clone the repository from your secondary node:</p>
<p><strong>Step
1.</strong> Clone the repository from your secondary node:</p>
<slot name="clipboard-1"></slot>
<slot name="clipboard-1"></slot>
<pre class="dark" id="geo-info-1">git clone {{cloneUrlSecondary}}</pre>
<pre class="dark" id="geo-info-1">git clone {{cloneUrlSecondary}}</pre>
<p><strong>Step
2.</strong> Go to the new directory and define <strong>primary's node
</strong> repository URL as the <strong>push</strong> remote:</p>
<p><strong>Step
2.</strong> Go to the new directory and define <strong>primary node's
</strong> repository URL as the <strong>push</strong> remote:</p>
<slot name="clipboard-2"></slot>
<slot name="clipboard-2"></slot>
<pre class="dark" id="geo-info-2">git remote set-url --push origin {{cloneUrlPrimary | emptyRepo}}</pre>
<pre class="dark" id="geo-info-2">git remote set-url --push origin {{cloneUrlPrimary | emptyRepo}}</pre>
<p><strong>Done.</strong> You can now commit and push code as you normally do, but with increased speed.</p>
<p><strong>Done.</strong> You can now commit and push code as you normally do, but with increased speed.</p>
...
...
app/helpers/button_helper.rb
View file @
937b8d03
...
@@ -40,7 +40,7 @@ module ButtonHelper
...
@@ -40,7 +40,7 @@ module ButtonHelper
placement:
placement
,
placement:
placement
,
container:
'body'
,
container:
'body'
,
title:
"Set a password on your account<br>to pull or push via
#{
protocol
}
"
,
title:
"Set a password on your account<br>to pull or push via
#{
protocol
}
"
,
primary_url:
(
project
.
geo_primary_http_url_to_repo
if
Gitlab
::
Geo
.
secondary?
)
primary_url:
(
geo_primary_http_url_to_repo
(
project
)
if
Gitlab
::
Geo
.
secondary?
)
}
}
end
end
...
...
app/helpers/ee_gitlab_routing_helper.rb
0 → 100644
View file @
937b8d03
module
EeGitlabRoutingHelper
def
geo_primary_web_url
(
project
)
File
.
join
(
::
Gitlab
::
Geo
.
primary_node
.
url
,
::
Gitlab
::
Routing
.
url_helpers
.
namespace_project_path
(
project
.
namespace
,
project
))
end
def
geo_primary_http_url_to_repo
(
project
)
"
#{
geo_primary_web_url
(
project
)
}
.git"
end
def
geo_primary_default_url_to_repo
(
project
)
case
default_clone_protocol
when
'http'
geo_primary_http_url_to_repo
(
project
)
end
end
end
app/helpers/projects_helper.rb
View file @
937b8d03
...
@@ -265,13 +265,6 @@ module ProjectsHelper
...
@@ -265,13 +265,6 @@ module ProjectsHelper
"
#{
number_to_human_size
(
size_in_bytes
,
delimiter:
','
,
precision:
2
)
}#{
limit_text
}
"
"
#{
number_to_human_size
(
size_in_bytes
,
delimiter:
','
,
precision:
2
)
}#{
limit_text
}
"
end
end
def
geo_primary_default_url_to_repo
(
project
=
@project
)
case
default_clone_protocol
when
'http'
project
.
geo_primary_http_url_to_repo
end
end
def
default_url_to_repo
(
project
=
@project
)
def
default_url_to_repo
(
project
=
@project
)
case
default_clone_protocol
case
default_clone_protocol
when
'krb5'
when
'krb5'
...
...
app/models/ee/project.rb
deleted
100644 → 0
View file @
babcc5d5
module
EE
# Project EE mixin
#
# This module is intended to encapsulate EE-specific model logic
# and be included in the `Project` model
module
Project
extend
ActiveSupport
::
Concern
included
do
def
geo_primary_web_url
File
.
join
(
::
Gitlab
::
Geo
.
primary_node
.
url
,
::
Gitlab
::
Routing
.
url_helpers
.
namespace_project_path
(
self
.
namespace
,
self
))
end
def
geo_primary_http_url_to_repo
"
#{
geo_primary_web_url
}
.git"
end
end
end
end
app/models/project.rb
View file @
937b8d03
...
@@ -16,7 +16,6 @@ class Project < ActiveRecord::Base
...
@@ -16,7 +16,6 @@ class Project < ActiveRecord::Base
include
ProjectFeaturesCompatibility
include
ProjectFeaturesCompatibility
include
SelectForProjectAuthorization
include
SelectForProjectAuthorization
prepend
EE
::
GeoAwareAvatar
prepend
EE
::
GeoAwareAvatar
include
EE
::
Project
extend
Gitlab
::
ConfigHelper
extend
Gitlab
::
ConfigHelper
...
...
changelogs/unreleased-ee/789-geo-clone-ui.yml
View file @
937b8d03
---
---
title
:
'
Geo:
improve
project
view
UI
to
guide
users
how
to
clone/push
from
Geo
secondary
title
:
'
Geo:
Improve
project
view
UI
to
teach
users
how
to
clone
from
a
secondary
Geo
node
and
push
to
a
primary.'
node'
merge_request
:
789
merge_request
:
789
author
:
Gabriel Mazetto
author
:
Gabriel Mazetto
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