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
affd4359
Commit
affd4359
authored
Mar 12, 2019
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes EE differences for folder_view
Moves the EE specs into an EE file Creates a EE version of the mixin
parent
75359504
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
38 deletions
+131
-38
app/assets/javascripts/environments/folder/environments_folder_view.vue
...ascripts/environments/folder/environments_folder_view.vue
+4
-24
app/assets/javascripts/environments/mixins/environments_folder_view_mixin.js
...pts/environments/mixins/environments_folder_view_mixin.js
+29
-0
ee/app/assets/javascripts/environments/mixins/environments_folder_view_mixin.js
...pts/environments/mixins/environments_folder_view_mixin.js
+24
-0
ee/spec/javascripts/environments/environments_folder_view_spec.js
...javascripts/environments/environments_folder_view_spec.js
+68
-0
spec/javascripts/environments/folder/environments_folder_view_spec.js
...ipts/environments/folder/environments_folder_view_spec.js
+6
-14
No files found.
app/assets/javascripts/environments/folder/environments_folder_view.vue
View file @
affd4359
<
script
>
<
script
>
import
folderMixin
from
'
ee_else_ce/environments/mixins/environments_folder_view_mixin
'
;
import
environmentsMixin
from
'
../mixins/environments_mixin
'
;
import
environmentsMixin
from
'
../mixins/environments_mixin
'
;
import
CIPaginationMixin
from
'
../../vue_shared/mixins/ci_pagination_api_mixin
'
;
import
CIPaginationMixin
from
'
../../vue_shared/mixins/ci_pagination_api_mixin
'
;
import
StopEnvironmentModal
from
'
../components/stop_environment_modal.vue
'
;
import
StopEnvironmentModal
from
'
../components/stop_environment_modal.vue
'
;
...
@@ -8,7 +9,7 @@ export default {
...
@@ -8,7 +9,7 @@ export default {
StopEnvironmentModal
,
StopEnvironmentModal
,
},
},
mixins
:
[
environmentsMixin
,
CIPaginationMixin
],
mixins
:
[
environmentsMixin
,
CIPaginationMixin
,
folderMixin
],
props
:
{
props
:
{
endpoint
:
{
endpoint
:
{
...
@@ -27,28 +28,6 @@ export default {
...
@@ -27,28 +28,6 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
// ee-only start
canaryDeploymentFeatureId
:
{
type
:
String
,
required
:
true
,
},
showCanaryDeploymentCallout
:
{
type
:
Boolean
,
required
:
true
,
},
userCalloutsPath
:
{
type
:
String
,
required
:
true
,
},
lockPromotionSvgPath
:
{
type
:
String
,
required
:
true
,
},
helpCanaryDeploymentsPath
:
{
type
:
String
,
required
:
true
,
},
// ee-only end
},
},
methods
:
{
methods
:
{
successCallback
(
resp
)
{
successCallback
(
resp
)
{
...
@@ -63,7 +42,8 @@ export default {
...
@@ -63,7 +42,8 @@ export default {
<div
v-if=
"!isLoading"
class=
"top-area"
>
<div
v-if=
"!isLoading"
class=
"top-area"
>
<h4
class=
"js-folder-name environments-folder-name"
>
<h4
class=
"js-folder-name environments-folder-name"
>
{{
s__
(
'
Environments|Environments
'
)
}}
/
<b>
{{
folderName
}}
</b>
{{
s__
(
'
Environments|Environments
'
)
}}
/
<b>
{{
folderName
}}
</b>
</h4>
</h4>
<tabs
:tabs=
"tabs"
scope=
"environments"
@
onChangeTab=
"onChangeTab"
/>
<tabs
:tabs=
"tabs"
scope=
"environments"
@
onChangeTab=
"onChangeTab"
/>
...
...
app/assets/javascripts/environments/mixins/environments_folder_view_mixin.js
0 → 100644
View file @
affd4359
export
default
{
props
:
{
canaryDeploymentFeatureId
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
showCanaryDeploymentCallout
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
userCalloutsPath
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
lockPromotionSvgPath
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
helpCanaryDeploymentsPath
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
};
ee/app/assets/javascripts/environments/mixins/environments_folder_view_mixin.js
0 → 100644
View file @
affd4359
export
default
{
props
:
{
canaryDeploymentFeatureId
:
{
type
:
String
,
required
:
true
,
},
showCanaryDeploymentCallout
:
{
type
:
Boolean
,
required
:
true
,
},
userCalloutsPath
:
{
type
:
String
,
required
:
true
,
},
lockPromotionSvgPath
:
{
type
:
String
,
required
:
true
,
},
helpCanaryDeploymentsPath
:
{
type
:
String
,
required
:
true
,
},
},
};
ee/spec/javascripts/environments/environments_folder_view_spec.js
0 → 100644
View file @
affd4359
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
environmentsFolderViewComponent
from
'
~/environments/folder/environments_folder_view.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
environmentsList
}
from
'
spec/environments/mock_data
'
;
describe
(
'
Environments Folder View
'
,
()
=>
{
let
Component
;
let
component
;
let
mock
;
const
mockData
=
{
endpoint
:
'
environments.json
'
,
folderName
:
'
review
'
,
canReadEnvironment
:
true
,
cssContainerClass
:
'
container
'
,
canaryDeploymentFeatureId
:
'
canary_deployment
'
,
showCanaryDeploymentCallout
:
true
,
userCalloutsPath
:
'
/callouts
'
,
lockPromotionSvgPath
:
'
/assets/illustrations/lock-promotion.svg
'
,
helpCanaryDeploymentsPath
:
'
help/canary-deployments
'
,
};
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
Component
=
Vue
.
extend
(
environmentsFolderViewComponent
);
});
afterEach
(()
=>
{
mock
.
restore
();
component
.
$destroy
();
});
describe
(
'
successful request
'
,
()
=>
{
beforeEach
(()
=>
{
mock
.
onGet
(
mockData
.
endpoint
).
reply
(
200
,
{
environments
:
environmentsList
,
stopped_count
:
1
,
available_count
:
0
,
},
{
'
X-nExt-pAge
'
:
'
2
'
,
'
x-page
'
:
'
1
'
,
'
X-Per-Page
'
:
'
2
'
,
'
X-Prev-Page
'
:
''
,
'
X-TOTAL
'
:
'
20
'
,
'
X-Total-Pages
'
:
'
10
'
,
},
);
component
=
mountComponent
(
Component
,
mockData
);
});
describe
(
'
deploy boards
'
,
()
=>
{
it
(
'
should render arrow to open deploy boards
'
,
done
=>
{
setTimeout
(()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.folder-icon.ic-chevron-right
'
)).
not
.
toBeNull
();
done
();
},
0
);
});
});
});
});
spec/javascripts/environments/folder/environments_folder_view_spec.js
View file @
affd4359
...
@@ -3,6 +3,7 @@ import MockAdapter from 'axios-mock-adapter';
...
@@ -3,6 +3,7 @@ import MockAdapter from 'axios-mock-adapter';
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
environmentsFolderViewComponent
from
'
~/environments/folder/environments_folder_view.vue
'
;
import
environmentsFolderViewComponent
from
'
~/environments/folder/environments_folder_view.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
removeBreakLine
,
removeWhitespace
}
from
'
spec/helpers/vue_component_helper
'
;
import
{
environmentsList
}
from
'
../mock_data
'
;
import
{
environmentsList
}
from
'
../mock_data
'
;
describe
(
'
Environments Folder View
'
,
()
=>
{
describe
(
'
Environments Folder View
'
,
()
=>
{
...
@@ -15,13 +16,11 @@ describe('Environments Folder View', () => {
...
@@ -15,13 +16,11 @@ describe('Environments Folder View', () => {
folderName
:
'
review
'
,
folderName
:
'
review
'
,
canReadEnvironment
:
true
,
canReadEnvironment
:
true
,
cssContainerClass
:
'
container
'
,
cssContainerClass
:
'
container
'
,
// ee-only start
canaryDeploymentFeatureId
:
'
canary_deployment
'
,
canaryDeploymentFeatureId
:
'
canary_deployment
'
,
showCanaryDeploymentCallout
:
true
,
showCanaryDeploymentCallout
:
true
,
userCalloutsPath
:
'
/callouts
'
,
userCalloutsPath
:
'
/callouts
'
,
lockPromotionSvgPath
:
'
/assets/illustrations/lock-promotion.svg
'
,
lockPromotionSvgPath
:
'
/assets/illustrations/lock-promotion.svg
'
,
helpCanaryDeploymentsPath
:
'
help/canary-deployments
'
,
helpCanaryDeploymentsPath
:
'
help/canary-deployments
'
,
// ee-only end
};
};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
...
@@ -96,9 +95,11 @@ describe('Environments Folder View', () => {
...
@@ -96,9 +95,11 @@ describe('Environments Folder View', () => {
it
(
'
should render parent folder name
'
,
done
=>
{
it
(
'
should render parent folder name
'
,
done
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.js-folder-name
'
).
textContent
.
trim
()).
toContain
(
expect
(
'
Environments / review
'
,
removeBreakLine
(
);
removeWhitespace
(
component
.
$el
.
querySelector
(
'
.js-folder-name
'
).
textContent
.
trim
()),
),
).
toContain
(
'
Environments / review
'
);
done
();
done
();
},
0
);
},
0
);
});
});
...
@@ -134,15 +135,6 @@ describe('Environments Folder View', () => {
...
@@ -134,15 +135,6 @@ describe('Environments Folder View', () => {
});
});
});
});
});
});
describe
(
'
deploy boards
'
,
()
=>
{
it
(
'
should render arrow to open deploy boards
'
,
done
=>
{
setTimeout
(()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.folder-icon.ic-chevron-right
'
)).
not
.
toBeNull
();
done
();
},
0
);
});
});
});
});
describe
(
'
unsuccessfull request
'
,
()
=>
{
describe
(
'
unsuccessfull request
'
,
()
=>
{
...
...
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