@drodil/backstage-plugin-qeta 2.10.3 → 2.11.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/api/QetaClient.esm.js +5 -2
- package/dist/api/QetaClient.esm.js.map +1 -1
- package/dist/components/AskPage/AskPage.esm.js +2 -3
- package/dist/components/AskPage/AskPage.esm.js.map +1 -1
- package/dist/components/Buttons/BackToQuestionsButton.esm.js +6 -6
- package/dist/components/Buttons/BackToQuestionsButton.esm.js.map +1 -1
- package/dist/components/Buttons/EntityFollowButton.esm.js +4 -1
- package/dist/components/Buttons/EntityFollowButton.esm.js.map +1 -1
- package/dist/components/Buttons/TagFollowButton.esm.js +5 -3
- package/dist/components/Buttons/TagFollowButton.esm.js.map +1 -1
- package/dist/components/FavoritePage/FavoritePage.esm.js +30 -4
- package/dist/components/FavoritePage/FavoritePage.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +20 -136
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/HomePageCards/QuestionsCard.esm.js +21 -0
- package/dist/components/HomePageCards/QuestionsCard.esm.js.map +1 -0
- package/dist/components/LeftMenu/LeftMenu.esm.js +54 -0
- package/dist/components/LeftMenu/LeftMenu.esm.js.map +1 -0
- package/dist/components/{HomePage → QetaPage}/FollowedEntitiesList.esm.js +2 -2
- package/dist/components/QetaPage/FollowedEntitiesList.esm.js.map +1 -0
- package/dist/components/{HomePage → QetaPage}/FollowedTagsList.esm.js +2 -2
- package/dist/components/QetaPage/FollowedTagsList.esm.js.map +1 -0
- package/dist/components/QetaPage/QetaPage.esm.js +79 -0
- package/dist/components/QetaPage/QetaPage.esm.js.map +1 -0
- package/dist/components/QetaPage/index.esm.js +2 -0
- package/dist/components/QuestionHighlightList/QuestionHighlightList.esm.js +8 -5
- package/dist/components/QuestionHighlightList/QuestionHighlightList.esm.js.map +1 -1
- package/dist/components/QuestionPage/AnswerCard.esm.js +46 -34
- package/dist/components/QuestionPage/AnswerCard.esm.js.map +1 -1
- package/dist/components/QuestionPage/QuestionCard.esm.js +6 -4
- package/dist/components/QuestionPage/QuestionCard.esm.js.map +1 -1
- package/dist/components/QuestionPage/QuestionPage.esm.js +4 -4
- package/dist/components/QuestionPage/QuestionPage.esm.js.map +1 -1
- package/dist/components/QuestionPage/VoteButtons.esm.js +5 -1
- package/dist/components/QuestionPage/VoteButtons.esm.js.map +1 -1
- package/dist/components/QuestionsContainer/QuestionList.esm.js +3 -3
- package/dist/components/QuestionsContainer/QuestionList.esm.js.map +1 -1
- package/dist/components/QuestionsContainer/QuestionListItem.esm.js +77 -75
- package/dist/components/QuestionsContainer/QuestionListItem.esm.js.map +1 -1
- package/dist/components/QuestionsPage/QuestionsPage.esm.js +54 -0
- package/dist/components/QuestionsPage/QuestionsPage.esm.js.map +1 -0
- package/dist/components/Statistics/StatisticsPage.esm.js +2 -4
- package/dist/components/Statistics/StatisticsPage.esm.js.map +1 -1
- package/dist/components/Statistics/TopRankingUsersCard.esm.js +4 -2
- package/dist/components/Statistics/TopRankingUsersCard.esm.js.map +1 -1
- package/dist/components/Statistics/styles.esm.js +3 -3
- package/dist/components/Statistics/styles.esm.js.map +1 -1
- package/dist/components/TagPage/TagPage.esm.js +32 -6
- package/dist/components/TagPage/TagPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserPage.esm.js +4 -5
- package/dist/components/UserPage/UserPage.esm.js.map +1 -1
- package/dist/index.d.ts +43 -37
- package/dist/locale/fi.esm.js +18 -16
- package/dist/locale/fi.esm.js.map +1 -1
- package/dist/plugin.esm.js +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/translation.esm.js +36 -26
- package/dist/translation.esm.js.map +1 -1
- package/dist/utils/hooks.esm.js +37 -10
- package/dist/utils/hooks.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/HomePage/FollowedEntitiesList.esm.js.map +0 -1
- package/dist/components/HomePage/FollowedTagsList.esm.js.map +0 -1
- package/dist/components/HomePage/index.esm.js +0 -2
- /package/dist/components/{HomePage → QetaPage}/index.esm.js.map +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useTheme,
|
|
1
|
+
import { useTheme, Grid, Chip, Typography, Avatar } from '@material-ui/core';
|
|
2
2
|
import { Link } from '@backstage/core-components';
|
|
3
3
|
import React, { useState, useEffect } from 'react';
|
|
4
4
|
import DOMPurify from 'dompurify';
|
|
@@ -9,12 +9,13 @@ import { questionRouteRef, userRouteRef } from '@drodil/backstage-plugin-qeta-re
|
|
|
9
9
|
import { RelativeTimeWithTooltip } from '../RelativeTimeWithTooltip/RelativeTimeWithTooltip.esm.js';
|
|
10
10
|
import { useTranslation, useStyles, useEntityAuthor } from '../../utils/hooks.esm.js';
|
|
11
11
|
import { useSignal } from '@backstage/plugin-signals-react';
|
|
12
|
+
import { VoteButtons } from '../QuestionPage/VoteButtons.esm.js';
|
|
13
|
+
import { FavoriteButton } from '../QuestionPage/FavoriteButton.esm.js';
|
|
12
14
|
|
|
13
15
|
const QuestionListItem = (props) => {
|
|
14
16
|
const { question, entity } = props;
|
|
15
17
|
const [correctAnswer, setCorrectAnswer] = useState(question.correctAnswer);
|
|
16
18
|
const [answersCount, setAnswersCount] = useState(question.answersCount);
|
|
17
|
-
const [score, setScore] = useState(question.score);
|
|
18
19
|
const [views, setViews] = useState(question.views);
|
|
19
20
|
const { t } = useTranslation();
|
|
20
21
|
const { lastSignal } = useSignal(`qeta:question_${question.id}`);
|
|
@@ -22,7 +23,6 @@ const QuestionListItem = (props) => {
|
|
|
22
23
|
if (lastSignal?.type === "question_stats") {
|
|
23
24
|
setCorrectAnswer(lastSignal.correctAnswer);
|
|
24
25
|
setAnswersCount(lastSignal.answersCount);
|
|
25
|
-
setScore(lastSignal.score);
|
|
26
26
|
setViews(lastSignal.views);
|
|
27
27
|
}
|
|
28
28
|
}, [lastSignal]);
|
|
@@ -31,78 +31,39 @@ const QuestionListItem = (props) => {
|
|
|
31
31
|
const theme = useTheme();
|
|
32
32
|
const styles = useStyles();
|
|
33
33
|
const { name, initials, user } = useEntityAuthor(question);
|
|
34
|
-
return /* @__PURE__ */ React.createElement(
|
|
35
|
-
|
|
34
|
+
return /* @__PURE__ */ React.createElement(
|
|
35
|
+
Grid,
|
|
36
36
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
className:
|
|
37
|
+
container: true,
|
|
38
|
+
spacing: 0,
|
|
39
|
+
className: styles.questionListItem,
|
|
40
|
+
justifyContent: "flex-start"
|
|
40
41
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
/* @__PURE__ */ React.createElement(Grid, { container: true, item: true, xs: 1, justifyContent: "center" }, /* @__PURE__ */ React.createElement("div", { className: styles.questionCardVote }, /* @__PURE__ */ React.createElement(VoteButtons, { entity: question }), /* @__PURE__ */ React.createElement(FavoriteButton, { entity: question }))),
|
|
43
|
+
/* @__PURE__ */ React.createElement(Grid, { item: true, xs: 11, className: styles.questionListItemContent }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 1 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
44
|
+
Chip,
|
|
45
|
+
{
|
|
46
|
+
variant: "outlined",
|
|
47
|
+
size: "small",
|
|
48
|
+
label: t("common.answers", {
|
|
49
|
+
count: answersCount
|
|
50
|
+
}),
|
|
51
|
+
style: {
|
|
52
|
+
borderColor: correctAnswer ? theme.palette.success.main : void 0,
|
|
53
|
+
marginBottom: "0"
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
count: answersCount
|
|
54
|
-
})
|
|
55
|
-
), /* @__PURE__ */ React.createElement(
|
|
56
|
-
Typography,
|
|
57
|
-
{
|
|
58
|
-
display: "block",
|
|
59
|
-
variant: "caption",
|
|
60
|
-
className: "qetaQuestionListItemViews"
|
|
61
|
-
},
|
|
62
|
-
t("common.viewsShort", {
|
|
63
|
-
count: views
|
|
64
|
-
})
|
|
65
|
-
)), /* @__PURE__ */ React.createElement(Box, { className: styles.questionListItemContent }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5", component: "div" }, /* @__PURE__ */ React.createElement(
|
|
66
|
-
Link,
|
|
67
|
-
{
|
|
68
|
-
to: entity ? `${questionRoute({
|
|
69
|
-
id: question.id.toString(10)
|
|
70
|
-
})}?entity=${entity}` : questionRoute({ id: question.id.toString(10) }),
|
|
71
|
-
className: "qetaQuestionListItemQuestionBtn"
|
|
72
|
-
},
|
|
73
|
-
question.title
|
|
74
|
-
)), /* @__PURE__ */ React.createElement(
|
|
75
|
-
Typography,
|
|
76
|
-
{
|
|
77
|
-
variant: "caption",
|
|
78
|
-
noWrap: true,
|
|
79
|
-
component: "div",
|
|
80
|
-
className: "qetaQuestionListItemContent",
|
|
81
|
-
style: { marginBottom: "5px" }
|
|
82
|
-
},
|
|
83
|
-
DOMPurify.sanitize(
|
|
84
|
-
truncate(removeMarkdownFormatting(question.content), 150)
|
|
85
|
-
)
|
|
86
|
-
), /* @__PURE__ */ React.createElement(TagsAndEntities, { question }), /* @__PURE__ */ React.createElement(
|
|
87
|
-
Typography,
|
|
88
|
-
{
|
|
89
|
-
variant: "caption",
|
|
90
|
-
display: "inline",
|
|
91
|
-
className: `${styles.questionListItemAuthor} qetaQuestionListItemAuthor`
|
|
92
|
-
},
|
|
93
|
-
/* @__PURE__ */ React.createElement(
|
|
94
|
-
Avatar,
|
|
56
|
+
), /* @__PURE__ */ React.createElement(
|
|
57
|
+
Chip,
|
|
95
58
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
" ",
|
|
105
|
-
/* @__PURE__ */ React.createElement(
|
|
59
|
+
variant: "outlined",
|
|
60
|
+
size: "small",
|
|
61
|
+
style: { border: "none", marginBottom: "0" },
|
|
62
|
+
label: t("common.viewsShort", {
|
|
63
|
+
count: views
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5", component: "div" }, /* @__PURE__ */ React.createElement(
|
|
106
67
|
Link,
|
|
107
68
|
{
|
|
108
69
|
to: entity ? `${questionRoute({
|
|
@@ -110,11 +71,52 @@ const QuestionListItem = (props) => {
|
|
|
110
71
|
})}?entity=${entity}` : questionRoute({ id: question.id.toString(10) }),
|
|
111
72
|
className: "qetaQuestionListItemQuestionBtn"
|
|
112
73
|
},
|
|
113
|
-
|
|
74
|
+
question.title
|
|
75
|
+
)), /* @__PURE__ */ React.createElement(
|
|
76
|
+
Typography,
|
|
77
|
+
{
|
|
78
|
+
variant: "caption",
|
|
79
|
+
noWrap: true,
|
|
80
|
+
component: "div",
|
|
81
|
+
className: "qetaQuestionListItemContent",
|
|
82
|
+
style: { marginBottom: "5px" }
|
|
83
|
+
},
|
|
84
|
+
DOMPurify.sanitize(
|
|
85
|
+
truncate(removeMarkdownFormatting(question.content), 150)
|
|
86
|
+
)
|
|
87
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(TagsAndEntities, { question }), /* @__PURE__ */ React.createElement(
|
|
88
|
+
Typography,
|
|
89
|
+
{
|
|
90
|
+
variant: "caption",
|
|
91
|
+
display: "inline",
|
|
92
|
+
className: `${styles.questionListItemAuthor} qetaQuestionListItemAuthor`
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ React.createElement(
|
|
95
|
+
Avatar,
|
|
96
|
+
{
|
|
97
|
+
src: user?.spec?.profile?.picture,
|
|
98
|
+
className: styles.questionListItemAvatar,
|
|
99
|
+
alt: name,
|
|
100
|
+
variant: "rounded"
|
|
101
|
+
},
|
|
102
|
+
initials
|
|
103
|
+
),
|
|
104
|
+
question.author === "anonymous" ? t("common.anonymousAuthor") : /* @__PURE__ */ React.createElement(Link, { to: `${userRoute()}/${question.author}` }, name),
|
|
114
105
|
" ",
|
|
115
|
-
/* @__PURE__ */ React.createElement(
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
/* @__PURE__ */ React.createElement(
|
|
107
|
+
Link,
|
|
108
|
+
{
|
|
109
|
+
to: entity ? `${questionRoute({
|
|
110
|
+
id: question.id.toString(10)
|
|
111
|
+
})}?entity=${entity}` : questionRoute({ id: question.id.toString(10) }),
|
|
112
|
+
className: "qetaQuestionListItemQuestionBtn"
|
|
113
|
+
},
|
|
114
|
+
t("authorBox.askedAtTime"),
|
|
115
|
+
" ",
|
|
116
|
+
/* @__PURE__ */ React.createElement(RelativeTimeWithTooltip, { value: question.created })
|
|
117
|
+
)
|
|
118
|
+
))))
|
|
119
|
+
);
|
|
118
120
|
};
|
|
119
121
|
|
|
120
122
|
export { QuestionListItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionListItem.esm.js","sources":["../../../src/components/QuestionsContainer/QuestionListItem.tsx"],"sourcesContent":["import {\n Avatar,\n Box,\n Card,\n CardContent,\n Typography,\n useTheme,\n} from '@material-ui/core';\nimport { Link } from '@backstage/core-components';\nimport React, { useEffect, useState } from 'react';\nimport DOMPurify from 'dompurify';\nimport {\n QetaSignal,\n QuestionResponse,\n removeMarkdownFormatting,\n truncate,\n} from '@drodil/backstage-plugin-qeta-common';\nimport { TagsAndEntities } from '../QuestionPage/TagsAndEntities';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport {\n questionRouteRef,\n userRouteRef,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { RelativeTimeWithTooltip } from '../RelativeTimeWithTooltip/RelativeTimeWithTooltip';\nimport { useEntityAuthor, useStyles, useTranslation } from '../../utils/hooks';\nimport { useSignal } from '@backstage/plugin-signals-react';\n\nexport interface QuestionListItemProps {\n question: QuestionResponse;\n entity?: string;\n}\n\nexport const QuestionListItem = (props: QuestionListItemProps) => {\n const { question, entity } = props;\n\n const [correctAnswer, setCorrectAnswer] = useState(question.correctAnswer);\n const [answersCount, setAnswersCount] = useState(question.answersCount);\n const [score, setScore] = useState(question.score);\n const [views, setViews] = useState(question.views);\n const { t } = useTranslation();\n\n const { lastSignal } = useSignal<QetaSignal>(`qeta:question_${question.id}`);\n\n useEffect(() => {\n if (lastSignal?.type === 'question_stats') {\n setCorrectAnswer(lastSignal.correctAnswer);\n setAnswersCount(lastSignal.answersCount);\n setScore(lastSignal.score);\n setViews(lastSignal.views);\n }\n }, [lastSignal]);\n\n const questionRoute = useRouteRef(questionRouteRef);\n const userRoute = useRouteRef(userRouteRef);\n const theme = useTheme();\n const styles = useStyles();\n const { name, initials, user } = useEntityAuthor(question);\n\n return (\n <Card className=\"qetaQuestionListItem\">\n <CardContent>\n <Box className={styles.questionListItemStats}>\n <Typography\n display=\"block\"\n variant=\"caption\"\n className=\"qetaQuestionListItemScore\"\n >\n {t('common.score', { score: score.toString(10) })}\n </Typography>\n <Typography\n variant=\"caption\"\n display=\"block\"\n className={`qetaQuestionListItemAnswers ${\n correctAnswer\n ? 'qetaQuestionListItemCorrectAnswer'\n : 'quetaQuestionListItemNoCorrectAnswer'\n }`}\n style={{\n color: correctAnswer ? theme.palette.success.main : undefined,\n }}\n >\n {t('common.answers', {\n count: answersCount,\n })}\n </Typography>\n <Typography\n display=\"block\"\n variant=\"caption\"\n className=\"qetaQuestionListItemViews\"\n >\n {t('common.viewsShort', {\n count: views,\n })}\n </Typography>\n </Box>\n <Box className={styles.questionListItemContent}>\n <Typography variant=\"h5\" component=\"div\">\n <Link\n to={\n entity\n ? `${questionRoute({\n id: question.id.toString(10),\n })}?entity=${entity}`\n : questionRoute({ id: question.id.toString(10) })\n }\n className=\"qetaQuestionListItemQuestionBtn\"\n >\n {question.title}\n </Link>\n </Typography>\n <Typography\n variant=\"caption\"\n noWrap\n component=\"div\"\n className=\"qetaQuestionListItemContent\"\n style={{ marginBottom: '5px' }}\n >\n {DOMPurify.sanitize(\n truncate(removeMarkdownFormatting(question.content), 150),\n )}\n </Typography>\n <TagsAndEntities question={question} />\n <Typography\n variant=\"caption\"\n display=\"inline\"\n className={`${styles.questionListItemAuthor} qetaQuestionListItemAuthor`}\n >\n <Avatar\n src={user?.spec?.profile?.picture}\n className={styles.questionListItemAvatar}\n alt={name}\n variant=\"rounded\"\n >\n {initials}\n </Avatar>\n {question.author === 'anonymous' ? (\n t('common.anonymousAuthor')\n ) : (\n <Link to={`${userRoute()}/${question.author}`}>{name}</Link>\n )}{' '}\n <Link\n to={\n entity\n ? `${questionRoute({\n id: question.id.toString(10),\n })}?entity=${entity}`\n : questionRoute({ id: question.id.toString(10) })\n }\n className=\"qetaQuestionListItemQuestionBtn\"\n >\n {t('authorBox.askedAtTime')}{' '}\n <RelativeTimeWithTooltip value={question.created} />\n </Link>\n </Typography>\n </Box>\n </CardContent>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAgCa,MAAA,gBAAA,GAAmB,CAAC,KAAiC,KAAA;AAChE,EAAM,MAAA,EAAE,QAAU,EAAA,MAAA,EAAW,GAAA,KAAA,CAAA;AAE7B,EAAA,MAAM,CAAC,aAAe,EAAA,gBAAgB,CAAI,GAAA,QAAA,CAAS,SAAS,aAAa,CAAA,CAAA;AACzE,EAAA,MAAM,CAAC,YAAc,EAAA,eAAe,CAAI,GAAA,QAAA,CAAS,SAAS,YAAY,CAAA,CAAA;AACtE,EAAA,MAAM,CAAC,KAAO,EAAA,QAAQ,CAAI,GAAA,QAAA,CAAS,SAAS,KAAK,CAAA,CAAA;AACjD,EAAA,MAAM,CAAC,KAAO,EAAA,QAAQ,CAAI,GAAA,QAAA,CAAS,SAAS,KAAK,CAAA,CAAA;AACjD,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA,CAAA;AAE7B,EAAA,MAAM,EAAE,UAAW,EAAA,GAAI,UAAsB,CAAiB,cAA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AAG,CAAA,QAAA,CAAS,EAAE,CAAA;AAAA,SAC5B,CAAC,CAAW,QAAA,EAAA,MAAM,CACnB,CAAA,GAAA,aAAA,CAAc,EAAE,EAAA,EAAI,QAAS,CAAA,EAAA,CAAG,QAAS,CAAA,EAAE,GAAG,CAAA;AAAA,QAEpD,SAAU,EAAA,iCAAA;AAAA,OAAA;AAAA,MAET,EAAE,uBAAuB,CAAA;AAAA,MAAG,GAAA;AAAA,sBAC5B,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,KAAO,EAAA,QAAA,CAAS,OAAS,EAAA,CAAA;AAAA,KACpD;AAAA,GAEJ,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"QuestionListItem.esm.js","sources":["../../../src/components/QuestionsContainer/QuestionListItem.tsx"],"sourcesContent":["import { Avatar, Chip, Grid, Typography, useTheme } from '@material-ui/core';\nimport { Link } from '@backstage/core-components';\nimport React, { useEffect, useState } from 'react';\nimport DOMPurify from 'dompurify';\nimport {\n QetaSignal,\n QuestionResponse,\n removeMarkdownFormatting,\n truncate,\n} from '@drodil/backstage-plugin-qeta-common';\nimport { TagsAndEntities } from '../QuestionPage/TagsAndEntities';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport {\n questionRouteRef,\n userRouteRef,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { RelativeTimeWithTooltip } from '../RelativeTimeWithTooltip/RelativeTimeWithTooltip';\nimport { useEntityAuthor, useStyles, useTranslation } from '../../utils/hooks';\nimport { useSignal } from '@backstage/plugin-signals-react';\nimport { VoteButtons } from '../QuestionPage/VoteButtons';\nimport { FavoriteButton } from '../QuestionPage/FavoriteButton';\n\nexport interface QuestionListItemProps {\n question: QuestionResponse;\n entity?: string;\n}\n\nexport const QuestionListItem = (props: QuestionListItemProps) => {\n const { question, entity } = props;\n\n const [correctAnswer, setCorrectAnswer] = useState(question.correctAnswer);\n const [answersCount, setAnswersCount] = useState(question.answersCount);\n const [views, setViews] = useState(question.views);\n const { t } = useTranslation();\n\n const { lastSignal } = useSignal<QetaSignal>(`qeta:question_${question.id}`);\n\n useEffect(() => {\n if (lastSignal?.type === 'question_stats') {\n setCorrectAnswer(lastSignal.correctAnswer);\n setAnswersCount(lastSignal.answersCount);\n setViews(lastSignal.views);\n }\n }, [lastSignal]);\n\n const questionRoute = useRouteRef(questionRouteRef);\n const userRoute = useRouteRef(userRouteRef);\n const theme = useTheme();\n const styles = useStyles();\n const { name, initials, user } = useEntityAuthor(question);\n\n return (\n <Grid\n container\n spacing={0}\n className={styles.questionListItem}\n justifyContent=\"flex-start\"\n >\n <Grid container item xs={1} justifyContent=\"center\">\n <div className={styles.questionCardVote}>\n <VoteButtons entity={question} />\n <FavoriteButton entity={question} />\n </div>\n </Grid>\n <Grid item xs={11} className={styles.questionListItemContent}>\n <Grid container spacing={1}>\n <Grid item xs={12}>\n <Chip\n variant=\"outlined\"\n size=\"small\"\n label={t('common.answers', {\n count: answersCount,\n })}\n style={{\n borderColor: correctAnswer\n ? theme.palette.success.main\n : undefined,\n marginBottom: '0',\n }}\n />\n <Chip\n variant=\"outlined\"\n size=\"small\"\n style={{ border: 'none', marginBottom: '0' }}\n label={t('common.viewsShort', {\n count: views,\n })}\n />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\" component=\"div\">\n <Link\n to={\n entity\n ? `${questionRoute({\n id: question.id.toString(10),\n })}?entity=${entity}`\n : questionRoute({ id: question.id.toString(10) })\n }\n className=\"qetaQuestionListItemQuestionBtn\"\n >\n {question.title}\n </Link>\n </Typography>\n <Typography\n variant=\"caption\"\n noWrap\n component=\"div\"\n className=\"qetaQuestionListItemContent\"\n style={{ marginBottom: '5px' }}\n >\n {DOMPurify.sanitize(\n truncate(removeMarkdownFormatting(question.content), 150),\n )}\n </Typography>\n </Grid>\n <Grid item xs={12}>\n <TagsAndEntities question={question} />\n <Typography\n variant=\"caption\"\n display=\"inline\"\n className={`${styles.questionListItemAuthor} qetaQuestionListItemAuthor`}\n >\n <Avatar\n src={user?.spec?.profile?.picture}\n className={styles.questionListItemAvatar}\n alt={name}\n variant=\"rounded\"\n >\n {initials}\n </Avatar>\n {question.author === 'anonymous' ? (\n t('common.anonymousAuthor')\n ) : (\n <Link to={`${userRoute()}/${question.author}`}>{name}</Link>\n )}{' '}\n <Link\n to={\n entity\n ? `${questionRoute({\n id: question.id.toString(10),\n })}?entity=${entity}`\n : questionRoute({ id: question.id.toString(10) })\n }\n className=\"qetaQuestionListItemQuestionBtn\"\n >\n {t('authorBox.askedAtTime')}{' '}\n <RelativeTimeWithTooltip value={question.created} />\n </Link>\n </Typography>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA2Ba,MAAA,gBAAA,GAAmB,CAAC,KAAiC,KAAA;AAChE,EAAM,MAAA,EAAE,QAAU,EAAA,MAAA,EAAW,GAAA,KAAA,CAAA;AAE7B,EAAA,MAAM,CAAC,aAAe,EAAA,gBAAgB,CAAI,GAAA,QAAA,CAAS,SAAS,aAAa,CAAA,CAAA;AACzE,EAAA,MAAM,CAAC,YAAc,EAAA,eAAe,CAAI,GAAA,QAAA,CAAS,SAAS,YAAY,CAAA,CAAA;AACtE,EAAA,MAAM,CAAC,KAAO,EAAA,QAAQ,CAAI,GAAA,QAAA,CAAS,SAAS,KAAK,CAAA,CAAA;AACjD,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA,CAAA;AAE7B,EAAA,MAAM,EAAE,UAAW,EAAA,GAAI,UAAsB,CAAiB,cAAA,EAAA,QAAA,CAAS,EAAE,CAAE,CAAA,CAAA,CAAA;AAE3E,EAAA,SAAA,CAAU,MAAM;AACd,IAAI,IAAA,UAAA,EAAY,SAAS,gBAAkB,EAAA;AACzC,MAAA,gBAAA,CAAiB,WAAW,aAAa,CAAA,CAAA;AACzC,MAAA,eAAA,CAAgB,WAAW,YAAY,CAAA,CAAA;AACvC,MAAA,Q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AA,CAAA,EAAG,WAAW,CAAA,CAAA,EAAI,QAAS,CAAA,MAAM,MAAK,IAAK,CAAA;AAAA,MACpD,GAAA;AAAA,sBACH,KAAA,CAAA,aAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,EAAA,EACE,MACI,GAAA,CAAA,EAAG,aAAc,CAAA;AAAA,YACf,EAAI,EAAA,QAAA,CAAS,EAAG,CAAA,QAAA,CAAS,EAAE,CAAA;AAAA,WAC5B,CAAC,CAAW,QAAA,EAAA,MAAM,CACnB,CAAA,GAAA,aAAA,CAAc,EAAE,EAAA,EAAI,QAAS,CAAA,EAAA,CAAG,QAAS,CAAA,EAAE,GAAG,CAAA;AAAA,UAEpD,SAAU,EAAA,iCAAA;AAAA,SAAA;AAAA,QAET,EAAE,uBAAuB,CAAA;AAAA,QAAG,GAAA;AAAA,wBAC5B,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,KAAO,EAAA,QAAA,CAAS,OAAS,EAAA,CAAA;AAAA,OACpD;AAAA,KAEJ,CACF,CACF,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useSearchParams } from 'react-router-dom';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
import { useTranslation } from '../../utils/hooks.esm.js';
|
|
4
|
+
import { ContentHeader } from '@backstage/core-components';
|
|
5
|
+
import { AskQuestionButton } from '../Buttons/AskQuestionButton.esm.js';
|
|
6
|
+
import { QuestionsContainer } from '../QuestionsContainer/QuestionsContainer.esm.js';
|
|
7
|
+
import { filterTags } from '@drodil/backstage-plugin-qeta-common';
|
|
8
|
+
import { Grid } from '@material-ui/core';
|
|
9
|
+
import { QuestionHighlightList } from '../QuestionHighlightList/QuestionHighlightList.esm.js';
|
|
10
|
+
import Whatshot from '@material-ui/icons/Whatshot';
|
|
11
|
+
import { FollowedTagsList } from '../QetaPage/FollowedTagsList.esm.js';
|
|
12
|
+
import { FollowedEntitiesList } from '../QetaPage/FollowedEntitiesList.esm.js';
|
|
13
|
+
|
|
14
|
+
const QuestionsPage = () => {
|
|
15
|
+
const [searchParams] = useSearchParams();
|
|
16
|
+
const [entityRef, setEntityRef] = React.useState(
|
|
17
|
+
void 0
|
|
18
|
+
);
|
|
19
|
+
const [tags, setTags] = React.useState(void 0);
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setEntityRef(searchParams.get("entity") ?? void 0);
|
|
23
|
+
setTags(filterTags(searchParams.get("tags")));
|
|
24
|
+
}, [searchParams, setEntityRef]);
|
|
25
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 12, lg: 9, xl: 10 }, /* @__PURE__ */ React.createElement(ContentHeader, { title: t("questionsPage.title") }, /* @__PURE__ */ React.createElement(AskQuestionButton, { entity: entityRef, tags })), /* @__PURE__ */ React.createElement(QuestionsContainer, { entity: entityRef, tags })), /* @__PURE__ */ React.createElement(Grid, { item: true, lg: 3, xl: 2 }, /* @__PURE__ */ React.createElement(
|
|
26
|
+
QuestionHighlightList,
|
|
27
|
+
{
|
|
28
|
+
type: "hot",
|
|
29
|
+
title: t("highlights.hot.title"),
|
|
30
|
+
noQuestionsLabel: t("highlights.hot.noQuestionsLabel"),
|
|
31
|
+
icon: /* @__PURE__ */ React.createElement(Whatshot, { fontSize: "small" }),
|
|
32
|
+
options: { tags, entity: entityRef }
|
|
33
|
+
}
|
|
34
|
+
), /* @__PURE__ */ React.createElement(
|
|
35
|
+
QuestionHighlightList,
|
|
36
|
+
{
|
|
37
|
+
type: "unanswered",
|
|
38
|
+
title: t("highlights.unanswered.title"),
|
|
39
|
+
noQuestionsLabel: t("highlights.unanswered.noQuestionsLabel"),
|
|
40
|
+
options: { tags, entity: entityRef }
|
|
41
|
+
}
|
|
42
|
+
), /* @__PURE__ */ React.createElement(
|
|
43
|
+
QuestionHighlightList,
|
|
44
|
+
{
|
|
45
|
+
type: "incorrect",
|
|
46
|
+
title: t("highlights.incorrect.title"),
|
|
47
|
+
noQuestionsLabel: t("highlights.incorrect.noQuestionsLabel"),
|
|
48
|
+
options: { tags, entity: entityRef }
|
|
49
|
+
}
|
|
50
|
+
), /* @__PURE__ */ React.createElement(FollowedTagsList, null), /* @__PURE__ */ React.createElement(FollowedEntitiesList, null)));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { QuestionsPage };
|
|
54
|
+
//# sourceMappingURL=QuestionsPage.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuestionsPage.esm.js","sources":["../../../src/components/QuestionsPage/QuestionsPage.tsx"],"sourcesContent":["import { useSearchParams } from 'react-router-dom';\nimport React, { useEffect } from 'react';\nimport { useTranslation } from '../../utils/hooks';\nimport { ContentHeader } from '@backstage/core-components';\nimport { AskQuestionButton } from '../Buttons/AskQuestionButton';\nimport { QuestionsContainer } from '../QuestionsContainer';\nimport { filterTags } from '@drodil/backstage-plugin-qeta-common';\nimport { Grid } from '@material-ui/core';\nimport { QuestionHighlightList } from '../QuestionHighlightList/QuestionHighlightList';\nimport Whatshot from '@material-ui/icons/Whatshot';\nimport { FollowedTagsList } from '../QetaPage/FollowedTagsList';\nimport { FollowedEntitiesList } from '../QetaPage/FollowedEntitiesList';\n\nexport const QuestionsPage = () => {\n const [searchParams] = useSearchParams();\n\n const [entityRef, setEntityRef] = React.useState<string | undefined>(\n undefined,\n );\n const [tags, setTags] = React.useState<string[] | undefined>(undefined);\n const { t } = useTranslation();\n useEffect(() => {\n setEntityRef(searchParams.get('entity') ?? undefined);\n setTags(filterTags(searchParams.get('tags')));\n }, [searchParams, setEntityRef]);\n\n return (\n <Grid container>\n <Grid item md={12} lg={9} xl={10}>\n <ContentHeader title={t('questionsPage.title')}>\n <AskQuestionButton entity={entityRef} tags={tags} />\n </ContentHeader>\n <QuestionsContainer entity={entityRef} tags={tags} />\n </Grid>\n <Grid item lg={3} xl={2}>\n <QuestionHighlightList\n type=\"hot\"\n title={t('highlights.hot.title')}\n noQuestionsLabel={t('highlights.hot.noQuestionsLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n options={{ tags: tags, entity: entityRef }}\n />\n <QuestionHighlightList\n type=\"unanswered\"\n title={t('highlights.unanswered.title')}\n noQuestionsLabel={t('highlights.unanswered.noQuestionsLabel')}\n options={{ tags: tags, entity: entityRef }}\n />\n <QuestionHighlightList\n type=\"incorrect\"\n title={t('highlights.incorrect.title')}\n noQuestionsLabel={t('highlights.incorrect.noQuestionsLabel')}\n options={{ tags: tags, entity: entityRef }}\n />\n <FollowedTagsList />\n <FollowedEntitiesList />\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAaO,MAAM,gBAAgB,MAAM;AACjC,EAAM,MAAA,CAAC,YAAY,CAAA,GAAI,eAAgB,EAAA,CAAA;AAEvC,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,KAAM,CAAA,QAAA;AAAA,IACtC,KAAA,CAAA;AAAA,GACF,CAAA;AACA,EAAA,MAAM,CAAC,IAAM,EAAA,OAAO,CAAI,GAAA,KAAA,CAAM,SAA+B,KAAS,CAAA,CAAA,CAAA;AACtE,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA,CAAA;AAC7B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,YAAA,CAAa,YAAa,CAAA,GAAA,CAAI,QAAQ,CAAA,IAAK,KAAS,CAAA,CAAA,CAAA;AACpD,IAAA,OAAA,CAAQ,UAAW,CAAA,YAAA,CAAa,GAAI,CAAA,MAAM,CAAC,CAAC,CAAA,CAAA;AAAA,GAC3C,EAAA,CAAC,YAAc,EAAA,YAAY,CAAC,CAAA,CAAA;AAE/B,EAAA,2CACG,IAAK,EAAA,EAAA,SAAA,EAAS,wBACZ,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EA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AY,EAAA,MAAA,EAAQ,SAAU,EAAA;AAAA,KAAA;AAAA,qBAE1C,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,IAAiB,mBACjB,KAAA,CAAA,aAAA,CAAA,oBAAA,EAAA,IAAqB,CACxB,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ContentHeader } from '@backstage/core-components';
|
|
3
3
|
import { AskQuestionButton } from '../Buttons/AskQuestionButton.esm.js';
|
|
4
|
-
import { Container } from '@material-ui/core';
|
|
5
4
|
import { TopRankingUsers } from './TopRankingUsersCard.esm.js';
|
|
6
|
-
import { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton.esm.js';
|
|
7
5
|
|
|
8
6
|
const StatisticsPage = () => {
|
|
9
|
-
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: "Statistics" }, /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(TopRankingUsers, { limit: 10 }));
|
|
10
8
|
};
|
|
11
9
|
|
|
12
10
|
export { StatisticsPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatisticsPage.esm.js","sources":["../../../src/components/Statistics/StatisticsPage.tsx"],"sourcesContent":["import React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"StatisticsPage.esm.js","sources":["../../../src/components/Statistics/StatisticsPage.tsx"],"sourcesContent":["import React from 'react';\nimport { ContentHeader } from '@backstage/core-components';\nimport { AskQuestionButton } from '../Buttons/AskQuestionButton';\nimport { TopRankingUsers } from './TopRankingUsersCard';\n\nexport const StatisticsPage = () => {\n return (\n <>\n <ContentHeader title=\"Statistics\">\n <AskQuestionButton />\n </ContentHeader>\n <TopRankingUsers limit={10} />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AAKO,MAAM,iBAAiB,MAAM;AAClC,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAM,YACnB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,iBAAkB,EAAA,IAAA,CACrB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,EAAA,KAAA,EAAO,IAAI,CAC9B,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -62,8 +62,10 @@ const RankingRow = (props) => {
|
|
|
62
62
|
style: { marginRight: "10px", fontWeight: 400 },
|
|
63
63
|
variant: "subtitle1"
|
|
64
64
|
},
|
|
65
|
-
`${ordinalPosition}
|
|
66
|
-
|
|
65
|
+
`${ordinalPosition}`,
|
|
66
|
+
" ",
|
|
67
|
+
/* @__PURE__ */ React.createElement(UserLink, { entityRef: userRef ?? "" })
|
|
68
|
+
))
|
|
67
69
|
}
|
|
68
70
|
), /* @__PURE__ */ React.createElement("div", { className: classes.votesText }, /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle1" }, props?.total, " ", props.unit)));
|
|
69
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopRankingUsersCard.esm.js","sources":["../../../src/components/Statistics/TopRankingUsersCard.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\nimport {\n CardTab,\n Progress,\n TabbedCard,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n Avatar,\n List,\n ListItem,\n ListItemAvatar,\n ListItemText,\n Typography,\n} from '@material-ui/core';\nimport { StatisticResponse } from '@drodil/backstage-plugin-qeta-common';\nimport { useQetaApi, useTranslation } from '../../utils/hooks';\nimport { TrophyIcon } from './TrophyIcon';\nimport { useStyles } from './styles';\nimport { UserLink } from '../Links/Links';\n\ntype RankingIcon = {\n iconsByRanking: Map<number, ReactNode>;\n userRankingIcon: ReactNode;\n};\n\nconst DefaultRankingIcons = new Map<number, ReactNode>([\n [\n 1,\n <TrophyIcon\n style={{ color: '#DAA520', height: '2.2rem', width: '2.2rem' }}\n />,\n ],\n [\n 2,\n <TrophyIcon\n style={{ color: '#C0C0C0', height: '2.1rem', width: '2.1rem' }}\n />,\n ],\n [\n 3,\n <TrophyIcon style={{ color: '#B87333', height: '2rem', width: '2rem' }} />,\n ],\n]);\n\nconst DefaultUserIcon = (\n <TrophyIcon style={{ height: '2rem', width: '2rem' }} />\n);\n\nconst getOrdinal = (n: number) => {\n if (n % 10 === 1 && n % 100 !== 11) {\n return `${n}st`;\n } else if (n % 10 === 2 && n % 100 !== 12) {\n return `${n}nd`;\n } else if (n % 10 === 3 && n % 100 !== 13) {\n return `${n}rd`;\n }\n\n return `${n}th`;\n};\n\nexport const RankingRow = (props: {\n userRef?: string;\n total: number;\n position: number;\n rankingIcon?: RankingIcon;\n unit: string;\n}) => {\n const classes = useStyles();\n const userRef = props.userRef;\n\n const ordinalPosition = props?.position ? getOrdinal(props?.position) : '';\n\n const userIcon = props.rankingIcon?.userRankingIcon\n ? props.rankingIcon?.userRankingIcon\n : DefaultUserIcon;\n\n const topRankingIcon = props.rankingIcon\n ? props.rankingIcon.iconsByRanking.get(Number(props?.position))\n : DefaultRankingIcons.get(Number(props?.position)) || DefaultUserIcon;\n\n const rankingIcon = props?.position > 3 ? userIcon : topRankingIcon;\n\n return (\n <ListItem className=\"qetaRankingCardRow\">\n <ListItemAvatar>\n <Avatar className={classes.trophyIcon}>{rankingIcon}</Avatar>\n </ListItemAvatar>\n\n <ListItemText\n disableTypography\n style={{\n display: 'flex',\n justifyContent: 'center',\n }}\n primary={\n <div style={{ display: 'flex' }}>\n <Typography\n style={{ marginRight: '10px', fontWeight: 400 }}\n variant=\"subtitle1\"\n >{`${ordinalPosition}`}</Typography>\n <UserLink entityRef={userRef ?? ''} />\n </div>\n }\n />\n\n <div className={classes.votesText}>\n <Typography variant=\"subtitle1\">\n {props?.total} {props.unit}\n </Typography>\n </div>\n </ListItem>\n );\n};\n\nexport const RankingCard = (props: {\n limit?: number;\n description: string;\n statistic?: StatisticResponse;\n unit: string;\n}) => {\n const rankingStats = props.limit\n ? props.statistic?.ranking.slice(0, props.limit)\n : props.statistic?.ranking;\n\n return (\n <div style={{ display: 'block' }} className=\"qetaRankingCard\">\n <span className=\"qetaRankingCardDescription\">{props.description}</span>\n <List className=\"qetaRankingCardList\">\n {rankingStats?.map(authorStats => {\n return (\n <RankingRow\n total={authorStats.total || 0}\n position={authorStats.position || 0}\n userRef={authorStats.author}\n unit={props.unit}\n />\n );\n })}\n {!rankingStats?.some(\n authorStats =>\n authorStats.author === props.statistic?.loggedUser?.author,\n ) && (\n <>\n <hr />\n <RankingRow\n total={props.statistic?.loggedUser?.total || 0}\n position={props.statistic?.loggedUser?.position || 0}\n userRef={props.statistic?.loggedUser?.author}\n unit={props.unit}\n />\n </>\n )}\n </List>\n </div>\n );\n};\n\nexport const TopRankingUsers = (props: {\n title?: string;\n hideTitle?: boolean;\n limit?: number;\n}) => {\n const { t } = useTranslation();\n const {\n value: topStatistics,\n loading,\n error,\n } = useQetaApi(api =>\n api.getTopStatisticsHomepage({\n options: { limit: 50 },\n }),\n );\n\n const tabData = [\n {\n title: t('statistics.mostQuestions.title'),\n description: t('statistics.mostQuestions.description'),\n unit: 'questions',\n },\n {\n title: t('statistics.mostAnswers.title'),\n description: t('statistics.mostAnswers.description'),\n unit: 'answers',\n },\n {\n title: t('statistics.topVotedQuestions.title'),\n description: t('statistics.topVotedQuestions.description'),\n unit: 'votes',\n },\n {\n title: t('statistics.topVotedAnswers.title'),\n description: t('statistics.topVotedAnswers.description'),\n unit: 'votes',\n },\n {\n title: t('statistics.topVotedCorrectAnswers.title'),\n description: t('statistics.topVotedCorrectAnswers.description'),\n unit: 'votes',\n },\n ];\n\n if ((error || topStatistics === undefined) && !loading) {\n return (\n <WarningPanel severity=\"error\" title={t('statistics.errorLoading')}>\n {error?.message}\n </WarningPanel>\n );\n }\n\n let content: ReactElement[];\n\n if (loading) {\n content = [\n <CardTab>\n <Progress />\n </CardTab>,\n ];\n } else if (topStatistics && topStatistics.length > 0) {\n content = topStatistics?.map((stats, index) => {\n return (\n <CardTab label={tabData[index].title}>\n <RankingCard\n description={tabData[index].description}\n limit={props.limit}\n statistic={stats}\n unit={tabData[index].unit}\n />\n </CardTab>\n );\n });\n } else {\n content = [<CardTab>{t('statistics.notAvailable')}</CardTab>];\n }\n\n return (\n <TabbedCard title={props.title || t('statistics.ranking')}>\n {content}\n </TabbedCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA0BA,MAAM,mBAAA,uBAA0B,GAAuB,CAAA;AAAA,EACrD;AAAA,IACE,CAAA;AAAA,oBACA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAO,EAAE,KAAA,EAAO,WAAW,MAAQ,EAAA,QAAA,EAAU,OAAO,QAAS,EAAA;AAAA,OAAA;AAAA,KAC/D;AAAA,GACF;AAAA,EACA;AAAA,IACE,CAAA;AAAA,oBACA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAO,EAAE,KAAA,EAAO,WAAW,MAAQ,EAAA,QAAA,EAAU,OAAO,QAAS,EAAA;AAAA,OAAA;AAAA,KAC/D;AAAA,GACF;AAAA,EACA;AAAA,IACE,CAAA;AAAA,oBACA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,KAAA,EAAO,EAAE,KAAA,EAAO,WAAW,MAAQ,EAAA,MAAA,EAAQ,KAAO,EAAA,MAAA,EAAU,EAAA,CAAA;AAAA,GAC1E;AACF,CAAC,CAAA,CAAA;AAED,MAAM,eAAA,uCACH,UAAW,EAAA,EAAA,KAAA,EAAO,EAAE,MAAQ,EAAA,MAAA,EAAQ,KAAO,EAAA,MAAA,EAAU,EAAA,CAAA,CAAA;AAGxD,MAAM,UAAA,GAAa,CAAC,CAAc,KAAA;AAChC,EAAA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ReactNode } from 'react';\nimport {\n CardTab,\n Progress,\n TabbedCard,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n Avatar,\n List,\n ListItem,\n ListItemAvatar,\n ListItemText,\n Typography,\n} from '@material-ui/core';\nimport { StatisticResponse } from '@drodil/backstage-plugin-qeta-common';\nimport { useQetaApi, useTranslation } from '../../utils/hooks';\nimport { TrophyIcon } from './TrophyIcon';\nimport { useStyles } from './styles';\nimport { UserLink } from '../Links/Links';\n\ntype RankingIcon = {\n iconsByRanking: Map<number, ReactNode>;\n userRankingIcon: ReactNode;\n};\n\nconst DefaultRankingIcons = new Map<number, ReactNode>([\n [\n 1,\n <TrophyIcon\n style={{ color: '#DAA520', height: '2.2rem', width: '2.2rem' }}\n />,\n ],\n [\n 2,\n <TrophyIcon\n style={{ color: '#C0C0C0', height: '2.1rem', width: '2.1rem' }}\n />,\n ],\n [\n 3,\n <TrophyIcon style={{ color: '#B87333', height: '2rem', width: '2rem' }} />,\n ],\n]);\n\nconst DefaultUserIcon = (\n <TrophyIcon style={{ height: '2rem', width: '2rem' }} />\n);\n\nconst getOrdinal = (n: number) => {\n if (n % 10 === 1 && n % 100 !== 11) {\n return `${n}st`;\n } else if (n % 10 === 2 && n % 100 !== 12) {\n return `${n}nd`;\n } else if (n % 10 === 3 && n % 100 !== 13) {\n return `${n}rd`;\n }\n\n return `${n}th`;\n};\n\nexport const RankingRow = (props: {\n userRef?: string;\n total: number;\n position: number;\n rankingIcon?: RankingIcon;\n unit: string;\n}) => {\n const classes = useStyles();\n const userRef = props.userRef;\n\n const ordinalPosition = props?.position ? getOrdinal(props?.position) : '';\n\n const userIcon = props.rankingIcon?.userRankingIcon\n ? props.rankingIcon?.userRankingIcon\n : DefaultUserIcon;\n\n const topRankingIcon = props.rankingIcon\n ? props.rankingIcon.iconsByRanking.get(Number(props?.position))\n : DefaultRankingIcons.get(Number(props?.position)) || DefaultUserIcon;\n\n const rankingIcon = props?.position > 3 ? userIcon : topRankingIcon;\n\n return (\n <ListItem className=\"qetaRankingCardRow\">\n <ListItemAvatar>\n <Avatar className={classes.trophyIcon}>{rankingIcon}</Avatar>\n </ListItemAvatar>\n\n <ListItemText\n disableTypography\n style={{\n display: 'flex',\n justifyContent: 'center',\n }}\n primary={\n <div style={{ display: 'flex' }}>\n <Typography\n style={{ marginRight: '10px', fontWeight: 400 }}\n variant=\"subtitle1\"\n >\n {`${ordinalPosition}`} <UserLink entityRef={userRef ?? ''} />\n </Typography>\n </div>\n }\n />\n\n <div className={classes.votesText}>\n <Typography variant=\"subtitle1\">\n {props?.total} {props.unit}\n </Typography>\n </div>\n </ListItem>\n );\n};\n\nexport const RankingCard = (props: {\n limit?: number;\n description: string;\n statistic?: StatisticResponse;\n unit: string;\n}) => {\n const rankingStats = props.limit\n ? props.statistic?.ranking.slice(0, props.limit)\n : props.statistic?.ranking;\n\n return (\n <div style={{ display: 'block' }} className=\"qetaRankingCard\">\n <span className=\"qetaRankingCardDescription\">{props.description}</span>\n <List className=\"qetaRankingCardList\">\n {rankingStats?.map(authorStats => {\n return (\n <RankingRow\n total={authorStats.total || 0}\n position={authorStats.position || 0}\n userRef={authorStats.author}\n unit={props.unit}\n />\n );\n })}\n {!rankingStats?.some(\n authorStats =>\n authorStats.author === props.statistic?.loggedUser?.author,\n ) && (\n <>\n <hr />\n <RankingRow\n total={props.statistic?.loggedUser?.total || 0}\n position={props.statistic?.loggedUser?.position || 0}\n userRef={props.statistic?.loggedUser?.author}\n unit={props.unit}\n />\n </>\n )}\n </List>\n </div>\n );\n};\n\nexport const TopRankingUsers = (props: {\n title?: string;\n hideTitle?: boolean;\n limit?: number;\n}) => {\n const { t } = useTranslation();\n const {\n value: topStatistics,\n loading,\n error,\n } = useQetaApi(api =>\n api.getTopStatisticsHomepage({\n options: { limit: 50 },\n }),\n );\n\n const tabData = [\n {\n title: t('statistics.mostQuestions.title'),\n description: t('statistics.mostQuestions.description'),\n unit: 'questions',\n },\n {\n title: t('statistics.mostAnswers.title'),\n description: t('statistics.mostAnswers.description'),\n unit: 'answers',\n },\n {\n title: t('statistics.topVotedQuestions.title'),\n description: t('statistics.topVotedQuestions.description'),\n unit: 'votes',\n },\n {\n title: t('statistics.topVotedAnswers.title'),\n description: t('statistics.topVotedAnswers.description'),\n unit: 'votes',\n },\n {\n title: t('statistics.topVotedCorrectAnswers.title'),\n description: t('statistics.topVotedCorrectAnswers.description'),\n unit: 'votes',\n },\n ];\n\n if ((error || topStatistics === undefined) && !loading) {\n return (\n <WarningPanel severity=\"error\" title={t('statistics.errorLoading')}>\n {error?.message}\n </WarningPanel>\n );\n }\n\n let content: ReactElement[];\n\n if (loading) {\n content = [\n <CardTab>\n <Progress />\n </CardTab>,\n ];\n } else if (topStatistics && topStatistics.length > 0) {\n content = topStatistics?.map((stats, index) => {\n return (\n <CardTab label={tabData[index].title}>\n <RankingCard\n description={tabData[index].description}\n limit={props.limit}\n statistic={stats}\n unit={tabData[index].unit}\n />\n </CardTab>\n );\n });\n } else {\n content = [<CardTab>{t('statistics.notAvailable')}</CardTab>];\n }\n\n return (\n <TabbedCard title={props.title || t('statistics.ranking')}>\n {content}\n </TabbedCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA0BA,MAAM,mBAAA,uBAA0B,GAAuB,CAAA;AAAA,EACrD;AAAA,IACE,CAAA;AAAA,oBACA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAO,EAAE,KAAA,EAAO,WAAW,MAAQ,EAAA,QAAA,EAAU,OAAO,QAAS,EAAA;AAAA,OAAA;AAAA,KAC/D;AAAA,GACF;AAAA,EACA;AAAA,IACE,CAAA;AAAA,oBACA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAO,EAAE,KAAA,EAAO,WAAW,MAAQ,EAAA,QAAA,EAAU,OAAO,QAAS,EAAA;AAAA,OAAA;AAAA,KAC/D;AAAA,GACF;AAAA,EACA;AAAA,IACE,CAAA;AAAA,oBAC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AAA;AAAA,GACI,MAAA;AACL,IAAA,OAAA,GAAU,iBAAE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,IAAA,EAAS,CAAE,CAAA,yBAAyB,CAAE,CAAU,CAAA,CAAA;AAAA,GAC9D;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,KAAO,EAAA,KAAA,CAAM,SAAS,CAAE,CAAA,oBAAoB,KACrD,OACH,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -7,9 +7,9 @@ const useStyles = makeStyles((theme) => {
|
|
|
7
7
|
color: theme.palette.text.primary,
|
|
8
8
|
borderRadius: "50%",
|
|
9
9
|
boxSizing: "border-box",
|
|
10
|
-
padding: "
|
|
11
|
-
height:
|
|
12
|
-
width:
|
|
10
|
+
padding: "0.5rem",
|
|
11
|
+
height: 50,
|
|
12
|
+
width: 50
|
|
13
13
|
},
|
|
14
14
|
votesText: {
|
|
15
15
|
display: "grid",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.esm.js","sources":["../../../src/components/Statistics/styles.ts"],"sourcesContent":["import { makeStyles } from '@material-ui/core';\n\nexport const useStyles = makeStyles(theme => {\n return {\n trophyIcon: {\n backgroundColor: 'initial',\n color: theme.palette.text.primary,\n borderRadius: '50%',\n boxSizing: 'border-box',\n padding: '
|
|
1
|
+
{"version":3,"file":"styles.esm.js","sources":["../../../src/components/Statistics/styles.ts"],"sourcesContent":["import { makeStyles } from '@material-ui/core';\n\nexport const useStyles = makeStyles(theme => {\n return {\n trophyIcon: {\n backgroundColor: 'initial',\n color: theme.palette.text.primary,\n borderRadius: '50%',\n boxSizing: 'border-box',\n padding: '0.5rem',\n height: 50,\n width: 50,\n },\n votesText: {\n display: 'grid',\n placeItems: 'center',\n marginLeft: '16px',\n },\n };\n});\n"],"names":[],"mappings":";;AAEa,MAAA,SAAA,GAAY,WAAW,CAAS,KAAA,KAAA;AAC3C,EAAO,OAAA;AAAA,IACL,UAAY,EAAA;AAAA,MACV,eAAiB,EAAA,SAAA;AAAA,MACjB,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA;AAAA,MAC1B,YAAc,EAAA,KAAA;AAAA,MACd,SAAW,EAAA,YAAA;AAAA,MACX,OAAS,EAAA,QAAA;AAAA,MACT,MAAQ,EAAA,EAAA;AAAA,MACR,KAAO,EAAA,EAAA;AAAA,KACT;AAAA,IACA,SAAW,EAAA;AAAA,MACT,OAAS,EAAA,MAAA;AAAA,MACT,UAAY,EAAA,QAAA;AAAA,MACZ,UAAY,EAAA,MAAA;AAAA,KACd;AAAA,GACF,CAAA;AACF,CAAC;;;;"}
|
|
@@ -1,26 +1,52 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ContentHeader } from '@backstage/core-components';
|
|
3
3
|
import { useParams } from 'react-router-dom';
|
|
4
4
|
import { QuestionsContainer } from '../QuestionsContainer/QuestionsContainer.esm.js';
|
|
5
5
|
import { TagsContainer } from './TagsContainer.esm.js';
|
|
6
6
|
import { AskQuestionButton } from '../Buttons/AskQuestionButton.esm.js';
|
|
7
|
-
import { Container } from '@material-ui/core';
|
|
8
|
-
import { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton.esm.js';
|
|
9
7
|
import { useTranslation } from '../../utils/hooks.esm.js';
|
|
10
8
|
import { TagFollowButton } from '../Buttons/TagFollowButton.esm.js';
|
|
9
|
+
import { Grid } from '@material-ui/core';
|
|
10
|
+
import { QuestionHighlightList } from '../QuestionHighlightList/QuestionHighlightList.esm.js';
|
|
11
|
+
import Whatshot from '@material-ui/icons/Whatshot';
|
|
12
|
+
import { FollowedTagsList } from '../QetaPage/FollowedTagsList.esm.js';
|
|
11
13
|
|
|
12
14
|
const TagPage = () => {
|
|
13
15
|
const { tag } = useParams();
|
|
14
16
|
const { t } = useTranslation();
|
|
15
|
-
return /* @__PURE__ */ React.createElement(
|
|
17
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 12, lg: 9, xl: 10 }, /* @__PURE__ */ React.createElement(
|
|
16
18
|
ContentHeader,
|
|
17
19
|
{
|
|
18
20
|
title: tag ? t("tagPage.taggedWithTitle", { tag }) : t("tagPage.defaultTitle")
|
|
19
21
|
},
|
|
20
22
|
tag && /* @__PURE__ */ React.createElement(TagFollowButton, { tag }),
|
|
21
|
-
/* @__PURE__ */ React.createElement(BackToQuestionsButton, null),
|
|
22
23
|
/* @__PURE__ */ React.createElement(AskQuestionButton, { tags: tag ? [tag] : void 0 })
|
|
23
|
-
), tag ? /* @__PURE__ */ React.createElement(QuestionsContainer, { tags: [tag ?? ""] }) : /* @__PURE__ */ React.createElement(TagsContainer, null)))
|
|
24
|
+
), tag ? /* @__PURE__ */ React.createElement(QuestionsContainer, { tags: [tag ?? ""] }) : /* @__PURE__ */ React.createElement(TagsContainer, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, lg: 3, xl: 2 }, /* @__PURE__ */ React.createElement(FollowedTagsList, null), /* @__PURE__ */ React.createElement(
|
|
25
|
+
QuestionHighlightList,
|
|
26
|
+
{
|
|
27
|
+
type: "hot",
|
|
28
|
+
title: t("highlights.hot.title"),
|
|
29
|
+
noQuestionsLabel: t("highlights.hot.noQuestionsLabel"),
|
|
30
|
+
icon: /* @__PURE__ */ React.createElement(Whatshot, { fontSize: "small" }),
|
|
31
|
+
options: { tags: [tag ?? ""] }
|
|
32
|
+
}
|
|
33
|
+
), /* @__PURE__ */ React.createElement(
|
|
34
|
+
QuestionHighlightList,
|
|
35
|
+
{
|
|
36
|
+
type: "unanswered",
|
|
37
|
+
title: t("highlights.unanswered.title"),
|
|
38
|
+
noQuestionsLabel: t("highlights.unanswered.noQuestionsLabel"),
|
|
39
|
+
options: { tags: [tag ?? ""] }
|
|
40
|
+
}
|
|
41
|
+
), /* @__PURE__ */ React.createElement(
|
|
42
|
+
QuestionHighlightList,
|
|
43
|
+
{
|
|
44
|
+
type: "incorrect",
|
|
45
|
+
title: t("highlights.incorrect.title"),
|
|
46
|
+
noQuestionsLabel: t("highlights.incorrect.noQuestionsLabel"),
|
|
47
|
+
options: { tags: [tag ?? ""] }
|
|
48
|
+
}
|
|
49
|
+
)));
|
|
24
50
|
};
|
|
25
51
|
|
|
26
52
|
export { TagPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagPage.esm.js","sources":["../../../src/components/TagPage/TagPage.tsx"],"sourcesContent":["import React from 'react';\nimport {
|
|
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 { QuestionsContainer } from '../QuestionsContainer/QuestionsContainer';\nimport { TagsContainer } from './TagsContainer';\nimport { AskQuestionButton } from '../Buttons/AskQuestionButton';\nimport { useTranslation } from '../../utils/hooks';\nimport { TagFollowButton } from '../Buttons/TagFollowButton';\nimport { Grid } from '@material-ui/core';\nimport { QuestionHighlightList } from '../QuestionHighlightList/QuestionHighlightList';\nimport Whatshot from '@material-ui/icons/Whatshot';\nimport { FollowedTagsList } from '../QetaPage/FollowedTagsList';\n\nexport const TagPage = () => {\n const { tag } = useParams();\n const { t } = useTranslation();\n return (\n <Grid container>\n <Grid item md={12} lg={9} xl={10}>\n <ContentHeader\n title={\n tag\n ? t('tagPage.taggedWithTitle', { tag })\n : t('tagPage.defaultTitle')\n }\n >\n {tag && <TagFollowButton tag={tag} />}\n <AskQuestionButton tags={tag ? [tag] : undefined} />\n </ContentHeader>\n {tag ? <QuestionsContainer tags={[tag ?? '']} /> : <TagsContainer />}\n </Grid>\n <Grid item lg={3} xl={2}>\n <FollowedTagsList />\n <QuestionHighlightList\n type=\"hot\"\n title={t('highlights.hot.title')}\n noQuestionsLabel={t('highlights.hot.noQuestionsLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n options={{ tags: [tag ?? ''] }}\n />\n <QuestionHighlightList\n type=\"unanswered\"\n title={t('highlights.unanswered.title')}\n noQuestionsLabel={t('highlights.unanswered.noQuestionsLabel')}\n options={{ tags: [tag ?? ''] }}\n />\n <QuestionHighlightList\n type=\"incorrect\"\n title={t('highlights.incorrect.title')}\n noQuestionsLabel={t('highlights.incorrect.noQuestionsLabel')}\n options={{ tags: [tag ?? ''] }}\n />\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAaO,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,uBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,IAAI,EAC5B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA,EACE,MACI,CAAE,CAAA,yBAAA,EAA2B,EAAE,GAAI,EAAC,CACpC,GAAA,CAAA,CAAE,sBAAsB,CAAA;AAAA,KAAA;AAAA,IAG7B,GAAA,oBAAQ,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAgB,GAAU,EAAA,CAAA;AAAA,wCAClC,iBAAkB,EAAA,EAAA,IAAA,EAAM,MAAM,CAAC,GAAG,IAAI,KAAW,CAAA,EAAA,CAAA;AAAA,GACpD,EACC,GAAM,mBAAA,KAAA,CAAA,aAAA,CAAC,kBAAmB,EAAA,EAAA,IAAA,EAAM,CAAC,GAAO,IAAA,EAAE,CAAG,EAAA,CAAA,mBAAM,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAc,CACpE,CACA,kBAAA,KAAA,CAAA,aA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SearchParams } from 'react-router-dom';
|
|
4
4
|
import { QuestionsContainer } from '../QuestionsContainer/QuestionsContainer.esm.js';
|
|
5
5
|
import { AskQuestionButton } from '../Buttons/AskQuestionButton.esm.js';
|
|
6
|
-
import {
|
|
7
|
-
import { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton.esm.js';
|
|
6
|
+
import { Box, Tab } from '@material-ui/core';
|
|
8
7
|
import { useEntityPresentation } from '@backstage/plugin-catalog-react';
|
|
9
8
|
import { TabContext, TabList, TabPanel } from '@material-ui/lab';
|
|
10
9
|
import { useTranslation } from '../../utils/hooks.esm.js';
|
|
@@ -27,7 +26,7 @@ const UserPage = () => {
|
|
|
27
26
|
setSearchParams({});
|
|
28
27
|
setTab(newValue);
|
|
29
28
|
};
|
|
30
|
-
return /* @__PURE__ */ React.createElement(
|
|
29
|
+
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(
|
|
31
30
|
TabList,
|
|
32
31
|
{
|
|
33
32
|
onChange: handleChange,
|
|
@@ -47,7 +46,7 @@ const UserPage = () => {
|
|
|
47
46
|
author: identity ?? "",
|
|
48
47
|
title: t("userPage.answers")
|
|
49
48
|
}
|
|
50
|
-
))))
|
|
49
|
+
))));
|
|
51
50
|
};
|
|
52
51
|
|
|
53
52
|
export { UserPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserPage.esm.js","sources":["../../../src/components/UserPage/UserPage.tsx"],"sourcesContent":["import React, { useState } from 'react';\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 { QuestionsContainer } from '../QuestionsContainer';\nimport { AskQuestionButton } from '../Buttons/AskQuestionButton';\nimport { Box, Tab } from '@material-ui/core';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { TabContext, TabList, TabPanel } from '@material-ui/lab';\nimport { AnswersContainer } from '../AnswersContainer';\nimport { useTranslation } from '../../utils/hooks';\n\nexport const UserPage = () => {\n const identity = useParams()['*'] ?? 'unknown';\n const presentation = useEntityPresentation(identity);\n const [tab, setTab] = useState('questions');\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 </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.questions')} value=\"questions\" />\n <Tab label={t('userPage.answers')} value=\"answers\" />\n </TabList>\n </Box>\n <TabPanel value=\"questions\">\n <QuestionsContainer\n author={identity ?? ''}\n showNoQuestionsBtn={false}\n />\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":";;;;;;;;;;;;;;;;;;AAWO,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,WAAW,CAAA,CAAA;AAC1C,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA,CAA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