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
Jérome Perrin
gitlab-ce
Commits
26664203
Commit
26664203
authored
Nov 07, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes
parent
2207528c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
27 deletions
+43
-27
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+17
-2
app/assets/javascripts/environments/environments_bundle.js.es6
...ssets/javascripts/environments/environments_bundle.js.es6
+12
-14
app/assets/javascripts/environments/services/environments_service.js.es6
...scripts/environments/services/environments_service.js.es6
+5
-3
app/assets/javascripts/environments/stores/environmnets_store.js.es6
...javascripts/environments/stores/environmnets_store.js.es6
+1
-0
app/views/projects/environments/components/_actions.html.haml
...views/projects/environments/components/_actions.html.haml
+8
-8
No files found.
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
26664203
/* globals Vue */
/* globals Vue */
/* eslint-disable no-param-reassign, no-return-assign */
(() => {
(() => {
/**
/**
* Envrionment Item Component
* Envrionment Item Component
...
@@ -112,12 +111,28 @@
...
@@ -112,12 +111,28 @@
return this.hasLastDeploymentKey && this.model.last_deployment && this.$options.hasKey(this.model.last_deployment, 'deployable');
return this.hasLastDeploymentKey && this.model.last_deployment && this.$options.hasKey(this.model.last_deployment, 'deployable');
},
},
/**
* Human readable date.
*
* @returns {String}
*/
createdDate() {
createdDate() {
return $.timeago(this.model.created_at);
return $.timeago(this.model.created_at);
},
},
/**
* Returns the manual actions with the name parsed.
*
* @returns {Array.<Object>}
*/
manualActions() {
manualActions() {
this.model.manual_actions.map(action => action.name = gl.text.humanize(action.name));
return this.model.manual_actions.map((action) => {
const parsedAction = {
name: gl.text.humanize(action.name),
play_url: action.play_url,
};
return parsedAction;
});
},
},
},
},
...
...
app/assets/javascripts/environments/environments_bundle.js.es6
View file @
26664203
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
//= require_tree ./services
//= require_tree ./services
//= require ./components/environment_item
//= require ./components/environment_item
//= require ../boards/vue_resource_interceptor
//= require ../boards/vue_resource_interceptor
/* globals Vue, EnvironmentsService */
/* eslint-disable no-param-reassign */
/* eslint-disable */
$(() => {
$(() => {
const environmentsListApp = document.getElementById('environments-list-view');
const environmentsListApp = document.getElementById('environments-list-view');
const Store = gl.environmentsList.EnvironmentsStore;
const Store = gl.environmentsList.EnvironmentsStore;
...
@@ -20,26 +20,24 @@ $(() => {
...
@@ -20,26 +20,24 @@ $(() => {
const filterState = state => environment => environment.state === state && environment;
const filterState = state => environment => environment.state === state && environment;
// recursiveMap :: (Function, Array) -> Array
// recursiveMap :: (Function, Array) -> Array
const recursiveMap = (fn, arr) => {
const recursiveMap = (fn, arr) => arr.map((item) => {
if (item.children) {
return arr.map((item) => {
if (!item.children) { return fn(item); }
const filteredChildren = recursiveMap(fn, item.children).filter(Boolean);
const filteredChildren = recursiveMap(fn, item.children).filter(Boolean);
if (filteredChildren.length) {
if (filteredChildren.length) {
item.children = filteredChildren;
item.children = filteredChildren;
return item;
return item;
}
}
}
return fn(item);
}).filter(Boolean);
}).filter(Boolean);
};
gl.EnvironmentsListApp = new Vue({
gl.EnvironmentsListApp = new Vue({
el: '#environments-list-view',
el: '#environments-list-view',
components: {
components: {
item: gl.environmentsList.EnvironmentItem
item: gl.environmentsList.EnvironmentItem
,
},
},
data: {
data: {
...
@@ -50,7 +48,7 @@ $(() => {
...
@@ -50,7 +48,7 @@ $(() => {
},
},
computed: {
computed: {
filteredEnvironments
()
{
filteredEnvironments
()
{
return recursiveMap(filterState(this.visibility), this.state.environments);
return recursiveMap(filterState(this.visibility), this.state.environments);
},
},
},
},
...
@@ -84,12 +82,12 @@ $(() => {
...
@@ -84,12 +82,12 @@ $(() => {
* @param {String} param
* @param {String} param
* @returns {String} The value of the requested parameter.
* @returns {String} The value of the requested parameter.
*/
*/
getQueryParameter(param) {
getQueryParameter(param
eter
) {
return window.location.search.substring(1).split('&').reduce((acc, param) => {
return window.location.search.substring(1).split('&').reduce((acc, param) => {
const paramSplited = param.split('=');
const paramSplited = param.split('=');
acc[paramSplited[0]] = paramSplited[1];
acc[paramSplited[0]] = paramSplited[1];
return acc;
return acc;
}, {})[param];
}, {})[param
eter
];
}
}
,
});
});
});
});
app/assets/javascripts/environments/services/environments_service.js.es6
View file @
26664203
/* globals Vue */
/* eslint-disable no-unused-vars, no-param-reassign */
class EnvironmentsService {
class EnvironmentsService {
constructor
(root) {
constructor(root) {
Vue.http.options.root = root;
Vue.http.options.root = root;
this.environments = Vue.resource(root);
this.environments = Vue.resource(root);
...
@@ -11,7 +13,7 @@ class EnvironmentsService {
...
@@ -11,7 +13,7 @@ class EnvironmentsService {
});
});
}
}
all
() {
all() {
return this.environments.get();
return this.environments.get();
}
}
}
;
}
app/assets/javascripts/environments/stores/environmnets_store.js.es6
View file @
26664203
/* eslint-disable no-param-reassign */
(() => {
(() => {
window.gl = window.gl || {};
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
window.gl.environmentsList = window.gl.environmentsList || {};
...
...
app/views/projects/environments/components/_actions.html.haml
View file @
26664203
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
%ul
.dropdown-menu.dropdown-menu-align-right
%ul
.dropdown-menu.dropdown-menu-align-right
%li
{
"v-for"
=>
"action in manualActions"
}
%li
{
"v-for"
=>
"action in manualActions"
}
%a
{
":
ref"
=>
"action.play_url"
,
%a
{
":h
ref"
=>
"action.play_url"
,
"data-method"
=>
"post"
,
"data-method"
=>
"post"
,
"rel"
=>
"nofollow"
}
"rel"
=>
"nofollow"
}
...
...
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