Procházet zdrojové kódy

Merge pull request #2277 from visuddhinanda/development

Development
visuddhinanda před 11 měsíci
rodič
revize
f389700625

+ 3 - 3
dashboard-v4/dashboard/src/components/task/Description.tsx

@@ -1,6 +1,6 @@
 import { useEffect, useState } from "react";
 import { Button, message, Space, Typography } from "antd";
-import { EditOutlined, CheckOutlined } from "@ant-design/icons";
+import { EditOutlined, SaveOutlined } from "@ant-design/icons";
 
 import { ITaskData, ITaskResponse, ITaskUpdateRequest } from "../api/task";
 import MdView from "../template/MdView";
@@ -72,7 +72,7 @@ const Description = ({ task, onChange, onDiscussion }: IWidget) => {
             <Button
               ghost
               type="primary"
-              icon={<CheckOutlined />}
+              icon={<SaveOutlined />}
               loading={loading}
               onClick={() => {
                 if (!task) {
@@ -100,7 +100,7 @@ const Description = ({ task, onChange, onDiscussion }: IWidget) => {
                   .finally(() => setLoading(false));
               }}
             >
-              完成
+              {intl.formatMessage({ id: "buttons.save" })}
             </Button>
           )}
         </span>

+ 21 - 11
dashboard-v4/dashboard/src/components/task/TaskStatusButton.tsx

@@ -1,5 +1,6 @@
 import { DropdownButtonType } from "antd/lib/dropdown/dropdown-button";
 import {
+  Button,
   Dropdown,
   MenuProps,
   message,
@@ -200,21 +201,30 @@ const TaskStatusButton = ({
       cancelText="No"
     >
       <Dropdown.Button
-        disabled={task?.type === "workflow"}
         type={buttonType}
         trigger={["click"]}
         icon={<DownOutlined />}
         menu={menuProps}
-      >
-        {loading ? (
-          <LoadingOutlined />
-        ) : newStatus === "done" ? (
-          <CheckOutlined />
-        ) : (
-          <></>
-        )}
-        {buttonText}
-      </Dropdown.Button>
+        buttonsRender={([leftButton, rightButton]) => {
+          return [
+            <Button
+              disabled={task?.type === "workflow"}
+              icon={
+                loading ? (
+                  <LoadingOutlined />
+                ) : newStatus === "done" ? (
+                  <CheckOutlined />
+                ) : (
+                  <></>
+                )
+              }
+            >
+              {buttonText}
+            </Button>,
+            rightButton,
+          ];
+        }}
+      />
     </Popconfirm>
   ) : (
     <Dropdown placement="bottomLeft" menu={menuProps}>