From af8c7de13bcaa0bf1b413966c914974eca079b4d Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Tue, 3 Nov 2020 22:17:20 +0800
Subject: feat: Add title to timeline.

---
 .../views/timeline-common/TimelinePropertyChangeDialog.tsx    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx')

diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx
index 87638f31..223525f9 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx
@@ -11,6 +11,7 @@ import OperationDialog, {
 } from "../common/OperationDialog";
 
 export interface TimelinePropertyInfo {
+  title: string;
   visibility: TimelineVisibility;
   description: string;
 }
@@ -36,6 +37,11 @@ const TimelinePropertyChangeDialog: React.FC<TimelinePropertyChangeDialogProps>
       title={"timeline.dialogChangeProperty.title"}
       titleColor="default"
       inputScheme={[
+        {
+          type: "text",
+          label: "timeline.dialogChangeProperty.titleField",
+          initValue: props.oldInfo.title,
+        },
         {
           type: "select",
           label: "timeline.dialogChangeProperty.visibility",
@@ -55,8 +61,11 @@ const TimelinePropertyChangeDialog: React.FC<TimelinePropertyChangeDialogProps>
       ]}
       open={props.open}
       close={props.close}
-      onProcess={([newVisibility, newDescription]) => {
+      onProcess={([newTitle, newVisibility, newDescription]) => {
         const req: TimelineChangePropertyRequest = {};
+        if (newTitle !== props.oldInfo.title) {
+          req.title = newTitle as string;
+        }
         if (newVisibility !== props.oldInfo.visibility) {
           req.visibility = newVisibility as TimelineVisibility;
         }
-- 
cgit v1.2.3

