Skip to content

Commit

Permalink
Remove unused code & tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed May 22, 2024
1 parent b16d196 commit b0204f2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 22 deletions.
9 changes: 5 additions & 4 deletions src/mixins/graphql.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,15 +15,18 @@ import { mapState } from 'vuex'
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

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
Expand Down
3 changes: 0 additions & 3 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand Down
14 changes: 0 additions & 14 deletions src/store/workflows.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/components/cylc/toolbar.vue.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ describe('Toolbar component', () => {
status: WorkflowState.RUNNING.name
}
]
store.state.workflows.workflowName = 'test'
})

it('should mount the component', async () => {
Expand Down

0 comments on commit b0204f2

Please sign in to comment.