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 () {
this.copySelectedNodes();
this.copySelectedNodes(true);
this.deleteSelectedNodes();
},
copySelectedNodes () {
copySelectedNodes (isCut: boolean) {
this.getSelectedNodesToSave().then((data) => {
const nodeData = JSON.stringify(data, null, 2);
this.copyToClipboard(nodeData);
if (data.nodes.length > 0) {
if(!isCut){
this.$showMessage({
title: 'Copied!',
message: '',
type: 'success',
});
}
this.$telemetry.track('User copied nodes', {
node_types: data.nodes.map((node) => node.type),
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:');
return;
}
this.$showMessage({
title: 'Webhook deleted',
message: `The webhook was deleted successfully`,
type: 'success',
});
},
/**