diff options
author | Phil Hughes <me@iamphill.com> | 2018-05-30 15:31:15 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-05-30 15:31:15 +0300 |
commit | 3270e140772319f74ede743c61a94af84a850b97 (patch) | |
tree | 0aa6ba5c01c233a34b152a9ca8ac8841a1b7af7b /app/assets/javascripts/ide/components/jobs/stage.vue | |
parent | c9d676c1069e6e88b4eeeea2246cc5706b56f2ab (diff) |
changed mutation to return new array
this makes the component completly unaware of the store, instead it emits
events to the parent which knows about the store
Diffstat (limited to 'app/assets/javascripts/ide/components/jobs/stage.vue')
-rw-r--r-- | app/assets/javascripts/ide/components/jobs/stage.vue | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/assets/javascripts/ide/components/jobs/stage.vue b/app/assets/javascripts/ide/components/jobs/stage.vue index 370bb61bae8..5b24bb1f5a7 100644 --- a/app/assets/javascripts/ide/components/jobs/stage.vue +++ b/app/assets/javascripts/ide/components/jobs/stage.vue @@ -1,5 +1,4 @@ <script> -import { mapActions } from 'vuex'; import tooltip from '../../../vue_shared/directives/tooltip'; import Icon from '../../../vue_shared/components/icon.vue'; import CiIcon from '../../../vue_shared/components/ci_icon.vue'; @@ -38,16 +37,17 @@ export default { return this.stage.jobs.length; }, }, - created() { - this.fetchJobs(this.stage); - }, mounted() { const { stageTitle } = this.$refs; this.showTooltip = stageTitle.scrollWidth > stageTitle.offsetWidth; + + this.$emit('fetch', this.stage); }, methods: { - ...mapActions('pipelines', ['fetchJobs', 'toggleStageCollapsed']), + toggleCollapsed() { + this.$emit('toggleCollapsed', this.stage.id); + }, }, }; </script> @@ -61,7 +61,7 @@ export default { :class="{ 'border-bottom-0': stage.isCollapsed }" - @click="toggleStageCollapsed(stage.id)" + @click="toggleCollapsed" > <ci-icon :status="stage.status" |