@drodil/backstage-plugin-qeta 3.48.2 → 3.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ArticlePage/ArticlePage.esm.js +14 -6
- package/dist/components/ArticlePage/ArticlePage.esm.js.map +1 -1
- package/dist/components/ArticlesPage/ArticlesPage.esm.js +29 -24
- package/dist/components/ArticlesPage/ArticlesPage.esm.js.map +1 -1
- package/dist/components/AskPage/AskPage.esm.js +18 -3
- package/dist/components/AskPage/AskPage.esm.js.map +1 -1
- package/dist/components/CollectionPage/CollectionPage.esm.js +79 -15
- package/dist/components/CollectionPage/CollectionPage.esm.js.map +1 -1
- package/dist/components/CollectionsPage/CollectionsPage.esm.js +11 -14
- package/dist/components/CollectionsPage/CollectionsPage.esm.js.map +1 -1
- package/dist/components/CreateLinkPage/CreateLinkPage.esm.js +2 -2
- package/dist/components/CreateLinkPage/CreateLinkPage.esm.js.map +1 -1
- package/dist/components/EntityPage/EntityPage.esm.js +110 -123
- package/dist/components/EntityPage/EntityPage.esm.js.map +1 -1
- package/dist/components/EntityPostsContent/EntityPostsContent.esm.js +2 -2
- package/dist/components/EntityPostsContent/EntityPostsContent.esm.js.map +1 -1
- package/dist/components/FavoritePage/FavoritePage.esm.js +34 -31
- package/dist/components/FavoritePage/FavoritePage.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +34 -35
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/LinkPage/LinkPage.esm.js +22 -25
- package/dist/components/LinkPage/LinkPage.esm.js.map +1 -1
- package/dist/components/LinksPage/LinksPage.esm.js +24 -25
- package/dist/components/LinksPage/LinksPage.esm.js.map +1 -1
- package/dist/components/ModeratorPage/ModeratorPage.esm.js +11 -5
- package/dist/components/ModeratorPage/ModeratorPage.esm.js.map +1 -1
- package/dist/components/PostsTableCard/Content.esm.js +2 -2
- package/dist/components/PostsTableCard/Content.esm.js.map +1 -1
- package/dist/components/QetaPage/QetaPage.esm.js +192 -164
- package/dist/components/QetaPage/QetaPage.esm.js.map +1 -1
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.esm.js +2 -2
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.esm.js.map +1 -1
- package/dist/components/QuestionPage/QuestionPage.esm.js +27 -9
- package/dist/components/QuestionPage/QuestionPage.esm.js.map +1 -1
- package/dist/components/QuestionsPage/QuestionsPage.esm.js +13 -54
- package/dist/components/QuestionsPage/QuestionsPage.esm.js.map +1 -1
- package/dist/components/RightContent/ArticlesRightContent.esm.js +31 -0
- package/dist/components/RightContent/ArticlesRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/AskRightContent.esm.js +16 -0
- package/dist/components/RightContent/AskRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/CollectionsRightContent.esm.js +12 -0
- package/dist/components/RightContent/CollectionsRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/DefaultRightContent.esm.js +27 -0
- package/dist/components/RightContent/DefaultRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/EntitiesRightContent.esm.js +12 -0
- package/dist/components/RightContent/EntitiesRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/EntityRightContent.esm.js +47 -0
- package/dist/components/RightContent/EntityRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/FavoriteRightContent.esm.js +9 -0
- package/dist/components/RightContent/FavoriteRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/HomeRightContent.esm.js +15 -0
- package/dist/components/RightContent/HomeRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/LinksRightContent.esm.js +31 -0
- package/dist/components/RightContent/LinksRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/QuestionsRightContent.esm.js +57 -0
- package/dist/components/RightContent/QuestionsRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/RightContent.esm.js +203 -0
- package/dist/components/RightContent/RightContent.esm.js.map +1 -0
- package/dist/components/RightContent/SimilarQuestions.esm.js +58 -0
- package/dist/components/RightContent/SimilarQuestions.esm.js.map +1 -0
- package/dist/components/RightContent/TagRightContent.esm.js +48 -0
- package/dist/components/RightContent/TagRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/TagsRightContent.esm.js +12 -0
- package/dist/components/RightContent/TagsRightContent.esm.js.map +1 -0
- package/dist/components/RightContent/UsersRightContent.esm.js +12 -0
- package/dist/components/RightContent/UsersRightContent.esm.js.map +1 -0
- package/dist/components/Statistics/GlobalStatsContent.esm.js +15 -9
- package/dist/components/Statistics/GlobalStatsContent.esm.js.map +1 -1
- package/dist/components/Statistics/StatisticsPage.esm.js +28 -11
- package/dist/components/Statistics/StatisticsPage.esm.js.map +1 -1
- package/dist/components/TagPage/TagPage.esm.js +75 -107
- package/dist/components/TagPage/TagPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserPage.esm.js +34 -22
- package/dist/components/UserPage/UserPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserStatsContent.esm.js +12 -9
- package/dist/components/UserPage/UserStatsContent.esm.js.map +1 -1
- package/dist/components/UsersPage/UsersPage.esm.js +12 -13
- package/dist/components/UsersPage/UsersPage.esm.js.map +1 -1
- package/dist/components/WritePage/WritePage.esm.js +2 -2
- package/dist/components/WritePage/WritePage.esm.js.map +1 -1
- package/dist/hooks/useSidebarSettings.esm.js +23 -0
- package/dist/hooks/useSidebarSettings.esm.js.map +1 -0
- package/dist/package.json.esm.js +1 -1
- package/package.json +3 -3
|
@@ -1,137 +1,124 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
|
-
import { ContentHeader } from '@backstage/core-components';
|
|
4
3
|
import { useParams } from 'react-router-dom';
|
|
5
|
-
import { qetaTranslationRef, qetaApiRef, EntityFollowButton, ButtonContainer, AskQuestionButton, WriteArticleButton, CreateLinkButton, PostsGrid, PostsContainer, EntitiesGrid, FollowedEntitiesList, PostHighlightList, PostHighlightListContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
6
|
-
import Whatshot from '@material-ui/icons/Whatshot';
|
|
7
|
-
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
|
8
|
-
import { EntityRefLink } from '@backstage/plugin-catalog-react';
|
|
9
|
-
import { Grid, Typography, Card, CardContent } from '@material-ui/core';
|
|
10
4
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
5
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
6
|
+
import { qetaTranslationRef, ContentHeader, AskQuestionButton, WriteArticleButton, CreateLinkButton, EntitiesGrid, useQetaApi, EntityFollowButton, ContentHeaderCard, PostsGrid, PostsContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
7
|
+
import { useEntityPresentation, catalogApiRef, EntityRefLink } from '@backstage/plugin-catalog-react';
|
|
8
|
+
import CategoryOutlined from '@material-ui/icons/CategoryOutlined';
|
|
9
|
+
import QuestionAnswerIcon from '@material-ui/icons/QuestionAnswer';
|
|
10
|
+
import PeopleIcon from '@material-ui/icons/People';
|
|
11
|
+
import { Skeleton } from '@material-ui/lab';
|
|
12
|
+
import { WarningPanel } from '@backstage/core-components';
|
|
11
13
|
|
|
12
|
-
const
|
|
13
|
-
const { entityRef } = useParams();
|
|
14
|
+
const SingleEntityPage = ({ entityRef }) => {
|
|
14
15
|
const { t } = useTranslationRef(qetaTranslationRef);
|
|
15
|
-
const [resp, setResp] = useState();
|
|
16
16
|
const [view, setView] = useState("list");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const [entity, setEntity] = useState(void 0);
|
|
18
|
+
const { Icon } = useEntityPresentation(entityRef);
|
|
19
|
+
const catalogApi = useApi(catalogApiRef);
|
|
19
20
|
useEffect(() => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
alertApi.post({
|
|
30
|
-
message: e.message,
|
|
31
|
-
severity: "error",
|
|
32
|
-
display: "transient"
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}, [qetaApi, entityRef, alertApi]);
|
|
36
|
-
let shownTitle = t("entitiesPage.defaultTitle");
|
|
37
|
-
let link = void 0;
|
|
38
|
-
if (entityRef) {
|
|
39
|
-
shownTitle = "";
|
|
40
|
-
link = /* @__PURE__ */ jsx(EntityRefLink, { entityRef });
|
|
21
|
+
catalogApi.getEntityByRef(entityRef).then((e) => setEntity(e));
|
|
22
|
+
}, [catalogApi, entityRef]);
|
|
23
|
+
const {
|
|
24
|
+
value: resp,
|
|
25
|
+
loading,
|
|
26
|
+
error
|
|
27
|
+
} = useQetaApi((api) => api.getEntity(entityRef), [entityRef]);
|
|
28
|
+
if (loading) {
|
|
29
|
+
return /* @__PURE__ */ jsx(Skeleton, { variant: "rect", height: 200 });
|
|
41
30
|
}
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */
|
|
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
|
-
entityRef && (view === "grid" ? /* @__PURE__ */ jsx(
|
|
79
|
-
PostsGrid,
|
|
80
|
-
{
|
|
81
|
-
entity: entityRef,
|
|
82
|
-
filterPanelProps: { showEntityFilter: false },
|
|
83
|
-
view,
|
|
84
|
-
onViewChange: setView
|
|
85
|
-
}
|
|
86
|
-
) : /* @__PURE__ */ jsx(
|
|
87
|
-
PostsContainer,
|
|
88
|
-
{
|
|
89
|
-
entity: entityRef,
|
|
90
|
-
filterPanelProps: { showEntityFilter: false },
|
|
91
|
-
view,
|
|
92
|
-
showTypeLabel: true,
|
|
93
|
-
onViewChange: setView
|
|
94
|
-
}
|
|
95
|
-
)),
|
|
96
|
-
!entityRef && /* @__PURE__ */ jsx(EntitiesGrid, {})
|
|
97
|
-
] }),
|
|
98
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, lg: 3, xl: 2, children: [
|
|
99
|
-
/* @__PURE__ */ jsx(FollowedEntitiesList, {}),
|
|
100
|
-
resp && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
101
|
-
/* @__PURE__ */ jsx(
|
|
102
|
-
PostHighlightList,
|
|
103
|
-
{
|
|
104
|
-
type: "hot",
|
|
105
|
-
title: t("highlights.hotQuestions.title"),
|
|
106
|
-
noQuestionsLabel: t("highlights.hotQuestions.noQuestionsLabel"),
|
|
107
|
-
icon: /* @__PURE__ */ jsx(Whatshot, { fontSize: "small" }),
|
|
108
|
-
options: { entities: [resp.entityRef] },
|
|
109
|
-
postType: "question"
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
/* @__PURE__ */ jsx(
|
|
113
|
-
PostHighlightList,
|
|
31
|
+
if (error || !resp) {
|
|
32
|
+
return /* @__PURE__ */ jsx(WarningPanel, { severity: "error", title: t("questionPage.errorLoading"), children: error?.message });
|
|
33
|
+
}
|
|
34
|
+
const title = /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
EntityRefLink,
|
|
37
|
+
{
|
|
38
|
+
entityRef: resp.entityRef,
|
|
39
|
+
defaultKind: "Component",
|
|
40
|
+
hideIcon: true
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { style: { marginLeft: "0.5em", display: "flex" }, children: /* @__PURE__ */ jsx(EntityFollowButton, { entityRef: resp.entityRef }) })
|
|
44
|
+
] });
|
|
45
|
+
const description = `${entity?.kind} ${entity?.spec?.type ? `(${entity?.spec?.type})` : ""}`;
|
|
46
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
+
/* @__PURE__ */ jsxs(
|
|
48
|
+
ContentHeader,
|
|
49
|
+
{
|
|
50
|
+
title,
|
|
51
|
+
titleIcon: /* @__PURE__ */ jsx(CategoryOutlined, { fontSize: "large" }),
|
|
52
|
+
description,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsx(AskQuestionButton, { entity: resp.entityRef }),
|
|
55
|
+
/* @__PURE__ */ jsx(WriteArticleButton, { entity: resp.entityRef }),
|
|
56
|
+
/* @__PURE__ */ jsx(CreateLinkButton, { entity: resp.entityRef })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
resp && /* @__PURE__ */ jsx(
|
|
61
|
+
ContentHeaderCard,
|
|
62
|
+
{
|
|
63
|
+
description: entity?.metadata?.description,
|
|
64
|
+
imageIcon: Icon ? /* @__PURE__ */ jsx("div", { style: { fontSize: "80px", display: "flex" }, children: /* @__PURE__ */ jsx(Icon, { fontSize: "inherit" }) }) : /* @__PURE__ */ jsx(CategoryOutlined, { style: { fontSize: 80 } }),
|
|
65
|
+
stats: [
|
|
114
66
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
/* @__PURE__ */ jsx(
|
|
123
|
-
PostHighlightList,
|
|
67
|
+
label: t("common.postsLabel", {
|
|
68
|
+
count: resp.postsCount,
|
|
69
|
+
itemType: "post"
|
|
70
|
+
}),
|
|
71
|
+
value: resp.postsCount,
|
|
72
|
+
icon: /* @__PURE__ */ jsx(QuestionAnswerIcon, { fontSize: "small" })
|
|
73
|
+
},
|
|
124
74
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
options: { entities: [resp.entityRef] },
|
|
129
|
-
postType: "question"
|
|
75
|
+
label: t("common.followersLabel", { count: resp.followerCount }),
|
|
76
|
+
value: resp.followerCount,
|
|
77
|
+
icon: /* @__PURE__ */ jsx(PeopleIcon, { fontSize: "small" })
|
|
130
78
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
view === "grid" ? /* @__PURE__ */ jsx(
|
|
83
|
+
PostsGrid,
|
|
84
|
+
{
|
|
85
|
+
entity: entityRef,
|
|
86
|
+
filterPanelProps: { showEntityFilter: false },
|
|
87
|
+
view,
|
|
88
|
+
onViewChange: setView
|
|
89
|
+
}
|
|
90
|
+
) : /* @__PURE__ */ jsx(
|
|
91
|
+
PostsContainer,
|
|
92
|
+
{
|
|
93
|
+
entity: entityRef,
|
|
94
|
+
filterPanelProps: { showEntityFilter: false },
|
|
95
|
+
view,
|
|
96
|
+
showTypeLabel: true,
|
|
97
|
+
onViewChange: setView
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] });
|
|
101
|
+
};
|
|
102
|
+
const EntityPage = () => {
|
|
103
|
+
const { entityRef } = useParams();
|
|
104
|
+
const { t } = useTranslationRef(qetaTranslationRef);
|
|
105
|
+
if (entityRef) {
|
|
106
|
+
return /* @__PURE__ */ jsx(SingleEntityPage, { entityRef });
|
|
107
|
+
}
|
|
108
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
109
|
+
/* @__PURE__ */ jsxs(
|
|
110
|
+
ContentHeader,
|
|
111
|
+
{
|
|
112
|
+
title: t("entitiesPage.defaultTitle"),
|
|
113
|
+
titleIcon: /* @__PURE__ */ jsx(CategoryOutlined, { fontSize: "large" }),
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsx(AskQuestionButton, {}),
|
|
116
|
+
/* @__PURE__ */ jsx(WriteArticleButton, {}),
|
|
117
|
+
/* @__PURE__ */ jsx(CreateLinkButton, {})
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsx(EntitiesGrid, {})
|
|
135
122
|
] });
|
|
136
123
|
};
|
|
137
124
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPage.esm.js","sources":["../../../src/components/EntityPage/EntityPage.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"EntityPage.esm.js","sources":["../../../src/components/EntityPage/EntityPage.tsx"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n AskQuestionButton,\n CreateLinkButton,\n EntitiesGrid,\n EntityFollowButton,\n PostsContainer,\n PostsGrid,\n qetaTranslationRef,\n useQetaApi,\n ViewType,\n WriteArticleButton,\n ContentHeaderCard,\n ContentHeader,\n} from '@drodil/backstage-plugin-qeta-react';\nimport {\n EntityRefLink,\n useEntityPresentation,\n catalogApiRef,\n} from '@backstage/plugin-catalog-react';\nimport CategoryOutlined from '@material-ui/icons/CategoryOutlined';\nimport QuestionAnswerIcon from '@material-ui/icons/QuestionAnswer';\nimport PeopleIcon from '@material-ui/icons/People';\nimport { Skeleton } from '@material-ui/lab';\nimport { WarningPanel } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\n\nconst SingleEntityPage = ({ entityRef }: { entityRef: string }) => {\n const { t } = useTranslationRef(qetaTranslationRef);\n const [view, setView] = useState<ViewType>('list');\n const [entity, setEntity] = useState<Entity | undefined>(undefined);\n const { Icon } = useEntityPresentation(entityRef);\n const catalogApi = useApi(catalogApiRef);\n\n useEffect(() => {\n catalogApi.getEntityByRef(entityRef).then(e => setEntity(e));\n }, [catalogApi, entityRef]);\n\n const {\n value: resp,\n loading,\n error,\n } = useQetaApi(api => api.getEntity(entityRef), [entityRef]);\n\n if (loading) {\n return <Skeleton variant=\"rect\" height={200} />;\n }\n\n if (error || !resp) {\n return (\n <WarningPanel severity=\"error\" title={t('questionPage.errorLoading')}>\n {error?.message}\n </WarningPanel>\n );\n }\n\n const title = (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <EntityRefLink\n entityRef={resp.entityRef}\n defaultKind=\"Component\"\n hideIcon\n />\n <span style={{ marginLeft: '0.5em', display: 'flex' }}>\n <EntityFollowButton entityRef={resp.entityRef} />\n </span>\n </div>\n );\n\n const description = `${entity?.kind} ${\n entity?.spec?.type ? `(${entity?.spec?.type})` : ''\n }`;\n\n return (\n <>\n <ContentHeader\n title={title}\n titleIcon={<CategoryOutlined fontSize=\"large\" />}\n description={description}\n >\n <AskQuestionButton entity={resp.entityRef} />\n <WriteArticleButton entity={resp.entityRef} />\n <CreateLinkButton entity={resp.entityRef} />\n </ContentHeader>\n {resp && (\n <ContentHeaderCard\n description={entity?.metadata?.description}\n imageIcon={\n Icon ? (\n <div style={{ fontSize: '80px', display: 'flex' }}>\n <Icon fontSize=\"inherit\" />\n </div>\n ) : (\n <CategoryOutlined style={{ fontSize: 80 }} />\n )\n }\n stats={[\n {\n label: t('common.postsLabel', {\n count: resp.postsCount,\n itemType: 'post',\n }),\n value: resp.postsCount,\n icon: <QuestionAnswerIcon fontSize=\"small\" />,\n },\n {\n label: t('common.followersLabel', { count: resp.followerCount }),\n value: resp.followerCount,\n icon: <PeopleIcon fontSize=\"small\" />,\n },\n ]}\n />\n )}\n {view === 'grid' ? (\n <PostsGrid\n entity={entityRef}\n filterPanelProps={{ showEntityFilter: false }}\n view={view}\n onViewChange={setView}\n />\n ) : (\n <PostsContainer\n entity={entityRef}\n filterPanelProps={{ showEntityFilter: false }}\n view={view}\n showTypeLabel\n onViewChange={setView}\n />\n )}\n </>\n );\n};\n\nexport const EntityPage = () => {\n const { entityRef } = useParams();\n const { t } = useTranslationRef(qetaTranslationRef);\n\n if (entityRef) {\n return <SingleEntityPage entityRef={entityRef} />;\n }\n\n return (\n <>\n <ContentHeader\n title={t('entitiesPage.defaultTitle')}\n titleIcon={<CategoryOutlined fontSize=\"large\" />}\n >\n <AskQuestionButton />\n <WriteArticleButton />\n <CreateLinkButton />\n </ContentHeader>\n <EntitiesGrid />\n </>\n );\n};\n"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { QetaProvider, PostsContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
4
4
|
import { Content } from '@backstage/core-components';
|
|
5
5
|
import { isUserEntity, stringifyEntityRef } from '@backstage/catalog-model';
|
|
6
6
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
@@ -16,7 +16,7 @@ const EntityPostsContent = (props) => {
|
|
|
16
16
|
additionalProps.entity = props.entity ?? stringifyEntityRef(entity);
|
|
17
17
|
}
|
|
18
18
|
return /* @__PURE__ */ jsx(
|
|
19
|
-
|
|
19
|
+
QetaProvider,
|
|
20
20
|
{
|
|
21
21
|
remarkPlugins: props.remarkPlugins,
|
|
22
22
|
rehypePlugins: props.rehypePlugins,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPostsContent.esm.js","sources":["../../../src/components/EntityPostsContent/EntityPostsContent.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n PostsContainer,\n PostsContainerProps,\n
|
|
1
|
+
{"version":3,"file":"EntityPostsContent.esm.js","sources":["../../../src/components/EntityPostsContent/EntityPostsContent.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n PostsContainer,\n PostsContainerProps,\n QetaProvider,\n ViewType,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Content } from '@backstage/core-components';\nimport { isUserEntity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { Container } from '@material-ui/core';\nimport { PluggableList } from 'unified';\n\nexport type EntityPostsContentProps = PostsContainerProps & {\n remarkPlugins?: PluggableList;\n rehypePlugins?: PluggableList;\n};\n\nexport const EntityPostsContent = (props: EntityPostsContentProps) => {\n const [view, setView] = useState<ViewType>('list');\n const { entity } = useEntity();\n const additionalProps: PostsContainerProps = {};\n if (isUserEntity(entity)) {\n additionalProps.author = stringifyEntityRef(entity);\n } else {\n additionalProps.entity = props.entity ?? stringifyEntityRef(entity);\n }\n\n return (\n <QetaProvider\n remarkPlugins={props.remarkPlugins}\n rehypePlugins={props.rehypePlugins}\n >\n <Content>\n <Container>\n <PostsContainer\n {...props}\n {...additionalProps}\n view={view}\n onViewChange={setView}\n />\n </Container>\n </Content>\n </QetaProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAkBa,MAAA,kBAAA,GAAqB,CAAC,KAAmC,KAAA;AACpE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAmB,MAAM,CAAA;AACjD,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,kBAAuC,EAAC;AAC9C,EAAI,IAAA,YAAA,CAAa,MAAM,CAAG,EAAA;AACxB,IAAgB,eAAA,CAAA,MAAA,GAAS,mBAAmB,MAAM,CAAA;AAAA,GAC7C,MAAA;AACL,IAAA,eAAA,CAAgB,MAAS,GAAA,KAAA,CAAM,MAAU,IAAA,kBAAA,CAAmB,MAAM,CAAA;AAAA;AAGpE,EACE,uBAAA,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,eAAe,KAAM,CAAA,aAAA;AAAA,MACrB,eAAe,KAAM,CAAA,aAAA;AAAA,MAErB,QAAA,kBAAA,GAAA,CAAC,OACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,SACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UACE,GAAG,KAAA;AAAA,UACH,GAAG,eAAA;AAAA,UACJ,IAAA;AAAA,UACA,YAAc,EAAA;AAAA;AAAA,SAElB,CACF,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { ContentHeader } from '@backstage
|
|
3
|
-
import
|
|
4
|
-
import { Grid } from '@material-ui/core';
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { qetaTranslationRef, ContentHeader, AskQuestionButton, WriteArticleButton, CreateLinkButton, PostsGrid, PostsContainer } from '@drodil/backstage-plugin-qeta-react';
|
|
3
|
+
import StarBorder from '@material-ui/icons/StarBorder';
|
|
5
4
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
6
5
|
import { useState } from 'react';
|
|
7
6
|
|
|
8
7
|
const FavoritePage = () => {
|
|
9
8
|
const [view, setView] = useState("list");
|
|
10
9
|
const { t } = useTranslationRef(qetaTranslationRef);
|
|
11
|
-
return /* @__PURE__ */ jsxs(
|
|
12
|
-
/* @__PURE__ */ jsxs(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/* @__PURE__ */ jsx(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
10
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
|
+
/* @__PURE__ */ jsxs(
|
|
12
|
+
ContentHeader,
|
|
13
|
+
{
|
|
14
|
+
title: t("favoritePage.title"),
|
|
15
|
+
titleIcon: /* @__PURE__ */ jsx(StarBorder, { fontSize: "large" }),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx(AskQuestionButton, {}),
|
|
18
|
+
/* @__PURE__ */ jsx(WriteArticleButton, {}),
|
|
19
|
+
/* @__PURE__ */ jsx(CreateLinkButton, {})
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
view === "grid" ? /* @__PURE__ */ jsx(
|
|
24
|
+
PostsGrid,
|
|
25
|
+
{
|
|
26
|
+
favorite: true,
|
|
27
|
+
showNoQuestionsBtn: false,
|
|
28
|
+
view,
|
|
29
|
+
onViewChange: setView
|
|
30
|
+
}
|
|
31
|
+
) : /* @__PURE__ */ jsx(
|
|
32
|
+
PostsContainer,
|
|
33
|
+
{
|
|
34
|
+
favorite: true,
|
|
35
|
+
showNoQuestionsBtn: false,
|
|
36
|
+
showTypeLabel: true,
|
|
37
|
+
view,
|
|
38
|
+
onViewChange: setView
|
|
39
|
+
}
|
|
40
|
+
)
|
|
38
41
|
] });
|
|
39
42
|
};
|
|
40
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritePage.esm.js","sources":["../../../src/components/FavoritePage/FavoritePage.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"FavoritePage.esm.js","sources":["../../../src/components/FavoritePage/FavoritePage.tsx"],"sourcesContent":["import {\n AskQuestionButton,\n ContentHeader,\n CreateLinkButton,\n PostsContainer,\n PostsGrid,\n qetaTranslationRef,\n ViewType,\n WriteArticleButton,\n} from '@drodil/backstage-plugin-qeta-react';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { useState } from 'react';\n\nexport const FavoritePage = () => {\n const [view, setView] = useState<ViewType>('list');\n const { t } = useTranslationRef(qetaTranslationRef);\n\n return (\n <>\n <ContentHeader\n title={t('favoritePage.title')}\n titleIcon={<StarBorder fontSize=\"large\" />}\n >\n <AskQuestionButton />\n <WriteArticleButton />\n <CreateLinkButton />\n </ContentHeader>\n {view === 'grid' ? (\n <PostsGrid\n favorite\n showNoQuestionsBtn={false}\n view={view}\n onViewChange={setView}\n />\n ) : (\n <PostsContainer\n favorite\n showNoQuestionsBtn={false}\n showTypeLabel\n view={view}\n onViewChange={setView}\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AAcO,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAmB,MAAM,CAAA;AACjD,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,kBAAkB,CAAA;AAElD,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,IAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,oBAAoB,CAAA;AAAA,QAC7B,SAAW,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,QAExC,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,iBAAkB,EAAA,EAAA,CAAA;AAAA,8BAClB,kBAAmB,EAAA,EAAA,CAAA;AAAA,8BACnB,gBAAiB,EAAA,EAAA;AAAA;AAAA;AAAA,KACpB;AAAA,IACC,SAAS,MACR,mBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,QAAQ,EAAA,IAAA;AAAA,QACR,kBAAoB,EAAA,KAAA;AAAA,QACpB,IAAA;AAAA,QACA,YAAc,EAAA;AAAA;AAAA,KAGhB,mBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,QAAQ,EAAA,IAAA;AAAA,QACR,kBAAoB,EAAA,KAAA;AAAA,QACpB,aAAa,EAAA,IAAA;AAAA,QACb,IAAA;AAAA,QACA,YAAc,EAAA;AAAA;AAAA;AAChB,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { ContentHeader } from '@backstage
|
|
3
|
-
import { qetaTranslationRef, useIdentityApi, ButtonContainer, AskQuestionButton, WriteArticleButton, CreateLinkButton, SuggestionsCard, PostsCard, ImpactCard, FollowedTagsList, FollowedEntitiesList, FollowedCollectionsList } from '@drodil/backstage-plugin-qeta-react';
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { qetaTranslationRef, useIdentityApi, ContentHeader, AskQuestionButton, WriteArticleButton, CreateLinkButton, SuggestionsCard, PostsCard } from '@drodil/backstage-plugin-qeta-react';
|
|
4
3
|
import { Grid } from '@material-ui/core';
|
|
5
4
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
5
|
+
import HomeOutlined from '@material-ui/icons/HomeOutlined';
|
|
6
6
|
|
|
7
7
|
const HomePage = () => {
|
|
8
8
|
const { t } = useTranslationRef(qetaTranslationRef);
|
|
@@ -11,38 +11,37 @@ const HomePage = () => {
|
|
|
11
11
|
loading: loadingUser,
|
|
12
12
|
error: userError
|
|
13
13
|
} = useIdentityApi((api) => api.getBackstageIdentity(), []);
|
|
14
|
-
return /* @__PURE__ */ jsxs(
|
|
15
|
-
/* @__PURE__ */ jsxs(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */ jsx(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */ jsx(FollowedCollectionsList, {})
|
|
14
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
|
+
/* @__PURE__ */ jsxs(
|
|
16
|
+
ContentHeader,
|
|
17
|
+
{
|
|
18
|
+
title: t("homePage.title"),
|
|
19
|
+
titleIcon: /* @__PURE__ */ jsx(HomeOutlined, { fontSize: "large" }),
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx(AskQuestionButton, {}),
|
|
22
|
+
/* @__PURE__ */ jsx(WriteArticleButton, {}),
|
|
23
|
+
/* @__PURE__ */ jsx(CreateLinkButton, {})
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, children: [
|
|
28
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(SuggestionsCard, {}) }),
|
|
29
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
30
|
+
PostsCard,
|
|
31
|
+
{
|
|
32
|
+
title: t("highlights.unanswered.title"),
|
|
33
|
+
options: { noAnswers: true, random: true, type: "question" },
|
|
34
|
+
postType: "question"
|
|
35
|
+
}
|
|
36
|
+
) }),
|
|
37
|
+
user && !loadingUser && !userError && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
38
|
+
PostsCard,
|
|
39
|
+
{
|
|
40
|
+
title: t("highlights.own.title"),
|
|
41
|
+
options: { author: user.userEntityRef },
|
|
42
|
+
postType: "question"
|
|
43
|
+
}
|
|
44
|
+
) })
|
|
46
45
|
] })
|
|
47
46
|
] });
|
|
48
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.esm.js","sources":["../../../src/components/HomePage/HomePage.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"HomePage.esm.js","sources":["../../../src/components/HomePage/HomePage.tsx"],"sourcesContent":["import {\n AskQuestionButton,\n ContentHeader,\n CreateLinkButton,\n PostsCard,\n qetaTranslationRef,\n SuggestionsCard,\n useIdentityApi,\n WriteArticleButton,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { Grid } from '@material-ui/core';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport HomeOutlined from '@material-ui/icons/HomeOutlined';\n\nexport const HomePage = () => {\n const { t } = useTranslationRef(qetaTranslationRef);\n const {\n value: user,\n loading: loadingUser,\n error: userError,\n } = useIdentityApi(api => api.getBackstageIdentity(), []);\n\n return (\n <>\n <ContentHeader\n title={t('homePage.title')}\n titleIcon={<HomeOutlined fontSize=\"large\" />}\n >\n <AskQuestionButton />\n <WriteArticleButton />\n <CreateLinkButton />\n </ContentHeader>\n <Grid container>\n <Grid item xs={12}>\n <SuggestionsCard />\n </Grid>\n <Grid item xs={12}>\n <PostsCard\n title={t('highlights.unanswered.title')}\n options={{ noAnswers: true, random: true, type: 'question' }}\n postType=\"question\"\n />\n </Grid>\n {user && !loadingUser && !userError && (\n <Grid item xs={12}>\n <PostsCard\n title={t('highlights.own.title')}\n options={{ author: user.userEntityRef }}\n postType=\"question\"\n />\n </Grid>\n )}\n </Grid>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AAcO,MAAM,WAAW,MAAM;AAC5B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,kBAAkB,CAAA;AAClD,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,IAAA;AAAA,IACP,OAAS,EAAA,WAAA;AAAA,IACT,KAAO,EAAA;AAAA,MACL,cAAe,CAAA,CAAA,GAAA,KAAO,IAAI,oBAAqB,EAAA,EAAG,EAAE,CAAA;AAExD,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,IAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,gBAAgB,CAAA;AAAA,QACzB,SAAW,kBAAA,GAAA,CAAC,YAAa,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,QAE1C,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,iBAAkB,EAAA,EAAA,CAAA;AAAA,8BAClB,kBAAmB,EAAA,EAAA,CAAA;AAAA,8BACnB,gBAAiB,EAAA,EAAA;AAAA;AAAA;AAAA,KACpB;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,mBAAgB,CACnB,EAAA,CAAA;AAAA,sBACC,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EACb,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,UACtC,SAAS,EAAE,SAAA,EAAW,MAAM,MAAQ,EAAA,IAAA,EAAM,MAAM,UAAW,EAAA;AAAA,UAC3D,QAAS,EAAA;AAAA;AAAA,OAEb,EAAA,CAAA;AAAA,MACC,IAAA,IAAQ,CAAC,WAAA,IAAe,CAAC,SAAA,wBACvB,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,EACb,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,EAAE,sBAAsB,CAAA;AAAA,UAC/B,OAAS,EAAA,EAAE,MAAQ,EAAA,IAAA,CAAK,aAAc,EAAA;AAAA,UACtC,QAAS,EAAA;AAAA;AAAA,OAEb,EAAA;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -2,11 +2,11 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useParams } from 'react-router-dom';
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import { useSignal } from '@backstage/plugin-signals-react';
|
|
5
|
-
import { WarningPanel
|
|
6
|
-
import { qetaApiRef, qetaTranslationRef, useQetaApi,
|
|
5
|
+
import { WarningPanel } from '@backstage/core-components';
|
|
6
|
+
import { qetaApiRef, qetaTranslationRef, useQetaApi, ContentHeader, FaviconItem, CreateLinkButton, AddToCollectionButton, DraftBanner, DeletedBanner, LinkCard, RelativeTimeWithTooltip, UpdatedByLink } from '@drodil/backstage-plugin-qeta-react';
|
|
7
7
|
import { Skeleton } from '@material-ui/lab';
|
|
8
8
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
9
|
-
import { makeStyles, Box
|
|
9
|
+
import { makeStyles, Box } from '@material-ui/core';
|
|
10
10
|
import { useApi } from '@backstage/core-plugin-api';
|
|
11
11
|
|
|
12
12
|
const useDescriptionStyles = makeStyles(
|
|
@@ -71,33 +71,30 @@ const LinkPage = () => {
|
|
|
71
71
|
] });
|
|
72
72
|
};
|
|
73
73
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ jsxs(
|
|
75
75
|
ContentHeader,
|
|
76
76
|
{
|
|
77
|
-
title: post.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
) })
|
|
95
|
-
] }) : post.title,
|
|
77
|
+
title: post.url ? /* @__PURE__ */ jsx(
|
|
78
|
+
"a",
|
|
79
|
+
{
|
|
80
|
+
href: post.url,
|
|
81
|
+
target: "_blank",
|
|
82
|
+
rel: "noopener noreferrer",
|
|
83
|
+
style: { color: "inherit", textDecoration: "none" },
|
|
84
|
+
"data-testid": "link-title",
|
|
85
|
+
onClick: (event) => {
|
|
86
|
+
event.stopPropagation();
|
|
87
|
+
qetaApi.clickLink(post.id);
|
|
88
|
+
},
|
|
89
|
+
children: post.title
|
|
90
|
+
}
|
|
91
|
+
) : post.title,
|
|
92
|
+
titleIcon: post.url ? /* @__PURE__ */ jsx(FaviconItem, { entity: post }) : void 0,
|
|
96
93
|
description: getDescription(post),
|
|
97
|
-
children:
|
|
94
|
+
children: [
|
|
98
95
|
/* @__PURE__ */ jsx(CreateLinkButton, {}),
|
|
99
96
|
/* @__PURE__ */ jsx(AddToCollectionButton, { post })
|
|
100
|
-
]
|
|
97
|
+
]
|
|
101
98
|
}
|
|
102
99
|
),
|
|
103
100
|
post.status === "draft" && /* @__PURE__ */ jsx(DraftBanner, {}),
|