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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
39c719a8
Commit
39c719a8
authored
Feb 17, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate deploy board in environments table.
Toggle deploy board
parent
515b74d0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
96 additions
and
7 deletions
+96
-7
app/assets/javascripts/environments/components/deploy_board_component.js.es6
...pts/environments/components/deploy_board_component.js.es6
+1
-0
app/assets/javascripts/environments/components/environment.js.es6
...ts/javascripts/environments/components/environment.js.es6
+7
-5
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+30
-0
app/assets/javascripts/environments/components/environments_table.js.es6
...scripts/environments/components/environments_table.js.es6
+15
-1
app/assets/javascripts/environments/environments_bundle.js.es6
...ssets/javascripts/environments/environments_bundle.js.es6
+0
-1
app/assets/javascripts/environments/stores/environments_store.js.es6
...javascripts/environments/stores/environments_store.js.es6
+25
-0
app/assets/stylesheets/pages/environments.scss
app/assets/stylesheets/pages/environments.scss
+18
-0
No files found.
app/assets/javascripts/environments/components/deploy_board_component.js.es6
View file @
39c719a8
...
@@ -22,6 +22,7 @@ module.exports = Vue.component('deploy_boards_components', {
...
@@ -22,6 +22,7 @@ module.exports = Vue.component('deploy_boards_components', {
created() {
created() {
// Fetch data
// Fetch data
console.log('HERE!');
},
},
template: `
template: `
...
...
app/assets/javascripts/environments/components/environment.js.es6
View file @
39c719a8
/* eslint-disable no-param-reassign, no-new */
/* eslint-disable no-param-reassign, no-new */
/* global Flash */
/* global Flash */
const Vue = require('vue');
const Vue =
window.Vue =
require('vue');
Vue.use(require('vue-resource'));
window.
Vue.use(require('vue-resource'));
const EnvironmentsService = require('../services/environments_service');
const EnvironmentsService = require('../services/environments_service');
const EnvironmentTable = require('./environments_table');
const EnvironmentTable = require('./environments_table');
const EnvironmentsStore = require('../stores/environments_store');
const EnvironmentsStore = require('../stores/environments_store');
...
@@ -98,8 +98,9 @@ module.exports = Vue.component('environment-component', {
...
@@ -98,8 +98,9 @@ module.exports = Vue.component('environment-component', {
},
},
methods: {
methods: {
toggleRow(model) {
toggleDeployBoard(model) {
return this.store.toggleFolder(model.name);
debugger;
return this.store.toggleDeployBoard(model);
},
},
/**
/**
...
@@ -178,7 +179,8 @@ module.exports = Vue.component('environment-component', {
...
@@ -178,7 +179,8 @@ module.exports = Vue.component('environment-component', {
:can-read-environment="canReadEnvironmentParsed"
:can-read-environment="canReadEnvironmentParsed"
:play-icon-svg="playIconSvg"
:play-icon-svg="playIconSvg"
:terminal-icon-svg="terminalIconSvg"
:terminal-icon-svg="terminalIconSvg"
:commit-icon-svg="commitIconSvg">
:commit-icon-svg="commitIconSvg"
:toggleDeployBoard="toggleDeployBoard">
</environment-table>
</environment-table>
<table-pagination v-if="state.paginationInformation && state.paginationInformation.totalPages > 1"
<table-pagination v-if="state.paginationInformation && state.paginationInformation.totalPages > 1"
...
...
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
39c719a8
...
@@ -61,6 +61,17 @@ module.exports = Vue.component('environment-item', {
...
@@ -61,6 +61,17 @@ module.exports = Vue.component('environment-item', {
type: String,
type: String,
required: false,
required: false,
},
},
/**
* Top level environments with `rollout_status`
* can render a deploy board. In order to render it we need to update
* the parent compoenent data.
*
*/
toggleDeployBoard: {
type: Function,
required: false,
},
},
},
computed: {
computed: {
...
@@ -415,6 +426,17 @@ module.exports = Vue.component('environment-item', {
...
@@ -415,6 +426,17 @@ module.exports = Vue.component('environment-item', {
return `${window.location.pathname}/folders/${this.model.folderName}`;
return `${window.location.pathname}/folders/${this.model.folderName}`;
},
},
/**
* If the environment has a deploy board we need to render an arrow icon
* next to it's name.
*
* @return {Boolean}
*/
hasDeployBoard() {
return true;
// return this.model.rollout_status;
},
},
},
/**
/**
...
@@ -435,11 +457,19 @@ module.exports = Vue.component('environment-item', {
...
@@ -435,11 +457,19 @@ module.exports = Vue.component('environment-item', {
template: `
template: `
<tr>
<tr>
<td>
<td>
<span class="deploy-board-icon"
v-if="!model.isFolder"
v-on:click="toggleDeployBoard(model)">
<i class="fa fa-caret-right" aria-hidden="true" v-if="!model.isDeployBoardVisible"></i>
<i class="fa fa-caret-down" aria-hidden="true" v-if="model.isDeployBoardVisible"></i>
</span>
<a v-if="!model.isFolder"
<a v-if="!model.isFolder"
class="environment-name"
class="environment-name"
:href="environmentPath">
:href="environmentPath">
{{model.name}}
{{model.name}}
</a>
</a>
<a v-else class="folder-name" :href="folderUrl">
<a v-else class="folder-name" :href="folderUrl">
<span class="folder-icon">
<span class="folder-icon">
<i class="fa fa-folder" aria-hidden="true"></i>
<i class="fa fa-folder" aria-hidden="true"></i>
...
...
app/assets/javascripts/environments/components/environments_table.js.es6
View file @
39c719a8
...
@@ -3,11 +3,13 @@
...
@@ -3,11 +3,13 @@
*/
*/
const Vue = require('vue');
const Vue = require('vue');
const EnvironmentItem = require('./environment_item');
const EnvironmentItem = require('./environment_item');
const DeployBoard = require('./deploy_board_component');
module.exports = Vue.component('environment-table-component', {
module.exports = Vue.component('environment-table-component', {
components: {
components: {
'environment-item': EnvironmentItem,
'environment-item': EnvironmentItem,
'deploy-board': DeployBoard,
},
},
props: {
props: {
...
@@ -43,6 +45,11 @@ module.exports = Vue.component('environment-table-component', {
...
@@ -43,6 +45,11 @@ module.exports = Vue.component('environment-table-component', {
type: String,
type: String,
required: false,
required: false,
},
},
toggleDeployBoard: {
type: Function,
required: false,
},
},
},
template: `
template: `
...
@@ -66,7 +73,14 @@ module.exports = Vue.component('environment-table-component', {
...
@@ -66,7 +73,14 @@ module.exports = Vue.component('environment-table-component', {
:can-read-environment="canReadEnvironment"
:can-read-environment="canReadEnvironment"
:play-icon-svg="playIconSvg"
:play-icon-svg="playIconSvg"
:terminal-icon-svg="terminalIconSvg"
:terminal-icon-svg="terminalIconSvg"
:commit-icon-svg="commitIconSvg"></tr>
:commit-icon-svg="commitIconSvg"
:toggleDeployBoard="toggleDeployBoard.bind(model)"></tr>
<tr v-if="model.isDeployBoardVisible">
<td colspan="6" class="deploy-board-container">
<deploy-board></deploy-board>
</td>
</tr>
</template>
</template>
</tbody>
</tbody>
</table>
</table>
...
...
app/assets/javascripts/environments/environments_bundle.js.es6
View file @
39c719a8
const EnvironmentsComponent = require('./components/environment');
const EnvironmentsComponent = require('./components/environment');
require('../vue_shared/vue_resource_interceptor');
$(() => {
$(() => {
window.gl = window.gl || {};
window.gl = window.gl || {};
...
...
app/assets/javascripts/environments/stores/environments_store.js.es6
View file @
39c719a8
...
@@ -39,6 +39,10 @@ class EnvironmentsStore {
...
@@ -39,6 +39,10 @@ class EnvironmentsStore {
if (env.size > 1) {
if (env.size > 1) {
filtered = Object.assign({}, env, { isFolder: true, folderName: env.name });
filtered = Object.assign({}, env, { isFolder: true, folderName: env.name });
} else {
// FIX ME
// no folders items with `x` key can have a deploy board
filtered = Object.assign({}, env, { isDeployBoardVisible: false });
}
}
if (env.latest) {
if (env.latest) {
...
@@ -56,6 +60,27 @@ class EnvironmentsStore {
...
@@ -56,6 +60,27 @@ class EnvironmentsStore {
return filteredEnvironments;
return filteredEnvironments;
}
}
/**
* Toggles deploy board visibility for the provided environment.
*
* @param {Object} environment
* @return {Array}
*/
toggleDeployBoard(environment) {
const environments = Object.assign([], this.state.environments);
this.state.environments = environments.map((env) => {
let updated = Object.assign({}, env);
if (env.id === environment.id) {
updated = Object.assign({}, updated, { isDeployBoardVisible: !env.isDeployBoardVisible });
}
return updated;
});
return this.state.environments;
}
setPagination(pagination = {}) {
setPagination(pagination = {}) {
const normalizedHeaders = gl.utils.normalizeHeaders(pagination);
const normalizedHeaders = gl.utils.normalizeHeaders(pagination);
const paginationInformation = gl.utils.parseIntPagination(normalizedHeaders);
const paginationInformation = gl.utils.parseIntPagination(normalizedHeaders);
...
...
app/assets/stylesheets/pages/environments.scss
View file @
39c719a8
...
@@ -185,3 +185,21 @@
...
@@ -185,3 +185,21 @@
border-color
:
$border-color
;
border-color
:
$border-color
;
}
}
}
}
.deploy-board-icon
i
{
font-size
:
20px
;
vertical-align
:
bottom
;
cursor
:
pointer
;
}
.deploy-board
{
border-top
:
1px
solid
$border-color
;
border-bottom
:
1px
solid
$border-color
;
padding
:
10px
;
background-color
:
#fbfbfb
;
min-height
:
20px
;
}
td
.deploy-board-container
{
padding
:
0
;
}
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