mirror of
https://github.com/n8n-io/n8n
synced 2026-04-21 15:47:20 +00:00
fix(editor): Adjust time format for negative numbers (no-changelog) (#16194)
This commit is contained in:
parent
aa407350bb
commit
aa03110f2e
6 changed files with 21 additions and 7 deletions
|
|
@ -3,6 +3,7 @@ import { I18nClass } from './index';
|
|||
describe(I18nClass, () => {
|
||||
describe('displayTimer', () => {
|
||||
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(12)).toBe('0s');
|
||||
expect(new I18nClass().displayTimer(123)).toBe('0s');
|
||||
|
|
|
|||
|
|
@ -107,11 +107,9 @@ export class I18nClass {
|
|||
remainingMs = remainingMs % minute;
|
||||
}
|
||||
|
||||
if (!showMs) {
|
||||
remainingMs -= remainingMs % second;
|
||||
}
|
||||
const remainingSec = showMs ? remainingMs / second : Math.floor(remainingMs / second);
|
||||
|
||||
parts.push(`${remainingMs / second}${this.baseText('genericHelpers.secShort')}`);
|
||||
parts.push(`${remainingSec}${this.baseText('genericHelpers.secShort')}`);
|
||||
|
||||
return parts.join(' ');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
||||
import type { IRestApiContext } from '../types';
|
||||
import { makeRestApiRequest } from '../utils';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
||||
export interface LdapSyncData {
|
||||
id: number;
|
||||
|
|
|
|||
|
|
@ -284,6 +284,6 @@ export async function streamRequest<T extends object>(
|
|||
}
|
||||
} catch (e: unknown) {
|
||||
assert(e instanceof Error);
|
||||
onError?.(e as Error);
|
||||
onError?.(e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,6 +199,6 @@ describe('GlobalExecutionsListItem', () => {
|
|||
|
||||
const executionTimeElement = getByTestId('execution-time');
|
||||
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": {
|
||||
"dependsOn": [
|
||||
"^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/codemirror-lang#lint",
|
||||
"@n8n/storybook#lint",
|
||||
|
|
@ -94,6 +101,13 @@
|
|||
},
|
||||
"test:frontend": {
|
||||
"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/codemirror-lang#test",
|
||||
"@n8n/composables#build",
|
||||
|
|
|
|||
Loading…
Reference in a new issue