diff --git a/src/mixins/graphql.js b/src/mixins/graphql.js index 97363c4f7..26d208000 100644 --- a/src/mixins/graphql.js +++ b/src/mixins/graphql.js @@ -1,6 +1,4 @@ -import { mapState } from 'vuex' - -/** +/* * Copyright (C) NIWA & British Crown (Met Office) & Contributors. * * This program is free software: you can redistribute it and/or modify @@ -17,15 +15,18 @@ import { mapState } from 'vuex' * along with this program. If not, see . */ +import { mapState } from 'vuex' + /** * A mixin that contains data used for a GraphQL subscription, such as the * query variables. * - * To be used in Views that are bound to VueRouter routes that contain the + * To be used in Views that are bound to Vue-Router routes that contain the * :workflowName param. */ export default { props: { + /** This is set by vue-router */ workflowName: { type: String, required: true diff --git a/src/router/index.js b/src/router/index.js index ea6d2451a..4d3f00b57 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -90,15 +90,12 @@ router.beforeEach(async (to, from) => { // Set toolbar title: let title = to.name - let workflowName = null if (to.meta.toolbar) { // When a workflow is being displayed, we set the title to a // different value. title = to.params.workflowName - workflowName = to.params.workflowName } store.commit('app/setTitle', title) - store.commit('workflows/SET_WORKFLOW_NAME', workflowName) store.dispatch('setAlert', null) }) diff --git a/src/store/workflows.module.js b/src/store/workflows.module.js index bd68fd89f..7fcd95797 100644 --- a/src/store/workflows.module.js +++ b/src/store/workflows.module.js @@ -33,16 +33,6 @@ const state = () => ({ $index: {}, children: [] }, - /** - * This holds the name of the current workflow. This is set by VueRouter - * and is used to decide what's the current workflow. It is used in conjunction - * with the workflows/workflows (above) when finding the current workflow and - * using it, for instance, to create the GraphQL variables of a workflow - * view (see mixins used in the Tree View). - * - * @type {String} - */ - workflowName: null }) const getters = { @@ -475,10 +465,6 @@ function remove (state, prunedID) { } const mutations = { - // the old callback methods - SET_WORKFLOW_NAME (state, data) { - state.workflowName = data - }, // the new cylc tree methods CREATE: createTree, UPDATE: update, diff --git a/tests/unit/components/cylc/toolbar.vue.spec.js b/tests/unit/components/cylc/toolbar.vue.spec.js index ccefc99df..a615d3617 100644 --- a/tests/unit/components/cylc/toolbar.vue.spec.js +++ b/tests/unit/components/cylc/toolbar.vue.spec.js @@ -48,7 +48,6 @@ describe('Toolbar component', () => { status: WorkflowState.RUNNING.name } ] - store.state.workflows.workflowName = 'test' }) it('should mount the component', async () => {