mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 01:13:55 +00:00
fix: allow renaming custom field (#803)
* fix: allow renaming custom field * style: change time-to-end icon
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { memo, useEffect, useState } from 'react';
|
||||
import { Tooltip } from '@chakra-ui/react';
|
||||
import { BiArrowToBottom } from '@react-icons/all-files/bi/BiArrowToBottom';
|
||||
import { IoArrowDown } from '@react-icons/all-files/io5/IoArrowDown';
|
||||
import { IoArrowUp } from '@react-icons/all-files/io5/IoArrowUp';
|
||||
import { IoFlag } from '@react-icons/all-files/io5/IoFlag';
|
||||
import { IoPeople } from '@react-icons/all-files/io5/IoPeople';
|
||||
import { IoPlay } from '@react-icons/all-files/io5/IoPlay';
|
||||
import { IoPlayForward } from '@react-icons/all-files/io5/IoPlayForward';
|
||||
@@ -173,7 +173,7 @@ function TimerIcon(props: { type: TimerType; className: string }) {
|
||||
return <IoTime className={className} />;
|
||||
}
|
||||
if (type === TimerType.TimeToEnd) {
|
||||
return <BiArrowToBottom className={className} />;
|
||||
return <IoFlag className={className} />
|
||||
}
|
||||
return <IoArrowDown className={className} />;
|
||||
}
|
||||
|
||||
@@ -404,12 +404,13 @@ export const editCustomField = async (label: string, newField: Partial<CustomFie
|
||||
throw new Error('Change of field type is not allowed');
|
||||
}
|
||||
|
||||
persistedCustomFields[newField.label] = { ...existingField, ...newField };
|
||||
|
||||
if (existingField.label !== newField.label) {
|
||||
delete persistedCustomFields[existingField.label];
|
||||
customFieldChangelog[label] = newField.label;
|
||||
}
|
||||
|
||||
persistedCustomFields[label] = { ...existingField, ...newField };
|
||||
|
||||
scheduleCustomFieldPersist(persistedCustomFields);
|
||||
invalidateIfUsed(label);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user