mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 11:53:49 +00:00
refactor: timer design review
This commit is contained in:
+2
-2
@@ -26,10 +26,10 @@ describe('makeOptionsFromCustomFields()', () => {
|
||||
];
|
||||
const result = makeOptionsFromCustomFields(testCustomFields, additionalData);
|
||||
expect(result).toStrictEqual([
|
||||
{ value: 'custom-field1', label: 'Custom: Field 1' },
|
||||
{ value: 'custom-field2', label: 'Custom: Field 2' },
|
||||
{ value: 'test1', label: 'Test 1' },
|
||||
{ value: 'test2', label: 'Test 2' },
|
||||
{ value: 'custom-field1', label: 'Custom: Field 1' },
|
||||
{ value: 'custom-field2', label: 'Custom: Field 2' },
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ export const getTimeOption = (timeFormat: string): ParamField => {
|
||||
const placeholder = `${timeFormat} (default)`;
|
||||
return {
|
||||
id: 'timeformat',
|
||||
title: 'Time format string, taken from the Application Settings',
|
||||
description: 'Format for auxiliar time fields (not the running), eg. HH:mm:ss or hh:mm:ss a, see docs for help',
|
||||
title: 'Clock time format, defaults to value from the Settings',
|
||||
description: 'Format for the Time Now field, eg. HH:mm:ss or hh:mm:ss a, see docs for help',
|
||||
type: 'string',
|
||||
placeholder,
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ export function makeOptionsFromCustomFields(
|
||||
additionalOptions: SelectOption[] = [],
|
||||
filterImageType = true,
|
||||
): SelectOption[] {
|
||||
const options: SelectOption[] = [];
|
||||
const options: SelectOption[] = [...additionalOptions];
|
||||
|
||||
// Add custom fields first
|
||||
for (const [key, value] of Object.entries(customFields)) {
|
||||
@@ -27,7 +27,7 @@ export function makeOptionsFromCustomFields(
|
||||
});
|
||||
}
|
||||
|
||||
return options.concat(additionalOptions);
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user