diff options
author | crupest <crupest@outlook.com> | 2020-11-04 10:31:34 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-11-04 10:31:34 +0800 |
commit | b082a3ba08c9782c0834af77e6c3f0438534ad72 (patch) | |
tree | b4ebd1b485d3ce7f8388a68fc1d08e7d6be7885c /FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx | |
parent | c2d6a21c049d0f4f8b64a33eb60de7271465692c (diff) | |
download | timeline-b082a3ba08c9782c0834af77e6c3f0438534ad72.tar.gz timeline-b082a3ba08c9782c0834af77e6c3f0438534ad72.tar.bz2 timeline-b082a3ba08c9782c0834af77e6c3f0438534ad72.zip |
refactor: Refactor operation dialog.
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx')
-rw-r--r-- | FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx index 223525f9..ee49586e 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx @@ -6,9 +6,7 @@ import { TimelineChangePropertyRequest, } from "@/services/timeline"; -import OperationDialog, { - OperationSelectInputInfoOption, -} from "../common/OperationDialog"; +import OperationDialog from "../common/OperationDialog"; export interface TimelinePropertyInfo { title: string; @@ -45,12 +43,10 @@ const TimelinePropertyChangeDialog: React.FC<TimelinePropertyChangeDialogProps> { type: "select", label: "timeline.dialogChangeProperty.visibility", - options: kTimelineVisibilities.map<OperationSelectInputInfoOption>( - (v) => ({ - label: labelMap[v], - value: v, - }) - ), + options: kTimelineVisibilities.map((v) => ({ + label: labelMap[v], + value: v, + })), initValue: props.oldInfo.visibility, }, { @@ -64,13 +60,13 @@ const TimelinePropertyChangeDialog: React.FC<TimelinePropertyChangeDialogProps> onProcess={([newTitle, newVisibility, newDescription]) => { const req: TimelineChangePropertyRequest = {}; if (newTitle !== props.oldInfo.title) { - req.title = newTitle as string; + req.title = newTitle; } if (newVisibility !== props.oldInfo.visibility) { req.visibility = newVisibility as TimelineVisibility; } if (newDescription !== props.oldInfo.description) { - req.description = newDescription as string; + req.description = newDescription; } return props.onProcess(req); }} |