Refactor overlay to allow translation

This commit is contained in:
Iván Ovejero 2021-11-19 16:15:35 +01:00
parent ed4f9a5e68
commit ed3fa11a86
4 changed files with 17 additions and 17 deletions

View file

@ -541,6 +541,7 @@ export default {
thisNodeDoesNotHaveAnyParameters: '🇩🇪 This node does not have any parameters.',
},
nodeView: {
dropConnectionToAddNode: '🇩🇪 Drop connection<br />to add node',
addNode: '🇩🇪 Add node',
stopWaitingForWebhookCall: '🇩🇪 Stop waiting for Webhook call',
deletesTheCurrentExecutionData: '🇩🇪 Deletes the current Execution Data.',
@ -589,8 +590,6 @@ export default {
executingWorkflow: '🇩🇪 Executing Workflow',
waitingForWebhookCall: '🇩🇪 Waiting for Webhook-Call',
},
dropConnectionToCreateNode: '🇩🇪 Drop connection<br />to create node',
deleteConnection: '🇩🇪 Delete Connection',
itLooksLikeYouHaveBeenEditingSomething: '🇩🇪 It looks like you have been editing something. If you leave before saving, your changes will be lost.',
thereWasAProblemLoadingTheNodeParametersOfNode: '🇩🇪 There was a problem loading the node-parameters of node',
noNodesGivenToAdd: '🇩🇪 No nodes given to add!',

View file

@ -535,6 +535,7 @@ export default {
thisNodeDoesNotHaveAnyParameters: 'This node does not have any parameters.',
},
nodeView: {
dropConnectionToAddNode: 'Drop connection<br />to add node',
addNode: 'Add node',
stopWaitingForWebhookCall: 'Stop waiting for Webhook call',
deletesTheCurrentExecutionData: 'Deletes the current Execution Data.',
@ -583,8 +584,6 @@ export default {
executingWorkflow: 'Executing Workflow',
waitingForWebhookCall: 'Waiting for Webhook-Call',
},
dropConnectionToCreateNode: 'Drop connection<br />to create node',
deleteConnection: 'Delete Connection',
itLooksLikeYouHaveBeenEditingSomething: 'It looks like you have been editing something. If you leave before saving, your changes will be lost.',
thereWasAProblemLoadingTheNodeParametersOfNode: 'There was a problem loading the node-parameters of node',
noNodesGivenToAdd: 'No nodes given to add!',

View file

@ -1608,7 +1608,21 @@ export default mixins(
this.pullConnActive = true;
this.newNodeInsertPosition = null;
CanvasHelpers.resetConnection(connection);
CanvasHelpers.addOverlays(connection, CanvasHelpers.CONNECTOR_DROP_NODE_OVERLAY);
CanvasHelpers.addOverlays(
connection,
[
[
'Label',
{
id: CanvasHelpers.OVERLAY_DROP_NODE_ID,
label: this.$baseText('nodeView.dropConnectionToAddNode'),
cssClass: 'drop-add-node-label',
location: 0.5,
visible: true,
},
],
],
);
const nodes = [...document.querySelectorAll('.node-default')];
const onMouseMove = (e: MouseEvent) => {

View file

@ -112,18 +112,6 @@ export const CONNECTOR_ARROW_OVERLAYS: OverlaySpec[] = [
],
];
export const CONNECTOR_DROP_NODE_OVERLAY: OverlaySpec[] = [
[
'Label',
{
id: OVERLAY_DROP_NODE_ID,
label: 'Drop connection<br />to add node',
cssClass: 'drop-add-node-label',
location: 0.5,
visible: true,
},
],
];
export const ANCHOR_POSITIONS: {