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
Léo-Paul Géneau
gitlab-ce
Commits
d6ae01da
Commit
d6ae01da
authored
Feb 09, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CJS in all environments components
parent
8f3678f1
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
782 additions
and
817 deletions
+782
-817
app/assets/javascripts/environments/components/environment.js.es6
...ts/javascripts/environments/components/environment.js.es6
+178
-184
app/assets/javascripts/environments/components/environment_actions.js.es6
...cripts/environments/components/environment_actions.js.es6
+40
-47
app/assets/javascripts/environments/components/environment_external_url.js.es6
...s/environments/components/environment_external_url.js.es6
+16
-20
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+455
-463
app/assets/javascripts/environments/components/environment_rollback.js.es6
...ripts/environments/components/environment_rollback.js.es6
+26
-29
app/assets/javascripts/environments/components/environment_stop.js.es6
...vascripts/environments/components/environment_stop.js.es6
+21
-24
app/assets/javascripts/environments/components/environment_terminal_button.js.es6
...nvironments/components/environment_terminal_button.js.es6
+22
-25
app/assets/javascripts/environments/environments_bundle.js.es6
...ssets/javascripts/environments/environments_bundle.js.es6
+2
-3
app/assets/javascripts/environments/services/environments_service.js.es6
...scripts/environments/services/environments_service.js.es6
+1
-1
app/assets/javascripts/vue_shared/components/commit.js.es6
app/assets/javascripts/vue_shared/components/commit.js.es6
+1
-0
spec/javascripts/environments/environment_actions_spec.js.es6
.../javascripts/environments/environment_actions_spec.js.es6
+3
-3
spec/javascripts/environments/environment_external_url_spec.js.es6
...scripts/environments/environment_external_url_spec.js.es6
+2
-2
spec/javascripts/environments/environment_item_spec.js.es6
spec/javascripts/environments/environment_item_spec.js.es6
+4
-4
spec/javascripts/environments/environment_rollback_spec.js.es6
...javascripts/environments/environment_rollback_spec.js.es6
+4
-4
spec/javascripts/environments/environment_spec.js.es6
spec/javascripts/environments/environment_spec.js.es6
+5
-6
spec/javascripts/environments/environment_stop_spec.js.es6
spec/javascripts/environments/environment_stop_spec.js.es6
+2
-2
No files found.
app/assets/javascripts/environments/components/environment.js.es6
View file @
d6ae01da
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_actions.js.es6
View file @
d6ae01da
/* global Vue */
const Vue = require('vue');
window.Vue = require('vue');
module.exports = Vue.component('actions-component', {
props: {
(() => {
actions: {
window.gl = window.gl || {};
type: Array,
window.gl.environmentsList = window.gl.environmentsList || {};
required: false,
default: () => [],
gl.environmentsList.ActionsComponent = Vue.component('actions-component', {
props: {
actions: {
type: Array,
required: false,
default: () => [],
},
playIconSvg: {
type: String,
required: false,
},
},
},
template: `
playIconSvg: {
<div class="inline">
type: String,
<div class="dropdown">
required: false,
<a class="dropdown-new btn btn-default" data-toggle="dropdown">
},
<span class="js-dropdown-play-icon-container" v-html="playIconSvg"></span>
},
<i class="fa fa-caret-down"></i>
</a>
template: `
<div class="inline">
<ul class="dropdown-menu dropdown-menu-align-right">
<div class="dropdown">
<li v-for="action in actions">
<a class="dropdown-new btn btn-default" data-toggle="dropdown">
<a :href="action.play_path"
<span class="js-dropdown-play-icon-container" v-html="playIconSvg"></span>
data-method="post"
<i class="fa fa-caret-down"></i>
rel="nofollow"
</a>
class="js-manual-action-link">
<ul class="dropdown-menu dropdown-menu-align-right">
<span class="js-action-play-icon-container" v-html="playIconSvg"></span>
<li v-for="action in actions">
<a :href="action.play_path"
<span>
data-method="post"
{{action.name}}
rel="nofollow"
</span>
class="js-manual-action-link">
</a>
</li>
<span class="js-action-play-icon-container" v-html="playIconSvg"></span>
</ul>
</div>
<span>
{{action.name}}
</span>
</a>
</li>
</ul>
</div>
</div>
`,
</div>
});
`,
})
()
;
});
app/assets/javascripts/environments/components/environment_external_url.js.es6
View file @
d6ae01da
/* global Vue */
/**
* Renders the external url link in environments table.
*/
const Vue = require('vue');
window.Vue = require('vue');
module.exports = Vue.component('external-url-component', {
props: {
(() => {
externalUrl: {
window.gl = window.gl || {};
type: String,
window.gl.environmentsList = window.gl.environmentsList || {};
default: '',
gl.environmentsList.ExternalUrlComponent = Vue.component('external-url-component', {
props: {
externalUrl: {
type: String,
default: '',
},
},
},
},
template: `
template: `
<a class="btn external_url" :href="externalUrl" target="_blank">
<a class="btn external_url" :href="externalUrl" target="_blank">
<i class="fa fa-external-link"></i>
<i class="fa fa-external-link"></i>
</a>
</a>
`,
`,
});
});
})();
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
d6ae01da
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_rollback.js.es6
View file @
d6ae01da
/* global Vue */
/**
* Renders Rollback or Re deploy button in environments table depending
* of the provided property `isLastDeployment`
*/
const Vue = require('vue');
window.Vue = require('vue');
module.exports = Vue.component('rollback-component', {
props: {
(() => {
retryUrl: {
window.gl = window.gl || {};
type: String,
window.gl.environmentsList = window.gl.environmentsList || {};
default: '',
},
gl.environmentsList.RollbackComponent = Vue.component('rollback-component', {
props: {
retryUrl: {
type: String,
default: '',
},
isLastDeployment: {
isLastDeployment: {
type: Boolean,
type: Boolean,
default: true,
default: true,
},
},
},
},
template: `
template: `
<a class="btn" :href="retryUrl" data-method="post" rel="nofollow">
<a class="btn" :href="retryUrl" data-method="post" rel="nofollow">
<span v-if="isLastDeployment">
<span v-if="isLastDeployment">
Re-deploy
Re-deploy
</span>
</span>
<span v-else>
<span v-else>
Rollback
Rollback
</span>
</span>
</a>
</a>
`,
`,
});
});
})();
app/assets/javascripts/environments/components/environment_stop.js.es6
View file @
d6ae01da
/* global Vue */
/**
* Renders the stop "button" that allows stop an environment.
* Used in environments table.
*/
const Vue = require('vue');
window.Vue = require('vue');
module.exports = Vue.component('stop-component', {
props: {
(() => {
stopUrl: {
window.gl = window.gl || {};
type: String,
window.gl.environmentsList = window.gl.environmentsList || {};
default: '',
gl.environmentsList.StopComponent = Vue.component('stop-component', {
props: {
stopUrl: {
type: String,
default: '',
},
},
},
},
template: `
template: `
<a class="btn stop-env-link"
<a class="btn stop-env-link"
:href="stopUrl"
:href="stopUrl"
data-confirm="Are you sure you want to stop this environment?"
data-confirm="Are you sure you want to stop this environment?"
data-method="post"
data-method="post"
rel="nofollow">
rel="nofollow">
<i class="fa fa-stop stop-env-icon"></i>
<i class="fa fa-stop stop-env-icon" aria-hidden="true"></i>
</a>
</a>
`,
`,
});
});
})();
app/assets/javascripts/environments/components/environment_terminal_button.js.es6
View file @
d6ae01da
/* global Vue */
/**
* Renders a terminal button to open a web terminal.
* Used in environments table.
*/
const Vue = require('vue');
window.Vue = require('vue');
module.exports = Vue.component('terminal-button-component', {
props: {
(() => {
terminalPath: {
window.gl = window.gl || {};
type: String,
window.gl.environmentsList = window.gl.environmentsList || {};
default: '',
},
gl.environmentsList.TerminalButtonComponent = Vue.component('terminal-button-component', {
terminalIconSvg: {
props: {
type: String,
terminalPath: {
default: '',
type: String,
default: '',
},
terminalIconSvg: {
type: String,
default: '',
},
},
},
},
template: `
template: `
<a class="btn terminal-button"
<a class="btn terminal-button"
:href="terminalPath">
:href="terminalPath">
<span class="js-terminal-icon-container" v-html="terminalIconSvg"></span>
<span class="js-terminal-icon-container" v-html="terminalIconSvg"></span>
</a>
</a>
`,
`,
});
});
})();
app/assets/javascripts/environments/environments_bundle.js.es6
View file @
d6ae01da
window.Vue = require('vue');
const EnvironmentsComponent = require('./components/environment');
require('./components/environment');
require('../vue_shared/vue_resource_interceptor');
require('../vue_shared/vue_resource_interceptor');
$(() => {
$(() => {
...
@@ -9,7 +8,7 @@ $(() => {
...
@@ -9,7 +8,7 @@ $(() => {
gl.EnvironmentsListApp.$destroy(true);
gl.EnvironmentsListApp.$destroy(true);
}
}
gl.EnvironmentsListApp = new
gl.environmentsList.
EnvironmentsComponent({
gl.EnvironmentsListApp = new EnvironmentsComponent({
el: document.querySelector('#environments-list-view'),
el: document.querySelector('#environments-list-view'),
});
});
});
});
app/assets/javascripts/environments/services/environments_service.js.es6
View file @
d6ae01da
const Vue =
window.Vue =
require('vue');
const Vue = require('vue');
class EnvironmentsService {
class EnvironmentsService {
constructor(endpoint) {
constructor(endpoint) {
...
...
app/assets/javascripts/vue_shared/components/commit.js.es6
View file @
d6ae01da
/* global Vue */
/* global Vue */
window.Vue = require('vue');
(() => {
(() => {
window.gl = window.gl || {};
window.gl = window.gl || {};
...
...
spec/javascripts/environments/environment_actions_spec.js.es6
View file @
d6ae01da
require('~/environments/components/environment_actions');
const ActionsComponent =
require('~/environments/components/environment_actions');
describe('Actions Component', () => {
describe('Actions Component', () => {
preloadFixtures('static/environments/element.html.raw');
preloadFixtures('static/environments/element.html.raw');
...
@@ -19,7 +19,7 @@ describe('Actions Component', () => {
...
@@ -19,7 +19,7 @@ describe('Actions Component', () => {
},
},
];
];
const component = new
window.gl.environmentsList.
ActionsComponent({
const component = new ActionsComponent({
el: document.querySelector('.test-dom-element'),
el: document.querySelector('.test-dom-element'),
propsData: {
propsData: {
actions: actionsMock,
actions: actionsMock,
...
@@ -47,7 +47,7 @@ describe('Actions Component', () => {
...
@@ -47,7 +47,7 @@ describe('Actions Component', () => {
},
},
];
];
const component = new
window.gl.environmentsList.
ActionsComponent({
const component = new ActionsComponent({
el: document.querySelector('.test-dom-element'),
el: document.querySelector('.test-dom-element'),
propsData: {
propsData: {
actions: actionsMock,
actions: actionsMock,
...
...
spec/javascripts/environments/environment_external_url_spec.js.es6
View file @
d6ae01da
require('~/environments/components/environment_external_url');
const ExternalUrlComponent =
require('~/environments/components/environment_external_url');
describe('External URL Component', () => {
describe('External URL Component', () => {
preloadFixtures('static/environments/element.html.raw');
preloadFixtures('static/environments/element.html.raw');
...
@@ -8,7 +8,7 @@ describe('External URL Component', () => {
...
@@ -8,7 +8,7 @@ describe('External URL Component', () => {
it('should link to the provided externalUrl prop', () => {
it('should link to the provided externalUrl prop', () => {
const externalURL = 'https://gitlab.com';
const externalURL = 'https://gitlab.com';
const component = new
window.gl.environmentsList.
ExternalUrlComponent({
const component = new ExternalUrlComponent({
el: document.querySelector('.test-dom-element'),
el: document.querySelector('.test-dom-element'),
propsData: {
propsData: {
externalUrl: externalURL,
externalUrl: externalURL,
...
...
spec/javascripts/environments/environment_item_spec.js.es6
View file @
d6ae01da
window.timeago = require('vendor/timeago');
window.timeago = require('vendor/timeago');
require('~/environments/components/environment_item');
const EnvironmentItem =
require('~/environments/components/environment_item');
f
describe('Environment item', () => {
describe('Environment item', () => {
preloadFixtures('static/environments/table.html.raw');
preloadFixtures('static/environments/table.html.raw');
beforeEach(() => {
beforeEach(() => {
loadFixtures('static/environments/table.html.raw');
loadFixtures('static/environments/table.html.raw');
...
@@ -21,7 +21,7 @@ fdescribe('Environment item', () => {
...
@@ -21,7 +21,7 @@ fdescribe('Environment item', () => {
},
},
};
};
component = new
window.gl.environmentsList.
EnvironmentItem({
component = new EnvironmentItem({
el: document.querySelector('tr#environment-row'),
el: document.querySelector('tr#environment-row'),
propsData: {
propsData: {
model: mockItem,
model: mockItem,
...
@@ -111,7 +111,7 @@ fdescribe('Environment item', () => {
...
@@ -111,7 +111,7 @@ fdescribe('Environment item', () => {
},
},
};
};
component = new
window.gl.environmentsList.
EnvironmentItem({
component = new EnvironmentItem({
el: document.querySelector('tr#environment-row'),
el: document.querySelector('tr#environment-row'),
propsData: {
propsData: {
model: environment,
model: environment,
...
...
spec/javascripts/environments/environment_rollback_spec.js.es6
View file @
d6ae01da
require('~/environments/components/environment_rollback');
const RollbackComponent =
require('~/environments/components/environment_rollback');
describe('Rollback Component', () => {
describe('Rollback Component', () => {
preloadFixtures('static/environments/element.html.raw');
preloadFixtures('static/environments/element.html.raw');
...
@@ -10,7 +10,7 @@ describe('Rollback Component', () => {
...
@@ -10,7 +10,7 @@ describe('Rollback Component', () => {
});
});
it('Should link to the provided retryUrl', () => {
it('Should link to the provided retryUrl', () => {
const component = new
window.gl.environmentsList.
RollbackComponent({
const component = new RollbackComponent({
el: document.querySelector('.test-dom-element'),
el: document.querySelector('.test-dom-element'),
propsData: {
propsData: {
retryUrl: retryURL,
retryUrl: retryURL,
...
@@ -22,7 +22,7 @@ describe('Rollback Component', () => {
...
@@ -22,7 +22,7 @@ describe('Rollback Component', () => {
});
});
it('Should render Re-deploy label when isLastDeployment is true', () => {
it('Should render Re-deploy label when isLastDeployment is true', () => {
const component = new
window.gl.environmentsList.
RollbackComponent({
const component = new RollbackComponent({
el: document.querySelector('.test-dom-element'),
el: document.querySelector('.test-dom-element'),
propsData: {
propsData: {
retryUrl: retryURL,
retryUrl: retryURL,
...
@@ -34,7 +34,7 @@ describe('Rollback Component', () => {
...
@@ -34,7 +34,7 @@ describe('Rollback Component', () => {
});
});
it('Should render Rollback label when isLastDeployment is false', () => {
it('Should render Rollback label when isLastDeployment is false', () => {
const component = new
window.gl.environmentsList.
RollbackComponent({
const component = new RollbackComponent({
el: document.querySelector('.test-dom-element'),
el: document.querySelector('.test-dom-element'),
propsData: {
propsData: {
retryUrl: retryURL,
retryUrl: retryURL,
...
...
spec/javascripts/environments/environment_spec.js.es6
View file @
d6ae01da
/* global Vue, environment */
const Vue = require('vue');
require('~/flash');
require('~/flash');
require('~/environments/components/environment');
const EnvironmentsComponent =
require('~/environments/components/environment');
const { environment } = require('./mock_data');
const { environment } = require('./mock_data');
describe('Environment', () => {
describe('Environment', () => {
...
@@ -32,7 +31,7 @@ describe('Environment', () => {
...
@@ -32,7 +31,7 @@ describe('Environment', () => {
});
});
it('should render the empty state', (done) => {
it('should render the empty state', (done) => {
component = new
gl.environmentsList.
EnvironmentsComponent({
component = new EnvironmentsComponent({
el: document.querySelector('#environments-list-view'),
el: document.querySelector('#environments-list-view'),
});
});
...
@@ -72,7 +71,7 @@ describe('Environment', () => {
...
@@ -72,7 +71,7 @@ describe('Environment', () => {
});
});
it('should render a table with environments', (done) => {
it('should render a table with environments', (done) => {
component = new
gl.environmentsList.
EnvironmentsComponent({
component = new EnvironmentsComponent({
el: document.querySelector('#environments-list-view'),
el: document.querySelector('#environments-list-view'),
});
});
...
@@ -104,7 +103,7 @@ describe('Environment', () => {
...
@@ -104,7 +103,7 @@ describe('Environment', () => {
});
});
it('should render empty state', (done) => {
it('should render empty state', (done) => {
component = new
gl.environmentsList.
EnvironmentsComponent({
component = new EnvironmentsComponent({
el: document.querySelector('#environments-list-view'),
el: document.querySelector('#environments-list-view'),
});
});
...
...
spec/javascripts/environments/environment_stop_spec.js.es6
View file @
d6ae01da
require('~/environments/components/environment_stop');
const StopComponent =
require('~/environments/components/environment_stop');
describe('Stop Component', () => {
describe('Stop Component', () => {
preloadFixtures('static/environments/element.html.raw');
preloadFixtures('static/environments/element.html.raw');
...
@@ -10,7 +10,7 @@ describe('Stop Component', () => {
...
@@ -10,7 +10,7 @@ describe('Stop Component', () => {
loadFixtures('static/environments/element.html.raw');
loadFixtures('static/environments/element.html.raw');
stopURL = '/stop';
stopURL = '/stop';
component = new
window.gl.environmentsList.
StopComponent({
component = new StopComponent({
el: document.querySelector('.test-dom-element'),
el: document.querySelector('.test-dom-element'),
propsData: {
propsData: {
stopUrl: stopURL,
stopUrl: stopURL,
...
...
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