Added toast tweaks (#2530)

* Added toast fallback

* Added a parameter to copy function to deduce cut operations

* 👕 Fix Liniting
This commit is contained in:
Anuj Kapoor 2021-12-10 18:54:09 +05:30 committed by GitHub
parent 6453996de3
commit 1d05185c4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -840,15 +840,22 @@ export default mixins(
}, },
cutSelectedNodes () { cutSelectedNodes () {
this.copySelectedNodes(); this.copySelectedNodes(true);
this.deleteSelectedNodes(); this.deleteSelectedNodes();
}, },
copySelectedNodes () { copySelectedNodes (isCut: boolean) {
this.getSelectedNodesToSave().then((data) => { this.getSelectedNodesToSave().then((data) => {
const nodeData = JSON.stringify(data, null, 2); const nodeData = JSON.stringify(data, null, 2);
this.copyToClipboard(nodeData); this.copyToClipboard(nodeData);
if (data.nodes.length > 0) { if (data.nodes.length > 0) {
if(!isCut){
this.$showMessage({
title: 'Copied!',
message: '',
type: 'success',
});
}
this.$telemetry.track('User copied nodes', { this.$telemetry.track('User copied nodes', {
node_types: data.nodes.map((node) => node.type), node_types: data.nodes.map((node) => node.type),
workflow_id: this.$store.getters.workflowId, workflow_id: this.$store.getters.workflowId,
@ -963,12 +970,6 @@ export default mixins(
this.$showError(error, 'Problem deleting the test-webhook', 'There was a problem deleting webhook:'); this.$showError(error, 'Problem deleting the test-webhook', 'There was a problem deleting webhook:');
return; return;
} }
this.$showMessage({
title: 'Webhook deleted',
message: `The webhook was deleted successfully`,
type: 'success',
});
}, },
/** /**