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

Merge pull request #2024 from visuddhinanda/agile

中间标题限制字符数20
visuddhinanda 2 лет назад
Родитель
Сommit
650b7b51a4

+ 1 - 1
dashboard/src/components/article/NavigateButton.tsx

@@ -98,7 +98,7 @@ const NavigateButtonWidget = ({
               key="title"
               key="title"
               maxWidth={250}
               maxWidth={250}
               suffixCount={7}
               suffixCount={7}
-              text={nextTitle}
+              text={nextTitle?.substring(0, 20)}
             />
             />
             <DoubleRightOutlined key="icon" />
             <DoubleRightOutlined key="icon" />
           </Space>
           </Space>

+ 13 - 5
dashboard/src/components/article/TypePali.tsx

@@ -103,10 +103,10 @@ const TypePaliWidget = ({
     }
     }
 
 
     setLoading(true);
     setLoading(true);
-    console.log("url", url);
+    console.info("TypePali api request", url);
     get<IArticleResponse>(url)
     get<IArticleResponse>(url)
       .then((json) => {
       .then((json) => {
-        console.log("article", json);
+        console.debug("TypePali api response ", json);
         if (json.ok) {
         if (json.ok) {
           setArticleData(json.data);
           setArticleData(json.data);
           if (json.data.html) {
           if (json.data.html) {
@@ -198,9 +198,17 @@ const TypePaliWidget = ({
     return;
     return;
   };
   };
 
 
-  const title = articleData?.title_text
-    ? articleData?.title_text
-    : articleData?.title;
+  let title = "";
+  if (articleData) {
+    if (type === "chapter") {
+      title = articleData.title_text
+        ? articleData.title_text
+        : articleData.title;
+    } else {
+      const id = articleId?.split("-");
+      title = id ? (id.length > 1 ? id[1] : "unknown") : "unknown";
+    }
+  }
 
 
   let fullPath: ITocPathNode[] = [];
   let fullPath: ITocPathNode[] = [];
   if (articleData && articleData.path && articleData.path.length > 0) {
   if (articleData && articleData.path && articleData.path.length > 0) {

+ 1 - 1
dashboard/src/locales/en-US/tables.ts

@@ -2,7 +2,7 @@ const items = {
   "tables.publicity.all": "all",
   "tables.publicity.all": "all",
   "tables.publicity.disable": "disable",
   "tables.publicity.disable": "disable",
   "tables.publicity.private": "private",
   "tables.publicity.private": "private",
-  "tables.publicity.public.bylink": "链接公开",
+  "tables.publicity.public.bylink": "public in link",
   "tables.publicity.public": "public",
   "tables.publicity.public": "public",
   "tables.publicity.public.edit": "public editable",
   "tables.publicity.public.edit": "public editable",
   "tables.role.all": "all",
   "tables.role.all": "all",