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
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
Hide 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 */
/* eslint-disable no-param-reassign, no-return-assign */
(() => {
/**
* Envrionment Item Component
...
...
@@ -112,12 +111,28 @@
return this.hasLastDeploymentKey && this.model.last_deployment && this.$options.hasKey(this.model.last_deployment, 'deployable');
},
/**
* Human readable date.
*
* @returns {String}
*/
createdDate() {
return $.timeago(this.model.created_at);
},
/**
* Returns the manual actions with the name parsed.
*
* @returns {Array.<Object>}
*/
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 @@
//= require_tree ./services
//= require ./components/environment_item
//= require ../boards/vue_resource_interceptor
/* globals Vue, EnvironmentsService */
/* eslint-disable no-param-reassign */
/* eslint-disable */
$(() => {
const environmentsListApp = document.getElementById('environments-list-view');
const Store = gl.environmentsList.EnvironmentsStore;
...
...
@@ -20,26 +20,24 @@ $(() => {
const filterState = state => environment => environment.state === state && environment;
// recursiveMap :: (Function, Array) -> Array
const recursiveMap = (fn, arr) => {
return arr.map((item) => {
if (!item.children) { return fn(item); }
const recursiveMap = (fn, arr) => arr.map((item) => {
if (item.children) {
const filteredChildren = recursiveMap(fn, item.children).filter(Boolean);
if (filteredChildren.length) {
item.children = filteredChildren;
return item;
}
}
return fn(item);
}).filter(Boolean);
}).filter(Boolean);
};
gl.EnvironmentsListApp = new Vue({
el: '#environments-list-view',
components: {
item: gl.environmentsList.EnvironmentItem
item: gl.environmentsList.EnvironmentItem
,
},
data: {
...
...
@@ -50,7 +48,7 @@ $(() => {
},
computed: {
filteredEnvironments
()
{
filteredEnvironments
()
{
return recursiveMap(filterState(this.visibility), this.state.environments);
},
},
...
...
@@ -84,12 +82,12 @@ $(() => {
* @param {String} param
* @returns {String} The value of the requested parameter.
*/
getQueryParameter(param) {
getQueryParameter(param
eter
) {
return window.location.search.substring(1).split('&').reduce((acc, param) => {
const paramSplited = param.split('=');
acc[paramSplited[0]] = paramSplited[1];
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 {
constructor
(root) {
constructor(root) {
Vue.http.options.root = root;
this.environments = Vue.resource(root);
...
...
@@ -11,7 +13,7 @@ class EnvironmentsService {
});
}
all
() {
all() {
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.environmentsList = window.gl.environmentsList || {};
...
...
app/views/projects/environments/components/_actions.html.haml
View file @
26664203
...
...
@@ -5,12 +5,12 @@
=
custom_icon
(
'icon_play'
)
=
icon
(
'caret-down'
)
%ul
.dropdown-menu.dropdown-menu-align-right
%li
{
"v-for"
=>
"action in manualActions"
}
%a
{
":
ref"
=>
"action.play_url"
,
"data-method"
=>
"post"
,
"rel"
=>
"nofollow"
}
%ul
.dropdown-menu.dropdown-menu-align-right
%li
{
"v-for"
=>
"action in manualActions"
}
%a
{
":h
ref"
=>
"action.play_url"
,
"data-method"
=>
"post"
,
"rel"
=>
"nofollow"
}
=
custom_icon
(
'icon_play'
)
%span
{{action.name}}
\ No newline at end of file
=
custom_icon
(
'icon_play'
)
%span
{{action.name}}
\ No newline at end of file
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