@drodil/backstage-plugin-qeta 2.15.0 → 3.0.0
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 +45 -0
- package/dist/components/ArticlePage/ArticlePage.esm.js.map +1 -0
- package/dist/components/ArticlesPage/ArticlesPage.esm.js +34 -0
- package/dist/components/ArticlesPage/ArticlesPage.esm.js.map +1 -0
- package/dist/components/AskPage/AskPage.esm.js +4 -4
- package/dist/components/AskPage/AskPage.esm.js.map +1 -1
- package/dist/components/CollectionCreatePage/CollectionCreatePage.esm.js +20 -0
- package/dist/components/CollectionCreatePage/CollectionCreatePage.esm.js.map +1 -0
- package/dist/components/CollectionPage/CollectionPage.esm.js +34 -0
- package/dist/components/CollectionPage/CollectionPage.esm.js.map +1 -0
- package/dist/components/CollectionsPage/CollectionsPage.esm.js +11 -0
- package/dist/components/CollectionsPage/CollectionsPage.esm.js.map +1 -0
- package/dist/components/EntityPage/EntityPage.esm.js +75 -0
- package/dist/components/EntityPage/EntityPage.esm.js.map +1 -0
- package/dist/components/FavoritePage/FavoritePage.esm.js +14 -22
- package/dist/components/FavoritePage/FavoritePage.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +7 -10
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/LeftMenu/LeftMenu.esm.js +47 -16
- package/dist/components/LeftMenu/LeftMenu.esm.js.map +1 -1
- package/dist/components/LeftMenu/LeftMenuButton.esm.js +75 -0
- package/dist/components/LeftMenu/LeftMenuButton.esm.js.map +1 -0
- package/dist/components/QetaPage/QetaPage.esm.js +51 -9
- package/dist/components/QetaPage/QetaPage.esm.js.map +1 -1
- package/dist/components/QuestionPage/QuestionPage.esm.js +7 -13
- package/dist/components/QuestionPage/QuestionPage.esm.js.map +1 -1
- package/dist/components/QuestionTableCard/Content.esm.js +1 -1
- package/dist/components/QuestionTableCard/Content.esm.js.map +1 -1
- package/dist/components/QuestionTableCard/index.esm.js +0 -1
- package/dist/components/QuestionTableCard/index.esm.js.map +1 -1
- package/dist/components/QuestionsPage/QuestionsPage.esm.js +13 -15
- package/dist/components/QuestionsPage/QuestionsPage.esm.js.map +1 -1
- package/dist/components/Statistics/GlobalStatsContent.esm.js +1 -3
- package/dist/components/Statistics/GlobalStatsContent.esm.js.map +1 -1
- package/dist/components/Statistics/StatisticsPage.esm.js +2 -3
- package/dist/components/Statistics/StatisticsPage.esm.js.map +1 -1
- package/dist/components/TagPage/TagPage.esm.js +32 -25
- package/dist/components/TagPage/TagPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserPage.esm.js +7 -16
- package/dist/components/UserPage/UserPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserStatsContent.esm.js +1 -3
- package/dist/components/UserPage/UserStatsContent.esm.js.map +1 -1
- package/dist/components/UsersPage/UsersPage.esm.js +11 -0
- package/dist/components/UsersPage/UsersPage.esm.js.map +1 -0
- package/dist/components/WritePage/WritePage.esm.js +40 -0
- package/dist/components/WritePage/WritePage.esm.js.map +1 -0
- package/dist/index.d.ts +8 -422
- package/dist/index.esm.js +0 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +2 -2
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +4 -24
- package/dist/api/QetaClient.esm.js +0 -513
- package/dist/api/QetaClient.esm.js.map +0 -1
- package/dist/components/AnswersContainer/AnswerList.esm.js +0 -100
- package/dist/components/AnswersContainer/AnswerList.esm.js.map +0 -1
- package/dist/components/AnswersContainer/AnswerListItem.esm.js +0 -90
- package/dist/components/AnswersContainer/AnswerListItem.esm.js.map +0 -1
- package/dist/components/AnswersContainer/AnswersContainer.esm.js +0 -210
- package/dist/components/AnswersContainer/AnswersContainer.esm.js.map +0 -1
- package/dist/components/AskAnonymouslyCheckbox/AskAnonymouslyCheckbox.esm.js +0 -34
- package/dist/components/AskAnonymouslyCheckbox/AskAnonymouslyCheckbox.esm.js.map +0 -1
- package/dist/components/AskForm/AskForm.esm.js +0 -245
- package/dist/components/AskForm/AskForm.esm.js.map +0 -1
- package/dist/components/AskForm/EntitiesInput.esm.js +0 -100
- package/dist/components/AskForm/EntitiesInput.esm.js.map +0 -1
- package/dist/components/AskForm/TagInput.esm.js +0 -81
- package/dist/components/AskForm/TagInput.esm.js.map +0 -1
- package/dist/components/Buttons/AskQuestionButton.esm.js +0 -45
- package/dist/components/Buttons/AskQuestionButton.esm.js.map +0 -1
- package/dist/components/Buttons/BackToQuestionsButton.esm.js +0 -39
- package/dist/components/Buttons/BackToQuestionsButton.esm.js.map +0 -1
- package/dist/components/Buttons/EntityFollowButton.esm.js +0 -34
- package/dist/components/Buttons/EntityFollowButton.esm.js.map +0 -1
- package/dist/components/Buttons/TagFollowButton.esm.js +0 -33
- package/dist/components/Buttons/TagFollowButton.esm.js.map +0 -1
- package/dist/components/CommentSection/CommentList.esm.js +0 -47
- package/dist/components/CommentSection/CommentList.esm.js.map +0 -1
- package/dist/components/CommentSection/CommentSection.esm.js +0 -126
- package/dist/components/CommentSection/CommentSection.esm.js.map +0 -1
- package/dist/components/DeleteModal/DeleteModal.esm.js +0 -78
- package/dist/components/DeleteModal/DeleteModal.esm.js.map +0 -1
- package/dist/components/HomePageCards/ImpactCard.esm.js +0 -22
- package/dist/components/HomePageCards/ImpactCard.esm.js.map +0 -1
- package/dist/components/HomePageCards/QuestionsCard.esm.js +0 -21
- package/dist/components/HomePageCards/QuestionsCard.esm.js.map +0 -1
- package/dist/components/Links/Links.esm.js +0 -33
- package/dist/components/Links/Links.esm.js.map +0 -1
- package/dist/components/MarkdownEditor/MarkdownEditor.esm.js +0 -78
- package/dist/components/MarkdownEditor/MarkdownEditor.esm.js.map +0 -1
- package/dist/components/MarkdownRenderer/MarkdownRenderer.esm.js +0 -37
- package/dist/components/MarkdownRenderer/MarkdownRenderer.esm.js.map +0 -1
- package/dist/components/QetaPage/FollowedEntitiesList.esm.js +0 -43
- package/dist/components/QetaPage/FollowedEntitiesList.esm.js.map +0 -1
- package/dist/components/QetaPage/FollowedTagsList.esm.js +0 -56
- package/dist/components/QetaPage/FollowedTagsList.esm.js.map +0 -1
- package/dist/components/QuestionHighlightList/QuestionHighlightList.esm.js +0 -64
- package/dist/components/QuestionHighlightList/QuestionHighlightList.esm.js.map +0 -1
- package/dist/components/QuestionPage/AnswerCard.esm.js +0 -113
- package/dist/components/QuestionPage/AnswerCard.esm.js.map +0 -1
- package/dist/components/QuestionPage/AnswerForm.esm.js +0 -153
- package/dist/components/QuestionPage/AnswerForm.esm.js.map +0 -1
- package/dist/components/QuestionPage/AuthorBox.esm.js +0 -25
- package/dist/components/QuestionPage/AuthorBox.esm.js.map +0 -1
- package/dist/components/QuestionPage/EntityChip.esm.js +0 -27
- package/dist/components/QuestionPage/EntityChip.esm.js.map +0 -1
- package/dist/components/QuestionPage/FavoriteButton.esm.js +0 -45
- package/dist/components/QuestionPage/FavoriteButton.esm.js.map +0 -1
- package/dist/components/QuestionPage/LinkButton.esm.js +0 -28
- package/dist/components/QuestionPage/LinkButton.esm.js.map +0 -1
- package/dist/components/QuestionPage/QuestionCard.esm.js +0 -107
- package/dist/components/QuestionPage/QuestionCard.esm.js.map +0 -1
- package/dist/components/QuestionPage/TagsAndEntities.esm.js +0 -44
- package/dist/components/QuestionPage/TagsAndEntities.esm.js.map +0 -1
- package/dist/components/QuestionPage/VoteButtons.esm.js +0 -153
- package/dist/components/QuestionPage/VoteButtons.esm.js.map +0 -1
- package/dist/components/QuestionTableCard/QuestionTableRow.esm.js +0 -21
- package/dist/components/QuestionTableCard/QuestionTableRow.esm.js.map +0 -1
- package/dist/components/QuestionTableCard/QuestionsTable.esm.js +0 -130
- package/dist/components/QuestionTableCard/QuestionsTable.esm.js.map +0 -1
- package/dist/components/QuestionsContainer/DateRangeFilter.esm.js +0 -110
- package/dist/components/QuestionsContainer/DateRangeFilter.esm.js.map +0 -1
- package/dist/components/QuestionsContainer/FilterPanel.esm.js +0 -237
- package/dist/components/QuestionsContainer/FilterPanel.esm.js.map +0 -1
- package/dist/components/QuestionsContainer/NoQuestionsCard.esm.js +0 -47
- package/dist/components/QuestionsContainer/NoQuestionsCard.esm.js.map +0 -1
- package/dist/components/QuestionsContainer/QuestionList.esm.js +0 -103
- package/dist/components/QuestionsContainer/QuestionList.esm.js.map +0 -1
- package/dist/components/QuestionsContainer/QuestionListItem.esm.js +0 -123
- package/dist/components/QuestionsContainer/QuestionListItem.esm.js.map +0 -1
- package/dist/components/QuestionsContainer/QuestionsContainer.esm.js +0 -243
- package/dist/components/QuestionsContainer/QuestionsContainer.esm.js.map +0 -1
- package/dist/components/RelativeTimeWithTooltip/RelativeTimeWithTooltip.esm.js +0 -22
- package/dist/components/RelativeTimeWithTooltip/RelativeTimeWithTooltip.esm.js.map +0 -1
- package/dist/components/Statistics/StatsChart.esm.js +0 -238
- package/dist/components/Statistics/StatsChart.esm.js.map +0 -1
- package/dist/components/Statistics/SummaryStatsGrid.esm.js +0 -47
- package/dist/components/Statistics/SummaryStatsGrid.esm.js.map +0 -1
- package/dist/components/Statistics/TopRankingUsersCard.esm.js +0 -161
- package/dist/components/Statistics/TopRankingUsersCard.esm.js.map +0 -1
- package/dist/components/Statistics/TrophyIcon.esm.js +0 -19
- package/dist/components/Statistics/TrophyIcon.esm.js.map +0 -1
- package/dist/components/Statistics/styles.esm.js +0 -23
- package/dist/components/Statistics/styles.esm.js.map +0 -1
- package/dist/components/TagPage/TagsContainer.esm.js +0 -57
- package/dist/components/TagPage/TagsContainer.esm.js.map +0 -1
- package/dist/locale/fi.esm.js +0 -195
- package/dist/locale/fi.esm.js.map +0 -1
- package/dist/translation.esm.js +0 -359
- package/dist/translation.esm.js.map +0 -1
- package/dist/utils/hooks.esm.js +0 -430
- package/dist/utils/hooks.esm.js.map +0 -1
- package/dist/utils/utils.esm.js +0 -72
- package/dist/utils/utils.esm.js.map +0 -1
|
@@ -1,50 +1,57 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import { ContentHeader } from '@backstage/core-components';
|
|
3
3
|
import { useParams } from 'react-router-dom';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { AskQuestionButton } from '../Buttons/AskQuestionButton.esm.js';
|
|
7
|
-
import { useTranslation } from '../../utils/hooks.esm.js';
|
|
8
|
-
import { TagFollowButton } from '../Buttons/TagFollowButton.esm.js';
|
|
9
|
-
import { Grid } from '@material-ui/core';
|
|
10
|
-
import { QuestionHighlightList } from '../QuestionHighlightList/QuestionHighlightList.esm.js';
|
|
4
|
+
import { useTranslation, qetaApiRef, TagFollowButton, AskQuestionButton, WriteArticleButton, MarkdownRenderer, PostsContainer, TagsGrid, FollowedTagsList, PostHighlightList } from '@drodil/backstage-plugin-qeta-react';
|
|
5
|
+
import { Grid, Card, CardContent, Typography } from '@material-ui/core';
|
|
11
6
|
import Whatshot from '@material-ui/icons/Whatshot';
|
|
12
|
-
import {
|
|
7
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
13
8
|
|
|
14
9
|
const TagPage = () => {
|
|
15
10
|
const { tag } = useParams();
|
|
16
11
|
const { t } = useTranslation();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
const [resp, setResp] = React.useState();
|
|
13
|
+
const qetaApi = useApi(qetaApiRef);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!tag) {
|
|
16
|
+
setResp(void 0);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
qetaApi.getTag(tag).then((res) => {
|
|
20
|
+
if (res) {
|
|
21
|
+
setResp(res);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}, [qetaApi, tag]);
|
|
25
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 4 }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 12, lg: 9, xl: 10 }, /* @__PURE__ */ React.createElement(ContentHeader, { title: tag ? `#${tag}` : t("tagPage.defaultTitle") }, tag && /* @__PURE__ */ React.createElement(TagFollowButton, { tag }), /* @__PURE__ */ React.createElement(AskQuestionButton, { tags: tag ? [tag] : void 0 }), /* @__PURE__ */ React.createElement(WriteArticleButton, { tags: tag ? [tag] : void 0 })), resp && /* @__PURE__ */ React.createElement(Card, { variant: "outlined", style: { marginBottom: "1rem" } }, /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, t("common.posts", {
|
|
26
|
+
count: resp.postsCount,
|
|
27
|
+
itemType: "post"
|
|
28
|
+
}), " \xB7 ", t("common.followers", { count: resp.followerCount })), resp.description && /* @__PURE__ */ React.createElement(MarkdownRenderer, { content: resp.description }))), tag ? /* @__PURE__ */ React.createElement(PostsContainer, { tags: [tag ?? ""] }) : /* @__PURE__ */ React.createElement(TagsGrid, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, lg: 3, xl: 2 }, /* @__PURE__ */ React.createElement(FollowedTagsList, null), /* @__PURE__ */ React.createElement(
|
|
29
|
+
PostHighlightList,
|
|
26
30
|
{
|
|
27
31
|
type: "hot",
|
|
28
|
-
title: t("highlights.
|
|
29
|
-
noQuestionsLabel: t("highlights.
|
|
32
|
+
title: t("highlights.hotQuestions.title"),
|
|
33
|
+
noQuestionsLabel: t("highlights.hotQuestions.noQuestionsLabel"),
|
|
30
34
|
icon: /* @__PURE__ */ React.createElement(Whatshot, { fontSize: "small" }),
|
|
31
|
-
options: { tags: [tag ?? ""] }
|
|
35
|
+
options: { tags: [tag ?? ""] },
|
|
36
|
+
postType: "question"
|
|
32
37
|
}
|
|
33
38
|
), /* @__PURE__ */ React.createElement(
|
|
34
|
-
|
|
39
|
+
PostHighlightList,
|
|
35
40
|
{
|
|
36
41
|
type: "unanswered",
|
|
37
42
|
title: t("highlights.unanswered.title"),
|
|
38
43
|
noQuestionsLabel: t("highlights.unanswered.noQuestionsLabel"),
|
|
39
|
-
options: { tags: [tag ?? ""] }
|
|
44
|
+
options: { tags: [tag ?? ""] },
|
|
45
|
+
postType: "question"
|
|
40
46
|
}
|
|
41
47
|
), /* @__PURE__ */ React.createElement(
|
|
42
|
-
|
|
48
|
+
PostHighlightList,
|
|
43
49
|
{
|
|
44
50
|
type: "incorrect",
|
|
45
51
|
title: t("highlights.incorrect.title"),
|
|
46
52
|
noQuestionsLabel: t("highlights.incorrect.noQuestionsLabel"),
|
|
47
|
-
options: { tags: [tag ?? ""] }
|
|
53
|
+
options: { tags: [tag ?? ""] },
|
|
54
|
+
postType: "question"
|
|
48
55
|
}
|
|
49
56
|
)));
|
|
50
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagPage.esm.js","sources":["../../../src/components/TagPage/TagPage.tsx"],"sourcesContent":["import React from 'react';\nimport { ContentHeader } from '@backstage/core-components';\nimport { useParams } from 'react-router-dom';\nimport {
|
|
1
|
+
{"version":3,"file":"TagPage.esm.js","sources":["../../../src/components/TagPage/TagPage.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { ContentHeader } from '@backstage/core-components';\nimport { useParams } from 'react-router-dom';\nimport {\n AskQuestionButton,\n FollowedTagsList,\n MarkdownRenderer,\n PostHighlightList,\n PostsContainer,\n qetaApiRef,\n TagFollowButton,\n TagsGrid,\n useTranslation,\n WriteArticleButton,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Card, CardContent, Grid, Typography } from '@material-ui/core';\nimport Whatshot from '@material-ui/icons/Whatshot';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { TagResponse } from '@drodil/backstage-plugin-qeta-common';\n\nexport const TagPage = () => {\n const { tag } = useParams();\n const { t } = useTranslation();\n const [resp, setResp] = React.useState<undefined | TagResponse>();\n\n const qetaApi = useApi(qetaApiRef);\n\n useEffect(() => {\n if (!tag) {\n setResp(undefined);\n return;\n }\n\n qetaApi.getTag(tag).then(res => {\n if (res) {\n setResp(res);\n }\n });\n }, [qetaApi, tag]);\n\n return (\n <Grid container spacing={4}>\n <Grid item md={12} lg={9} xl={10}>\n <ContentHeader title={tag ? `#${tag}` : t('tagPage.defaultTitle')}>\n {tag && <TagFollowButton tag={tag} />}\n <AskQuestionButton tags={tag ? [tag] : undefined} />\n <WriteArticleButton tags={tag ? [tag] : undefined} />\n </ContentHeader>\n {resp && (\n <Card variant=\"outlined\" style={{ marginBottom: '1rem' }}>\n <CardContent>\n <Typography variant=\"caption\">\n {t('common.posts', {\n count: resp.postsCount,\n itemType: 'post',\n })}\n {' · '}\n {t('common.followers', { count: resp.followerCount })}\n </Typography>\n {resp.description && (\n <MarkdownRenderer content={resp.description} />\n )}\n </CardContent>\n </Card>\n )}\n {tag ? <PostsContainer tags={[tag ?? '']} /> : <TagsGrid />}\n </Grid>\n <Grid item lg={3} xl={2}>\n <FollowedTagsList />\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: [tag ?? ''] }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"unanswered\"\n title={t('highlights.unanswered.title')}\n noQuestionsLabel={t('highlights.unanswered.noQuestionsLabel')}\n options={{ tags: [tag ?? ''] }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"incorrect\"\n title={t('highlights.incorrect.title')}\n noQuestionsLabel={t('highlights.incorrect.noQuestionsLabel')}\n options={{ tags: [tag ?? ''] }}\n postType=\"question\"\n />\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAoBO,MAAM,UAAU,MAAM;AAC3B,EAAM,MAAA,EAAE,GAAI,EAAA,GAAI,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA,CAAA;AAC7B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,MAAM,QAAkC,EAAA,CA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AC,iBAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,YAAA;AAAA,MACL,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,MACtC,gBAAA,EAAkB,EAAE,wCAAwC,CAAA;AAAA,MAC5D,SAAS,EAAE,IAAA,EAAM,CAAC,GAAA,IAAO,EAAE,CAAE,EAAA;AAAA,MAC7B,QAAS,EAAA,UAAA;AAAA,KAAA;AAAA,GAEX,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,WAAA;AAAA,MACL,KAAA,EAAO,EAAE,4BAA4B,CAAA;AAAA,MACrC,gBAAA,EAAkB,EAAE,uCAAuC,CAAA;AAAA,MAC3D,SAAS,EAAE,IAAA,EAAM,CAAC,GAAA,IAAO,EAAE,CAAE,EAAA;AAAA,MAC7B,QAAS,EAAA,UAAA;AAAA,KAAA;AAAA,GAEb,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { ContentHeader } from '@backstage/core-components';
|
|
3
3
|
import { useParams, useSearchParams } from 'react-router-dom';
|
|
4
|
-
import {
|
|
5
|
-
import { AskQuestionButton } from '../Buttons/AskQuestionButton.esm.js';
|
|
4
|
+
import { useTranslation, AskQuestionButton, WriteArticleButton, PostsContainer, PostsGrid, AnswersContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
6
5
|
import { Box, Tab } from '@material-ui/core';
|
|
7
6
|
import { useEntityPresentation } from '@backstage/plugin-catalog-react';
|
|
8
7
|
import { TabContext, TabList, TabPanel } from '@material-ui/lab';
|
|
9
|
-
import { useTranslation } from '../../utils/hooks.esm.js';
|
|
10
|
-
import 'dompurify';
|
|
11
|
-
import '@drodil/backstage-plugin-qeta-common';
|
|
12
|
-
import '@backstage/core-plugin-api';
|
|
13
|
-
import '@drodil/backstage-plugin-qeta-react';
|
|
14
|
-
import 'react-relative-time';
|
|
15
|
-
import 'lodash';
|
|
16
|
-
import '@backstage/catalog-model';
|
|
17
|
-
import '../QuestionPage/VoteButtons.esm.js';
|
|
18
|
-
import { AnswersContainer } from '../AnswersContainer/AnswersContainer.esm.js';
|
|
19
8
|
import { UserStatsContent } from './UserStatsContent.esm.js';
|
|
20
9
|
|
|
21
10
|
const UserPage = () => {
|
|
@@ -28,7 +17,7 @@ const UserPage = () => {
|
|
|
28
17
|
setSearchParams({});
|
|
29
18
|
setTab(newValue);
|
|
30
19
|
};
|
|
31
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: `${presentation.primaryTitle}` }, /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(TabContext, { value: tab }, /* @__PURE__ */ React.createElement(Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React.createElement(
|
|
20
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: `${presentation.primaryTitle}` }, /* @__PURE__ */ React.createElement(AskQuestionButton, null), /* @__PURE__ */ React.createElement(WriteArticleButton, null)), /* @__PURE__ */ React.createElement(TabContext, { value: tab }, /* @__PURE__ */ React.createElement(Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React.createElement(
|
|
32
21
|
TabList,
|
|
33
22
|
{
|
|
34
23
|
onChange: handleChange,
|
|
@@ -36,14 +25,16 @@ const UserPage = () => {
|
|
|
36
25
|
},
|
|
37
26
|
/* @__PURE__ */ React.createElement(Tab, { label: t("userPage.statistics"), value: "statistics" }),
|
|
38
27
|
/* @__PURE__ */ React.createElement(Tab, { label: t("userPage.questions"), value: "questions" }),
|
|
28
|
+
/* @__PURE__ */ React.createElement(Tab, { label: t("userPage.articles"), value: "articles" }),
|
|
39
29
|
/* @__PURE__ */ React.createElement(Tab, { label: t("userPage.answers"), value: "answers" })
|
|
40
30
|
)), /* @__PURE__ */ React.createElement(TabPanel, { value: "statistics" }, /* @__PURE__ */ React.createElement(UserStatsContent, { userRef: identity ?? "" })), /* @__PURE__ */ React.createElement(TabPanel, { value: "questions" }, /* @__PURE__ */ React.createElement(
|
|
41
|
-
|
|
31
|
+
PostsContainer,
|
|
42
32
|
{
|
|
43
33
|
author: identity ?? "",
|
|
44
|
-
showNoQuestionsBtn: false
|
|
34
|
+
showNoQuestionsBtn: false,
|
|
35
|
+
type: "question"
|
|
45
36
|
}
|
|
46
|
-
)), /* @__PURE__ */ React.createElement(TabPanel, { value: "answers" }, /* @__PURE__ */ React.createElement(
|
|
37
|
+
)), /* @__PURE__ */ React.createElement(TabPanel, { value: "articles" }, /* @__PURE__ */ React.createElement(PostsGrid, { author: identity ?? "", type: "article" })), /* @__PURE__ */ React.createElement(TabPanel, { value: "answers" }, /* @__PURE__ */ React.createElement(
|
|
47
38
|
AnswersContainer,
|
|
48
39
|
{
|
|
49
40
|
author: identity ?? "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserPage.esm.js","sources":["../../../src/components/UserPage/UserPage.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { ContentHeader } from '@backstage/core-components';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport {
|
|
1
|
+
{"version":3,"file":"UserPage.esm.js","sources":["../../../src/components/UserPage/UserPage.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { ContentHeader } from '@backstage/core-components';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport {\n AnswersContainer,\n AskQuestionButton,\n PostsContainer,\n PostsGrid,\n useTranslation,\n WriteArticleButton,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Box, Tab } from '@material-ui/core';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { TabContext, TabList, TabPanel } from '@material-ui/lab';\nimport { UserStatsContent } from './UserStatsContent';\n\nexport const UserPage = () => {\n const identity = useParams()['*'] ?? 'unknown';\n const presentation = useEntityPresentation(identity);\n const [tab, setTab] = useState('statistics');\n const { t } = useTranslation();\n const [_searchParams, setSearchParams] = useSearchParams();\n\n const handleChange = (_event: React.ChangeEvent<{}>, newValue: string) => {\n setSearchParams({});\n setTab(newValue);\n };\n return (\n <>\n <ContentHeader title={`${presentation.primaryTitle}`}>\n <AskQuestionButton />\n <WriteArticleButton />\n </ContentHeader>\n <TabContext value={tab}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n onChange={handleChange}\n aria-label={t('userPage.profileTab')}\n >\n <Tab label={t('userPage.statistics')} value=\"statistics\" />\n <Tab label={t('userPage.questions')} value=\"questions\" />\n <Tab label={t('userPage.articles')} value=\"articles\" />\n <Tab label={t('userPage.answers')} value=\"answers\" />\n </TabList>\n </Box>\n <TabPanel value=\"statistics\">\n <UserStatsContent userRef={identity ?? ''} />\n </TabPanel>\n <TabPanel value=\"questions\">\n <PostsContainer\n author={identity ?? ''}\n showNoQuestionsBtn={false}\n type=\"question\"\n />\n </TabPanel>\n <TabPanel value=\"articles\">\n <PostsGrid author={identity ?? ''} type=\"article\" />\n </TabPanel>\n <TabPanel value=\"answers\">\n <AnswersContainer\n author={identity ?? ''}\n title={t('userPage.answers')}\n />\n </TabPanel>\n </TabContext>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAgBO,MAAM,WAAW,MAAM;AAC5B,EAAA,MAAM,QAAW,GAAA,SAAA,EAAY,CAAA,GAAG,CAAK,IAAA,SAAA,CAAA;AACrC,EAAM,MAAA,YAAA,GAAe,sBAAsB,QAAQ,CAAA,CAAA;AACnD,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAI,SAAS,YAAY,CAAA,CAAA;AAC3C,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA,CAAA;AAC7B,EAAA,MAAM,CAAC,aAAA,EAAe,eAAe,CAAA,GAAI,eAAgB,EAAA,CAAA;AAEzD,EAAM,MAAA,YAAA,GAAe,CAAC,MAAA,E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AAA,CAAA,gBAAA,EAAA,EAAiB,OAAS,EAAA,QAAA,IAAY,IAAI,CAC7C,CAAA,kBACC,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,OAAM,WACd,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,QAAQ,QAAY,IAAA,EAAA;AAAA,MACpB,kBAAoB,EAAA,KAAA;AAAA,MACpB,IAAK,EAAA,UAAA;AAAA,KAAA;AAAA,GAET,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,YAAS,KAAM,EAAA,UAAA,EAAA,sCACb,SAAU,EAAA,EAAA,MAAA,EAAQ,QAAY,IAAA,EAAA,EAAI,MAAK,SAAU,EAAA,CACpD,mBACC,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,OAAM,SACd,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,QAAQ,QAAY,IAAA,EAAA;AAAA,MACpB,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,KAAA;AAAA,GAE/B,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { useQetaApi } from '
|
|
1
|
+
import { useQetaApi, StatsChart, SummaryStatsGrid } from '@drodil/backstage-plugin-qeta-react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Grid, Card, CardContent } from '@material-ui/core';
|
|
4
|
-
import { StatsChart } from '../Statistics/StatsChart.esm.js';
|
|
5
|
-
import { SummaryStatsGrid } from '../Statistics/SummaryStatsGrid.esm.js';
|
|
6
4
|
|
|
7
5
|
const UserStatsContent = (props) => {
|
|
8
6
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStatsContent.esm.js","sources":["../../../src/components/UserPage/UserStatsContent.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"UserStatsContent.esm.js","sources":["../../../src/components/UserPage/UserStatsContent.tsx"],"sourcesContent":["import {\n StatsChart,\n SummaryStatsGrid,\n useQetaApi,\n} from '@drodil/backstage-plugin-qeta-react';\nimport React from 'react';\nimport { Card, CardContent, Grid } from '@material-ui/core';\n\nexport const UserStatsContent = (props: { userRef: string }) => {\n const {\n value: response,\n loading,\n error,\n } = useQetaApi(api => api.getUserStats(props.userRef), []);\n if (loading || error || !response) {\n return null;\n }\n return (\n <Grid container>\n <Grid item xs={12}>\n <Card>\n <CardContent>\n <StatsChart data={response.statistics} />\n </CardContent>\n </Card>\n </Grid>\n <Grid item xs={12}>\n <SummaryStatsGrid stats={response} />\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;AAQa,MAAA,gBAAA,GAAmB,CAAC,KAA+B,KAAA;AAC9D,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,QAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,GACF,GAAI,WAAW,CAAO,GAAA,KAAA,GAAA,CAAI,aAAa,KAAM,CAAA,OAAO,CAAG,EAAA,EAAE,CAAA,CAAA;AACzD,EAAI,IAAA,OAAA,IAAW,KAAS,IAAA,CAAC,QAAU,EAAA;AACjC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACA,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAA,sCACZ,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,sBACZ,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAA,sCACE,UAAW,EAAA,EAAA,IAAA,EAAM,QAAS,CAAA,UAAA,EAAY,CACzC,CACF,CACF,CAAA,sCACC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,sBACZ,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,EAAiB,KAAO,EAAA,QAAA,EAAU,CACrC,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation, UsersGrid } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
import { ContentHeader } from '@backstage/core-components';
|
|
4
|
+
|
|
5
|
+
const UsersPage = () => {
|
|
6
|
+
const { t } = useTranslation();
|
|
7
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: t("usersPage.title") }), /* @__PURE__ */ React.createElement(UsersGrid, null));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { UsersPage };
|
|
11
|
+
//# sourceMappingURL=UsersPage.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsersPage.esm.js","sources":["../../../src/components/UsersPage/UsersPage.tsx"],"sourcesContent":["import React from 'react';\nimport { UsersGrid, useTranslation } from '@drodil/backstage-plugin-qeta-react';\nimport { ContentHeader } from '@backstage/core-components';\n\nexport const UsersPage = () => {\n const { t } = useTranslation();\n\n return (\n <>\n <ContentHeader title={t('usersPage.title')} />\n <UsersGrid />\n </>\n );\n};\n"],"names":[],"mappings":";;;;AAIO,MAAM,YAAY,MAAM;AAC7B,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA,CAAA;AAE7B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,KAAO,EAAA,CAAA,CAAE,iBAAiB,CAAG,EAAA,CAAA,kBAC3C,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,IAAU,CACb,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useParams, useSearchParams } from 'react-router-dom';
|
|
3
|
+
import { filterTags } from '@drodil/backstage-plugin-qeta-common';
|
|
4
|
+
import { useTranslation, PostForm } from '@drodil/backstage-plugin-qeta-react';
|
|
5
|
+
import { useEntityPresentation } from '@backstage/plugin-catalog-react';
|
|
6
|
+
import { ContentHeader, InfoCard } from '@backstage/core-components';
|
|
7
|
+
import { Grid } from '@material-ui/core';
|
|
8
|
+
|
|
9
|
+
const WritePage = () => {
|
|
10
|
+
const { id } = useParams();
|
|
11
|
+
const [searchParams] = useSearchParams();
|
|
12
|
+
const entity = searchParams.get("entity") ?? void 0;
|
|
13
|
+
const entityPage = searchParams.get("entityPage") === "true";
|
|
14
|
+
const tags = filterTags(searchParams.get("tags"));
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
let title;
|
|
17
|
+
if (id) {
|
|
18
|
+
title = t("writePage.title.existingArticle");
|
|
19
|
+
} else if (entity) {
|
|
20
|
+
const representation = useEntityPresentation(entity);
|
|
21
|
+
title = t("writePage.title.entityArticle", {
|
|
22
|
+
entity: representation.primaryTitle
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
title = t("writePage.title.newArticle");
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title }), /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(InfoCard, null, /* @__PURE__ */ React.createElement(
|
|
28
|
+
PostForm,
|
|
29
|
+
{
|
|
30
|
+
id,
|
|
31
|
+
entity,
|
|
32
|
+
entityPage,
|
|
33
|
+
tags,
|
|
34
|
+
type: "article"
|
|
35
|
+
}
|
|
36
|
+
)))));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { WritePage };
|
|
40
|
+
//# sourceMappingURL=WritePage.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WritePage.esm.js","sources":["../../../src/components/WritePage/WritePage.tsx"],"sourcesContent":["import React from 'react';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport { filterTags } from '@drodil/backstage-plugin-qeta-common';\nimport { PostForm, useTranslation } from '@drodil/backstage-plugin-qeta-react';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { ContentHeader, InfoCard } from '@backstage/core-components';\nimport { Grid } from '@material-ui/core';\n\nexport const WritePage = () => {\n const { id } = useParams();\n const [searchParams] = useSearchParams();\n const entity = searchParams.get('entity') ?? undefined;\n const entityPage = searchParams.get('entityPage') === 'true';\n const tags = filterTags(searchParams.get('tags'));\n const { t } = useTranslation();\n let title;\n if (id) {\n title = t('writePage.title.existingArticle');\n } else if (entity) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const representation = useEntityPresentation(entity);\n title = t('writePage.title.entityArticle', {\n entity: representation.primaryTitle,\n });\n } else {\n title = t('writePage.title.newArticle');\n }\n\n return (\n <>\n <ContentHeader title={title} />\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <InfoCard>\n <PostForm\n id={id}\n entity={entity}\n entityPage={entityPage}\n tags={tags}\n type=\"article\"\n />\n </InfoCard>\n </Grid>\n </Grid>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAQO,MAAM,YAAY,MAAM;AAC7B,EAAM,MAAA,EAAE,EAAG,EAAA,GAAI,SAAU,EAAA,CAAA;AACzB,EAAM,MAAA,CAAC,YAAY,CAAA,GAAI,eAAgB,EAAA,CAAA;AACvC,EAAA,MAAM,MAAS,GAAA,YAAA,CAAa,GAAI,CAAA,QAAQ,CAAK,IAAA,KAAA,CAAA,CAAA;AAC7C,EAAA,MAAM,UAAa,GAAA,YAAA,CAAa,GAAI,CAAA,YAAY,CAAM,KAAA,MAAA,CAAA;AACtD,EAAA,MAAM,IAAO,GAAA,UAAA,CAAW,YAAa,CAAA,GAAA,CAAI,MAAM,CAAC,CAAA,CAAA;AAChD,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAA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