From 1bf74bfd255372f17f9135ba0ce6ad9111c845d9 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Thu, 17 May 2018 10:25:11 +0100 Subject: Moves string to a constant --- app/assets/javascripts/pipelines/components/pipelines_table_row.vue | 4 +++- app/assets/javascripts/pipelines/components/stage.vue | 3 ++- app/assets/javascripts/pipelines/constants.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/pipelines/components/pipelines_table_row.vue b/app/assets/javascripts/pipelines/components/pipelines_table_row.vue index 41b5e418dd1..fdf8c04207f 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_table_row.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_table_row.vue @@ -9,6 +9,7 @@ import CommitComponent from '../../vue_shared/components/commit.vue'; import LoadingButton from '../../vue_shared/components/loading_button.vue'; import Icon from '../../vue_shared/components/icon.vue'; + import { PIPELINES_TABLE } from '../constants.js' /** * Pipeline table row. @@ -46,6 +47,7 @@ required: true, }, }, + pipelinesTable: PIPELINES_TABLE, data() { return { isRetrying: false, @@ -297,7 +299,7 @@ v-for="(stage, index) in pipeline.details.stages" :key="index"> diff --git a/app/assets/javascripts/pipelines/components/stage.vue b/app/assets/javascripts/pipelines/components/stage.vue index 61cf7c1b665..1e6392cf60a 100644 --- a/app/assets/javascripts/pipelines/components/stage.vue +++ b/app/assets/javascripts/pipelines/components/stage.vue @@ -21,6 +21,7 @@ import Icon from '../../vue_shared/components/icon.vue'; import LoadingIcon from '../../vue_shared/components/loading_icon.vue'; import JobComponent from './graph/job_component.vue'; import tooltip from '../../vue_shared/directives/tooltip'; +import { PIPELINES_TABLE } from '../constants.js' export default { components: { @@ -141,7 +142,7 @@ export default { }, pipelineActionRequestComplete() { - if (this.type === 'PIPELINES_TABLE') { + if (this.type === PIPELINES_TABLE) { // warn the table to update eventHub.$emit('refreshPipelinesTable'); } else { diff --git a/app/assets/javascripts/pipelines/constants.js b/app/assets/javascripts/pipelines/constants.js index b384c7500e7..eaa11a84cb9 100644 --- a/app/assets/javascripts/pipelines/constants.js +++ b/app/assets/javascripts/pipelines/constants.js @@ -1,2 +1,2 @@ -// eslint-disable-next-line import/prefer-default-export export const CANCEL_REQUEST = 'CANCEL_REQUEST'; +export const PIPELINES_TABLE = 'PIPELINES_TABLE'; -- cgit v1.2.1