Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
26664203
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
26664203
编写于
11月 07, 2016
作者:
F
Filipa Lacerda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small fixes
上级
2207528c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
43 addition
and
27 deletion
+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
未找到文件。
app/assets/javascripts/environments/components/environment_item.js.es6
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
26664203
/* eslint-disable no-param-reassign */
(() => {
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
...
...
app/views/projects/environments/components/_actions.html.haml
浏览文件 @
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录