@drodil/backstage-plugin-qeta 3.24.5 → 3.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ArticlePage/ArticlePage.esm.js +21 -11
- package/dist/components/ArticlePage/ArticlePage.esm.js.map +1 -1
- package/dist/components/ArticlesPage/ArticlesPage.esm.js +24 -15
- package/dist/components/ArticlesPage/ArticlesPage.esm.js.map +1 -1
- package/dist/components/AskPage/AskPage.esm.js +22 -15
- package/dist/components/AskPage/AskPage.esm.js.map +1 -1
- package/dist/components/CollectionCreatePage/CollectionCreatePage.esm.js +5 -2
- package/dist/components/CollectionCreatePage/CollectionCreatePage.esm.js.map +1 -1
- package/dist/components/CollectionPage/CollectionPage.esm.js +34 -25
- package/dist/components/CollectionPage/CollectionPage.esm.js.map +1 -1
- package/dist/components/CollectionsPage/CollectionsPage.esm.js +17 -12
- package/dist/components/CollectionsPage/CollectionsPage.esm.js.map +1 -1
- package/dist/components/EntityPage/EntityPage.esm.js +96 -65
- package/dist/components/EntityPage/EntityPage.esm.js.map +1 -1
- package/dist/components/FavoritePage/FavoritePage.esm.js +34 -22
- package/dist/components/FavoritePage/FavoritePage.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +34 -16
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/ModeratorPage/ModeratorPage.esm.js +19 -9
- package/dist/components/ModeratorPage/ModeratorPage.esm.js.map +1 -1
- package/dist/components/PostsTableCard/Content.esm.js +2 -2
- package/dist/components/PostsTableCard/Content.esm.js.map +1 -1
- package/dist/components/QetaPage/QetaPage.esm.js +120 -85
- package/dist/components/QetaPage/QetaPage.esm.js.map +1 -1
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.esm.js +70 -34
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.esm.js.map +1 -1
- package/dist/components/QuestionPage/QuestionPage.esm.js +79 -42
- package/dist/components/QuestionPage/QuestionPage.esm.js.map +1 -1
- package/dist/components/QuestionsPage/QuestionsPage.esm.js +54 -43
- package/dist/components/QuestionsPage/QuestionsPage.esm.js.map +1 -1
- package/dist/components/Statistics/GlobalStatsContent.esm.js +10 -4
- package/dist/components/Statistics/GlobalStatsContent.esm.js.map +1 -1
- package/dist/components/Statistics/StatisticsPage.esm.js +11 -2
- package/dist/components/Statistics/StatisticsPage.esm.js.map +1 -1
- package/dist/components/TagPage/TagPage.esm.js +88 -58
- package/dist/components/TagPage/TagPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserPage.esm.js +60 -40
- package/dist/components/UserPage/UserPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserStatsContent.esm.js +10 -4
- package/dist/components/UserPage/UserStatsContent.esm.js.map +1 -1
- package/dist/components/UsersPage/UsersPage.esm.js +30 -20
- package/dist/components/UsersPage/UsersPage.esm.js.map +1 -1
- package/dist/components/WritePage/WritePage.esm.js +14 -11
- package/dist/components/WritePage/WritePage.esm.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/package.json +24 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStatsContent.esm.js","sources":["../../../src/components/Statistics/GlobalStatsContent.tsx"],"sourcesContent":["import {\n StatsChart,\n SummaryStatsGrid,\n useQetaApi,\n} from '@drodil/backstage-plugin-qeta-react';\nimport
|
|
1
|
+
{"version":3,"file":"GlobalStatsContent.esm.js","sources":["../../../src/components/Statistics/GlobalStatsContent.tsx"],"sourcesContent":["import {\n StatsChart,\n SummaryStatsGrid,\n useQetaApi,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Card, CardContent, CircularProgress, Grid } from '@material-ui/core';\n\nexport const GlobalStatsContent = () => {\n const {\n value: response,\n loading,\n error,\n } = useQetaApi(api => api.getGlobalStats(), []);\n if (error) {\n return null;\n }\n return (\n <Grid container>\n <Grid item xs={12}>\n <Card>\n <CardContent>\n {!loading && response && <StatsChart data={response.statistics} />}\n {loading && <CircularProgress />}\n </CardContent>\n </Card>\n </Grid>\n <Grid item xs={12}>\n {!loading && response && <SummaryStatsGrid stats={response} />}\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;AAOO,MAAM,qBAAqB,MAAM;AACtC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,QAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,MACE,UAAW,CAAA,CAAA,GAAA,KAAO,IAAI,cAAe,EAAA,EAAG,EAAE,CAAA;AAC9C,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,OAAA,IAAA;AAAA;AAET,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IACb,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAI,IACb,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA,EACC,+BAAC,WACE,EAAA,EAAA,QAAA,EAAA;AAAA,MAAA,CAAC,WAAW,QAAY,oBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,IAAA,EAAM,SAAS,UAAY,EAAA,CAAA;AAAA,MAC/D,OAAA,wBAAY,gBAAiB,EAAA,EAAA;AAAA,KAAA,EAChC,GACF,CACF,EAAA,CAAA;AAAA,oBACC,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EACZ,QAAC,EAAA,CAAA,OAAA,IAAW,QAAY,oBAAA,GAAA,CAAC,gBAAiB,EAAA,EAAA,KAAA,EAAO,UAAU,CAC9D,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { ContentHeader } from '@backstage/core-components';
|
|
3
3
|
import { ButtonContainer, AskQuestionButton, WriteArticleButton, TopRankingUsers } from '@drodil/backstage-plugin-qeta-react';
|
|
4
4
|
import { GlobalStatsContent } from './GlobalStatsContent.esm.js';
|
|
5
5
|
import { Grid } from '@material-ui/core';
|
|
6
6
|
|
|
7
7
|
const StatisticsPage = () => {
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9
|
+
/* @__PURE__ */ jsx(ContentHeader, { title: "Statistics", children: /* @__PURE__ */ jsxs(ButtonContainer, { children: [
|
|
10
|
+
/* @__PURE__ */ jsx(AskQuestionButton, {}),
|
|
11
|
+
/* @__PURE__ */ jsx(WriteArticleButton, {})
|
|
12
|
+
] }) }),
|
|
13
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, children: [
|
|
14
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(GlobalStatsContent, {}) }),
|
|
15
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(TopRankingUsers, { limit: 10 }) })
|
|
16
|
+
] })
|
|
17
|
+
] });
|
|
9
18
|
};
|
|
10
19
|
|
|
11
20
|
export { StatisticsPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatisticsPage.esm.js","sources":["../../../src/components/Statistics/StatisticsPage.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"StatisticsPage.esm.js","sources":["../../../src/components/Statistics/StatisticsPage.tsx"],"sourcesContent":["import { ContentHeader } from '@backstage/core-components';\nimport {\n AskQuestionButton,\n ButtonContainer,\n TopRankingUsers,\n WriteArticleButton,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { GlobalStatsContent } from './GlobalStatsContent';\nimport { Grid } from '@material-ui/core';\n\nexport const StatisticsPage = () => {\n return (\n <>\n <ContentHeader title=\"Statistics\">\n <ButtonContainer>\n <AskQuestionButton />\n <WriteArticleButton />\n </ButtonContainer>\n </ContentHeader>\n <Grid container>\n <Grid item xs={12}>\n <GlobalStatsContent />\n </Grid>\n <Grid item xs={12}>\n <TopRankingUsers limit={10} />\n </Grid>\n </Grid>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AAUO,MAAM,iBAAiB,MAAM;AAClC,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAM,YACnB,EAAA,QAAA,kBAAA,IAAA,CAAC,eACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,iBAAkB,EAAA,EAAA,CAAA;AAAA,0BAClB,kBAAmB,EAAA,EAAA;AAAA,KAAA,EACtB,CACF,EAAA,CAAA;AAAA,oBACA,IAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IACb,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EACb,EAAA,QAAA,kBAAA,GAAA,CAAC,sBAAmB,CACtB,EAAA,CAAA;AAAA,sBACA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,IACb,QAAC,kBAAA,GAAA,CAAA,eAAA,EAAA,EAAgB,KAAO,EAAA,EAAA,EAAI,CAC9B,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import { ContentHeader } from '@backstage/core-components';
|
|
3
4
|
import { useParams } from 'react-router-dom';
|
|
4
5
|
import { useTranslation, qetaApiRef, ButtonContainer, TagFollowButton, AskQuestionButton, WriteArticleButton, MarkdownRenderer, PostsContainer, TagsGrid, FollowedTagsList, PostHighlightList } from '@drodil/backstage-plugin-qeta-react';
|
|
@@ -9,7 +10,7 @@ import { Grid, Card, CardContent, Typography } from '@material-ui/core';
|
|
|
9
10
|
const TagPage = () => {
|
|
10
11
|
const { tag } = useParams();
|
|
11
12
|
const { t } = useTranslation();
|
|
12
|
-
const [resp, setResp] =
|
|
13
|
+
const [resp, setResp] = useState();
|
|
13
14
|
const qetaApi = useApi(qetaApiRef);
|
|
14
15
|
useEffect(() => {
|
|
15
16
|
if (!tag) {
|
|
@@ -22,62 +23,91 @@ const TagPage = () => {
|
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
}, [qetaApi, tag]);
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
26
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 4, children: [
|
|
27
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, md: 12, lg: 9, xl: 10, children: [
|
|
28
|
+
/* @__PURE__ */ jsx(ContentHeader, { title: tag ? `#${tag}` : t("tagPage.defaultTitle"), children: /* @__PURE__ */ jsxs(ButtonContainer, { children: [
|
|
29
|
+
tag && /* @__PURE__ */ jsx(TagFollowButton, { tag }),
|
|
30
|
+
/* @__PURE__ */ jsx(AskQuestionButton, { tags: tag ? [tag] : void 0 }),
|
|
31
|
+
/* @__PURE__ */ jsx(WriteArticleButton, { tags: tag ? [tag] : void 0 })
|
|
32
|
+
] }) }),
|
|
33
|
+
resp && /* @__PURE__ */ jsx(Card, { variant: "outlined", style: { marginBottom: "1em" }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
|
|
34
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "caption", children: [
|
|
35
|
+
t("common.posts", {
|
|
36
|
+
count: resp.postsCount,
|
|
37
|
+
itemType: "post"
|
|
38
|
+
}),
|
|
39
|
+
" \xB7 ",
|
|
40
|
+
t("common.followers", { count: resp.followerCount })
|
|
41
|
+
] }),
|
|
42
|
+
resp.description && /* @__PURE__ */ jsx(MarkdownRenderer, { content: resp.description })
|
|
43
|
+
] }) }),
|
|
44
|
+
tag ? /* @__PURE__ */ jsx(
|
|
45
|
+
PostsContainer,
|
|
46
|
+
{
|
|
47
|
+
tags: [tag ?? ""],
|
|
48
|
+
filterPanelProps: { showTagFilter: false }
|
|
49
|
+
}
|
|
50
|
+
) : /* @__PURE__ */ jsx(TagsGrid, {})
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, lg: 3, xl: 2, children: [
|
|
53
|
+
/* @__PURE__ */ jsx(FollowedTagsList, {}),
|
|
54
|
+
resp && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
PostHighlightList,
|
|
57
|
+
{
|
|
58
|
+
type: "hot",
|
|
59
|
+
title: t("highlights.hotQuestions.title"),
|
|
60
|
+
noQuestionsLabel: t("highlights.hotQuestions.noQuestionsLabel"),
|
|
61
|
+
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
62
|
+
options: { tags: [resp.tag] },
|
|
63
|
+
postType: "question"
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
PostHighlightList,
|
|
68
|
+
{
|
|
69
|
+
type: "unanswered",
|
|
70
|
+
title: t("highlights.unanswered.title"),
|
|
71
|
+
noQuestionsLabel: t("highlights.unanswered.noQuestionsLabel"),
|
|
72
|
+
options: { tags: [resp.tag] },
|
|
73
|
+
postType: "question"
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
PostHighlightList,
|
|
78
|
+
{
|
|
79
|
+
type: "incorrect",
|
|
80
|
+
title: t("highlights.incorrect.title"),
|
|
81
|
+
noQuestionsLabel: t("highlights.incorrect.noQuestionsLabel"),
|
|
82
|
+
options: { tags: [resp.tag] },
|
|
83
|
+
postType: "question"
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] }),
|
|
87
|
+
!resp && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
PostHighlightList,
|
|
90
|
+
{
|
|
91
|
+
type: "hot",
|
|
92
|
+
title: t("highlights.hotQuestions.title"),
|
|
93
|
+
noQuestionsLabel: t("highlights.hotQuestions.noQuestionsLabel"),
|
|
94
|
+
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
95
|
+
postType: "question"
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
PostHighlightList,
|
|
100
|
+
{
|
|
101
|
+
type: "hot",
|
|
102
|
+
title: t("highlights.hotArticles.title"),
|
|
103
|
+
noQuestionsLabel: t("highlights.hotArticles.noArticlesLabel"),
|
|
104
|
+
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
105
|
+
postType: "article"
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] })
|
|
109
|
+
] })
|
|
110
|
+
] });
|
|
81
111
|
};
|
|
82
112
|
|
|
83
113
|
export { TagPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagPage.esm.js","sources":["../../../src/components/TagPage/TagPage.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"TagPage.esm.js","sources":["../../../src/components/TagPage/TagPage.tsx"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { ContentHeader } from '@backstage/core-components';\nimport { useParams } from 'react-router-dom';\nimport {\n AskQuestionButton,\n ButtonContainer,\n FollowedTagsList,\n MarkdownRenderer,\n PostHighlightList,\n PostsContainer,\n qetaApiRef,\n TagFollowButton,\n TagsGrid,\n useTranslation,\n WriteArticleButton,\n} from '@drodil/backstage-plugin-qeta-react';\nimport Whatshot from '@material-ui/icons/Whatshot';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { TagResponse } from '@drodil/backstage-plugin-qeta-common';\nimport { Card, CardContent, Grid, Typography } from '@material-ui/core';\n\nexport const TagPage = () => {\n const { tag } = useParams();\n const { t } = useTranslation();\n const [resp, setResp] = useState<undefined | TagResponse>();\n\n const qetaApi = useApi(qetaApiRef);\n\n useEffect(() => {\n if (!tag) {\n setResp(undefined);\n return;\n }\n\n qetaApi.getTag(tag).then(res => {\n if (res) {\n setResp(res);\n }\n });\n }, [qetaApi, tag]);\n\n return (\n <Grid container spacing={4}>\n <Grid item md={12} lg={9} xl={10}>\n <ContentHeader title={tag ? `#${tag}` : t('tagPage.defaultTitle')}>\n <ButtonContainer>\n {tag && <TagFollowButton tag={tag} />}\n <AskQuestionButton tags={tag ? [tag] : undefined} />\n <WriteArticleButton tags={tag ? [tag] : undefined} />\n </ButtonContainer>\n </ContentHeader>\n {resp && (\n <Card variant=\"outlined\" style={{ marginBottom: '1em' }}>\n <CardContent>\n <Typography variant=\"caption\">\n {t('common.posts', {\n count: resp.postsCount,\n itemType: 'post',\n })}\n {' · '}\n {t('common.followers', { count: resp.followerCount })}\n </Typography>\n {resp.description && (\n <MarkdownRenderer content={resp.description} />\n )}\n </CardContent>\n </Card>\n )}\n {tag ? (\n <PostsContainer\n tags={[tag ?? '']}\n filterPanelProps={{ showTagFilter: false }}\n />\n ) : (\n <TagsGrid />\n )}\n </Grid>\n <Grid item lg={3} xl={2}>\n <FollowedTagsList />\n {resp && (\n <>\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotQuestions.title')}\n noQuestionsLabel={t('highlights.hotQuestions.noQuestionsLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n options={{ tags: [resp.tag] }}\n postType=\"question\"\n />\n\n <PostHighlightList\n type=\"unanswered\"\n title={t('highlights.unanswered.title')}\n noQuestionsLabel={t('highlights.unanswered.noQuestionsLabel')}\n options={{ tags: [resp.tag] }}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"incorrect\"\n title={t('highlights.incorrect.title')}\n noQuestionsLabel={t('highlights.incorrect.noQuestionsLabel')}\n options={{ tags: [resp.tag] }}\n postType=\"question\"\n />\n </>\n )}\n {!resp && (\n <>\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotQuestions.title')}\n noQuestionsLabel={t('highlights.hotQuestions.noQuestionsLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotArticles.title')}\n noQuestionsLabel={t('highlights.hotArticles.noArticlesLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n postType=\"article\"\n />\n </>\n )}\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAqBO,MAAM,UAAU,MAAM;AAC3B,EAAM,MAAA,EAAE,GAAI,EAAA,GAAI,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,QAAkC,EAAA;AAE1D,EAAM,MAAA,OAAA,GAAU,OAAO,UAAU,CAAA;AAEjC,EAAA,SAAA,CAAU,MAAM;AACd,I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F,EAAA;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { ContentHeader } from '@backstage/core-components';
|
|
3
4
|
import { useParams, useSearchParams } from 'react-router-dom';
|
|
4
5
|
import { useUserInfo, useTranslation, useIdentityApi, UserFollowButton, ButtonContainer, AskQuestionButton, WriteArticleButton, PostsContainer, PostsGrid, CollectionsGrid, AnswersContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
@@ -21,45 +22,64 @@ const UserPage = () => {
|
|
|
21
22
|
setSearchParams({});
|
|
22
23
|
setTab(newValue);
|
|
23
24
|
};
|
|
24
|
-
const title = /* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
25
|
+
const title = /* @__PURE__ */ jsxs(Box, { style: { display: "flex", alignItems: "center" }, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Box, { style: { display: "inline-block", marginRight: "0.5em" }, children: /* @__PURE__ */ jsx(Avatar, { src: user?.spec?.profile?.picture, alt: name, variant: "rounded", children: initials }) }),
|
|
27
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h5", component: "h2", children: name }),
|
|
28
|
+
!loadingUser && !userError && currentUser?.userEntityRef !== identity && /* @__PURE__ */ jsx(
|
|
29
|
+
UserFollowButton,
|
|
30
|
+
{
|
|
31
|
+
userRef: identity,
|
|
32
|
+
style: { marginLeft: "0.5em" }
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
] });
|
|
36
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(ContentHeader, { titleComponent: title, description: secondaryTitle, children: /* @__PURE__ */ jsxs(ButtonContainer, { children: [
|
|
38
|
+
/* @__PURE__ */ jsx(AskQuestionButton, {}),
|
|
39
|
+
/* @__PURE__ */ jsx(WriteArticleButton, {})
|
|
40
|
+
] }) }),
|
|
41
|
+
/* @__PURE__ */ jsxs(TabContext, { value: tab, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(Box, { sx: { borderBottom: 1, borderColor: "divider" }, children: /* @__PURE__ */ jsxs(
|
|
43
|
+
TabList,
|
|
44
|
+
{
|
|
45
|
+
onChange: handleChange,
|
|
46
|
+
"aria-label": t("userPage.profileTab"),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Tab, { label: t("userPage.statistics"), value: "statistics" }),
|
|
49
|
+
/* @__PURE__ */ jsx(Tab, { label: t("userPage.questions"), value: "questions" }),
|
|
50
|
+
/* @__PURE__ */ jsx(Tab, { label: t("userPage.articles"), value: "articles" }),
|
|
51
|
+
/* @__PURE__ */ jsx(Tab, { label: t("userPage.collections"), value: "collections" }),
|
|
52
|
+
/* @__PURE__ */ jsx(Tab, { label: t("userPage.answers"), value: "answers" })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ jsx(TabPanel, { value: "statistics", children: /* @__PURE__ */ jsx(UserStatsContent, { userRef: identity ?? "" }) }),
|
|
57
|
+
/* @__PURE__ */ jsx(TabPanel, { value: "questions", children: /* @__PURE__ */ jsx(
|
|
58
|
+
PostsContainer,
|
|
59
|
+
{
|
|
60
|
+
author: identity ?? "",
|
|
61
|
+
showNoQuestionsBtn: false,
|
|
62
|
+
type: "question"
|
|
63
|
+
}
|
|
64
|
+
) }),
|
|
65
|
+
/* @__PURE__ */ jsx(TabPanel, { value: "articles", children: /* @__PURE__ */ jsx(
|
|
66
|
+
PostsGrid,
|
|
67
|
+
{
|
|
68
|
+
author: identity ?? "",
|
|
69
|
+
type: "article",
|
|
70
|
+
showNoQuestionsBtn: false
|
|
71
|
+
}
|
|
72
|
+
) }),
|
|
73
|
+
/* @__PURE__ */ jsx(TabPanel, { value: "collections", children: /* @__PURE__ */ jsx(CollectionsGrid, { owner: identity ?? "" }) }),
|
|
74
|
+
/* @__PURE__ */ jsx(TabPanel, { value: "answers", children: /* @__PURE__ */ jsx(
|
|
75
|
+
AnswersContainer,
|
|
76
|
+
{
|
|
77
|
+
author: identity ?? "",
|
|
78
|
+
title: t("userPage.answers")
|
|
79
|
+
}
|
|
80
|
+
) })
|
|
81
|
+
] })
|
|
82
|
+
] });
|
|
63
83
|
};
|
|
64
84
|
|
|
65
85
|
export { UserPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserPage.esm.js","sources":["../../../src/components/UserPage/UserPage.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"UserPage.esm.js","sources":["../../../src/components/UserPage/UserPage.tsx"],"sourcesContent":["import { ChangeEvent, useState } from 'react';\nimport { ContentHeader } from '@backstage/core-components';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport {\n AnswersContainer,\n AskQuestionButton,\n ButtonContainer,\n CollectionsGrid,\n PostsContainer,\n PostsGrid,\n useIdentityApi,\n UserFollowButton,\n useTranslation,\n useUserInfo,\n WriteArticleButton,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { UserStatsContent } from './UserStatsContent';\nimport { TabContext, TabList, TabPanel } from '@material-ui/lab';\nimport { Avatar, Box, Tab, Typography } from '@material-ui/core';\n\nexport const UserPage = () => {\n const identity = useParams()['*'] ?? 'unknown';\n const { name, initials, user, secondaryTitle } = useUserInfo(identity);\n const [tab, setTab] = useState('statistics');\n const { t } = useTranslation();\n const [_searchParams, setSearchParams] = useSearchParams();\n const {\n value: currentUser,\n loading: loadingUser,\n error: userError,\n } = useIdentityApi(api => api.getBackstageIdentity(), []);\n\n const handleChange = (_event: ChangeEvent<{}>, newValue: string) => {\n setSearchParams({});\n setTab(newValue);\n };\n const title = (\n <Box style={{ display: 'flex', alignItems: 'center' }}>\n <Box style={{ display: 'inline-block', marginRight: '0.5em' }}>\n <Avatar src={user?.spec?.profile?.picture} alt={name} variant=\"rounded\">\n {initials}\n </Avatar>\n </Box>\n <Typography variant=\"h5\" component=\"h2\">\n {name}\n </Typography>\n {!loadingUser &&\n !userError &&\n currentUser?.userEntityRef !== identity && (\n <UserFollowButton\n userRef={identity}\n style={{ marginLeft: '0.5em' }}\n />\n )}\n </Box>\n );\n\n return (\n <>\n <ContentHeader titleComponent={title} description={secondaryTitle}>\n <ButtonContainer>\n <AskQuestionButton />\n <WriteArticleButton />\n </ButtonContainer>\n </ContentHeader>\n <TabContext value={tab}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n onChange={handleChange}\n aria-label={t('userPage.profileTab')}\n >\n <Tab label={t('userPage.statistics')} value=\"statistics\" />\n <Tab label={t('userPage.questions')} value=\"questions\" />\n <Tab label={t('userPage.articles')} value=\"articles\" />\n <Tab label={t('userPage.collections')} value=\"collections\" />\n <Tab label={t('userPage.answers')} value=\"answers\" />\n </TabList>\n </Box>\n <TabPanel value=\"statistics\">\n <UserStatsContent userRef={identity ?? ''} />\n </TabPanel>\n <TabPanel value=\"questions\">\n <PostsContainer\n author={identity ?? ''}\n showNoQuestionsBtn={false}\n type=\"question\"\n />\n </TabPanel>\n <TabPanel value=\"articles\">\n <PostsGrid\n author={identity ?? ''}\n type=\"article\"\n showNoQuestionsBtn={false}\n />\n </TabPanel>\n <TabPanel value=\"collections\">\n <CollectionsGrid owner={identity ?? ''} />\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":";;;;;;;;;AAoBO,MAAM,WAAW,MAAM;AAC5B,EAAA,MAAM,QAAW,GAAA,SAAA,EAAY,CAAA,GAAG,CAAK,IAAA,SAAA;AACrC,EAAA,MAAM,EAAE,IAAM,EAAA,QAAA,EAAU,MAAM,cAAe,EAAA,GAAI,YAAY,QAAQ,CAAA;AACrE,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAI,SAAS,YAAY,CAAA;AAC3C,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,CAAC,aAAA,EAAe,eAAe,CAAA,GAAI,eAAgB,EAAA;AACzD,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,WAAA;AAAA,IACP,OAAS,EAAA,WAAA;AAAA,IACT,KAAO,EAAA;AAAA,MACL,cAAe,CAAA,CAAA,GAAA,KAAO,IAAI,oBAAqB,EAAA,EAAG,EAAE,CAAA;AAExD,EAAM,MAAA,YAAA,GAAe,CAAC,MAAA,EAAyB,QAAqB,KAAA;AAClE,IAAA,eAAA,CAAgB,EAAE,CAAA;AAClB,IAAA,MAAA,CAAO,QAAQ,CAAA;AAAA,GACjB;AACA,EAAM,MAAA,KAAA,wBACH,GAAI,EAAA,EAAA,KAAA,EAAO,EAAE,OAAS,EAAA,MAAA,EAAQ,UAAY,EAAA,QAAA,EACzC,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,GAAA,EAAA,EAAI,OAAO,EAAE,OAAA,EAAS,gBAAgB,WAAa,EAAA,OAAA,IAClD,QAAC,kBAAA,GAAA,CAAA,MAAA,EAAA,EAAO,KAAK,IAAM,EAAA,IAAA,EAAM,SAAS,OAAS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AAAA;AAAA,OAE/B,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useQetaApi, StatsChart, SummaryStatsGrid } from '@drodil/backstage-plugin-qeta-react';
|
|
2
|
-
import
|
|
3
|
-
import { Grid, Card, CardContent } from '@material-ui/core';
|
|
3
|
+
import { Grid, Card, CardContent, CircularProgress } from '@material-ui/core';
|
|
4
4
|
|
|
5
5
|
const UserStatsContent = (props) => {
|
|
6
6
|
const {
|
|
@@ -8,10 +8,16 @@ const UserStatsContent = (props) => {
|
|
|
8
8
|
loading,
|
|
9
9
|
error
|
|
10
10
|
} = useQetaApi((api) => api.getUserStats(props.userRef), []);
|
|
11
|
-
if (
|
|
11
|
+
if (error) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { children: [
|
|
16
|
+
!loading && response && /* @__PURE__ */ jsx(StatsChart, { data: response.statistics }),
|
|
17
|
+
loading && /* @__PURE__ */ jsx(CircularProgress, {})
|
|
18
|
+
] }) }) }),
|
|
19
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: !loading && response && /* @__PURE__ */ jsx(SummaryStatsGrid, { stats: response }) })
|
|
20
|
+
] });
|
|
15
21
|
};
|
|
16
22
|
|
|
17
23
|
export { UserStatsContent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStatsContent.esm.js","sources":["../../../src/components/UserPage/UserStatsContent.tsx"],"sourcesContent":["import {\n StatsChart,\n SummaryStatsGrid,\n useQetaApi,\n} from '@drodil/backstage-plugin-qeta-react';\nimport
|
|
1
|
+
{"version":3,"file":"UserStatsContent.esm.js","sources":["../../../src/components/UserPage/UserStatsContent.tsx"],"sourcesContent":["import {\n StatsChart,\n SummaryStatsGrid,\n useQetaApi,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Card, CardContent, CircularProgress, Grid } from '@material-ui/core';\n\nexport const UserStatsContent = (props: { userRef: string }) => {\n const {\n value: response,\n loading,\n error,\n } = useQetaApi(api => api.getUserStats(props.userRef), []);\n if (error) {\n return null;\n }\n return (\n <Grid container>\n <Grid item xs={12}>\n <Card>\n <CardContent>\n {!loading && response && <StatsChart data={response.statistics} />}\n {loading && <CircularProgress />}\n </CardContent>\n </Card>\n </Grid>\n <Grid item xs={12}>\n {!loading && response && <SummaryStatsGrid stats={response} />}\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;AAOa,MAAA,gBAAA,GAAmB,CAAC,KAA+B,KAAA;AAC9D,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,QAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,GACF,GAAI,WAAW,CAAO,GAAA,KAAA,GAAA,CAAI,aAAa,KAAM,CAAA,OAAO,CAAG,EAAA,EAAE,CAAA;AACzD,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,OAAA,IAAA;AAAA;AAET,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IACb,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAI,IACb,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA,EACC,+BAAC,WACE,EAAA,EAAA,QAAA,EAAA;AAAA,MAAA,CAAC,WAAW,QAAY,oBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,IAAA,EAAM,SAAS,UAAY,EAAA,CAAA;AAAA,MAC/D,OAAA,wBAAY,gBAAiB,EAAA,EAAA;AAAA,KAAA,EAChC,GACF,CACF,EAAA,CAAA;AAAA,oBACC,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EACZ,QAAC,EAAA,CAAA,OAAA,IAAW,QAAY,oBAAA,GAAA,CAAC,gBAAiB,EAAA,EAAA,KAAA,EAAO,UAAU,CAC9D,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useTranslation, UsersGrid, FollowedUsersList, PostHighlightList } from '@drodil/backstage-plugin-qeta-react';
|
|
3
3
|
import { ContentHeader } from '@backstage/core-components';
|
|
4
4
|
import { Grid } from '@material-ui/core';
|
|
@@ -6,25 +6,35 @@ import Whatshot from '@material-ui/icons/Whatshot';
|
|
|
6
6
|
|
|
7
7
|
const UsersPage = () => {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 4, children: [
|
|
10
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, md: 12, lg: 9, xl: 10, children: [
|
|
11
|
+
/* @__PURE__ */ jsx(ContentHeader, { title: t("usersPage.title") }),
|
|
12
|
+
/* @__PURE__ */ jsx(UsersGrid, {})
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, lg: 3, xl: 2, children: [
|
|
15
|
+
/* @__PURE__ */ jsx(FollowedUsersList, {}),
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
PostHighlightList,
|
|
18
|
+
{
|
|
19
|
+
type: "hot",
|
|
20
|
+
title: t("highlights.hotQuestions.title"),
|
|
21
|
+
noQuestionsLabel: t("highlights.hotQuestions.noQuestionsLabel"),
|
|
22
|
+
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
23
|
+
postType: "question"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
PostHighlightList,
|
|
28
|
+
{
|
|
29
|
+
type: "hot",
|
|
30
|
+
title: t("highlights.hotArticles.title"),
|
|
31
|
+
noQuestionsLabel: t("highlights.hotArticles.noArticlesLabel"),
|
|
32
|
+
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
33
|
+
postType: "article"
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
] })
|
|
37
|
+
] });
|
|
28
38
|
};
|
|
29
39
|
|
|
30
40
|
export { UsersPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsersPage.esm.js","sources":["../../../src/components/UsersPage/UsersPage.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"UsersPage.esm.js","sources":["../../../src/components/UsersPage/UsersPage.tsx"],"sourcesContent":["import {\n FollowedUsersList,\n PostHighlightList,\n UsersGrid,\n useTranslation,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { ContentHeader } from '@backstage/core-components';\nimport { Grid } from '@material-ui/core';\nimport Whatshot from '@material-ui/icons/Whatshot';\n\nexport const UsersPage = () => {\n const { t } = useTranslation();\n\n return (\n <Grid container spacing={4}>\n <Grid item md={12} lg={9} xl={10}>\n <ContentHeader title={t('usersPage.title')} />\n <UsersGrid />\n </Grid>\n <Grid item lg={3} xl={2}>\n <FollowedUsersList />\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotQuestions.title')}\n noQuestionsLabel={t('highlights.hotQuestions.noQuestionsLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n postType=\"question\"\n />\n <PostHighlightList\n type=\"hot\"\n title={t('highlights.hotArticles.title')}\n noQuestionsLabel={t('highlights.hotArticles.noArticlesLabel')}\n icon={<Whatshot fontSize=\"small\" />}\n postType=\"article\"\n />\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;AAUO,MAAM,YAAY,MAAM;AAC7B,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAE7B,EAAA,uBACG,IAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAC,SAAS,CACvB,EAAA,QAAA,EAAA;AAAA,oBAAC,IAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAI,IAAI,EAAI,EAAA,CAAA,EAAG,IAAI,EAC5B,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAO,CAAE,CAAA,iBAAiB,CAAG,EAAA,CAAA;AAAA,0BAC3C,SAAU,EAAA,EAAA;AAAA,KACb,EAAA,CAAA;AAAA,yBACC,IAAK,EAAA,EAAA,IAAA,EAAI,MAAC,EAAI,EAAA,CAAA,EAAG,IAAI,CACpB,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,iBAAkB,EAAA,EAAA,CAAA;AAAA,sBACnB,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,IAAK,EAAA,KAAA;AAAA,UACL,KAAA,EAAO,EAAE,+BAA+B,CAAA;AAAA,UACxC,gBAAA,EAAkB,EAAE,0CAA0C,CAAA;AAAA,UAC9D,IAAM,kBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,UACjC,QAAS,EAAA;AAAA;AAAA,OACX;AAAA,sBACA,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,IAAK,EAAA,KAAA;AAAA,UACL,KAAA,EAAO,EAAE,8BAA8B,CAAA;AAAA,UACvC,gBAAA,EAAkB,EAAE,wCAAwC,CAAA;AAAA,UAC5D,IAAM,kBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,UACjC,QAAS,EAAA;AAAA;AAAA;AACX,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useParams, useSearchParams } from 'react-router-dom';
|
|
3
3
|
import { filterTags } from '@drodil/backstage-plugin-qeta-common';
|
|
4
4
|
import { useTranslation, PostForm } from '@drodil/backstage-plugin-qeta-react';
|
|
@@ -24,16 +24,19 @@ const WritePage = () => {
|
|
|
24
24
|
} else {
|
|
25
25
|
title = t("writePage.title.newArticle");
|
|
26
26
|
}
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(ContentHeader, { title }),
|
|
29
|
+
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 3, direction: "column", children: /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(InfoCard, { children: /* @__PURE__ */ jsx(
|
|
30
|
+
PostForm,
|
|
31
|
+
{
|
|
32
|
+
id,
|
|
33
|
+
entity,
|
|
34
|
+
entityPage,
|
|
35
|
+
tags,
|
|
36
|
+
type: "article"
|
|
37
|
+
}
|
|
38
|
+
) }) }) })
|
|
39
|
+
] });
|
|
37
40
|
};
|
|
38
41
|
|
|
39
42
|
export { WritePage };
|