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
cf706800
Commit
cf706800
authored
Mar 08, 2019
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduces EE differences for environments table
Async loads EE components Creates a Mixin for EE properties
parent
26477f38
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
7 deletions
+65
-7
app/assets/javascripts/environments/components/environments_table.vue
...avascripts/environments/components/environments_table.vue
+36
-7
app/assets/javascripts/environments/mixins/environments_table_mixin.js
...vascripts/environments/mixins/environments_table_mixin.js
+10
-0
changelogs/unreleased/10081-env-table.yml
changelogs/unreleased/10081-env-table.yml
+5
-0
spec/javascripts/environments/environment_table_spec.js
spec/javascripts/environments/environment_table_spec.js
+14
-0
No files found.
app/assets/javascripts/environments/components/environments_table.vue
View file @
cf706800
...
...
@@ -4,21 +4,24 @@
*/
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
_
from
'
underscore
'
;
import
environmentItem
from
'
./environment_item.vue
'
;
import
environmentTableMixin
from
'
ee_else_ce/environments/mixins/environments_table_mixin
'
;
import
EnvironmentItem
from
'
./environment_item.vue
'
;
export
default
{
components
:
{
e
nvironmentItem
,
E
nvironmentItem
,
GlLoadingIcon
,
DeployBoard
:
()
=>
import
(
'
ee_component/environments/components/deploy_board_component.vue
'
),
CanaryDeploymentCallout
:
()
=>
import
(
'
ee_component/environments/components/canary_deployment_callout.vue
'
),
},
mixins
:
[
environmentTableMixin
],
props
:
{
environments
:
{
type
:
Array
,
required
:
true
,
default
:
()
=>
[],
},
canReadEnvironment
:
{
type
:
Boolean
,
required
:
false
,
...
...
@@ -95,6 +98,21 @@ export default {
:can-read-environment="canReadEnvironment"
/>
<div
v-if=
"shouldRenderDeployBoard"
:key=
"`deploy-board-row-$
{i}`"
class="js-deploy-board-row"
>
<div
class=
"deploy-board-container"
>
<deploy-board
:deploy-board-data=
"model.deployBoardData"
:is-loading=
"model.isLoadingDeployBoard"
:is-empty=
"model.isEmptyDeployBoard"
:logs-path=
"model.logs_path"
/>
</div>
</div>
<template
v-if=
"shouldRenderFolderContent(model)"
>
<div
v-if=
"model.isLoadingFolderContent"
:key=
"`loading-item-$
{i}`">
<gl-loading-icon
:size=
"2"
class=
"prepend-top-16"
/>
...
...
@@ -111,13 +129,24 @@ export default {
<div
:key=
"`sub-div-$
{i}`">
<div
class=
"text-center prepend-top-10"
>
<a
:href=
"folderUrl(model)"
class=
"btn btn-default"
>
{{
s__
(
'
Environments|Show all
'
)
}}
</a>
<a
:href=
"folderUrl(model)"
class=
"btn btn-default"
>
{{
s__
(
'
Environments|Show all
'
)
}}
</a>
</div>
</div>
</
template
>
</template>
<
template
v-if=
"shouldShowCanaryCallout(model)"
>
<canary-deployment-callout
:key=
"`canary-promo-$
{i}`"
:canary-deployment-feature-id="canaryDeploymentFeatureId"
:user-callouts-path="userCalloutsPath"
:lock-promotion-svg-path="lockPromotionSvgPath"
:help-canary-deployments-path="helpCanaryDeploymentsPath"
:data-js-canary-promo-key="i"
/>
</
template
>
</template>
</div>
</template>
app/assets/javascripts/environments/mixins/environments_table_mixin.js
0 → 100644
View file @
cf706800
export
default
{
methods
:
{
shouldShowCanaryCallout
()
{
return
false
;
},
shouldRenderDeployBoard
()
{
return
false
;
},
},
};
changelogs/unreleased/10081-env-table.yml
0 → 100644
View file @
cf706800
---
title
:
Removes EE differences for environments_table.vue
merge_request
:
author
:
type
:
other
spec/javascripts/environments/environment_table_spec.js
View file @
cf706800
...
...
@@ -6,6 +6,14 @@ describe('Environment table', () => {
let
Component
;
let
vm
;
const
eeOnlyProps
=
{
canaryDeploymentFeatureId
:
'
canary_deployment
'
,
showCanaryDeploymentCallout
:
true
,
userCalloutsPath
:
'
/callouts
'
,
lockPromotionSvgPath
:
'
/assets/illustrations/lock-promotion.svg
'
,
helpCanaryDeploymentsPath
:
'
help/canary-deployments
'
,
};
beforeEach
(()
=>
{
Component
=
Vue
.
extend
(
environmentTableComp
);
});
...
...
@@ -27,6 +35,7 @@ describe('Environment table', () => {
vm
=
mountComponent
(
Component
,
{
environments
:
[
mockItem
],
canReadEnvironment
:
true
,
...
eeOnlyProps
,
});
expect
(
vm
.
$el
.
getAttribute
(
'
class
'
)).
toContain
(
'
ci-table
'
);
...
...
@@ -67,6 +76,7 @@ describe('Environment table', () => {
vm
=
mountComponent
(
Component
,
{
environments
:
mockItems
,
canReadEnvironment
:
true
,
...
eeOnlyProps
,
});
const
[
old
,
newer
,
older
,
noDeploy
]
=
mockItems
;
...
...
@@ -130,6 +140,7 @@ describe('Environment table', () => {
vm
=
mountComponent
(
Component
,
{
environments
:
mockItems
,
canReadEnvironment
:
true
,
...
eeOnlyProps
,
});
const
[
prod
,
review
,
staging
]
=
mockItems
;
...
...
@@ -166,6 +177,7 @@ describe('Environment table', () => {
vm
=
mountComponent
(
Component
,
{
environments
:
mockItems
,
canReadEnvironment
:
true
,
...
eeOnlyProps
,
});
const
[
old
,
newer
,
older
]
=
mockItems
;
...
...
@@ -192,6 +204,7 @@ describe('Environment table', () => {
vm
=
mountComponent
(
Component
,
{
environments
:
mockItems
,
canReadEnvironment
:
true
,
...
eeOnlyProps
,
});
const
[
old
,
newer
,
older
]
=
mockItems
;
...
...
@@ -240,6 +253,7 @@ describe('Environment table', () => {
vm
=
mountComponent
(
Component
,
{
environments
:
mockItems
,
canReadEnvironment
:
true
,
...
eeOnlyProps
,
});
expect
(
vm
.
sortedEnvironments
.
map
(
env
=>
env
.
name
)).
toEqual
([
...
...
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