diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-03-12 17:44:47 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-03-13 09:28:44 +0000 |
commit | c829c1c4a9dc6bc327c08eed90e20c4fb6c2410d (patch) | |
tree | a380c7a12970fc8d0e5bc6dd46c64ce0b3f53ecf | |
parent | 6fc43e6f17bcb17f9754c571bf4fadd603abe82b (diff) | |
download | gitlab-ce-c829c1c4a9dc6bc327c08eed90e20c4fb6c2410d.tar.gz |
Removes EE differences for folder_view
3 files changed, 49 insertions, 5 deletions
diff --git a/app/assets/javascripts/environments/folder/environments_folder_view.vue b/app/assets/javascripts/environments/folder/environments_folder_view.vue index 80f0e00400b..6fd0561f682 100644 --- a/app/assets/javascripts/environments/folder/environments_folder_view.vue +++ b/app/assets/javascripts/environments/folder/environments_folder_view.vue @@ -1,4 +1,5 @@ <script> +import folderMixin from 'ee_else_ce/environments/mixins/environments_folder_view_mixin'; import environmentsMixin from '../mixins/environments_mixin'; import CIPaginationMixin from '../../vue_shared/mixins/ci_pagination_api_mixin'; import StopEnvironmentModal from '../components/stop_environment_modal.vue'; @@ -8,7 +9,7 @@ export default { StopEnvironmentModal, }, - mixins: [environmentsMixin, CIPaginationMixin], + mixins: [environmentsMixin, CIPaginationMixin, folderMixin], props: { endpoint: { @@ -41,7 +42,8 @@ export default { <div v-if="!isLoading" class="top-area"> <h4 class="js-folder-name environments-folder-name"> - {{ s__('Environments|Environments') }} / <b>{{ folderName }}</b> + {{ s__('Environments|Environments') }} / + <b>{{ folderName }}</b> </h4> <tabs :tabs="tabs" scope="environments" @onChangeTab="onChangeTab" /> @@ -52,6 +54,11 @@ export default { :environments="state.environments" :pagination="state.paginationInformation" :can-read-environment="canReadEnvironment" + :canary-deployment-feature-id="canaryDeploymentFeatureId" + :show-canary-deployment-callout="showCanaryDeploymentCallout" + :user-callouts-path="userCalloutsPath" + :lock-promotion-svg-path="lockPromotionSvgPath" + :help-canary-deployments-path="helpCanaryDeploymentsPath" @onChangePage="onChangePage" /> </div> diff --git a/app/assets/javascripts/environments/mixins/environments_folder_view_mixin.js b/app/assets/javascripts/environments/mixins/environments_folder_view_mixin.js new file mode 100644 index 00000000000..e793a7cadf2 --- /dev/null +++ b/app/assets/javascripts/environments/mixins/environments_folder_view_mixin.js @@ -0,0 +1,29 @@ +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: '', + }, + }, +}; diff --git a/spec/javascripts/environments/folder/environments_folder_view_spec.js b/spec/javascripts/environments/folder/environments_folder_view_spec.js index 69ddd26eef1..ff15067aeac 100644 --- a/spec/javascripts/environments/folder/environments_folder_view_spec.js +++ b/spec/javascripts/environments/folder/environments_folder_view_spec.js @@ -3,6 +3,7 @@ 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 { removeBreakLine, removeWhitespace } from 'spec/helpers/vue_component_helper'; import { environmentsList } from '../mock_data'; describe('Environments Folder View', () => { @@ -15,6 +16,11 @@ describe('Environments Folder View', () => { folderName: 'review', canReadEnvironment: true, cssContainerClass: 'container', + canaryDeploymentFeatureId: 'canary_deployment', + showCanaryDeploymentCallout: true, + userCalloutsPath: '/callouts', + lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg', + helpCanaryDeploymentsPath: 'help/canary-deployments', }; beforeEach(() => { @@ -89,9 +95,11 @@ describe('Environments Folder View', () => { it('should render parent folder name', done => { setTimeout(() => { - expect(component.$el.querySelector('.js-folder-name').textContent.trim()).toContain( - 'Environments / review', - ); + expect( + removeBreakLine( + removeWhitespace(component.$el.querySelector('.js-folder-name').textContent.trim()), + ), + ).toContain('Environments / review'); done(); }, 0); }); |