mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(editor): Adjust time format for negative numbers (no-changelog) (#16194)
This commit is contained in:
@@ -3,6 +3,7 @@ import { I18nClass } from './index';
|
|||||||
describe(I18nClass, () => {
|
describe(I18nClass, () => {
|
||||||
describe('displayTimer', () => {
|
describe('displayTimer', () => {
|
||||||
it('should format duration with hours, minutes and seconds', () => {
|
it('should format duration with hours, minutes and seconds', () => {
|
||||||
|
expect(new I18nClass().displayTimer(-1)).toBe('-1s');
|
||||||
expect(new I18nClass().displayTimer(0)).toBe('0s');
|
expect(new I18nClass().displayTimer(0)).toBe('0s');
|
||||||
expect(new I18nClass().displayTimer(12)).toBe('0s');
|
expect(new I18nClass().displayTimer(12)).toBe('0s');
|
||||||
expect(new I18nClass().displayTimer(123)).toBe('0s');
|
expect(new I18nClass().displayTimer(123)).toBe('0s');
|
||||||
|
|||||||
@@ -107,11 +107,9 @@ export class I18nClass {
|
|||||||
remainingMs = remainingMs % minute;
|
remainingMs = remainingMs % minute;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!showMs) {
|
const remainingSec = showMs ? remainingMs / second : Math.floor(remainingMs / second);
|
||||||
remainingMs -= remainingMs % second;
|
|
||||||
}
|
|
||||||
|
|
||||||
parts.push(`${remainingMs / second}${this.baseText('genericHelpers.secShort')}`);
|
parts.push(`${remainingSec}${this.baseText('genericHelpers.secShort')}`);
|
||||||
|
|
||||||
return parts.join(' ');
|
return parts.join(' ');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
import type { IDataObject } from 'n8n-workflow';
|
||||||
|
|
||||||
import type { IRestApiContext } from '../types';
|
import type { IRestApiContext } from '../types';
|
||||||
import { makeRestApiRequest } from '../utils';
|
import { makeRestApiRequest } from '../utils';
|
||||||
import type { IDataObject } from 'n8n-workflow';
|
|
||||||
|
|
||||||
export interface LdapSyncData {
|
export interface LdapSyncData {
|
||||||
id: number;
|
id: number;
|
||||||
|
|||||||
@@ -284,6 +284,6 @@ export async function streamRequest<T extends object>(
|
|||||||
}
|
}
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
assert(e instanceof Error);
|
assert(e instanceof Error);
|
||||||
onError?.(e as Error);
|
onError?.(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,6 +199,6 @@ describe('GlobalExecutionsListItem', () => {
|
|||||||
|
|
||||||
const executionTimeElement = getByTestId('execution-time');
|
const executionTimeElement = getByTestId('execution-time');
|
||||||
expect(executionTimeElement).toBeVisible();
|
expect(executionTimeElement).toBeVisible();
|
||||||
expect(executionTimeElement.textContent).toBe('30:00m');
|
expect(executionTimeElement.textContent).toBe('30m 0s');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
14
turbo.json
14
turbo.json
@@ -53,6 +53,13 @@
|
|||||||
"lint:frontend": {
|
"lint:frontend": {
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"^build",
|
"^build",
|
||||||
|
"@n8n/rest-api-client#lint",
|
||||||
|
"@n8n/api-types#lint",
|
||||||
|
"@n8n/constants#lint",
|
||||||
|
"@n8n/i18n#lint",
|
||||||
|
"@n8n/permissions#lint",
|
||||||
|
"@n8n/stores#lint",
|
||||||
|
"@n8n/utils#lint",
|
||||||
"@n8n/chat#lint",
|
"@n8n/chat#lint",
|
||||||
"@n8n/codemirror-lang#lint",
|
"@n8n/codemirror-lang#lint",
|
||||||
"@n8n/storybook#lint",
|
"@n8n/storybook#lint",
|
||||||
@@ -94,6 +101,13 @@
|
|||||||
},
|
},
|
||||||
"test:frontend": {
|
"test:frontend": {
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
|
"@n8n/rest-api-client#test",
|
||||||
|
"@n8n/api-types#test",
|
||||||
|
"@n8n/constants#test",
|
||||||
|
"@n8n/i18n#test",
|
||||||
|
"@n8n/permissions#test",
|
||||||
|
"@n8n/stores#test",
|
||||||
|
"@n8n/utils#test",
|
||||||
"@n8n/chat#test",
|
"@n8n/chat#test",
|
||||||
"@n8n/codemirror-lang#test",
|
"@n8n/codemirror-lang#test",
|
||||||
"@n8n/composables#build",
|
"@n8n/composables#build",
|
||||||
|
|||||||
Reference in New Issue
Block a user