Commit 40405714 authored by Mike Greiling's avatar Mike Greiling

remove geo_bundle entirely in favor of a simpler implementation

parent 96cf454d
/* global Vue */
(() => {
window.gl = window.gl || {};
window.gl.geo = window.gl.geo || {};
window.gl.geo.CloneDialog = Vue.extend({
props: ['title', 'id'],
data() {
return this.$parent.$data;
},
mounted() {
$(`#${this.id}`).appendTo('body').modal({ modal: true, show: false });
},
template: `
<div class="modal in" tabindex="-1" :id="id">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<a href="#" data-dismiss="modal" class="close">×</a>
<h3>{{title}}</h3>
</div>
<div class="modal-body">
<p><strong>Step 1.</strong> Clone the repository from your secondary node:</p>
<slot name="clipboard-1"></slot>
<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 node's</strong> repository URL as the <strong>push</strong> remote:</p>
<slot name="clipboard-2"></slot>
<pre class="dark" id="geo-info-2">git remote set-url --push origin {{cloneUrlPrimary || '&lt;clone url for primary repository&gt;'}}</pre>
<p><strong>Done.</strong> You can now commit and push code as you normally do, but with increased speed.</p>
</div>
</div>
</div>
</div>
`,
});
})();
/* global Vue */
window.Vue = require('vue');
require('./components/geo_clone_dialog');
$(document).ready(() => {
window.gl = window.gl || {};
const $geoClone = document.getElementById('geo-clone');
if ($geoClone) {
gl.GeoClone = new Vue({
el: $geoClone,
components: {
'geo-clone-dialog': gl.geo.CloneDialog,
},
data: Object.assign({}, $geoClone.dataset),
});
}
});
- project = project || @project - project = project || @project
- content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('common_vue')
= page_specific_javascript_bundle_tag('vue_geo_ee')
.git-clone-holder.input-group .git-clone-holder.input-group
.input-group-btn .input-group-btn
...@@ -41,10 +38,10 @@ ...@@ -41,10 +38,10 @@
e.preventDefault(); e.preventDefault();
var $this = $(this); var $this = $(this);
if (gl.GeoClone) { $('#modal-geo-info').data({
gl.GeoClone.cloneUrlSecondary = $this.attr('href'); cloneUrlSecondary: $this.attr('href'),
gl.GeoClone.cloneUrlPrimary = $this.data('primaryUrl'); cloneUrlPrimary: $this.data('primaryUrl') || ''
} });
}); });
= render 'shared/geo_info_modal', project: project if Gitlab::Geo.secondary? = render 'shared/geo_info_modal', project: project if Gitlab::Geo.secondary?
#geo-clone{ data: { clone_url_secondary: h(default_url_to_repo(project)), clone_url_primary: h(geo_primary_default_url_to_repo(project)) } } #modal-geo-info.modal.in{ tabindex: '-1', data: { clone_url_secondary: h(default_url_to_repo(project)), clone_url_primary: h(geo_primary_default_url_to_repo(project)) } }
%geo-clone-dialog{ id: 'modal-geo-info', title: 'How to work faster with Geo' } .modal-dialog
%span{ slot: 'clipboard-1' } .modal-content
= clipboard_button(clipboard_target: 'pre#geo-info-1') .modal-header
%span{ slot: 'clipboard-2' } %a.close{ href: '#', data: { dismiss: 'modal' } }
= clipboard_button(clipboard_target: 'pre#geo-info-2') %h3= 'How to work faster with Geo'
.modal-body
%p
%strong= 'Step 1.'
Clone the repository from your secondary node:
= clipboard_button(clipboard_target: 'pre#geo-info-1')
%pre#geo-info-1.dark
git clone
= default_url_to_repo()
%p
%strong= 'Step 2.'
Go to the new directory and define
%strong= "primary node's"
repository URL as the
%strong= 'push'
remote:
= clipboard_button(clipboard_target: 'pre#geo-info-2')
%pre#geo-info-2.dark
git remote set-url --push origin &lt;clone url for primary repository&gt;
%p
%strong= 'Done.'
You can now commit and push code as you normally do, but with increased speed.
:javascript
$('#modal-geo-info')
.appendTo('body')
.modal({ modal: true, show: false })
.on('show.bs.modal', function() {
var data = $(this).data();
$('#geo-info-1').text(
'git clone ' +
(data.cloneUrlSecondary || '<clone url for secondary repository>')
);
$('geo-info-2').text(
'git remote set-url --push origin ' +
(data.cloneUrlPrimary || '<clone url for primary repository>')
);
});
...@@ -41,7 +41,6 @@ var config = { ...@@ -41,7 +41,6 @@ var config = {
snippet: './snippet/snippet_bundle.js', snippet: './snippet/snippet_bundle.js',
terminal: './terminal/terminal_bundle.js', terminal: './terminal/terminal_bundle.js',
users: './users/users_bundle.js', users: './users/users_bundle.js',
vue_geo_ee: './geo/geo_bundle.js',
vue_pipelines: './vue_pipelines_index/index.js', vue_pipelines: './vue_pipelines_index/index.js',
}, },
...@@ -107,7 +106,6 @@ var config = { ...@@ -107,7 +106,6 @@ var config = {
'issuable', 'issuable',
'merge_conflicts', 'merge_conflicts',
'mr_widget_ee', 'mr_widget_ee',
'vue_geo_ee',
'vue_pipelines', 'vue_pipelines',
], ],
minChunks: function(module, count) { minChunks: function(module, count) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment