Просмотр исходного кода

Merge pull request #2049 from visuddhinanda/agile

不显示disable的选项
visuddhinanda 2 лет назад
Родитель
Сommit
ec016fd360

+ 1 - 1
dashboard/src/components/corpus/ChapterInChannel.tsx

@@ -131,7 +131,7 @@ const ChapterInChannelWidget = ({
               setOpen(true);
             }}
           >
-            更多
+            {intl.formatMessage({ id: "buttons.more" })}
           </Button>
         </div>
         <Modal

+ 1 - 1
dashboard/src/components/corpus/Recent.tsx

@@ -56,7 +56,7 @@ const RecentWidget = () => {
           );
         }}
       />
-      <Button type="link">更多</Button>
+      <Button type="link">{intl.formatMessage({ id: "buttons.more" })}</Button>
     </div>
   );
 };

+ 8 - 2
dashboard/src/components/home/ChapterNew.tsx

@@ -2,8 +2,10 @@ import { Col, Row } from "antd";
 import { Link } from "react-router-dom";
 import img_book from "../../assets/library/images/books.svg";
 import ChapterNewList from "./ChapterNewList";
+import { useIntl } from "react-intl";
 
 const ChapterNewWidget = () => {
+  const intl = useIntl();
   return (
     <Row
       style={{
@@ -21,9 +23,13 @@ const ChapterNewWidget = () => {
         }}
       >
         <div style={{ flex: 4, margin: "2em" }}>
-          <span style={{ fontSize: "250%", fontWeight: 700 }}>圣典</span>
+          <span style={{ fontSize: "250%", fontWeight: 700 }}>
+            {intl.formatMessage({ id: "columns.library.community.title" })}
+          </span>
           <span style={{ position: "absolute", right: 30, bottom: 0 }}>
-            <Link to="community/list">更多</Link>
+            <Link to="community/list">
+              {intl.formatMessage({ id: "buttons.more" })}
+            </Link>
           </span>
         </div>
         <div style={{ flex: 9 }}>

+ 5 - 1
dashboard/src/components/home/CourseNew.tsx

@@ -2,8 +2,10 @@ import { Col, Row } from "antd";
 import { Link } from "react-router-dom";
 import img_book from "../../assets/library/images/teachers.svg";
 import CourseNewList from "./CourseNewList";
+import { useIntl } from "react-intl";
 
 const CourseNewWidget = () => {
+  const intl = useIntl(); //i18n
   return (
     <Row
       style={{
@@ -29,7 +31,9 @@ const CourseNewWidget = () => {
             课程
           </span>
           <span style={{ position: "absolute", right: 30, bottom: 0 }}>
-            <Link to="course/list">更多</Link>
+            <Link to="course/list">
+              {intl.formatMessage({ id: "buttons.more" })}
+            </Link>
           </span>
         </div>
       </Col>

+ 8 - 3
dashboard/src/components/library/FooterBar.tsx

@@ -2,13 +2,14 @@ import { Link } from "react-router-dom";
 import { Layout, Row, Col, Typography } from "antd";
 import BeiAn from "../general/BeiAn";
 import Feedback from "../general/Feedback";
+import { useIntl } from "react-intl";
 
 const { Footer } = Layout;
 const { Paragraph } = Typography;
 
 const FooterBarWidget = () => {
-  //Library foot bar
-  // TODO 补充项目信息
+  const intl = useIntl();
+
   return (
     <Footer>
       <Row>
@@ -24,7 +25,11 @@ const FooterBarWidget = () => {
           </ul>
         </Col>
         <Col span={16}>
-          <Paragraph strong>问题反馈</Paragraph>
+          <Paragraph strong>
+            {intl.formatMessage({
+              id: "labels.feedback",
+            })}
+          </Paragraph>
           <Feedback />
         </Col>
       </Row>

+ 7 - 3
dashboard/src/components/studio/LeftSider.tsx

@@ -39,7 +39,9 @@ const LeftSiderWidget = ({ selectedKeys = "" }: IWidgetHeadBar) => {
 
   const items: MenuProps["items"] = [
     {
-      label: "常用",
+      label: intl.formatMessage({
+        id: "columns.studio.basic.title",
+      }),
       key: "basic",
       icon: <HomeOutlined />,
       children: [
@@ -87,7 +89,9 @@ const LeftSiderWidget = ({ selectedKeys = "" }: IWidgetHeadBar) => {
       ],
     },
     {
-      label: "高级",
+      label: intl.formatMessage({
+        id: "columns.studio.advance.title",
+      }),
       key: "advance",
       icon: <AppstoreOutlined />,
       children: [
@@ -162,7 +166,7 @@ const LeftSiderWidget = ({ selectedKeys = "" }: IWidgetHeadBar) => {
           ),
           key: "setting",
         },
-      ],
+      ].filter((value) => value.disabled !== true),
     },
     {
       label: intl.formatMessage({ id: "labels.collaboration" }),

+ 3 - 1
dashboard/src/components/studio/PublicitySelect.tsx

@@ -48,9 +48,11 @@ const PublicitySelectWidget = ({ width, disable = [], readonly }: IWidget) => {
       disable: disable.includes("public"),
     },
   ];
+
+  console.debug("disable", disable, options);
   return (
     <ProFormSelect
-      options={options}
+      options={options.filter((value) => value.disable === false)}
       readonly={readonly}
       width={width}
       name="status"

+ 1 - 1
dashboard/src/components/template/Wbw/WbwDetailFm.tsx

@@ -148,7 +148,7 @@ const WbwFactorMeaningItem = ({ pali, meaning = "", onChange }: IWFMI) => {
           ...items.filter((value, index) => index <= 5),
           {
             key: "more",
-            label: "更多",
+            label: intl.formatMessage({ id: "buttons.more" }),
             disabled: items.length <= 5,
             children: items.filter((value, index) => index > 5),
           },

+ 1 - 1
dashboard/src/components/template/Wbw/WbwFactorMeaning.tsx

@@ -103,7 +103,7 @@ const WbwFactorMeaningWidget = ({
                 ...items.filter((value, index) => index <= 5),
                 {
                   key: "more",
-                  label: "更多",
+                  label: intl.formatMessage({ id: "buttons.more" }),
                   children: items.filter((value, index) => index > 5),
                 },
               ],

+ 2 - 2
dashboard/src/components/users/SignUp.tsx

@@ -58,7 +58,7 @@ const SingUpWidget = () => {
         name: string;
       }>
         name="welcome"
-        title="注册"
+        title={intl.formatMessage({ id: "labels.sign-in" })}
         stepProps={{
           description: "注册wikipali基础版",
         }}
@@ -79,7 +79,7 @@ const SingUpWidget = () => {
           size="small"
         >
           <CheckCard
-            title="未注册"
+            title={intl.formatMessage({ id: "labels.software.edition.guest" })}
             description={
               <div>
                 <div>✅经文阅读</div>

+ 2 - 0
dashboard/src/locales/en-US/label.ts

@@ -37,10 +37,12 @@ const items = {
   "labels.loading": "loading",
   "labels.empty": "empty",
   "labels.curr.paragraph.cart.tpl": "Add to Cart",
+  "labels.software.edition.guest": "guest",
   "labels.software.edition.basic": "basic",
   "labels.software.edition.pro": "pro",
   "labels.table-of-content": "table of content",
   "labels.this-studio": "this studio",
+  "labels.feedback": "feedback",
 };
 
 export default items;

+ 2 - 0
dashboard/src/locales/zh-Hans/label.ts

@@ -42,10 +42,12 @@ const items = {
   "labels.dict.pass.2": "查词干",
   "labels.dict.pass.3": "查衍生",
   "labels.dict.pass.4": "查二次衍生",
+  "labels.software.edition.guest": "未注册",
   "labels.software.edition.basic": "基础版",
   "labels.software.edition.pro": "增强版",
   "labels.table-of-content": "目录",
   "labels.this-studio": "此工作室",
+  "labels.feedback": "问题反馈",
 };
 
 export default items;

+ 4 - 1
dashboard/src/pages/users/sign-up.tsx

@@ -1,8 +1,11 @@
 import { Card } from "antd";
 
 import SignUp from "../../components/users/SignUp";
+import { useIntl } from "react-intl";
 
 const Widget = () => {
+  const intl = useIntl();
+
   return (
     <div
       style={{
@@ -12,7 +15,7 @@ const Widget = () => {
         marginRight: "auto",
       }}
     >
-      <Card title="注册">
+      <Card title={intl.formatMessage({ id: "labels.sign-in" })}>
         <SignUp />
       </Card>
     </div>