@drodil/backstage-plugin-qeta 3.48.2 → 3.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ArticlePage/ArticlePage.esm.js +14 -6
- package/dist/components/ArticlePage/ArticlePage.esm.js.map +1 -1
- package/dist/components/ArticlesPage/ArticlesPage.esm.js +29 -24
- package/dist/components/ArticlesPage/ArticlesPage.esm.js.map +1 -1
- package/dist/components/AskPage/AskPage.esm.js +18 -3
- package/dist/components/AskPage/AskPage.esm.js.map +1 -1
- package/dist/components/CollectionPage/CollectionPage.esm.js +79 -15
- package/dist/components/CollectionPage/CollectionPage.esm.js.map +1 -1
- package/dist/components/CollectionsPage/CollectionsPage.esm.js +11 -14
- package/dist/components/CollectionsPage/CollectionsPage.esm.js.map +1 -1
- package/dist/components/CreateLinkPage/CreateLinkPage.esm.js +2 -2
- package/dist/components/CreateLinkPage/CreateLinkPage.esm.js.map +1 -1
- package/dist/components/EntityPage/EntityPage.esm.js +110 -123
- package/dist/components/EntityPage/EntityPage.esm.js.map +1 -1
- package/dist/components/EntityPostsContent/EntityPostsContent.esm.js +2 -2
- package/dist/components/EntityPostsContent/EntityPostsContent.esm.js.map +1 -1
- package/dist/components/FavoritePage/FavoritePage.esm.js +34 -31
- package/dist/components/FavoritePage/FavoritePage.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +34 -35
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/LinkPage/LinkPage.esm.js +22 -25
- package/dist/components/LinkPage/LinkPage.esm.js.map +1 -1
- package/dist/components/LinksPage/LinksPage.esm.js +24 -25
- package/dist/components/LinksPage/LinksPage.esm.js.map +1 -1
- package/dist/components/ModeratorPage/ModeratorPage.esm.js +11 -5
- package/dist/components/ModeratorPage/ModeratorPage.esm.js.map +1 -1
- package/dist/components/PostsTableCard/Content.esm.js +2 -2
- package/dist/components/PostsTableCard/Content.esm.js.map +1 -1
- package/dist/components/QetaPage/QetaPage.esm.js +192 -164
- package/dist/components/QetaPage/QetaPage.esm.js.map +1 -1
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.esm.js +2 -2
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.esm.js.map +1 -1
- package/dist/components/QuestionPage/QuestionPage.esm.js +27 -9
- package/dist/components/QuestionPage/QuestionPage.esm.js.map +1 -1
- package/dist/components/QuestionsPage/QuestionsPage.esm.js +13 -54
- package/dist/components/QuestionsPage/QuestionsPage.esm.js.map +1 -1
- package/dist/components/RightContent/ArticlesRightContent.esm.js +31 -0
- package/dist/components/RightContent/ArticlesRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/AskRightContent.esm.js +16 -0
- package/dist/components/RightContent/AskRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/CollectionsRightContent.esm.js +12 -0
- package/dist/components/RightContent/CollectionsRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/DefaultRightContent.esm.js +27 -0
- package/dist/components/RightContent/DefaultRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/EntitiesRightContent.esm.js +12 -0
- package/dist/components/RightContent/EntitiesRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/EntityRightContent.esm.js +47 -0
- package/dist/components/RightContent/EntityRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/FavoriteRightContent.esm.js +9 -0
- package/dist/components/RightContent/FavoriteRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/HomeRightContent.esm.js +15 -0
- package/dist/components/RightContent/HomeRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/LinksRightContent.esm.js +31 -0
- package/dist/components/RightContent/LinksRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/QuestionsRightContent.esm.js +57 -0
- package/dist/components/RightContent/QuestionsRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/RightContent.esm.js +203 -0
- package/dist/components/RightContent/RightContent.esm.js.map +1 -0
- package/dist/components/RightContent/SimilarQuestions.esm.js +58 -0
- package/dist/components/RightContent/SimilarQuestions.esm.js.map +1 -0
- package/dist/components/RightContent/TagRightContent.esm.js +48 -0
- package/dist/components/RightContent/TagRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/TagsRightContent.esm.js +12 -0
- package/dist/components/RightContent/TagsRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/UsersRightContent.esm.js +12 -0
- package/dist/components/RightContent/UsersRightContent.esm.js.map +1 -0
- package/dist/components/Statistics/GlobalStatsContent.esm.js +15 -9
- package/dist/components/Statistics/GlobalStatsContent.esm.js.map +1 -1
- package/dist/components/Statistics/StatisticsPage.esm.js +28 -11
- package/dist/components/Statistics/StatisticsPage.esm.js.map +1 -1
- package/dist/components/TagPage/TagPage.esm.js +75 -107
- package/dist/components/TagPage/TagPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserPage.esm.js +34 -22
- package/dist/components/UserPage/UserPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserStatsContent.esm.js +12 -9
- package/dist/components/UserPage/UserStatsContent.esm.js.map +1 -1
- package/dist/components/UsersPage/UsersPage.esm.js +12 -13
- package/dist/components/UsersPage/UsersPage.esm.js.map +1 -1
- package/dist/components/WritePage/WritePage.esm.js +2 -2
- package/dist/components/WritePage/WritePage.esm.js.map +1 -1
- package/dist/hooks/useSidebarSettings.esm.js +23 -0
- package/dist/hooks/useSidebarSettings.esm.js.map +1 -0
- package/dist/package.json.esm.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityRightContent.esm.js","sources":["../../../src/components/RightContent/EntityRightContent.tsx"],"sourcesContent":["import {\n FollowedEntitiesList,\n PostHighlightList,\n qetaTranslationRef,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Whatshot from '@material-ui/icons/Whatshot';\n\nexport const EntityRightContent = (props: { entityRef?: string }) => {\n const { t } = useTranslationRef(qetaTranslationRef);\n const { entityRef } = props;\n const entities = entityRef ? [entityRef] : undefined;\n\n return (\n <>\n <FollowedEntitiesList />\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotQuestions.title')}\n noQuestionsLabel={t('highlights.hotQuestions.noQuestionsLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n options={{ entities: entities }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"unanswered\"\n title={t('highlights.unanswered.title')}\n noQuestionsLabel={t('highlights.unanswered.noQuestionsLabel')}\n options={{ entities: entities }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"incorrect\"\n title={t('highlights.incorrect.title')}\n noQuestionsLabel={t('highlights.incorrect.noQuestionsLabel')}\n options={{ entities: entities }}\n postType=\"question\"\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AAQa,MAAA,kBAAA,GAAqB,CAAC,KAAkC,KAAA;AACnE,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,kBAAkB,CAAA;AAClD,EAAM,MAAA,EAAE,WAAc,GAAA,KAAA;AACtB,EAAA,MAAM,QAAW,GAAA,SAAA,GAAY,CAAC,SAAS,CAAI,GAAA,KAAA,CAAA;AAE3C,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,oBAAqB,EAAA,EAAA,CAAA;AAAA,oBACtB,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,IAAK,EAAA,KAAA;AAAA,QACL,KAAA,EAAO,EAAE,+BAA+B,CAAA;AAAA,QACxC,gBAAA,EAAkB,EAAE,0CAA0C,CAAA;AAAA,QAC9D,IAAM,kBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,QACjC,OAAA,EAAS,EAAE,QAAmB,EAAA;AAAA,QAC9B,QAAS,EAAA;AAAA;AAAA,KACX;AAAA,oBACA,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,IAAK,EAAA,YAAA;AAAA,QACL,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,QACtC,gBAAA,EAAkB,EAAE,wCAAwC,CAAA;AAAA,QAC5D,OAAA,EAAS,EAAE,QAAmB,EAAA;AAAA,QAC9B,QAAS,EAAA;AAAA;AAAA,KACX;AAAA,oBACA,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,IAAK,EAAA,WAAA;AAAA,QACL,KAAA,EAAO,EAAE,4BAA4B,CAAA;AAAA,QACrC,gBAAA,EAAkB,EAAE,uCAAuC,CAAA;AAAA,QAC3D,OAAA,EAAS,EAAE,QAAmB,EAAA;AAAA,QAC9B,QAAS,EAAA;AAAA;AAAA;AACX,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { PostHighlightListContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
|
|
4
|
+
const FavoriteRightContent = () => {
|
|
5
|
+
return /* @__PURE__ */ jsx(PostHighlightListContainer, { options: { favorite: true } });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { FavoriteRightContent };
|
|
9
|
+
//# sourceMappingURL=FavoriteRightContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FavoriteRightContent.esm.js","sources":["../../../src/components/RightContent/FavoriteRightContent.tsx"],"sourcesContent":["import { PostHighlightListContainer } from '@drodil/backstage-plugin-qeta-react';\n\nexport const FavoriteRightContent = () => {\n return <PostHighlightListContainer options={{ favorite: true }} />;\n};\n"],"names":[],"mappings":";;;AAEO,MAAM,uBAAuB,MAAM;AACxC,EAAA,2BAAQ,0BAA2B,EAAA,EAAA,OAAA,EAAS,EAAE,QAAA,EAAU,MAAQ,EAAA,CAAA;AAClE;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ImpactCard, FollowedTagsList, FollowedUsersList, FollowedEntitiesList, FollowedCollectionsList } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
|
|
4
|
+
const HomeRightContent = () => {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
|
+
/* @__PURE__ */ jsx(ImpactCard, {}),
|
|
7
|
+
/* @__PURE__ */ jsx(FollowedTagsList, {}),
|
|
8
|
+
/* @__PURE__ */ jsx(FollowedUsersList, {}),
|
|
9
|
+
/* @__PURE__ */ jsx(FollowedEntitiesList, {}),
|
|
10
|
+
/* @__PURE__ */ jsx(FollowedCollectionsList, {})
|
|
11
|
+
] });
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { HomeRightContent };
|
|
15
|
+
//# sourceMappingURL=HomeRightContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HomeRightContent.esm.js","sources":["../../../src/components/RightContent/HomeRightContent.tsx"],"sourcesContent":["import {\n FollowedCollectionsList,\n FollowedEntitiesList,\n FollowedTagsList,\n FollowedUsersList,\n ImpactCard,\n} from '@drodil/backstage-plugin-qeta-react';\n\nexport const HomeRightContent = () => {\n return (\n <>\n <ImpactCard />\n <FollowedTagsList />\n <FollowedUsersList />\n <FollowedEntitiesList />\n <FollowedCollectionsList />\n </>\n );\n};\n"],"names":[],"mappings":";;;AAQO,MAAM,mBAAmB,MAAM;AACpC,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,CAAA;AAAA,wBACX,gBAAiB,EAAA,EAAA,CAAA;AAAA,wBACjB,iBAAkB,EAAA,EAAA,CAAA;AAAA,wBAClB,oBAAqB,EAAA,EAAA,CAAA;AAAA,wBACrB,uBAAwB,EAAA,EAAA;AAAA,GAC3B,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { qetaTranslationRef, PostHighlightList, FollowedTagsList, FollowedEntitiesList } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
4
|
+
import Whatshot from '@material-ui/icons/Whatshot';
|
|
5
|
+
|
|
6
|
+
const LinksRightContent = (props) => {
|
|
7
|
+
const { t } = useTranslationRef(qetaTranslationRef);
|
|
8
|
+
const { tags, entityRef } = props;
|
|
9
|
+
const entities = entityRef ? [entityRef] : void 0;
|
|
10
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
PostHighlightList,
|
|
13
|
+
{
|
|
14
|
+
type: "hot",
|
|
15
|
+
title: t("highlights.hotLinks.title"),
|
|
16
|
+
noQuestionsLabel: t("highlights.hotLinks.noLinksLabel"),
|
|
17
|
+
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
18
|
+
postType: "link",
|
|
19
|
+
options: {
|
|
20
|
+
tags,
|
|
21
|
+
entities
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ jsx(FollowedTagsList, {}),
|
|
26
|
+
/* @__PURE__ */ jsx(FollowedEntitiesList, {})
|
|
27
|
+
] });
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { LinksRightContent };
|
|
31
|
+
//# sourceMappingURL=LinksRightContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinksRightContent.esm.js","sources":["../../../src/components/RightContent/LinksRightContent.tsx"],"sourcesContent":["import {\n FollowedEntitiesList,\n FollowedTagsList,\n PostHighlightList,\n qetaTranslationRef,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Whatshot from '@material-ui/icons/Whatshot';\n\nexport const LinksRightContent = (props: {\n tags?: string[];\n entityRef?: string;\n}) => {\n const { t } = useTranslationRef(qetaTranslationRef);\n const { tags, entityRef } = props;\n const entities = entityRef ? [entityRef] : undefined;\n\n return (\n <>\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotLinks.title')}\n noQuestionsLabel={t('highlights.hotLinks.noLinksLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n postType=\"link\"\n options={{\n tags: tags,\n entities: entities,\n }}\n />\n <FollowedTagsList />\n <FollowedEntitiesList />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AASa,MAAA,iBAAA,GAAoB,CAAC,KAG5B,KAAA;AACJ,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,kBAAkB,CAAA;AAClD,EAAM,MAAA,EAAE,IAAM,EAAA,SAAA,EAAc,GAAA,KAAA;AAC5B,EAAA,MAAM,QAAW,GAAA,SAAA,GAAY,CAAC,SAAS,CAAI,GAAA,KAAA,CAAA;AAE3C,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,IAAK,EAAA,KAAA;AAAA,QACL,KAAA,EAAO,EAAE,2BAA2B,CAAA;AAAA,QACpC,gBAAA,EAAkB,EAAE,kCAAkC,CAAA;AAAA,QACtD,IAAM,kBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,QACjC,QAAS,EAAA,MAAA;AAAA,QACT,OAAS,EAAA;AAAA,UACP,IAAA;AAAA,UACA;AAAA;AACF;AAAA,KACF;AAAA,wBACC,gBAAiB,EAAA,EAAA,CAAA;AAAA,wBACjB,oBAAqB,EAAA,EAAA;AAAA,GACxB,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { qetaTranslationRef, PostHighlightList, FollowedTagsList, FollowedEntitiesList } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
4
|
+
import Whatshot from '@material-ui/icons/Whatshot';
|
|
5
|
+
|
|
6
|
+
const QuestionsRightContent = (props) => {
|
|
7
|
+
const { t } = useTranslationRef(qetaTranslationRef);
|
|
8
|
+
const { tags, entityRef } = props;
|
|
9
|
+
const entities = entityRef ? [entityRef] : void 0;
|
|
10
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
PostHighlightList,
|
|
13
|
+
{
|
|
14
|
+
type: "hot",
|
|
15
|
+
title: t("highlights.hotQuestions.title"),
|
|
16
|
+
noQuestionsLabel: t("highlights.hotQuestions.noQuestionsLabel"),
|
|
17
|
+
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
18
|
+
options: {
|
|
19
|
+
tags,
|
|
20
|
+
entities
|
|
21
|
+
},
|
|
22
|
+
postType: "question"
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
PostHighlightList,
|
|
27
|
+
{
|
|
28
|
+
type: "unanswered",
|
|
29
|
+
title: t("highlights.unanswered.title"),
|
|
30
|
+
noQuestionsLabel: t("highlights.unanswered.noQuestionsLabel"),
|
|
31
|
+
options: {
|
|
32
|
+
tags,
|
|
33
|
+
entities
|
|
34
|
+
},
|
|
35
|
+
postType: "question"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
PostHighlightList,
|
|
40
|
+
{
|
|
41
|
+
type: "incorrect",
|
|
42
|
+
title: t("highlights.incorrect.title"),
|
|
43
|
+
noQuestionsLabel: t("highlights.incorrect.noQuestionsLabel"),
|
|
44
|
+
options: {
|
|
45
|
+
tags,
|
|
46
|
+
entities
|
|
47
|
+
},
|
|
48
|
+
postType: "question"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(FollowedTagsList, {}),
|
|
52
|
+
/* @__PURE__ */ jsx(FollowedEntitiesList, {})
|
|
53
|
+
] });
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { QuestionsRightContent };
|
|
57
|
+
//# sourceMappingURL=QuestionsRightContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuestionsRightContent.esm.js","sources":["../../../src/components/RightContent/QuestionsRightContent.tsx"],"sourcesContent":["import {\n FollowedEntitiesList,\n FollowedTagsList,\n PostHighlightList,\n qetaTranslationRef,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Whatshot from '@material-ui/icons/Whatshot';\n\nexport const QuestionsRightContent = (props: {\n tags?: string[];\n entityRef?: string;\n}) => {\n const { t } = useTranslationRef(qetaTranslationRef);\n const { tags, entityRef } = props;\n const entities = entityRef ? [entityRef] : undefined;\n\n return (\n <>\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotQuestions.title')}\n noQuestionsLabel={t('highlights.hotQuestions.noQuestionsLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n options={{\n tags: tags,\n entities: entities,\n }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"unanswered\"\n title={t('highlights.unanswered.title')}\n noQuestionsLabel={t('highlights.unanswered.noQuestionsLabel')}\n options={{\n tags: tags,\n entities: entities,\n }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"incorrect\"\n title={t('highlights.incorrect.title')}\n noQuestionsLabel={t('highlights.incorrect.noQuestionsLabel')}\n options={{\n tags: tags,\n entities: entities,\n }}\n postType=\"question\"\n />\n <FollowedTagsList />\n <FollowedEntitiesList />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AASa,MAAA,qBAAA,GAAwB,CAAC,KAGhC,KAA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BAAqB,EAAA,EAAA;AAAA,GACxB,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
4
|
+
import { AskRightContent } from './AskRightContent.esm.js';
|
|
5
|
+
import { qetaTranslationRef, questionsRouteRef, articlesRouteRef, usersRouteRef, tagsRouteRef, linksRouteRef, collectionsRouteRef, entitiesRouteRef, favoriteQuestionsRouteRef, qetaRouteRef, askRouteRef, editQuestionRouteRef, userRouteRef, tagRouteRef, entityRouteRef } from '@drodil/backstage-plugin-qeta-react';
|
|
6
|
+
import { makeStyles, Box, Tooltip, IconButton } from '@material-ui/core';
|
|
7
|
+
import { useLocation, useSearchParams, matchPath } from 'react-router-dom';
|
|
8
|
+
import { filterTags } from '@drodil/backstage-plugin-qeta-common';
|
|
9
|
+
import { HomeRightContent } from './HomeRightContent.esm.js';
|
|
10
|
+
import { QuestionsRightContent } from './QuestionsRightContent.esm.js';
|
|
11
|
+
import { ArticlesRightContent } from './ArticlesRightContent.esm.js';
|
|
12
|
+
import { LinksRightContent } from './LinksRightContent.esm.js';
|
|
13
|
+
import { FavoriteRightContent } from './FavoriteRightContent.esm.js';
|
|
14
|
+
import { UsersRightContent } from './UsersRightContent.esm.js';
|
|
15
|
+
import { TagRightContent } from './TagRightContent.esm.js';
|
|
16
|
+
import { TagsRightContent } from './TagsRightContent.esm.js';
|
|
17
|
+
import { EntitiesRightContent } from './EntitiesRightContent.esm.js';
|
|
18
|
+
import { EntityRightContent } from './EntityRightContent.esm.js';
|
|
19
|
+
import { CollectionsRightContent } from './CollectionsRightContent.esm.js';
|
|
20
|
+
import MenuOpenIcon from '@material-ui/icons/MenuOpen';
|
|
21
|
+
import ChevronLeftIcon from '@material-ui/icons/ChevronLeft';
|
|
22
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
23
|
+
import { DefaultRightContent } from './DefaultRightContent.esm.js';
|
|
24
|
+
|
|
25
|
+
const useStyles = makeStyles((theme) => ({
|
|
26
|
+
container: {
|
|
27
|
+
width: (props) => props.compact ? "72px" : "300px",
|
|
28
|
+
padding: (props) => props.compact ? theme.spacing(1) : theme.spacing(0, 0, 0, 2),
|
|
29
|
+
transition: "width 0.2s ease-in-out",
|
|
30
|
+
display: "flex",
|
|
31
|
+
flexDirection: "column",
|
|
32
|
+
overflowX: "hidden"
|
|
33
|
+
},
|
|
34
|
+
toggleButton: {
|
|
35
|
+
marginRight: "auto",
|
|
36
|
+
marginBottom: theme.spacing(1)
|
|
37
|
+
},
|
|
38
|
+
content: {
|
|
39
|
+
display: (props) => props.compact ? "none" : "block",
|
|
40
|
+
opacity: (props) => props.compact ? 0 : 1,
|
|
41
|
+
transition: "opacity 0.2s ease-in-out"
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
const RightContent = (props) => {
|
|
45
|
+
const { compact = false, onToggle } = props;
|
|
46
|
+
const classes = useStyles({ compact });
|
|
47
|
+
const location = useLocation();
|
|
48
|
+
const [searchParams] = useSearchParams();
|
|
49
|
+
const { t } = useTranslationRef(qetaTranslationRef);
|
|
50
|
+
const questionsPath = useRouteRef(questionsRouteRef);
|
|
51
|
+
const articlesPath = useRouteRef(articlesRouteRef);
|
|
52
|
+
const usersPath = useRouteRef(usersRouteRef);
|
|
53
|
+
const tagsPath = useRouteRef(tagsRouteRef);
|
|
54
|
+
const linksPath = useRouteRef(linksRouteRef);
|
|
55
|
+
const collectionsPath = useRouteRef(collectionsRouteRef);
|
|
56
|
+
const entitiesPath = useRouteRef(entitiesRouteRef);
|
|
57
|
+
const favoritePath = useRouteRef(favoriteQuestionsRouteRef);
|
|
58
|
+
const homePath = useRouteRef(qetaRouteRef);
|
|
59
|
+
const rootPath = homePath();
|
|
60
|
+
const isQuestions = matchPath(
|
|
61
|
+
{ path: questionsPath(), end: true },
|
|
62
|
+
location.pathname
|
|
63
|
+
);
|
|
64
|
+
const isAsk = matchPath(
|
|
65
|
+
{ path: `${rootPath}${askRouteRef.path}`, end: true },
|
|
66
|
+
location.pathname
|
|
67
|
+
) || matchPath(
|
|
68
|
+
{ path: `${rootPath}${editQuestionRouteRef.path}`, end: true },
|
|
69
|
+
location.pathname
|
|
70
|
+
);
|
|
71
|
+
const isArticles = matchPath(
|
|
72
|
+
{ path: articlesPath(), end: true },
|
|
73
|
+
location.pathname
|
|
74
|
+
);
|
|
75
|
+
const isUsers = matchPath(
|
|
76
|
+
{ path: usersPath(), end: true },
|
|
77
|
+
location.pathname
|
|
78
|
+
);
|
|
79
|
+
const userMatch = matchPath(
|
|
80
|
+
{ path: `${rootPath}${userRouteRef.path}` },
|
|
81
|
+
location.pathname
|
|
82
|
+
);
|
|
83
|
+
const isTags = matchPath({ path: tagsPath(), end: true }, location.pathname);
|
|
84
|
+
const tagMatch = matchPath(
|
|
85
|
+
{ path: `${rootPath}${tagRouteRef.path}` },
|
|
86
|
+
location.pathname
|
|
87
|
+
);
|
|
88
|
+
const isCollections = matchPath(
|
|
89
|
+
{ path: collectionsPath(), end: true },
|
|
90
|
+
location.pathname
|
|
91
|
+
);
|
|
92
|
+
const isEntities = matchPath(
|
|
93
|
+
{ path: entitiesPath(), end: true },
|
|
94
|
+
location.pathname
|
|
95
|
+
);
|
|
96
|
+
const entityMatch = matchPath(
|
|
97
|
+
{ path: `${rootPath}${entityRouteRef.path}` },
|
|
98
|
+
location.pathname
|
|
99
|
+
);
|
|
100
|
+
const isLinks = matchPath(
|
|
101
|
+
{ path: linksPath(), end: true },
|
|
102
|
+
location.pathname
|
|
103
|
+
);
|
|
104
|
+
const isFavorite = matchPath(
|
|
105
|
+
{ path: favoritePath(), end: true },
|
|
106
|
+
location.pathname
|
|
107
|
+
);
|
|
108
|
+
const isHome = matchPath({ path: homePath(), end: true }, location.pathname) || location.pathname === homePath();
|
|
109
|
+
const [entityRef, setEntityRef] = useState(void 0);
|
|
110
|
+
const [tags, setTags] = useState(void 0);
|
|
111
|
+
const [userRef, setUserRef] = useState(void 0);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (isQuestions || isArticles || isLinks) {
|
|
114
|
+
setEntityRef(searchParams.get("entity") ?? void 0);
|
|
115
|
+
setTags(filterTags(searchParams.get("tags")));
|
|
116
|
+
setUserRef(void 0);
|
|
117
|
+
} else if (tagMatch) {
|
|
118
|
+
if (tagMatch.params.tag) {
|
|
119
|
+
setTags([tagMatch.params.tag]);
|
|
120
|
+
}
|
|
121
|
+
setEntityRef(void 0);
|
|
122
|
+
setUserRef(void 0);
|
|
123
|
+
} else if (userMatch) {
|
|
124
|
+
if (userMatch.params["*"]) {
|
|
125
|
+
setUserRef(userMatch.params["*"]);
|
|
126
|
+
}
|
|
127
|
+
setTags(void 0);
|
|
128
|
+
setEntityRef(void 0);
|
|
129
|
+
} else if (entityMatch) {
|
|
130
|
+
if (entityMatch.params.entityRef) {
|
|
131
|
+
setEntityRef(entityMatch.params.entityRef);
|
|
132
|
+
}
|
|
133
|
+
setTags(void 0);
|
|
134
|
+
setUserRef(void 0);
|
|
135
|
+
} else {
|
|
136
|
+
setTags(void 0);
|
|
137
|
+
setEntityRef(void 0);
|
|
138
|
+
setUserRef(void 0);
|
|
139
|
+
}
|
|
140
|
+
}, [
|
|
141
|
+
searchParams,
|
|
142
|
+
isQuestions,
|
|
143
|
+
isArticles,
|
|
144
|
+
isLinks,
|
|
145
|
+
tagMatch,
|
|
146
|
+
userMatch,
|
|
147
|
+
entityMatch,
|
|
148
|
+
location.pathname
|
|
149
|
+
]);
|
|
150
|
+
let content = null;
|
|
151
|
+
if (isHome) {
|
|
152
|
+
content = /* @__PURE__ */ jsx(HomeRightContent, {});
|
|
153
|
+
} else if (isAsk) {
|
|
154
|
+
content = /* @__PURE__ */ jsx(AskRightContent, {});
|
|
155
|
+
} else if (isQuestions) {
|
|
156
|
+
content = /* @__PURE__ */ jsx(QuestionsRightContent, { tags, entityRef });
|
|
157
|
+
} else if (isArticles) {
|
|
158
|
+
content = /* @__PURE__ */ jsx(ArticlesRightContent, { tags, entityRef });
|
|
159
|
+
} else if (isLinks) {
|
|
160
|
+
content = /* @__PURE__ */ jsx(LinksRightContent, { tags, entityRef });
|
|
161
|
+
} else if (isFavorite) {
|
|
162
|
+
content = /* @__PURE__ */ jsx(FavoriteRightContent, {});
|
|
163
|
+
} else if (isUsers) {
|
|
164
|
+
content = /* @__PURE__ */ jsx(UsersRightContent, {});
|
|
165
|
+
} else if (tagMatch) {
|
|
166
|
+
content = /* @__PURE__ */ jsx(TagRightContent, { tags });
|
|
167
|
+
} else if (userMatch && userRef) {
|
|
168
|
+
content = null;
|
|
169
|
+
} else if (isTags) {
|
|
170
|
+
content = /* @__PURE__ */ jsx(TagsRightContent, {});
|
|
171
|
+
} else if (isEntities) {
|
|
172
|
+
content = /* @__PURE__ */ jsx(EntitiesRightContent, {});
|
|
173
|
+
} else if (entityMatch && entityRef) {
|
|
174
|
+
content = /* @__PURE__ */ jsx(EntityRightContent, { entityRef });
|
|
175
|
+
} else if (isCollections) {
|
|
176
|
+
content = /* @__PURE__ */ jsx(CollectionsRightContent, {});
|
|
177
|
+
}
|
|
178
|
+
if (!content) {
|
|
179
|
+
content = /* @__PURE__ */ jsx(DefaultRightContent, {});
|
|
180
|
+
}
|
|
181
|
+
return /* @__PURE__ */ jsxs(Box, { className: classes.container, children: [
|
|
182
|
+
/* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: compact ? "center" : "flex-start", children: /* @__PURE__ */ jsx(
|
|
183
|
+
Tooltip,
|
|
184
|
+
{
|
|
185
|
+
title: compact ? t("rightMenu.expand") : t("rightMenu.collapse"),
|
|
186
|
+
placement: "left",
|
|
187
|
+
children: /* @__PURE__ */ jsx(
|
|
188
|
+
IconButton,
|
|
189
|
+
{
|
|
190
|
+
onClick: onToggle,
|
|
191
|
+
size: "small",
|
|
192
|
+
className: compact ? "" : classes.toggleButton,
|
|
193
|
+
children: compact ? /* @__PURE__ */ jsx(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx(MenuOpenIcon, { style: { transform: "scaleX(-1)" } })
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
) }),
|
|
198
|
+
/* @__PURE__ */ jsx(Box, { className: classes.content, children: content })
|
|
199
|
+
] });
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export { RightContent };
|
|
203
|
+
//# sourceMappingURL=RightContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RightContent.esm.js","sources":["../../../src/components/RightContent/RightContent.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { AskRightContent } from './AskRightContent';\nimport {\n articlesRouteRef,\n askRouteRef,\n collectionsRouteRef,\n editQuestionRouteRef,\n entitiesRouteRef,\n entityRouteRef,\n favoriteQuestionsRouteRef,\n linksRouteRef,\n qetaRouteRef,\n questionsRouteRef,\n tagRouteRef,\n tagsRouteRef,\n userRouteRef,\n usersRouteRef,\n qetaTranslationRef,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Box, IconButton, makeStyles, Tooltip } from '@material-ui/core';\nimport { matchPath, useLocation, useSearchParams } from 'react-router-dom';\nimport { filterTags } from '@drodil/backstage-plugin-qeta-common';\nimport { HomeRightContent } from './HomeRightContent';\nimport { QuestionsRightContent } from './QuestionsRightContent';\nimport { ArticlesRightContent } from './ArticlesRightContent';\nimport { LinksRightContent } from './LinksRightContent';\nimport { FavoriteRightContent } from './FavoriteRightContent';\nimport { UsersRightContent } from './UsersRightContent';\nimport { TagRightContent } from './TagRightContent';\nimport { TagsRightContent } from './TagsRightContent';\nimport { EntitiesRightContent } from './EntitiesRightContent';\nimport { EntityRightContent } from './EntityRightContent';\nimport { CollectionsRightContent } from './CollectionsRightContent';\nimport MenuOpenIcon from '@material-ui/icons/MenuOpen';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\n\nconst useStyles = makeStyles(theme => ({\n container: {\n width: (props: { compact: boolean }) => (props.compact ? '72px' : '300px'),\n padding: (props: { compact: boolean }) =>\n props.compact ? theme.spacing(1) : theme.spacing(0, 0, 0, 2),\n transition: 'width 0.2s ease-in-out',\n display: 'flex',\n flexDirection: 'column',\n overflowX: 'hidden',\n },\n toggleButton: {\n marginRight: 'auto',\n marginBottom: theme.spacing(1),\n },\n content: {\n display: (props: { compact: boolean }) =>\n props.compact ? 'none' : 'block',\n opacity: (props: { compact: boolean }) => (props.compact ? 0 : 1),\n transition: 'opacity 0.2s ease-in-out',\n },\n}));\n\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { DefaultRightContent } from './DefaultRightContent';\n\nexport const RightContent = (props: {\n compact?: boolean;\n onToggle?: () => void;\n}) => {\n const { compact = false, onToggle } = props;\n const classes = useStyles({ compact });\n const location = useLocation();\n const [searchParams] = useSearchParams();\n const { t } = useTranslationRef(qetaTranslationRef);\n\n // Route Refs\n const questionsPath = useRouteRef(questionsRouteRef);\n const articlesPath = useRouteRef(articlesRouteRef);\n const usersPath = useRouteRef(usersRouteRef);\n const tagsPath = useRouteRef(tagsRouteRef);\n const linksPath = useRouteRef(linksRouteRef);\n const collectionsPath = useRouteRef(collectionsRouteRef);\n const entitiesPath = useRouteRef(entitiesRouteRef);\n const favoritePath = useRouteRef(favoriteQuestionsRouteRef);\n const homePath = useRouteRef(qetaRouteRef);\n // qetaRouteRef gives the base path of the plugin, e.g. /qeta\n const rootPath = homePath();\n\n // Matchers\n const isQuestions = matchPath(\n { path: questionsPath(), end: true },\n location.pathname,\n );\n const isAsk =\n matchPath(\n { path: `${rootPath}${askRouteRef.path}`, end: true },\n location.pathname,\n ) ||\n matchPath(\n { path: `${rootPath}${editQuestionRouteRef.path}`, end: true },\n location.pathname,\n );\n\n const isArticles = matchPath(\n { path: articlesPath(), end: true },\n location.pathname,\n );\n const isUsers = matchPath(\n { path: usersPath(), end: true },\n location.pathname,\n );\n const userMatch = matchPath(\n { path: `${rootPath}${userRouteRef.path}` },\n location.pathname,\n );\n const isTags = matchPath({ path: tagsPath(), end: true }, location.pathname);\n const tagMatch = matchPath(\n { path: `${rootPath}${tagRouteRef.path}` },\n location.pathname,\n );\n const isCollections = matchPath(\n { path: collectionsPath(), end: true },\n location.pathname,\n );\n const isEntities = matchPath(\n { path: entitiesPath(), end: true },\n location.pathname,\n );\n const entityMatch = matchPath(\n { path: `${rootPath}${entityRouteRef.path}` },\n location.pathname,\n );\n const isLinks = matchPath(\n { path: linksPath(), end: true },\n location.pathname,\n );\n const isFavorite = matchPath(\n { path: favoritePath(), end: true },\n location.pathname,\n );\n // Home is tricky because it's root, checking others first might be safer or check exact root\n const isHome =\n matchPath({ path: homePath(), end: true }, location.pathname) ||\n location.pathname === homePath();\n\n const [entityRef, setEntityRef] = useState<string | undefined>(undefined);\n const [tags, setTags] = useState<string[] | undefined>(undefined);\n const [userRef, setUserRef] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n if (isQuestions || isArticles || isLinks) {\n setEntityRef(searchParams.get('entity') ?? undefined);\n setTags(filterTags(searchParams.get('tags')));\n setUserRef(undefined);\n } else if (tagMatch) {\n if (tagMatch.params.tag) {\n setTags([tagMatch.params.tag]);\n }\n setEntityRef(undefined);\n setUserRef(undefined);\n } else if (userMatch) {\n if (userMatch.params['*']) {\n setUserRef(userMatch.params['*']);\n }\n setTags(undefined);\n setEntityRef(undefined);\n } else if (entityMatch) {\n if (entityMatch.params.entityRef) {\n setEntityRef(entityMatch.params.entityRef);\n }\n setTags(undefined);\n setUserRef(undefined);\n } else {\n setTags(undefined);\n setEntityRef(undefined);\n setUserRef(undefined);\n }\n }, [\n searchParams,\n isQuestions,\n isArticles,\n isLinks,\n tagMatch,\n userMatch,\n entityMatch,\n location.pathname,\n ]);\n\n let content = null;\n\n if (isHome) {\n content = <HomeRightContent />;\n } else if (isAsk) {\n content = <AskRightContent />;\n } else if (isQuestions) {\n content = <QuestionsRightContent tags={tags} entityRef={entityRef} />;\n } else if (isArticles) {\n content = <ArticlesRightContent tags={tags} entityRef={entityRef} />;\n } else if (isLinks) {\n content = <LinksRightContent tags={tags} entityRef={entityRef} />;\n } else if (isFavorite) {\n content = <FavoriteRightContent />;\n } else if (isUsers) {\n content = <UsersRightContent />;\n } else if (tagMatch) {\n content = <TagRightContent tags={tags} />;\n } else if (userMatch && userRef) {\n content = null;\n } else if (isTags) {\n content = <TagsRightContent />;\n } else if (isEntities) {\n content = <EntitiesRightContent />;\n } else if (entityMatch && entityRef) {\n content = <EntityRightContent entityRef={entityRef} />;\n } else if (isCollections) {\n content = <CollectionsRightContent />;\n }\n\n if (!content) {\n content = <DefaultRightContent />;\n }\n\n return (\n <Box className={classes.container}>\n <Box display=\"flex\" justifyContent={compact ? 'center' : 'flex-start'}>\n <Tooltip\n title={compact ? t('rightMenu.expand') : t('rightMenu.collapse')}\n placement=\"left\"\n >\n <IconButton\n onClick={onToggle}\n size=\"small\"\n className={compact ? '' : classes.toggleButton}\n >\n {compact ? (\n <ChevronLeftIcon />\n ) : (\n <MenuOpenIcon style={{ transform: 'scaleX(-1)' }} />\n )}\n </IconButton>\n </Tooltip>\n </Box>\n <Box className={classes.content}>{content}</Box>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,CAAC,KAAiC,KAAA,KAAA,CAAM,UAAU,MAAS,GAAA,OAAA;AAAA,IAClE,OAAS,EAAA,CAAC,KACR,KAAA,KAAA,CAAM,UAAU,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA,GAAI,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,IAC7D,UAAY,EAAA,wBAAA;AAAA,IACZ,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,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;AAGjC,EAAA,uBACG,IAAA,CAAA,GAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,SACtB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,cAAgB,EAAA,OAAA,GAAU,WAAW,YACvD,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,OAAO,OAAU,GAAA,CAAA,CAAE,kBAAkB,CAAA,GAAI,EAAE,oBAAoB,CAAA;AAAA,QAC/D,SAAU,EAAA,MAAA;AAAA,QAEV,QAAA,kBAAA,GAAA;AAAA,UAAC,UAAA;AAAA,UAAA;AAAA,YACC,OAAS,EAAA,QAAA;AAAA,YACT,IAAK,EAAA,OAAA;AAAA,YACL,SAAA,EAAW,OAAU,GAAA,EAAA,GAAK,OAAQ,CAAA,YAAA;AAAA,YAEjC,QAAA,EAAA,OAAA,mBACE,GAAA,CAAA,eAAA,EAAA,EAAgB,CAEjB,mBAAA,GAAA,CAAC,gBAAa,KAAO,EAAA,EAAE,SAAW,EAAA,YAAA,EAAgB,EAAA;AAAA;AAAA;AAEtD;AAAA,KAEJ,EAAA,CAAA;AAAA,oBACC,GAAA,CAAA,GAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,SAAU,QAAQ,EAAA,OAAA,EAAA;AAAA,GAC5C,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useQetaContext, qetaTranslationRef, useQetaApi, PostHighlightListContent } from '@drodil/backstage-plugin-qeta-react';
|
|
4
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
5
|
+
|
|
6
|
+
const SimilarQuestions = () => {
|
|
7
|
+
const { draftQuestion } = useQetaContext();
|
|
8
|
+
const { t } = useTranslationRef(qetaTranslationRef);
|
|
9
|
+
const [debouncedDraftQuestion, setDebouncedDraftQuestion] = React.useState(draftQuestion);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
const handler = setTimeout(() => {
|
|
12
|
+
setDebouncedDraftQuestion(draftQuestion);
|
|
13
|
+
}, 1500);
|
|
14
|
+
return () => {
|
|
15
|
+
clearTimeout(handler);
|
|
16
|
+
};
|
|
17
|
+
}, [draftQuestion]);
|
|
18
|
+
const { value: questions, loading } = useQetaApi(
|
|
19
|
+
(api) => {
|
|
20
|
+
if (!debouncedDraftQuestion || debouncedDraftQuestion.title.length === 0) {
|
|
21
|
+
return Promise.resolve({ posts: [], total: 0 });
|
|
22
|
+
}
|
|
23
|
+
return api.suggest({
|
|
24
|
+
title: debouncedDraftQuestion.title,
|
|
25
|
+
content: debouncedDraftQuestion.content,
|
|
26
|
+
tags: debouncedDraftQuestion.tags,
|
|
27
|
+
entities: debouncedDraftQuestion.entities
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
[debouncedDraftQuestion]
|
|
31
|
+
);
|
|
32
|
+
const [displayQuestions, setDisplayQuestions] = React.useState([]);
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (questions) {
|
|
35
|
+
setDisplayQuestions(questions.posts);
|
|
36
|
+
}
|
|
37
|
+
}, [questions]);
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
if ((!draftQuestion || draftQuestion.title.length === 0) && displayQuestions.length > 0) {
|
|
40
|
+
setDisplayQuestions([]);
|
|
41
|
+
}
|
|
42
|
+
}, [draftQuestion, displayQuestions]);
|
|
43
|
+
if (displayQuestions.length === 0) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
PostHighlightListContent,
|
|
48
|
+
{
|
|
49
|
+
title: t("rightMenu.similarQuestions"),
|
|
50
|
+
posts: displayQuestions,
|
|
51
|
+
loading,
|
|
52
|
+
disableLoading: true
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { SimilarQuestions };
|
|
58
|
+
//# sourceMappingURL=SimilarQuestions.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimilarQuestions.esm.js","sources":["../../../src/components/RightContent/SimilarQuestions.tsx"],"sourcesContent":["import React from 'react';\n\nimport {\n PostHighlightListContent,\n qetaTranslationRef,\n useQetaApi,\n useQetaContext,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { Post } from '@drodil/backstage-plugin-qeta-common';\n\nexport const SimilarQuestions = () => {\n const { draftQuestion } = useQetaContext();\n const { t } = useTranslationRef(qetaTranslationRef);\n const [debouncedDraftQuestion, setDebouncedDraftQuestion] =\n React.useState(draftQuestion);\n\n React.useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedDraftQuestion(draftQuestion);\n }, 1500);\n\n return () => {\n clearTimeout(handler);\n };\n }, [draftQuestion]);\n\n const { value: questions, loading } = useQetaApi(\n api => {\n if (\n !debouncedDraftQuestion ||\n debouncedDraftQuestion.title.length === 0\n ) {\n return Promise.resolve({ posts: [], total: 0 });\n }\n return api.suggest({\n title: debouncedDraftQuestion.title,\n content: debouncedDraftQuestion.content,\n tags: debouncedDraftQuestion.tags,\n entities: debouncedDraftQuestion.entities,\n });\n },\n [debouncedDraftQuestion],\n );\n\n const [displayQuestions, setDisplayQuestions] = React.useState<Post[]>([]);\n\n React.useEffect(() => {\n if (questions) {\n setDisplayQuestions(questions.posts);\n }\n }, [questions]);\n\n React.useEffect(() => {\n if (\n (!draftQuestion || draftQuestion.title.length === 0) &&\n displayQuestions.length > 0\n ) {\n setDisplayQuestions([]);\n }\n }, [draftQuestion, displayQuestions]);\n\n if (displayQuestions.length === 0) {\n return null;\n }\n\n return (\n <PostHighlightListContent\n title={t('rightMenu.similarQuestions')}\n posts={displayQuestions}\n loading={loading}\n disableLoading\n />\n );\n};\n"],"names":[],"mappings":";;;;;AAWO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ACrC,GACF,EAAG,CAAC,SAAS,CAAC,CAAA;AAEd,EAAA,KAAA,CAAM,UAAU,MAAM;AACpB,IACG,IAAA,CAAA,CAAC,iBAAiB,aAAc,CAAA,KAAA,CAAM,WAAW,CAClD,KAAA,gBAAA,CAAiB,SAAS,CAC1B,EAAA;AACA,MAAA,mBAAA,CAAoB,EAAE,CAAA;AAAA;AACxB,GACC,EAAA,CAAC,aAAe,EAAA,gBAAgB,CAAC,CAAA;AAEpC,EAAI,IAAA,gBAAA,CAAiB,WAAW,CAAG,EAAA;AACjC,IAAO,OAAA,IAAA;AAAA;AAGT,EACE,uBAAA,GAAA;AAAA,IAAC,wBAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,4BAA4B,CAAA;AAAA,MACrC,KAAO,EAAA,gBAAA;AAAA,MACP,OAAA;AAAA,MACA,cAAc,EAAA;AAAA;AAAA,GAChB;AAEJ;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { qetaTranslationRef, FollowedTagsList, PostHighlightList, PostHighlightListContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
4
|
+
import Whatshot from '@material-ui/icons/Whatshot';
|
|
5
|
+
|
|
6
|
+
const TagRightContent = (props) => {
|
|
7
|
+
const { t } = useTranslationRef(qetaTranslationRef);
|
|
8
|
+
const { tags } = props;
|
|
9
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10
|
+
/* @__PURE__ */ jsx(FollowedTagsList, {}),
|
|
11
|
+
tags && tags.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
+
/* @__PURE__ */ jsx(
|
|
13
|
+
PostHighlightList,
|
|
14
|
+
{
|
|
15
|
+
type: "hot",
|
|
16
|
+
title: t("highlights.hotQuestions.title"),
|
|
17
|
+
noQuestionsLabel: t("highlights.hotQuestions.noQuestionsLabel"),
|
|
18
|
+
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
19
|
+
options: { tags },
|
|
20
|
+
postType: "question"
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
PostHighlightList,
|
|
25
|
+
{
|
|
26
|
+
type: "unanswered",
|
|
27
|
+
title: t("highlights.unanswered.title"),
|
|
28
|
+
noQuestionsLabel: t("highlights.unanswered.noQuestionsLabel"),
|
|
29
|
+
options: { tags },
|
|
30
|
+
postType: "question"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
PostHighlightList,
|
|
35
|
+
{
|
|
36
|
+
type: "incorrect",
|
|
37
|
+
title: t("highlights.incorrect.title"),
|
|
38
|
+
noQuestionsLabel: t("highlights.incorrect.noQuestionsLabel"),
|
|
39
|
+
options: { tags },
|
|
40
|
+
postType: "question"
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] }) : /* @__PURE__ */ jsx(PostHighlightListContainer, {})
|
|
44
|
+
] });
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { TagRightContent };
|
|
48
|
+
//# sourceMappingURL=TagRightContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagRightContent.esm.js","sources":["../../../src/components/RightContent/TagRightContent.tsx"],"sourcesContent":["import {\n FollowedTagsList,\n PostHighlightList,\n PostHighlightListContainer,\n qetaTranslationRef,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Whatshot from '@material-ui/icons/Whatshot';\n\nexport const TagRightContent = (props: { tags?: string[] }) => {\n const { t } = useTranslationRef(qetaTranslationRef);\n const { tags } = props;\n\n return (\n <>\n <FollowedTagsList />\n {tags && tags.length > 0 ? (\n <>\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotQuestions.title')}\n noQuestionsLabel={t('highlights.hotQuestions.noQuestionsLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n options={{ tags: tags }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"unanswered\"\n title={t('highlights.unanswered.title')}\n noQuestionsLabel={t('highlights.unanswered.noQuestionsLabel')}\n options={{ tags: tags }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"incorrect\"\n title={t('highlights.incorrect.title')}\n noQuestionsLabel={t('highlights.incorrect.noQuestionsLabel')}\n options={{ tags: tags }}\n postType=\"question\"\n />\n </>\n ) : (\n <PostHighlightListContainer />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AASa,MAAA,eAAA,GAAkB,CAAC,KAA+B,KAAA;AAC7D,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,kBAAkB,CAAA;AAClD,EAAM,MAAA,EAAE,MAAS,GAAA,KAAA;AAEjB,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,gBAAiB,EAAA,EAAA,CAAA;AAAA,IACjB,IAAQ,IAAA,IAAA,CAAK,MAAS,GAAA,CAAA,mBAEnB,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,IAAK,EAAA,KAAA;AAAA,UACL,KAAA,EAAO,EAAE,+BAA+B,CAAA;AAAA,UACxC,gBAAA,EAAkB,EAAE,0CAA0C,CAAA;AAAA,UAC9D,IAAM,kBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,UACjC,OAAA,EAAS,EAAE,IAAW,EAAA;AAAA,UACtB,QAAS,EAAA;AAAA;AAAA,OACX;AAAA,sBACA,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,IAAK,EAAA,YAAA;AAAA,UACL,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,UACtC,gBAAA,EAAkB,EAAE,wCAAwC,CAAA;AAAA,UAC5D,OAAA,EAAS,EAAE,IAAW,EAAA;AAAA,UACtB,QAAS,EAAA;AAAA;AAAA,OACX;AAAA,sBACA,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,IAAK,EAAA,WAAA;AAAA,UACL,KAAA,EAAO,EAAE,4BAA4B,CAAA;AAAA,UACrC,gBAAA,EAAkB,EAAE,uCAAuC,CAAA;AAAA,UAC3D,OAAA,EAAS,EAAE,IAAW,EAAA;AAAA,UACtB,QAAS,EAAA;AAAA;AAAA;AACX,KACF,EAAA,CAAA,uBAEC,0BAA2B,EAAA,EAAA;AAAA,GAEhC,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { FollowedTagsList, PostHighlightListContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
|
|
4
|
+
const TagsRightContent = () => {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
|
+
/* @__PURE__ */ jsx(FollowedTagsList, {}),
|
|
7
|
+
/* @__PURE__ */ jsx(PostHighlightListContainer, {})
|
|
8
|
+
] });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { TagsRightContent };
|
|
12
|
+
//# sourceMappingURL=TagsRightContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagsRightContent.esm.js","sources":["../../../src/components/RightContent/TagsRightContent.tsx"],"sourcesContent":["import {\n FollowedTagsList,\n PostHighlightListContainer,\n} from '@drodil/backstage-plugin-qeta-react';\n\nexport const TagsRightContent = () => {\n return (\n <>\n <FollowedTagsList />\n <PostHighlightListContainer />\n </>\n );\n};\n"],"names":[],"mappings":";;;AAKO,MAAM,mBAAmB,MAAM;AACpC,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,gBAAiB,EAAA,EAAA,CAAA;AAAA,wBACjB,0BAA2B,EAAA,EAAA;AAAA,GAC9B,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { FollowedUsersList, PostHighlightListContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
|
|
4
|
+
const UsersRightContent = () => {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
|
+
/* @__PURE__ */ jsx(FollowedUsersList, {}),
|
|
7
|
+
/* @__PURE__ */ jsx(PostHighlightListContainer, {})
|
|
8
|
+
] });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { UsersRightContent };
|
|
12
|
+
//# sourceMappingURL=UsersRightContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsersRightContent.esm.js","sources":["../../../src/components/RightContent/UsersRightContent.tsx"],"sourcesContent":["import {\n FollowedUsersList,\n PostHighlightListContainer,\n} from '@drodil/backstage-plugin-qeta-react';\n\nexport const UsersRightContent = () => {\n return (\n <>\n <FollowedUsersList />\n <PostHighlightListContainer />\n </>\n );\n};\n"],"names":[],"mappings":";;;AAKO,MAAM,oBAAoB,MAAM;AACrC,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,iBAAkB,EAAA,EAAA,CAAA;AAAA,wBAClB,0BAA2B,EAAA,EAAA;AAAA,GAC9B,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useQetaApi, StatsChart
|
|
3
|
-
import { Grid, Card, CardContent, CircularProgress } from '@material-ui/core';
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useQetaApi, StatsChart } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
import { Grid, Card, CardHeader, CardContent, CircularProgress } from '@material-ui/core';
|
|
4
4
|
|
|
5
5
|
const GlobalStatsContent = () => {
|
|
6
6
|
const {
|
|
@@ -11,13 +11,19 @@ const GlobalStatsContent = () => {
|
|
|
11
11
|
if (error) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */ jsx(
|
|
16
|
-
|
|
14
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx(CardHeader, { title: "Activity Trends" }),
|
|
16
|
+
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
17
|
+
!loading && response && /* @__PURE__ */ jsx(
|
|
18
|
+
StatsChart,
|
|
19
|
+
{
|
|
20
|
+
data: response.statistics,
|
|
21
|
+
summary: response.summary
|
|
22
|
+
}
|
|
23
|
+
),
|
|
17
24
|
loading && /* @__PURE__ */ jsx(CircularProgress, {})
|
|
18
|
-
] })
|
|
19
|
-
|
|
20
|
-
] });
|
|
25
|
+
] })
|
|
26
|
+
] }) }) });
|
|
21
27
|
};
|
|
22
28
|
|
|
23
29
|
export { GlobalStatsContent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStatsContent.esm.js","sources":["../../../src/components/Statistics/GlobalStatsContent.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"GlobalStatsContent.esm.js","sources":["../../../src/components/Statistics/GlobalStatsContent.tsx"],"sourcesContent":["import { StatsChart, useQetaApi } from '@drodil/backstage-plugin-qeta-react';\nimport {\n Card,\n CardContent,\n CardHeader,\n CircularProgress,\n Grid,\n} from '@material-ui/core';\n\nexport const GlobalStatsContent = () => {\n const {\n value: response,\n loading,\n error,\n } = useQetaApi(api => api.getGlobalStats(), []);\n if (error) {\n return null;\n }\n return (\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <Card>\n <CardHeader title=\"Activity Trends\" />\n <CardContent>\n {!loading && response && (\n <StatsChart\n data={response.statistics}\n summary={response.summary as unknown as Record<string, number>}\n />\n )}\n {loading && <CircularProgress />}\n </CardContent>\n </Card>\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;AASO,MAAM,qBAAqB,MAAM;AACtC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,QAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,MACE,UAAW,CAAA,CAAA,GAAA,KAAO,IAAI,cAAe,EAAA,EAAG,EAAE,CAAA;AAC9C,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,OAAA,IAAA;AAAA;AAET,EAAA,uBACG,GAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAC,OAAS,EAAA,CAAA,EACvB,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EACb,+BAAC,IACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAM,iBAAkB,EAAA,CAAA;AAAA,yBACnC,WACE,EAAA,EAAA,QAAA,EAAA;AAAA,MAAA,CAAC,WAAW,QACX,oBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,MAAM,QAAS,CAAA,UAAA;AAAA,UACf,SAAS,QAAS,CAAA;AAAA;AAAA,OACpB;AAAA,MAED,OAAA,wBAAY,gBAAiB,EAAA,EAAA;AAAA,KAChC,EAAA;AAAA,GAAA,EACF,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|