⚡ Adjust all calls
This commit is contained in:
@@ -23,23 +23,23 @@ export const genericHelpers = mixins(showMessage, renderText).extend({
|
||||
displayTimer (msPassed: number, showMs = false): string {
|
||||
if (msPassed < 60000) {
|
||||
if (showMs === false) {
|
||||
return `${this.$n(Math.floor(msPassed / 1000), 'decimal')} ${this.$baseText('genericHelpers.sec')}`;
|
||||
return `${this.$n(Math.floor(msPassed / 1000), 'decimal')} ${this.$i18n2.baseText('genericHelpers.sec')}`;
|
||||
}
|
||||
|
||||
return `${this.$n(msPassed / 1000, 'decimal')} ${this.$baseText('genericHelpers.sec')}`;
|
||||
return `${this.$i18n2.number(msPassed / 1000, 'decimal')} ${this.$i18n2.baseText('genericHelpers.sec')}`;
|
||||
}
|
||||
|
||||
const secondsPassed = Math.floor(msPassed / 1000);
|
||||
const minutesPassed = Math.floor(secondsPassed / 60);
|
||||
|
||||
return `${this.$n(minutesPassed, 'decimal')}:${this.$n(secondsPassed, 'decimal')} ${this.$baseText('genericHelpers.min')}`;
|
||||
return `${this.$i18n2.number(minutesPassed, 'decimal')}:${this.$i18n2.number(secondsPassed, 'decimal')} ${this.$i18n2.baseText('genericHelpers.min')}`;
|
||||
},
|
||||
editAllowedCheck (): boolean {
|
||||
if (this.isReadOnly) {
|
||||
this.$showMessage({
|
||||
// title: 'Workflow can not be changed!',
|
||||
title: this.$baseText('genericHelpers.showMessage.title'),
|
||||
message: this.$baseText('genericHelpers.showMessage.message'),
|
||||
title: this.$i18n2.baseText('genericHelpers.showMessage.title'),
|
||||
message: this.$i18n2.baseText('genericHelpers.showMessage.message'),
|
||||
type: 'error',
|
||||
duration: 0,
|
||||
});
|
||||
@@ -58,7 +58,7 @@ export const genericHelpers = mixins(showMessage, renderText).extend({
|
||||
this.loadingService = this.$loading(
|
||||
{
|
||||
lock: true,
|
||||
text: text || this.$baseText('genericHelpers.loading'),
|
||||
text: text || this.$i18n2.baseText('genericHelpers.loading'),
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(255, 255, 255, 0.8)',
|
||||
},
|
||||
|
||||
@@ -181,7 +181,7 @@ export const nodeBase = mixins(
|
||||
hover: false,
|
||||
showOutputLabel: nodeTypeData.outputs.length === 1,
|
||||
size: nodeTypeData.outputs.length >= 3 ? 'small' : 'medium',
|
||||
hoverMessage: this.$baseText('nodeBase.clickToAddNodeOrDragToConnect'),
|
||||
hoverMessage: this.$i18n2.baseText('nodeBase.clickToAddNodeOrDragToConnect'),
|
||||
},
|
||||
endpointHoverStyle: {
|
||||
fill: getStyleTokenValue('--color-primary'),
|
||||
|
||||
@@ -263,8 +263,8 @@ export const pushConnection = mixins(
|
||||
// Workflow did execute without a problem
|
||||
this.$titleSet(workflow.name as string, 'IDLE');
|
||||
this.$showMessage({
|
||||
title: this.$baseText('pushConnection.showMessage.title'),
|
||||
message: this.$baseText('pushConnection.showMessage.message'),
|
||||
title: this.$i18n2.baseText('pushConnection.showMessage.title'),
|
||||
message: this.$i18n2.baseText('pushConnection.showMessage.message'),
|
||||
type: 'success',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ export const renderText = Vue.extend({
|
||||
},
|
||||
|
||||
/**
|
||||
* Render a string of dynamic text, i.e. a string with a constructed path to the localized value in the node text object - in the credentials modal (`$credText`), in the node view (`$nodeText`), or in the headers (`$headerText`) in the nodes panel and node view. _Private method_, to be called only from within this mixin.
|
||||
* Render a string of dynamic text, i.e. a string with a constructed path to the localized value in the node text object - in the credentials modal (`$i18n2.credText`), in the node view (`$i18n2.nodeText`), or in the headers (`$i18n2.headerText`) in the nodes panel and node view. _Private method_, to be called only from within this mixin.
|
||||
*
|
||||
* Unlike in `$baseText`, the fallback has to be set manually for dynamic text.
|
||||
* Unlike in `$i18n2.baseText`, the fallback has to be set manually for dynamic text.
|
||||
*/
|
||||
__render(
|
||||
{ key, fallback }: { key: string; fallback: string; },
|
||||
|
||||
@@ -135,8 +135,8 @@ export const showMessage = mixins(externalHooks, renderText).extend({
|
||||
async confirmMessage (message: string, headline: string, type: MessageType | null = 'warning', confirmButtonText?: string, cancelButtonText?: string): Promise<boolean> {
|
||||
try {
|
||||
const options: ElMessageBoxOptions = {
|
||||
confirmButtonText: confirmButtonText || this.$baseText('showMessage.ok'),
|
||||
cancelButtonText: cancelButtonText || this.$baseText('showMessage.cancel'),
|
||||
confirmButtonText: confirmButtonText || this.$i18n2.baseText('showMessage.ok'),
|
||||
cancelButtonText: cancelButtonText || this.$i18n2.baseText('showMessage.cancel'),
|
||||
dangerouslyUseHTMLString: true,
|
||||
...(type && { type }),
|
||||
};
|
||||
@@ -174,7 +174,7 @@ export const showMessage = mixins(externalHooks, renderText).extend({
|
||||
<summary
|
||||
style="color: #ff6d5a; font-weight: bold; cursor: pointer;"
|
||||
>
|
||||
${this.$baseText('showMessage.showDetails')}
|
||||
${this.$i18n2.baseText('showMessage.showDetails')}
|
||||
</summary>
|
||||
<p>${node.name}: ${errorDescription}</p>
|
||||
</details>
|
||||
|
||||
@@ -480,8 +480,8 @@ export const workflowHelpers = mixins(
|
||||
this.$store.commit('removeActiveAction', 'workflowSaving');
|
||||
|
||||
this.$showMessage({
|
||||
title: this.$baseText('workflowHelpers.showMessage.title'),
|
||||
message: this.$baseText('workflowHelpers.showMessage.message') + `: "${e.message}"`,
|
||||
title: this.$i18n2.baseText('workflowHelpers.showMessage.title'),
|
||||
message: this.$i18n2.baseText('workflowHelpers.showMessage.message') + `: "${e.message}"`,
|
||||
type: 'error',
|
||||
});
|
||||
|
||||
@@ -554,8 +554,8 @@ export const workflowHelpers = mixins(
|
||||
this.$store.commit('removeActiveAction', 'workflowSaving');
|
||||
|
||||
this.$showMessage({
|
||||
title: this.$baseText('workflowHelpers.showMessage.title'),
|
||||
message: this.$baseText('workflowHelpers.showMessage.message') + `: "${e.message}"`,
|
||||
title: this.$i18n2.baseText('workflowHelpers.showMessage.title'),
|
||||
message: this.$i18n2.baseText('workflowHelpers.showMessage.message') + `: "${e.message}"`,
|
||||
type: 'error',
|
||||
});
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export const workflowRun = mixins(
|
||||
// Do not start if the connection to server is not active
|
||||
// because then it can not receive the data as it executes.
|
||||
throw new Error(
|
||||
this.$baseText('workflowRun.noActiveConnectionToTheServer'),
|
||||
this.$i18n2.baseText('workflowRun.noActiveConnectionToTheServer'),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ export const workflowRun = mixins(
|
||||
}
|
||||
|
||||
this.$showMessage({
|
||||
title: this.$baseText('workflowRun.showMessage.title'),
|
||||
message: this.$baseText('workflowRun.showMessage.message') + ':<br /> - ' + errorMessages.join('<br /> - '),
|
||||
title: this.$i18n2.baseText('workflowRun.showMessage.title'),
|
||||
message: this.$i18n2.baseText('workflowRun.showMessage.message') + ':<br /> - ' + errorMessages.join('<br /> - '),
|
||||
type: 'error',
|
||||
duration: 0,
|
||||
});
|
||||
@@ -206,8 +206,8 @@ export const workflowRun = mixins(
|
||||
this.$titleSet(workflow.name as string, 'ERROR');
|
||||
this.$showError(
|
||||
error,
|
||||
this.$baseText('workflowRun.showError.title'),
|
||||
this.$baseText('workflowRun.showError.message') + ':',
|
||||
this.$i18n2.baseText('workflowRun.showError.title'),
|
||||
this.$i18n2.baseText('workflowRun.showError.message') + ':',
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user