refactor(editor): Refactor utils files and mixins (#4654)
* ✨ Added `utils` module. Moved `canvasHelpers` and old `utils.ts` file to it * ✨ Moved rest of utils and helpers * ⚡ Fixing sytax errors * 🔨 Refactoring new utils files * 🔨 Organizing imports, adding comments and a bit more refactoring * ✔️ Fixing tests * 🔨 Moving mixins to `src`
This commit is contained in:
committed by
GitHub
parent
67983e8f94
commit
5059c57f4a
31
packages/editor-ui/src/mixins/titleChange.ts
Normal file
31
packages/editor-ui/src/mixins/titleChange.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
import {
|
||||
WorkflowTitleStatus,
|
||||
} from '../../Interface';
|
||||
|
||||
export const titleChange = Vue.extend({
|
||||
methods: {
|
||||
/**
|
||||
* Change title of n8n tab
|
||||
*
|
||||
* @param {string} workflow Name of workflow
|
||||
* @param {WorkflowTitleStatus} status Status of workflow
|
||||
*/
|
||||
$titleSet(workflow: string, status: WorkflowTitleStatus) {
|
||||
let icon = '⚠️';
|
||||
if (status === 'EXECUTING') {
|
||||
icon = '🔄';
|
||||
} else if (status === 'IDLE') {
|
||||
icon = '▶️';
|
||||
}
|
||||
|
||||
window.document.title = `n8n - ${icon} ${workflow}`;
|
||||
},
|
||||
|
||||
$titleReset() {
|
||||
document.title = `n8n - Workflow Automation`;
|
||||
},
|
||||
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user