From 5279a39e97e46aba4aad38adca8b9f9100a36c74 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 12 Jun 2017 07:48:54 +0000 Subject: [PATCH] Use vue files for navigation tabs and buttons --- .../pipelines/components/nav_controls.js | 52 ------------- .../pipelines/components/nav_controls.vue | 54 +++++++++++++ .../pipelines/components/navigation_tabs.js | 72 ------------------ .../pipelines/components/navigation_tabs.vue | 76 +++++++++++++++++++ app/assets/javascripts/pipelines/pipelines.js | 4 +- .../pipelines/nav_controls_spec.js | 2 +- 6 files changed, 133 insertions(+), 127 deletions(-) delete mode 100644 app/assets/javascripts/pipelines/components/nav_controls.js create mode 100644 app/assets/javascripts/pipelines/components/nav_controls.vue delete mode 100644 app/assets/javascripts/pipelines/components/navigation_tabs.js create mode 100644 app/assets/javascripts/pipelines/components/navigation_tabs.vue diff --git a/app/assets/javascripts/pipelines/components/nav_controls.js b/app/assets/javascripts/pipelines/components/nav_controls.js deleted file mode 100644 index 6aa10531034..00000000000 --- a/app/assets/javascripts/pipelines/components/nav_controls.js +++ /dev/null @@ -1,52 +0,0 @@ -export default { - props: { - newPipelinePath: { - type: String, - required: true, - }, - - hasCiEnabled: { - type: Boolean, - required: true, - }, - - helpPagePath: { - type: String, - required: true, - }, - - ciLintPath: { - type: String, - required: true, - }, - - canCreatePipeline: { - type: Boolean, - required: true, - }, - }, - - template: ` - - `, -}; diff --git a/app/assets/javascripts/pipelines/components/nav_controls.vue b/app/assets/javascripts/pipelines/components/nav_controls.vue new file mode 100644 index 00000000000..632fc167f2b --- /dev/null +++ b/app/assets/javascripts/pipelines/components/nav_controls.vue @@ -0,0 +1,54 @@ + + diff --git a/app/assets/javascripts/pipelines/components/navigation_tabs.js b/app/assets/javascripts/pipelines/components/navigation_tabs.js deleted file mode 100644 index 1626ae17a30..00000000000 --- a/app/assets/javascripts/pipelines/components/navigation_tabs.js +++ /dev/null @@ -1,72 +0,0 @@ -export default { - props: { - scope: { - type: String, - required: true, - }, - - count: { - type: Object, - required: true, - }, - - paths: { - type: Object, - required: true, - }, - }, - - mounted() { - $(document).trigger('init.scrolling-tabs'); - }, - - template: ` - - `, -}; diff --git a/app/assets/javascripts/pipelines/components/navigation_tabs.vue b/app/assets/javascripts/pipelines/components/navigation_tabs.vue new file mode 100644 index 00000000000..d2f6d47f043 --- /dev/null +++ b/app/assets/javascripts/pipelines/components/navigation_tabs.vue @@ -0,0 +1,76 @@ + + diff --git a/app/assets/javascripts/pipelines/pipelines.js b/app/assets/javascripts/pipelines/pipelines.js index 23b967b4b32..b530461837c 100644 --- a/app/assets/javascripts/pipelines/pipelines.js +++ b/app/assets/javascripts/pipelines/pipelines.js @@ -5,8 +5,8 @@ import pipelinesTableComponent from '../vue_shared/components/pipelines_table'; import tablePagination from '../vue_shared/components/table_pagination.vue'; import emptyState from './components/empty_state.vue'; import errorState from './components/error_state.vue'; -import navigationTabs from './components/navigation_tabs'; -import navigationControls from './components/nav_controls'; +import navigationTabs from './components/navigation_tabs.vue'; +import navigationControls from './components/nav_controls.vue'; import loadingIcon from '../vue_shared/components/loading_icon.vue'; import Poll from '../lib/utils/poll'; diff --git a/spec/javascripts/pipelines/nav_controls_spec.js b/spec/javascripts/pipelines/nav_controls_spec.js index 601eebce38a..f1697840fcd 100644 --- a/spec/javascripts/pipelines/nav_controls_spec.js +++ b/spec/javascripts/pipelines/nav_controls_spec.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import navControlsComp from '~/pipelines/components/nav_controls'; +import navControlsComp from '~/pipelines/components/nav_controls.vue'; describe('Pipelines Nav Controls', () => { let NavControlsComponent;