From d1da5624d74b6ae6ea779df1485c661fa3014fd8 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Wed, 10 May 2017 15:52:09 +0000 Subject: Tech debt: Creates vue component for loading icon --- .../javascripts/boards/components/board_list.js | 19 ++++---- .../javascripts/boards/components/modal/index.js | 4 +- .../commit/pipelines/pipelines_table.js | 17 ++++--- .../deploy_keys/components/action_btn.vue | 13 +++--- .../javascripts/deploy_keys/components/app.vue | 16 +++---- .../environments/components/environment.vue | 15 +++--- .../components/environment_actions.vue | 10 ++-- .../components/environment_rollback.vue | 10 ++-- .../environments/components/environment_stop.vue | 10 ++-- .../environments/components/environments_table.vue | 8 ++-- .../folder/environments_folder_view.vue | 15 +++--- .../pipelines/components/async_button.vue | 10 ++-- .../pipelines/components/graph/graph_component.vue | 9 ++-- .../pipelines/components/pipelines_actions.js | 10 ++-- .../javascripts/pipelines/components/stage.vue | 15 +++--- app/assets/javascripts/pipelines/pipelines.js | 14 +++--- .../vue_shared/components/loading_icon.vue | 33 ++++++++++++++ app/assets/stylesheets/pages/environments.scss | 5 -- app/assets/stylesheets/pages/pipelines.scss | 6 --- .../vue_shared/components/loading_icon_spec.js | 53 ++++++++++++++++++++++ 20 files changed, 187 insertions(+), 105 deletions(-) create mode 100644 app/assets/javascripts/vue_shared/components/loading_icon.vue create mode 100644 spec/javascripts/vue_shared/components/loading_icon_spec.js diff --git a/app/assets/javascripts/boards/components/board_list.js b/app/assets/javascripts/boards/components/board_list.js index 49a775002c3..7ee2696e720 100644 --- a/app/assets/javascripts/boards/components/board_list.js +++ b/app/assets/javascripts/boards/components/board_list.js @@ -2,6 +2,7 @@ import boardNewIssue from './board_new_issue'; import boardCard from './board_card'; import eventHub from '../eventhub'; +import loadingIcon from '../../vue_shared/components/loading_icon.vue'; const Store = gl.issueBoards.BoardsStore; @@ -44,6 +45,7 @@ export default { components: { boardCard, boardNewIssue, + loadingIcon, }, methods: { listHeight() { @@ -156,10 +158,7 @@ export default { class="board-list-loading text-center" aria-label="Loading issues" v-if="loading"> - + - + + + Showing all issues diff --git a/app/assets/javascripts/boards/components/modal/index.js b/app/assets/javascripts/boards/components/modal/index.js index a61cc7954a1..507f16f3f06 100644 --- a/app/assets/javascripts/boards/components/modal/index.js +++ b/app/assets/javascripts/boards/components/modal/index.js @@ -2,6 +2,7 @@ import Vue from 'vue'; import queryData from '../../utils/query_data'; +import loadingIcon from '../../../vue_shared/components/loading_icon.vue'; require('./header'); require('./list'); @@ -137,6 +138,7 @@ gl.issueBoards.IssuesModal = Vue.extend({ 'modal-list': gl.issueBoards.ModalList, 'modal-footer': gl.issueBoards.ModalFooter, 'empty-state': gl.issueBoards.ModalEmptyState, + loadingIcon, }, template: `
- +
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.js b/app/assets/javascripts/commit/pipelines/pipelines_table.js index ad9c600b499..b8be0d8a301 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_table.js +++ b/app/assets/javascripts/commit/pipelines/pipelines_table.js @@ -6,6 +6,7 @@ import PipelineStore from '../../pipelines/stores/pipelines_store'; import eventHub from '../../pipelines/event_hub'; import EmptyState from '../../pipelines/components/empty_state.vue'; import ErrorState from '../../pipelines/components/error_state.vue'; +import loadingIcon from '../../vue_shared/components/loading_icon.vue'; import '../../lib/utils/common_utils'; import '../../vue_shared/vue_resource_interceptor'; import Poll from '../../lib/utils/poll'; @@ -17,8 +18,6 @@ import Poll from '../../lib/utils/poll'; * We need a store to store the received environemnts. * We need a service to communicate with the server. * - * Necessary SVG in the table are provided as props. This should be refactored - * as soon as we have Webpack and can load them directly into JS files. */ export default Vue.component('pipelines-table', { @@ -27,6 +26,7 @@ export default Vue.component('pipelines-table', { 'pipelines-table-component': PipelinesTableComponent, 'error-state': ErrorState, 'empty-state': EmptyState, + loadingIcon, }, /** @@ -151,13 +151,12 @@ export default Vue.component('pipelines-table', { template: `
-
-