visuddhinanda 3 лет назад
Родитель
Сommit
92d4179685

+ 14 - 3
dashboard/src/components/channel/ChapterInChannelList.tsx

@@ -50,8 +50,9 @@ interface IItem {
 }
 interface IWidget {
   channelId?: string;
+  onChange?: Function;
 }
-const Widget = ({ channelId }: IWidget) => {
+const Widget = ({ channelId, onChange }: IWidget) => {
   const intl = useIntl();
 
   return (
@@ -79,7 +80,12 @@ const Widget = ({ channelId }: IWidget) => {
               <div key={index}>
                 <div key={1}>
                   <Link
-                    to={`/article/chapter/${row.book}-${row.paragraph}_${channelId}`}
+                    to={
+                      `/article/chapter/${row.book}-${row.paragraph}` +
+                      channelId
+                        ? `?channel=${channelId}`
+                        : ""
+                    }
                   >
                     {row.title ? row.title : row.subTitle}
                   </Link>
@@ -173,7 +179,12 @@ const Widget = ({ channelId }: IWidget) => {
                 }}
               >
                 <Link
-                  to={`/article/chapter/${row.book}-${row.paragraph}_${channelId}/edit`}
+                  to={
+                    `/article/chapter/${row.book}-${row.paragraph}/edit` +
+                    channelId
+                      ? `?channel=${channelId}`
+                      : ""
+                  }
                 >
                   {intl.formatMessage({
                     id: "buttons.edit",

+ 6 - 1
dashboard/src/components/corpus/ChapterCard.tsx

@@ -45,7 +45,12 @@ const Widget = ({ data, onTagClick }: IWidgetChapterCard) => {
             <Col span={16}>
               <Title level={5}>
                 <Link
-                  to={`/article/chapter/${data.book}-${data.paragraph}_${data.channel.id}`}
+                  to={
+                    `/article/chapter/${data.book}-${data.paragraph}` +
+                    data.channel.id
+                      ? `?channel=${data.channel.id}`
+                      : ""
+                  }
                   target="_blank"
                 >
                   {data.title ? data.title : data.paliTitle}

+ 4 - 5
dashboard/src/components/corpus/TocPath.tsx

@@ -27,12 +27,11 @@ const Widget = ({
   channel,
   onChange,
 }: IWidgetTocPath): JSX.Element => {
-  let sChannel = "";
-  if (typeof channel !== "undefined" && channel.length > 0) {
-    sChannel = "_" + channel.join("_");
-  }
-
   const path = data.map((item, id) => {
+    let sChannel = "";
+    if (typeof channel !== "undefined" && channel.length > 0) {
+      sChannel = "?channel=" + channel.join("_");
+    }
     const linkChapter = `/article/chapter/${item.book}-${item.paragraph}${sChannel}`;
     let oneItem = <></>;
     const title = <PaliText text={item.title} />;