فهرست منبع

add important

visuddhinanda 2 سال پیش
والد
کامیت
498b50d626

+ 8 - 1
dashboard/src/components/channel/ChannelSentDiff.tsx

@@ -26,6 +26,7 @@ interface IWidget {
   srcChannel?: IChannel;
   srcChannel?: IChannel;
   destChannel?: IChannel;
   destChannel?: IChannel;
   sentences?: string[];
   sentences?: string[];
+  important?: boolean;
   goPrev?: Function;
   goPrev?: Function;
   onSubmit?: Function;
   onSubmit?: Function;
 }
 }
@@ -33,6 +34,7 @@ const ChannelSentDiffWidget = ({
   srcChannel,
   srcChannel,
   destChannel,
   destChannel,
   sentences,
   sentences,
+  important = false,
   goPrev,
   goPrev,
   onSubmit,
   onSubmit,
 }: IWidget) => {
 }: IWidget) => {
@@ -105,7 +107,11 @@ const ChannelSentDiffWidget = ({
           });
           });
           setDiffData(diffList);
           setDiffData(diffList);
           setNewRowKeys(newRows);
           setNewRowKeys(newRows);
-          setSelectedRowKeys(newRows);
+          if (important) {
+            setSelectedRowKeys(sentences);
+          } else {
+            setSelectedRowKeys(newRows);
+          }
           setEmptyRowKeys(emptyRows);
           setEmptyRowKeys(emptyRows);
         }
         }
       });
       });
@@ -127,6 +133,7 @@ const ChannelSentDiffWidget = ({
         <Select
         <Select
           defaultValue={"new"}
           defaultValue={"new"}
           style={{ width: 180 }}
           style={{ width: 180 }}
+          disabled={important}
           onChange={(value: string) => {
           onChange={(value: string) => {
             switch (value) {
             switch (value) {
               case "new":
               case "new":

+ 3 - 0
dashboard/src/components/channel/CopyToModal.tsx

@@ -9,6 +9,7 @@ interface IWidget {
   channel?: IChannel;
   channel?: IChannel;
   sentencesId?: string[];
   sentencesId?: string[];
   open?: boolean;
   open?: boolean;
+  important?: boolean;
   onClose?: Function;
   onClose?: Function;
 }
 }
 const CopyToModalWidget = ({
 const CopyToModalWidget = ({
@@ -16,6 +17,7 @@ const CopyToModalWidget = ({
   channel,
   channel,
   sentencesId,
   sentencesId,
   open,
   open,
+  important = false,
   onClose,
   onClose,
 }: IWidget) => {
 }: IWidget) => {
   const [isModalOpen, setIsModalOpen] = useState(open);
   const [isModalOpen, setIsModalOpen] = useState(open);
@@ -59,6 +61,7 @@ const CopyToModalWidget = ({
           initStep={initStep}
           initStep={initStep}
           channel={channel}
           channel={channel}
           sentencesId={sentencesId}
           sentencesId={sentencesId}
+          important={important}
           onClose={() => {
           onClose={() => {
             setIsModalOpen(false);
             setIsModalOpen(false);
             Modal.destroyAll();
             Modal.destroyAll();

+ 3 - 0
dashboard/src/components/channel/CopyToStep.tsx

@@ -13,6 +13,7 @@ interface IWidget {
   type?: ArticleType;
   type?: ArticleType;
   articleId?: string;
   articleId?: string;
   sentencesId?: string[];
   sentencesId?: string[];
+  important?: boolean;
   stepChange?: Function;
   stepChange?: Function;
   onClose?: Function;
   onClose?: Function;
 }
 }
@@ -22,6 +23,7 @@ const CopyToStepWidget = ({
   type,
   type,
   articleId,
   articleId,
   sentencesId,
   sentencesId,
+  important = false,
   stepChange,
   stepChange,
   onClose,
   onClose,
 }: IWidget) => {
 }: IWidget) => {
@@ -77,6 +79,7 @@ const CopyToStepWidget = ({
           srcChannel={channel}
           srcChannel={channel}
           destChannel={destChannel}
           destChannel={destChannel}
           sentences={sentencesId}
           sentences={sentencesId}
+          important={important}
           goPrev={() => {
           goPrev={() => {
             prev();
             prev();
           }}
           }}