@drodil/backstage-plugin-qeta 2.5.3 → 2.6.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/AnswersContainer/AnswerList.esm.js +5 -4
- package/dist/components/AnswersContainer/AnswerList.esm.js.map +1 -1
- package/dist/components/AnswersContainer/AnswerListItem.esm.js +8 -7
- package/dist/components/AnswersContainer/AnswerListItem.esm.js.map +1 -1
- package/dist/components/AnswersContainer/AnswersContainer.esm.js +12 -15
- package/dist/components/AnswersContainer/AnswersContainer.esm.js.map +1 -1
- package/dist/components/AskAnonymouslyCheckbox/AskAnonymouslyCheckbox.esm.js +3 -1
- package/dist/components/AskAnonymouslyCheckbox/AskAnonymouslyCheckbox.esm.js.map +1 -1
- package/dist/components/AskForm/AskForm.esm.js +13 -6
- package/dist/components/AskForm/AskForm.esm.js.map +1 -1
- package/dist/components/AskForm/EntitiesInput.esm.js +7 -3
- package/dist/components/AskForm/EntitiesInput.esm.js.map +1 -1
- package/dist/components/AskForm/TagInput.esm.js +7 -3
- package/dist/components/AskForm/TagInput.esm.js.map +1 -1
- package/dist/components/AskPage/AskPage.esm.js +7 -3
- package/dist/components/AskPage/AskPage.esm.js.map +1 -1
- package/dist/components/Buttons/AskQuestionButton.esm.js +3 -1
- package/dist/components/Buttons/AskQuestionButton.esm.js.map +1 -1
- package/dist/components/Buttons/BackToQuestionsButton.esm.js +3 -2
- package/dist/components/Buttons/BackToQuestionsButton.esm.js.map +1 -1
- package/dist/components/CommentSection/CommentList.esm.js +3 -2
- package/dist/components/CommentSection/CommentList.esm.js.map +1 -1
- package/dist/components/CommentSection/CommentSection.esm.js +5 -3
- package/dist/components/CommentSection/CommentSection.esm.js.map +1 -1
- package/dist/components/DeleteModal/DeleteModal.esm.js +6 -5
- package/dist/components/DeleteModal/DeleteModal.esm.js.map +1 -1
- package/dist/components/FavoritePage/FavoritePage.esm.js +3 -1
- package/dist/components/FavoritePage/FavoritePage.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +19 -13
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/Links/Links.esm.js +3 -1
- package/dist/components/Links/Links.esm.js.map +1 -1
- package/dist/components/QuestionHighlightList/QuestionHighlightList.esm.js +3 -2
- package/dist/components/QuestionHighlightList/QuestionHighlightList.esm.js.map +1 -1
- package/dist/components/QuestionPage/AnswerCard.esm.js +4 -3
- package/dist/components/QuestionPage/AnswerCard.esm.js.map +1 -1
- package/dist/components/QuestionPage/AnswerForm.esm.js +6 -4
- package/dist/components/QuestionPage/AnswerForm.esm.js.map +1 -1
- package/dist/components/QuestionPage/AuthorBox.esm.js +3 -2
- package/dist/components/QuestionPage/AuthorBox.esm.js.map +1 -1
- package/dist/components/QuestionPage/FavoriteButton.esm.js +4 -2
- package/dist/components/QuestionPage/FavoriteButton.esm.js.map +1 -1
- package/dist/components/QuestionPage/LinkButton.esm.js +9 -13
- package/dist/components/QuestionPage/LinkButton.esm.js.map +1 -1
- package/dist/components/QuestionPage/QuestionCard.esm.js +4 -3
- package/dist/components/QuestionPage/QuestionCard.esm.js.map +1 -1
- package/dist/components/QuestionPage/QuestionPage.esm.js +19 -16
- package/dist/components/QuestionPage/QuestionPage.esm.js.map +1 -1
- package/dist/components/QuestionPage/VoteButtons.esm.js +7 -5
- package/dist/components/QuestionPage/VoteButtons.esm.js.map +1 -1
- package/dist/components/QuestionTableCard/QuestionsTable.esm.js +8 -7
- package/dist/components/QuestionTableCard/QuestionsTable.esm.js.map +1 -1
- package/dist/components/QuestionsContainer/DateRangeFilter.esm.js +12 -11
- package/dist/components/QuestionsContainer/DateRangeFilter.esm.js.map +1 -1
- package/dist/components/QuestionsContainer/FilterPanel.esm.js +22 -19
- package/dist/components/QuestionsContainer/FilterPanel.esm.js.map +1 -1
- package/dist/components/QuestionsContainer/NoQuestionsCard.esm.js +4 -3
- package/dist/components/QuestionsContainer/NoQuestionsCard.esm.js.map +1 -1
- package/dist/components/QuestionsContainer/QuestionList.esm.js +4 -3
- package/dist/components/QuestionsContainer/QuestionList.esm.js.map +1 -1
- package/dist/components/QuestionsContainer/QuestionListItem.esm.js +12 -9
- package/dist/components/QuestionsContainer/QuestionListItem.esm.js.map +1 -1
- package/dist/components/QuestionsContainer/QuestionsContainer.esm.js +13 -9
- package/dist/components/QuestionsContainer/QuestionsContainer.esm.js.map +1 -1
- package/dist/components/Statistics/TopRankingUsersCard.esm.js +15 -14
- package/dist/components/Statistics/TopRankingUsersCard.esm.js.map +1 -1
- package/dist/components/TagPage/TagPage.esm.js +10 -1
- package/dist/components/TagPage/TagPage.esm.js.map +1 -1
- package/dist/components/TagPage/TagsContainer.esm.js +7 -13
- package/dist/components/TagPage/TagsContainer.esm.js.map +1 -1
- package/dist/components/UserPage/UserPage.esm.js +18 -3
- package/dist/components/UserPage/UserPage.esm.js.map +1 -1
- package/dist/index.d.ts +180 -1
- package/dist/index.esm.js +1 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/locale/fi.esm.js +185 -0
- package/dist/locale/fi.esm.js.map +1 -0
- package/dist/translation.esm.js +323 -0
- package/dist/translation.esm.js.map +1 -0
- package/dist/utils/hooks.esm.js +6 -1
- package/dist/utils/hooks.esm.js.map +1 -1
- package/package.json +3 -3
|
@@ -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 } 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 {\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: 'Most questions',\n description: 'People who have posted most questions',\n unit: 'questions',\n },\n {\n title: 'Most answers',\n description: 'People who have answered most questions',\n unit: 'answers',\n },\n {\n title: 'Top Upvoted Questions',\n description: 'People who have the highest rated questions',\n unit: 'votes',\n },\n {\n title: 'Top Upvoted Answers',\n description: 'People who have the highest rated answers',\n unit: 'votes',\n },\n {\n title: 'Top Upvoted Correct Answers',\n description: 'People who have the highest rated correct answers',\n unit: 'votes',\n },\n ];\n\n if ((error || topStatistics === undefined) && !loading) {\n return (\n <WarningPanel severity=\"error\" title=\"Could not load statistics.\">\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>No statistics available</CardTab>];\n }\n\n return (\n <TabbedCard title={props.title || 'Ranking Q&A 🏆'}>{content}</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,IAAI,CAAI,GAAA,EAAA,KAAO,CAAK,IAAA,CAAA,GAAI,QAAQ,EAAI,E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AA,IAAiB,aAAc,CAAA,MAAA,GAAS,CAAG,EAAA;AACpD,IAAA,OAAA,GAAU,aAAe,EAAA,GAAA,CAAI,CAAC,KAAA,EAAO,KAAU,KAAA;AAC7C,MAAA,2CACG,OAAQ,EAAA,EAAA,KAAA,EAAO,OAAQ,CAAA,KAAK,EAAE,KAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,WAAA,EAAa,OAAQ,CAAA,KAAK,CAAE,CAAA,WAAA;AAAA,UAC5B,OAAO,KAAM,CAAA,KAAA;AAAA,UACb,SAAW,EAAA,KAAA;AAAA,UACX,IAAA,EAAM,OAAQ,CAAA,KAAK,CAAE,CAAA,IAAA;AAAA,SAAA;AAAA,OAEzB,CAAA,CAAA;AAAA,KAEH,CAAA,CAAA;AAAA,GACI,MAAA;AACL,IAAA,OAAA,GAAU,iBAAC,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,IAAA,EAAA,yBAAuB,CAAU,CAAA,CAAA;AAAA,GACvD;AAEA,EAAA,2CACG,UAAW,EAAA,EAAA,KAAA,EAAO,KAAM,CAAA,KAAA,IAAS,2BAAmB,OAAQ,CAAA,CAAA;AAEjE;;;;"}
|
|
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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
|
|
7
7
|
import { Container } from '@material-ui/core';
|
|
8
8
|
import { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton.esm.js';
|
|
9
|
+
import { useTranslation } from '../../utils/hooks.esm.js';
|
|
9
10
|
|
|
10
11
|
const TagPage = () => {
|
|
11
12
|
const { tag } = useParams();
|
|
12
|
-
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(
|
|
15
|
+
ContentHeader,
|
|
16
|
+
{
|
|
17
|
+
title: tag ? t("tagPage.taggedWithTitle", { tag }) : t("tagPage.defaultTitle")
|
|
18
|
+
},
|
|
19
|
+
/* @__PURE__ */ React.createElement(BackToQuestionsButton, null),
|
|
20
|
+
/* @__PURE__ */ React.createElement(AskQuestionButton, { tags: tag ? [tag] : void 0 })
|
|
21
|
+
), tag ? /* @__PURE__ */ React.createElement(QuestionsContainer, { tags: [tag ?? ""] }) : /* @__PURE__ */ React.createElement(TagsContainer, null)));
|
|
13
22
|
};
|
|
14
23
|
|
|
15
24
|
export { TagPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagPage.esm.js","sources":["../../../src/components/TagPage/TagPage.tsx"],"sourcesContent":["import React from 'react';\nimport { Content, 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 { Container } from '@material-ui/core';\nimport { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton';\n\nexport const TagPage = () => {\n const { tag } = useParams();\n return (\n <Content>\n <Container maxWidth=\"lg\">\n <ContentHeader
|
|
1
|
+
{"version":3,"file":"TagPage.esm.js","sources":["../../../src/components/TagPage/TagPage.tsx"],"sourcesContent":["import React from 'react';\nimport { Content, 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 { Container } from '@material-ui/core';\nimport { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton';\nimport { useTranslation } from '../../utils/hooks';\n\nexport const TagPage = () => {\n const { tag } = useParams();\n const { t } = useTranslation();\n return (\n <Content>\n <Container maxWidth=\"lg\">\n <ContentHeader\n title={\n tag\n ? t('tagPage.taggedWithTitle', { tag })\n : t('tagPage.defaultTitle')\n }\n >\n <BackToQuestionsButton />\n <AskQuestionButton tags={tag ? [tag] : undefined} />\n </ContentHeader>\n {tag ? <QuestionsContainer tags={[tag ?? '']} /> : <TagsContainer />}\n </Container>\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAUO,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,OAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAU,UAAS,IAClB,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,wCAG7B,qBAAsB,EAAA,IAAA,CAAA;AAAA,wCACtB,iBAAkB,EAAA,EAAA,IAAA,EAAM,MAAM,CAAC,GAAG,IAAI,KAAW,CAAA,EAAA,CAAA;AAAA,GAEnD,EAAA,GAAA,mBAAO,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,EAAmB,IAAM,EAAA,CAAC,GAAO,IAAA,EAAE,CAAG,EAAA,CAAA,mBAAM,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAc,CACpE,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Grid, TextField, IconButton, Typography, Chip, Avatar } from '@material-ui/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { useQetaApi } from '../../utils/hooks.esm.js';
|
|
3
|
+
import { useTranslation, useQetaApi } from '../../utils/hooks.esm.js';
|
|
4
4
|
import { Progress, WarningPanel } from '@backstage/core-components';
|
|
5
5
|
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
6
6
|
import { tagRouteRef } from '@drodil/backstage-plugin-qeta-react';
|
|
@@ -8,6 +8,7 @@ import { tagRouteRef } from '@drodil/backstage-plugin-qeta-react';
|
|
|
8
8
|
const TagsContainer = () => {
|
|
9
9
|
const [searchQuery, setSearchQuery] = React.useState("");
|
|
10
10
|
const tagRoute = useRouteRef(tagRouteRef);
|
|
11
|
+
const { t } = useTranslation();
|
|
11
12
|
const {
|
|
12
13
|
value: response,
|
|
13
14
|
loading,
|
|
@@ -17,13 +18,13 @@ const TagsContainer = () => {
|
|
|
17
18
|
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
18
19
|
}
|
|
19
20
|
if (error || response === void 0) {
|
|
20
|
-
return /* @__PURE__ */ React.createElement(WarningPanel, { severity: "error", title: "
|
|
21
|
+
return /* @__PURE__ */ React.createElement(WarningPanel, { severity: "error", title: t("tagPage.errorLoading") }, error?.message);
|
|
21
22
|
}
|
|
22
23
|
const filterData = (query, data) => {
|
|
23
24
|
if (!query) {
|
|
24
25
|
return data;
|
|
25
26
|
}
|
|
26
|
-
return data.filter((
|
|
27
|
+
return data.filter((tag) => tag.tag.toLowerCase().includes(query));
|
|
27
28
|
};
|
|
28
29
|
const tags = filterData(searchQuery, response);
|
|
29
30
|
return /* @__PURE__ */ React.createElement(Grid, { container: true, className: "qetaTagsContainer" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
@@ -32,19 +33,12 @@ const TagsContainer = () => {
|
|
|
32
33
|
id: "search-bar",
|
|
33
34
|
className: "text qetaTagsContainerSearchInput",
|
|
34
35
|
onChange: (event) => setSearchQuery(event.target.value),
|
|
35
|
-
label: "
|
|
36
|
+
label: t("tagPage.search.label"),
|
|
36
37
|
variant: "outlined",
|
|
37
|
-
placeholder: "
|
|
38
|
+
placeholder: t("tagPage.search.placeholder"),
|
|
38
39
|
size: "small"
|
|
39
40
|
}
|
|
40
|
-
), /* @__PURE__ */ React.createElement(IconButton, { type: "submit", "aria-label": "search" })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
41
|
-
Typography,
|
|
42
|
-
{
|
|
43
|
-
variant: "h6",
|
|
44
|
-
className: "qetaTagsContainerTitle"
|
|
45
|
-
},
|
|
46
|
-
`Showing ${tags.length} tags`
|
|
47
|
-
)), /* @__PURE__ */ React.createElement(Grid, { item: true }, tags.map((tag) => /* @__PURE__ */ React.createElement(
|
|
41
|
+
), /* @__PURE__ */ React.createElement(IconButton, { type: "submit", "aria-label": "search" })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6", className: "qetaTagsContainerTitle" }, t("tagPage.tags", { count: tags.length }))), /* @__PURE__ */ React.createElement(Grid, { item: true }, tags.map((tag) => /* @__PURE__ */ React.createElement(
|
|
48
42
|
Chip,
|
|
49
43
|
{
|
|
50
44
|
key: tag.tag,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsContainer.esm.js","sources":["../../../src/components/TagPage/TagsContainer.tsx"],"sourcesContent":["import {\n Avatar,\n Chip,\n Grid,\n IconButton,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport React from 'react';\nimport { useQetaApi } from '../../utils/hooks';\nimport { Progress, WarningPanel } from '@backstage/core-components';\nimport { TagResponse } from '@drodil/backstage-plugin-qeta-common';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { tagRouteRef } from '@drodil/backstage-plugin-qeta-react';\n\nexport const TagsContainer = () => {\n const [searchQuery, setSearchQuery] = React.useState('');\n const tagRoute = useRouteRef(tagRouteRef);\n const {\n value: response,\n loading,\n error,\n } = useQetaApi(api => api.getTags(), []);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error || response === undefined) {\n return (\n <WarningPanel severity=\"error\" title
|
|
1
|
+
{"version":3,"file":"TagsContainer.esm.js","sources":["../../../src/components/TagPage/TagsContainer.tsx"],"sourcesContent":["import {\n Avatar,\n Chip,\n Grid,\n IconButton,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport React from 'react';\nimport { useQetaApi, useTranslation } from '../../utils/hooks';\nimport { Progress, WarningPanel } from '@backstage/core-components';\nimport { TagResponse } from '@drodil/backstage-plugin-qeta-common';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { tagRouteRef } from '@drodil/backstage-plugin-qeta-react';\n\nexport const TagsContainer = () => {\n const [searchQuery, setSearchQuery] = React.useState('');\n const tagRoute = useRouteRef(tagRouteRef);\n const { t } = useTranslation();\n const {\n value: response,\n loading,\n error,\n } = useQetaApi(api => api.getTags(), []);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error || response === undefined) {\n return (\n <WarningPanel severity=\"error\" title={t('tagPage.errorLoading')}>\n {error?.message}\n </WarningPanel>\n );\n }\n\n const filterData = (query: string, data: TagResponse[]) => {\n if (!query) {\n return data;\n }\n return data.filter(tag => tag.tag.toLowerCase().includes(query));\n };\n\n const tags = filterData(searchQuery, response);\n\n return (\n <Grid container className=\"qetaTagsContainer\">\n <Grid item xs={12}>\n <TextField\n id=\"search-bar\"\n className=\"text qetaTagsContainerSearchInput\"\n onChange={(\n event: React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>,\n ) => setSearchQuery(event.target.value)}\n label={t('tagPage.search.label')}\n variant=\"outlined\"\n placeholder={t('tagPage.search.placeholder')}\n size=\"small\"\n />\n <IconButton type=\"submit\" aria-label=\"search\" />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h6\" className=\"qetaTagsContainerTitle\">\n {t('tagPage.tags', { count: tags.length })}\n </Typography>\n </Grid>\n <Grid item>\n {tags.map(tag => (\n <Chip\n key={tag.tag}\n variant=\"outlined\"\n avatar={<Avatar>{tag.questionsCount}</Avatar>}\n label={tag.tag}\n className=\"qetaTagsContainerChip\"\n component=\"a\"\n clickable\n href={tagRoute({ tag: tag.tag })}\n />\n ))}\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAeO,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,CAAC,WAAa,EAAA,cAAc,CAAI,GAAA,KAAA,CAAM,SAAS,EAAE,CAAA,CAAA;AACvD,EAAM,MAAA,QAAA,GAAW,YAAY,WAAW,CAAA,CAAA;AACxC,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA,CAAA;AAC7B,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,QAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,MACE,UAAW,CAAA,CAAA,GAAA,KAAO,IAAI,OAAQ,EAAA,EAAG,EAAE,CAAA,CAAA;AAEvC,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,GACnB;AAEA,EAAI,IAAA,KAAA,IAAS,aAAa,KAAW,CAAA,EAAA;AACnC,IACE,uBAAA,KAAA,CAAA,aAAA,CAAC,gBAAa,QAAS,EAAA,OAAA,EAAQ,OAAO,CAAE,CAAA,sBAAsB,CAC3D,EAAA,EAAA,KAAA,EAAO,OACV,CAAA,CAAA;AAAA,GAEJ;AAEA,EAAM,MAAA,UAAA,GAAa,CAAC,KAAA,EAAe,IAAwB,KAAA;AACzD,IAAA,IAAI,CAAC,KAAO,EAAA;AACV,MAAO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CACR,GAAA,qBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,KAAK,GAAI,CAAA,GAAA;AAAA,MACT,OAAQ,EAAA,UAAA;AAAA,MACR,MAAQ,kBAAA,KAAA,CAAA,aAAA,CAAC,MAAQ,EAAA,IAAA,EAAA,GAAA,CAAI,cAAe,CAAA;AAAA,MACpC,OAAO,GAAI,CAAA,GAAA;AAAA,MACX,SAAU,EAAA,uBAAA;AAAA,MACV,SAAU,EAAA,GAAA;AAAA,MACV,SAAS,EAAA,IAAA;AAAA,MACT,MAAM,QAAS,CAAA,EAAE,GAAK,EAAA,GAAA,CAAI,KAAK,CAAA;AAAA,KAAA;AAAA,GAElC,CACH,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -7,7 +7,7 @@ import { Container, Box, Tab } from '@material-ui/core';
|
|
|
7
7
|
import { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton.esm.js';
|
|
8
8
|
import { useEntityPresentation } from '@backstage/plugin-catalog-react';
|
|
9
9
|
import { TabContext, TabList, TabPanel } from '@material-ui/lab';
|
|
10
|
-
import '../../utils/hooks.esm.js';
|
|
10
|
+
import { useTranslation } from '../../utils/hooks.esm.js';
|
|
11
11
|
import 'dompurify';
|
|
12
12
|
import '@backstage/catalog-model';
|
|
13
13
|
import '@backstage/core-plugin-api';
|
|
@@ -20,18 +20,33 @@ const UserPage = () => {
|
|
|
20
20
|
const identity = useParams()["*"] ?? "unknown";
|
|
21
21
|
const presentation = useEntityPresentation(identity);
|
|
22
22
|
const [tab, setTab] = useState("questions");
|
|
23
|
+
const { t } = useTranslation();
|
|
23
24
|
const [_searchParams, setSearchParams] = useSearchParams();
|
|
24
25
|
const handleChange = (_event, newValue) => {
|
|
25
26
|
setSearchParams({});
|
|
26
27
|
setTab(newValue);
|
|
27
28
|
};
|
|
28
|
-
return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: `${presentation.primaryTitle}` }, /* @__PURE__ */ React.createElement(BackToQuestionsButton, null), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(TabContext, { value: tab }, /* @__PURE__ */ React.createElement(Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React.createElement(
|
|
29
|
+
return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: `${presentation.primaryTitle}` }, /* @__PURE__ */ React.createElement(BackToQuestionsButton, null), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(TabContext, { value: tab }, /* @__PURE__ */ React.createElement(Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React.createElement(
|
|
30
|
+
TabList,
|
|
31
|
+
{
|
|
32
|
+
onChange: handleChange,
|
|
33
|
+
"aria-label": t("userPage.profileTab")
|
|
34
|
+
},
|
|
35
|
+
/* @__PURE__ */ React.createElement(Tab, { label: t("userPage.questions"), value: "questions" }),
|
|
36
|
+
/* @__PURE__ */ React.createElement(Tab, { label: t("userPage.answers"), value: "answers" })
|
|
37
|
+
)), /* @__PURE__ */ React.createElement(TabPanel, { value: "questions" }, /* @__PURE__ */ React.createElement(
|
|
29
38
|
QuestionsContainer,
|
|
30
39
|
{
|
|
31
40
|
author: identity ?? "",
|
|
32
41
|
showNoQuestionsBtn: false
|
|
33
42
|
}
|
|
34
|
-
)), /* @__PURE__ */ React.createElement(TabPanel, { value: "answers" }, /* @__PURE__ */ React.createElement(
|
|
43
|
+
)), /* @__PURE__ */ React.createElement(TabPanel, { value: "answers" }, /* @__PURE__ */ React.createElement(
|
|
44
|
+
AnswersContainer,
|
|
45
|
+
{
|
|
46
|
+
author: identity ?? "",
|
|
47
|
+
title: t("userPage.answers")
|
|
48
|
+
}
|
|
49
|
+
)))));
|
|
35
50
|
};
|
|
36
51
|
|
|
37
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 { Content, ContentHeader } from '@backstage/core-components';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport { QuestionsContainer } from '../QuestionsContainer';\nimport { AskQuestionButton } from '../Buttons/AskQuestionButton';\nimport { Box, Container, Tab } from '@material-ui/core';\nimport { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { TabContext, TabList, TabPanel } from '@material-ui/lab';\nimport { AnswersContainer } from '../AnswersContainer';\n\nexport const UserPage = () => {\n const identity = useParams()['*'] ?? 'unknown';\n const presentation = useEntityPresentation(identity);\n const [tab, setTab] = useState('questions');\n const [_searchParams, setSearchParams] = useSearchParams();\n\n const handleChange = (_event: React.ChangeEvent<{}>, newValue: string) => {\n setSearchParams({});\n setTab(newValue);\n };\n return (\n <Content>\n <Container maxWidth=\"lg\">\n <ContentHeader title={`${presentation.primaryTitle}`}>\n <BackToQuestionsButton />\n <AskQuestionButton />\n </ContentHeader>\n <TabContext value={tab}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList
|
|
1
|
+
{"version":3,"file":"UserPage.esm.js","sources":["../../../src/components/UserPage/UserPage.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Content, ContentHeader } from '@backstage/core-components';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport { QuestionsContainer } from '../QuestionsContainer';\nimport { AskQuestionButton } from '../Buttons/AskQuestionButton';\nimport { Box, Container, Tab } from '@material-ui/core';\nimport { BackToQuestionsButton } from '../Buttons/BackToQuestionsButton';\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 <Content>\n <Container maxWidth=\"lg\">\n <ContentHeader title={`${presentation.primaryTitle}`}>\n <BackToQuestionsButton />\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 </Container>\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAYO,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,CAAA;AAC7B,EAAA,MAAM,CAAC,aAAA,EAAe,eAAe,CAAA,GAAI,eAAgB,EAAA,CAAA;AAEzD,EAAM,MAAA,YAAA,GAAe,CAAC,MAAA,EAA+B,QAAqB,KAAA;AACxE,IAAA,eAAA,CAAgB,EAAE,CAAA,CAAA;AAClB,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,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,QAAQ,QAAY,IAAA,EAAA;AAAA,MACpB,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,KAAA;AAAA,GAE/B,CACF,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
|
5
5
|
import { FetchApi, DiscoveryApi } from '@backstage/core-plugin-api';
|
|
6
6
|
import { AnswersResponse, AnswerResponse, QuestionResponse, StatisticResponse, QuestionsResponse, QuestionRequest, TagResponse, EntityResponse, StatisticsRequestParameters, AnswerRequest, AnswerResponseBody, AttachmentResponseBody, Question, Answer } from '@drodil/backstage-plugin-qeta-common';
|
|
7
7
|
import { SvgIconProps } from '@material-ui/core';
|
|
8
|
+
import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
|
|
8
9
|
|
|
9
10
|
declare const qetaPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
10
11
|
root: _backstage_core_plugin_api.RouteRef<undefined>;
|
|
@@ -221,4 +222,182 @@ declare class QetaClient implements QetaApi {
|
|
|
221
222
|
private getQueryParameters;
|
|
222
223
|
}
|
|
223
224
|
|
|
224
|
-
|
|
225
|
+
/** @alpha */
|
|
226
|
+
declare const qetaTranslationRef: _backstage_core_plugin_api_alpha.TranslationRef<"qeta", {
|
|
227
|
+
readonly "favorite.remove": "Remove this question from favorites";
|
|
228
|
+
readonly "favorite.add": "Mark this question as favorite";
|
|
229
|
+
readonly "statistics.errorLoading": "Could not load statistics";
|
|
230
|
+
readonly "statistics.notAvailable": "Statistics are unavailable";
|
|
231
|
+
readonly "statistics.ranking": "Ranking Q&A 🏆";
|
|
232
|
+
readonly "statistics.mostQuestions.title": "Most questions";
|
|
233
|
+
readonly "statistics.mostQuestions.description": "People who have posted most questions";
|
|
234
|
+
readonly "statistics.mostAnswers.title": "Most answers";
|
|
235
|
+
readonly "statistics.mostAnswers.description": "People who have posted most answers";
|
|
236
|
+
readonly "statistics.topVotedQuestions.title": "Top voted questions";
|
|
237
|
+
readonly "statistics.topVotedQuestions.description": "People who have the highest rated questions";
|
|
238
|
+
readonly "statistics.topVotedAnswers.title": "Top voted answers";
|
|
239
|
+
readonly "statistics.topVotedAnswers.description": "People who have the highest rated answers";
|
|
240
|
+
readonly "statistics.topVotedCorrectAnswers.title": "Top voted correct answers";
|
|
241
|
+
readonly "statistics.topVotedCorrectAnswers.description": "People who have the highest rated correct answers";
|
|
242
|
+
readonly "link.answer": "Copy link to this answer to clipboard";
|
|
243
|
+
readonly "link.question": "Copy link to this question to clipboard";
|
|
244
|
+
readonly "link.aria": "Copy link to clipboard";
|
|
245
|
+
readonly pluginName: "Q&A";
|
|
246
|
+
readonly "answerList.errorLoading": "Could not load answers";
|
|
247
|
+
readonly "answerList.noAnswers": "No answers";
|
|
248
|
+
readonly "answerList.limitSelect": "Answers per page";
|
|
249
|
+
readonly "common.score": "{{score}} score";
|
|
250
|
+
readonly "common.anonymousAuthor": "Anonymous";
|
|
251
|
+
readonly "common.answers_zero": "No answers";
|
|
252
|
+
readonly "common.answers_one": "{{count}} answer";
|
|
253
|
+
readonly "common.answers_other": "{{count}} answers";
|
|
254
|
+
readonly "common.views_zero": "Viewed {{count}} times";
|
|
255
|
+
readonly "common.views_one": "Viewed {{count}} time";
|
|
256
|
+
readonly "common.views_other": "Viewed {{count}} times";
|
|
257
|
+
readonly "common.viewsShort_zero": "0 views";
|
|
258
|
+
readonly "common.viewsShort_one": "{{count}} view";
|
|
259
|
+
readonly "common.viewsShort_other": "{{count}} views";
|
|
260
|
+
readonly "common.questions_zero": "No questions";
|
|
261
|
+
readonly "common.questions_one": "{{count}} question";
|
|
262
|
+
readonly "common.questions_other": "{{count}} questions";
|
|
263
|
+
readonly "answer.questionTitle": "Q: {{question}}";
|
|
264
|
+
readonly "answer.answeredTime": "answered";
|
|
265
|
+
readonly "answerContainer.title.answersBy": "Answers by";
|
|
266
|
+
readonly "answerContainer.title.answersAbout": "Answers about";
|
|
267
|
+
readonly "answerContainer.title.answersTagged": "Answers tagged with {{tags}}";
|
|
268
|
+
readonly "answerContainer.search.label": "Search for answers";
|
|
269
|
+
readonly "answerContainer.search.placeholder": "Search...";
|
|
270
|
+
readonly "anonymousCheckbox.tooltip": "By enabling this, other users won't be able to see you as an author";
|
|
271
|
+
readonly "anonymousCheckbox.answerAnonymously": "Answer anonymously";
|
|
272
|
+
readonly "anonymousCheckbox.askAnonymously": "Ask anonymously";
|
|
273
|
+
readonly "askForm.errorPosting": "Could not post question";
|
|
274
|
+
readonly "askForm.titleInput.label": "Title";
|
|
275
|
+
readonly "askForm.titleInput.helperText": "Write good title for your question that people can understand";
|
|
276
|
+
readonly "askForm.contentInput.placeholder": "Your question";
|
|
277
|
+
readonly "askForm.submit.existingQuestion": "Save";
|
|
278
|
+
readonly "askForm.submit.newQuestion": "Post";
|
|
279
|
+
readonly "answerForm.errorPosting": "Could not post answer";
|
|
280
|
+
readonly "answerForm.contentInput.placeholder": "Your answer";
|
|
281
|
+
readonly "answerForm.submit.existingAnswer": "Save";
|
|
282
|
+
readonly "answerForm.submit.newAnswer": "Post";
|
|
283
|
+
readonly "entitiesInput.label": "Entities";
|
|
284
|
+
readonly "entitiesInput.placeholder": "Type or select entities";
|
|
285
|
+
readonly "entitiesInput.helperText": "Add up to {{max}} entities this question relates to";
|
|
286
|
+
readonly "tagsInput.label": "Tags";
|
|
287
|
+
readonly "tagsInput.placeholder": "Type or select tags";
|
|
288
|
+
readonly "tagsInput.helperText": "Add up to {{max}} tags to categorize your question";
|
|
289
|
+
readonly "askPage.title.existingQuestion": "Edit question";
|
|
290
|
+
readonly "askPage.title.newQuestion": "Ask question";
|
|
291
|
+
readonly "askPage.title.entityQuestion": "Ask a question about {{entity}}";
|
|
292
|
+
readonly "askQuestionButton.title": "Ask question";
|
|
293
|
+
readonly "backToQuestionsButton.title": "Back to questions";
|
|
294
|
+
readonly "commentList.deleteLink": "delete";
|
|
295
|
+
readonly "commentSection.input.placeholder": "Your comment";
|
|
296
|
+
readonly "commentSection.addComment": "Add comment";
|
|
297
|
+
readonly "commentSection.post": "Post";
|
|
298
|
+
readonly "deleteModal.title.answer": "Are you sure you want to delete this answer?";
|
|
299
|
+
readonly "deleteModal.title.question": "Are you sure you want to delete this question?";
|
|
300
|
+
readonly "deleteModal.errorDeleting": "Failed to delete";
|
|
301
|
+
readonly "deleteModal.deleteButton": "Delete";
|
|
302
|
+
readonly "deleteModal.cancelButton": "Cancel";
|
|
303
|
+
readonly "favoritePage.title": "Your favorite questions";
|
|
304
|
+
readonly "homePage.title": "All questions";
|
|
305
|
+
readonly "homePage.moreMenu.statistics": "Statistics";
|
|
306
|
+
readonly "homePage.moreMenu.tags": "Tags";
|
|
307
|
+
readonly "homePage.moreMenu.title": "More";
|
|
308
|
+
readonly "homePage.moreMenu.profile": "Profile";
|
|
309
|
+
readonly "homePage.moreMenu.favoriteQuestions": "Favorite questions";
|
|
310
|
+
readonly "homePage.highlights.loadError": "Failed to load questions";
|
|
311
|
+
readonly "homePage.highlights.hot.title": "Hot questions";
|
|
312
|
+
readonly "homePage.highlights.hot.noQuestionsLabel": "No questions";
|
|
313
|
+
readonly "homePage.highlights.unanswered.title": "Unanswered questions";
|
|
314
|
+
readonly "homePage.highlights.unanswered.noQuestionsLabel": "No unanswered questions";
|
|
315
|
+
readonly "homePage.highlights.incorrect.title": "Questions without correct answer";
|
|
316
|
+
readonly "homePage.highlights.incorrect.noQuestionsLabel": "No questions without correct answers";
|
|
317
|
+
readonly "userLink.anonymous": "Anonymous";
|
|
318
|
+
readonly "questionPage.errorLoading": "Could not load question";
|
|
319
|
+
readonly "questionPage.editButton": "Edit";
|
|
320
|
+
readonly "questionPage.sortAnswers.label": "Sort answers";
|
|
321
|
+
readonly "questionPage.sortAnswers.default": "Default";
|
|
322
|
+
readonly "questionPage.sortAnswers.createdDesc": "Created (desc)";
|
|
323
|
+
readonly "questionPage.sortAnswers.createdAsc": "Created (asc)";
|
|
324
|
+
readonly "questionPage.sortAnswers.scoreDesc": "Score (desc)";
|
|
325
|
+
readonly "questionPage.sortAnswers.scoreAsc": "Score (asc)";
|
|
326
|
+
readonly "questionPage.sortAnswers.commentsDesc": "Comments (desc)";
|
|
327
|
+
readonly "questionPage.sortAnswers.commentsAsc": "Comments (asc)";
|
|
328
|
+
readonly "questionPage.sortAnswers.authorDesc": "Author (desc)";
|
|
329
|
+
readonly "questionPage.sortAnswers.authorAsc": "Author (asc)";
|
|
330
|
+
readonly "questionPage.sortAnswers.updatedDesc": "Updated (desc)";
|
|
331
|
+
readonly "questionPage.sortAnswers.updatedAsc": "Updated (asc)";
|
|
332
|
+
readonly "authorBox.askedAtTime": "asked";
|
|
333
|
+
readonly "authorBox.postedAtTime": "Posted";
|
|
334
|
+
readonly "authorBox.updatedAtTime": "Updated";
|
|
335
|
+
readonly "authorBox.updatedBy": "by";
|
|
336
|
+
readonly "voteButtons.answer.markCorrect": "Mark this answer correct";
|
|
337
|
+
readonly "voteButtons.answer.markIncorrect": "Mark this answer incorrect";
|
|
338
|
+
readonly "voteButtons.answer.marked": "This answer has been marked as correct";
|
|
339
|
+
readonly "voteButtons.answer.good": "This answer is good";
|
|
340
|
+
readonly "voteButtons.answer.bad": "This answer is not good";
|
|
341
|
+
readonly "voteButtons.answer.own": "You cannot vote your own answer";
|
|
342
|
+
readonly "voteButtons.question.good": "This question is good";
|
|
343
|
+
readonly "voteButtons.question.bad": "This question is not good";
|
|
344
|
+
readonly "voteButtons.question.own": "You cannot vote your own question";
|
|
345
|
+
readonly "datePicker.from": "From date";
|
|
346
|
+
readonly "datePicker.to": "To date";
|
|
347
|
+
readonly "datePicker.invalidRange": "Date range invalid, 'To date' should be greater than 'From date'";
|
|
348
|
+
readonly "datePicker.range.label": "Date range";
|
|
349
|
+
readonly "datePicker.range.default": "Select";
|
|
350
|
+
readonly "datePicker.range.last7days": "Last 7 days";
|
|
351
|
+
readonly "datePicker.range.last30days": "Last 30 days";
|
|
352
|
+
readonly "datePicker.range.custom": "Custom";
|
|
353
|
+
readonly "filterPanel.noAnswers.label": "No answers";
|
|
354
|
+
readonly "filterPanel.filterButton": "Filter";
|
|
355
|
+
readonly "filterPanel.noCorrectAnswers.label": "No correct answers";
|
|
356
|
+
readonly "filterPanel.noVotes.label": "No votes";
|
|
357
|
+
readonly "filterPanel.orderBy.answers": "Answers";
|
|
358
|
+
readonly "filterPanel.orderBy.label": "Order by";
|
|
359
|
+
readonly "filterPanel.orderBy.score": "Score";
|
|
360
|
+
readonly "filterPanel.orderBy.created": "Created";
|
|
361
|
+
readonly "filterPanel.orderBy.views": "Views";
|
|
362
|
+
readonly "filterPanel.orderBy.updated": "Updated";
|
|
363
|
+
readonly "filterPanel.order.label": "Order";
|
|
364
|
+
readonly "filterPanel.order.desc": "Descending";
|
|
365
|
+
readonly "filterPanel.order.asc": "Ascending";
|
|
366
|
+
readonly "filterPanel.filters.tag.label": "Tag";
|
|
367
|
+
readonly "filterPanel.filters.tag.placeholder": "Type or select tag";
|
|
368
|
+
readonly "filterPanel.filters.label": "Filters";
|
|
369
|
+
readonly "filterPanel.filters.entity.label": "Entity";
|
|
370
|
+
readonly "filterPanel.filters.entity.placeholder": "Type or select entity";
|
|
371
|
+
readonly "questionList.errorLoading": "Could not load questions";
|
|
372
|
+
readonly "questionList.questionsPerPage": "Questions per page";
|
|
373
|
+
readonly "questionsContainer.title.favorite": "Your favorite questions";
|
|
374
|
+
readonly "questionsContainer.title.questionsBy": "Questions by";
|
|
375
|
+
readonly "questionsContainer.title.questionsAbout": "Questions about";
|
|
376
|
+
readonly "questionsContainer.title.questionsTagged": "Questions tagged with {{tags}}";
|
|
377
|
+
readonly "questionsContainer.search.label": "Search for questions";
|
|
378
|
+
readonly "questionsContainer.search.placeholder": "Search...";
|
|
379
|
+
readonly "questionsContainer.noQuestions": "No questions found";
|
|
380
|
+
readonly "questionsContainer.askOneButton": "Go ahead and ask one!";
|
|
381
|
+
readonly "questionsTable.errorLoading": "Could not load questions";
|
|
382
|
+
readonly "questionsTable.latest": "Latest";
|
|
383
|
+
readonly "questionsTable.mostViewed": "Most viewed";
|
|
384
|
+
readonly "questionsTable.favorites": "Favorites";
|
|
385
|
+
readonly "questionsTable.cells.author": "Author";
|
|
386
|
+
readonly "questionsTable.cells.title": "Title";
|
|
387
|
+
readonly "questionsTable.cells.asked": "Asked";
|
|
388
|
+
readonly "questionsTable.cells.updated": "Last updated";
|
|
389
|
+
readonly "tagPage.errorLoading": "Could not load tags";
|
|
390
|
+
readonly "tagPage.search.label": "Search tag";
|
|
391
|
+
readonly "tagPage.search.placeholder": "Search...";
|
|
392
|
+
readonly "tagPage.taggedWithTitle": "Questions tagged with {{tag}}";
|
|
393
|
+
readonly "tagPage.defaultTitle": "Tags";
|
|
394
|
+
readonly "tagPage.tags_zero": "No tags";
|
|
395
|
+
readonly "tagPage.tags_one": "Showing {{count}} tag";
|
|
396
|
+
readonly "tagPage.tags_other": "Showing {{count}} tags";
|
|
397
|
+
readonly "userPage.questions": "Questions";
|
|
398
|
+
readonly "userPage.answers": "Answers";
|
|
399
|
+
readonly "userPage.profileTab": "Profile";
|
|
400
|
+
}>;
|
|
401
|
+
declare const qetaTranslations: _backstage_core_plugin_api_alpha.TranslationResource<"qeta">;
|
|
402
|
+
|
|
403
|
+
export { AnswerList, AnswerListItem, AnswersContainer, AskForm, Content, type QetaApi, QetaClient, QetaPage, QuestionTableCard, QuestionsContainer, QuestionsTable, RankingCard, RankingRow, StatisticsPage, TopRankingUsers, TrophyIcon, qetaApiRef, qetaPlugin, qetaTranslationRef, qetaTranslations };
|
package/dist/index.esm.js
CHANGED
|
@@ -10,4 +10,5 @@ export { RankingCard, RankingRow, TopRankingUsers } from './components/Statistic
|
|
|
10
10
|
export { TrophyIcon } from './components/Statistics/TrophyIcon.esm.js';
|
|
11
11
|
export { StatisticsPage } from './components/Statistics/StatisticsPage.esm.js';
|
|
12
12
|
export { QetaClient, qetaApiRef } from './api/QetaClient.esm.js';
|
|
13
|
+
export { qetaTranslationRef, qetaTranslations } from './translation.esm.js';
|
|
13
14
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|