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
Tatuya Kamada
gitlab-ce
Commits
de990812
Commit
de990812
authored
Oct 14, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creates component
parent
52c4f8ef
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
29 deletions
+80
-29
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+34
-0
app/assets/javascripts/environments/components/environments_tree_view.js.es6
...pts/environments/components/environments_tree_view.js.es6
+0
-0
app/assets/javascripts/environments/environments_bundle.js.es6
...ssets/javascripts/environments/environments_bundle.js.es6
+3
-2
app/assets/javascripts/environments/services/environments_service.js.es6
...scripts/environments/services/environments_service.js.es6
+0
-2
app/assets/javascripts/environments/stores/environmnets_store.js.es6
...javascripts/environments/stores/environmnets_store.js.es6
+9
-2
app/views/projects/environments/components/_environment.html.haml
...s/projects/environments/components/_environment.html.haml
+8
-0
app/views/projects/environments/index.html.haml
app/views/projects/environments/index.html.haml
+26
-23
No files found.
app/assets/javascripts/environments/components/environment_item.js.es6
0 → 100644
View file @
de990812
(() => {
const Store = gl.environmentsList.EnvironmentsStore;
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
gl.environmentsList.EnvironmentItem = Vue.extend({
props: {
model: Object
},
data: function () {
return {
open: false
};
},
computed: {
isFolder: function() {
debugger;
return this.model.children && this.model.children.length
}
},
methods: {
toggle: function () {
if (this.isFolder) {
this.open = !this.open;
}
}
}
})
})();
\ No newline at end of file
app/assets/javascripts/environments/components/environments_tree_view.js.es6
deleted
100644 → 0
View file @
52c4f8ef
app/assets/javascripts/environments/environments_bundle.js.es6
View file @
de990812
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
//= require vue-resource
//= require vue-resource
//= require_tree ./stores
//= require_tree ./stores
//= require_tree ./services
//= require_tree ./services
//= require ./components/environment_item
$(() => {
$(() => {
...
@@ -20,10 +20,11 @@ $(() => {
...
@@ -20,10 +20,11 @@ $(() => {
el: $environmentsListApp,
el: $environmentsListApp,
components: {
components: {
'
tree-view': gl.environmentsList.TreeView
'
environment-item': gl.environmentsList.EnvironmentItem
},
},
data: {
data: {
state: Store.state,
endpoint: $environmentsListApp.dataset.endpoint,
endpoint: $environmentsListApp.dataset.endpoint,
loading: true
loading: true
},
},
...
...
app/assets/javascripts/environments/services/environments_service.js.es6
View file @
de990812
...
@@ -3,8 +3,6 @@ class EnvironmentsService {
...
@@ -3,8 +3,6 @@ class EnvironmentsService {
constructor (root) {
constructor (root) {
Vue.http.options.root = root;
Vue.http.options.root = root;
debugger;
this.environments = Vue.resource(root);
this.environments = Vue.resource(root);
Vue.http.interceptors.push((request, next) => {
Vue.http.interceptors.push((request, next) => {
...
...
app/assets/javascripts/environments/stores/environmnets_store.js.es6
View file @
de990812
...
@@ -31,10 +31,13 @@
...
@@ -31,10 +31,13 @@
* },
* },
* {name: "environment_1", environment_type: null}
* {name: "environment_1", environment_type: null}
* ]
* ]
* @param {Array} environments List of environments
*
*
* @param {Array} environments List of environments.
* @returns {Array} Tree structured array with the received environments.
*/
*/
storeEnvironments(environments) {
storeEnvironments(environments) {
this.state.environments
= environments.reduce((acc, environment) => {
const environmentsTree
= environments.reduce((acc, environment) => {
if (environment.environment_type !== null) {
if (environment.environment_type !== null) {
const occurs = acc.find((element, index, array) => {
const occurs = acc.find((element, index, array) => {
return element.name === environment.environment_type;
return element.name === environment.environment_type;
...
@@ -55,6 +58,10 @@
...
@@ -55,6 +58,10 @@
return acc;
return acc;
}, []).sort();
}, []).sort();
this.state.environments = environmentsTree;
return environmentsTree;
}
}
}
}
})();
})();
\ No newline at end of file
app/views/projects/environments/components/_environment.html.haml
0 → 100644
View file @
de990812
%environment-item
{
"inline-template"
=>
true
,
"v-for"
=>
"environment in state.environments"
,
":model"
=>
"environment"
}
%i
{
"v-if"
=>
"isFolder"
}
=
icon
(
"plus"
)
%i
{
"v-if"
=>
""
}
=
icon
(
"less"
)
{{model.name}}
app/views/projects/environments/index.html.haml
View file @
de990812
...
@@ -26,8 +26,10 @@
...
@@ -26,8 +26,10 @@
New environment
New environment
.environments-container
#environments-list-view
{
"v-cloak"
=>
true
,
data:
environments_list_data
}
.environments-container
#environments-list-view
{
"v-cloak"
=>
true
,
data:
environments_list_data
}
-
if
@all_environments
.
blank?
.environments-list-viewtext-center
{
"v-if"
=>
"loading"
}
.blank-state.blank-state-no-icon
=
icon
(
"spinner spin"
)
.blank-state.blank-state-no-icon
{
"v-if"
=>
"state.environments.length === 0"
}
%h2
.blank-state-title
%h2
.blank-state-title
You don't have any environments right now.
You don't have any environments right now.
%p
.blank-state-text
%p
.blank-state-text
...
@@ -38,14 +40,15 @@
...
@@ -38,14 +40,15 @@
-
if
can?
(
current_user
,
:create_environment
,
@project
)
-
if
can?
(
current_user
,
:create_environment
,
@project
)
=
link_to
new_namespace_project_environment_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create'
do
=
link_to
new_namespace_project_environment_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create'
do
New environment
New environment
-
else
.table-holder
.table-holder
{
"v-if"
=>
"state.environments.length"
}
%table
.table.ci-table.environments
%table
.table.ci-table.environments
%tbody
%thead
%th
Environment
%th
Environment
%th
Last Deployment
%th
Last Deployment
%th
Build
%th
Build
%th
Commit
%th
Commit
%th
%th
%th
.hidden-xs
%th
.hidden-xs
/ = render @environments
%tbody
=
render
"projects/environments/components/environment"
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