@drodil/backstage-plugin-qeta 1.11.0 → 1.12.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/esm/{index-4867abd8.esm.js → index-44c96bf9.esm.js} +3 -3
- package/dist/esm/index-44c96bf9.esm.js.map +1 -0
- package/dist/esm/{index-8cc27392.esm.js → index-600a4b78.esm.js} +162 -117
- package/dist/esm/index-600a4b78.esm.js.map +1 -0
- package/dist/esm/{index-6bfa5b72.esm.js → index-d0c348c4.esm.js} +107 -34
- package/dist/esm/index-d0c348c4.esm.js.map +1 -0
- package/dist/index.esm.js +2 -2
- package/package.json +2 -2
- package/dist/esm/index-4867abd8.esm.js.map +0 -1
- package/dist/esm/index-6bfa5b72.esm.js.map +0 -1
- package/dist/esm/index-8cc27392.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as Content, g as QuestionsTable } from './index-
|
|
1
|
+
export { C as Content, g as QuestionsTable } from './index-d0c348c4.esm.js';
|
|
2
2
|
import '@backstage/core-plugin-api';
|
|
3
3
|
import '@backstage/plugin-home';
|
|
4
4
|
import '@backstage/errors';
|
|
@@ -25,7 +25,7 @@ import 'react-mde/lib/styles/css/react-mde-editor.css';
|
|
|
25
25
|
import 'react-mde/lib/styles/css/react-mde-toolbar.css';
|
|
26
26
|
import 'file-type';
|
|
27
27
|
import '@material-ui/icons/Refresh';
|
|
28
|
-
import '@material-ui/icons/HomeOutlined';
|
|
29
28
|
import '@backstage/plugin-permission-react';
|
|
30
29
|
import '@drodil/backstage-plugin-qeta-common';
|
|
31
|
-
|
|
30
|
+
import '@material-ui/icons/HomeOutlined';
|
|
31
|
+
//# sourceMappingURL=index-44c96bf9.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-44c96bf9.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { Grid, useTheme, Tooltip, IconButton, Typography, Box, Modal, Backdrop, Button, Avatar, Divider, TextField, Card, CardContent, Container, Chip, List, ListSubheader, ListItem, ListItemText, Menu, MenuItem, ListItemIcon } from '@material-ui/core';
|
|
3
|
-
import { Content, ContentHeader,
|
|
3
|
+
import { Content, ContentHeader, InfoCard, Link, MarkdownContent, WarningPanel, Progress, Page, Header } from '@backstage/core-components';
|
|
4
4
|
import { useParams, useNavigate, Routes, Route } from 'react-router-dom';
|
|
5
|
-
import { A as AskForm, q as qetaApiRef, u as useBasePath, a as useStyles, f as formatEntityName, T as TagsAndEntities, M as MarkdownEditor, b as useQetaApi, c as AskQuestionButton, Q as QuestionsContainer, S as StatisticsPage, d as useIdentityApi, e as TrophyIcon } from './index-
|
|
6
|
-
import HomeOutlined from '@material-ui/icons/HomeOutlined';
|
|
5
|
+
import { B as BackToQuestionsButton, A as AskForm, q as qetaApiRef, u as useBasePath, a as useStyles, f as formatEntityName, T as TagsAndEntities, M as MarkdownEditor, b as useQetaApi, c as AskQuestionButton, Q as QuestionsContainer, S as StatisticsPage, d as useIdentityApi, e as TrophyIcon } from './index-d0c348c4.esm.js';
|
|
7
6
|
import ArrowDownward from '@material-ui/icons/ArrowDownward';
|
|
8
7
|
import ArrowUpward from '@material-ui/icons/ArrowUpward';
|
|
9
8
|
import Check from '@material-ui/icons/Check';
|
|
@@ -39,10 +38,11 @@ import 'react-mde/lib/styles/css/react-mde-editor.css';
|
|
|
39
38
|
import 'react-mde/lib/styles/css/react-mde-toolbar.css';
|
|
40
39
|
import 'file-type';
|
|
41
40
|
import '@material-ui/icons/Refresh';
|
|
41
|
+
import '@material-ui/icons/HomeOutlined';
|
|
42
42
|
|
|
43
43
|
const AskPage = () => {
|
|
44
44
|
const { id } = useParams();
|
|
45
|
-
return /* @__PURE__ */ React.createElement(Content,
|
|
45
|
+
return /* @__PURE__ */ React.createElement(Content, { className: "qetaAskPage" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: id ? "Edit question" : "Ask question" }, /* @__PURE__ */ React.createElement(BackToQuestionsButton, null)), /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(InfoCard, null, /* @__PURE__ */ React.createElement(AskForm, { id })))));
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const VoteButtons = (props) => {
|
|
@@ -121,6 +121,7 @@ const VoteButtons = (props) => {
|
|
|
121
121
|
{
|
|
122
122
|
"aria-label": "vote up",
|
|
123
123
|
color: ownVote > 0 ? "primary" : "default",
|
|
124
|
+
className: ownVote > 0 ? "qetaVoteUpSelected" : "qetaVoteUp",
|
|
124
125
|
disabled: own,
|
|
125
126
|
size: "small",
|
|
126
127
|
onClick: voteUp
|
|
@@ -131,6 +132,7 @@ const VoteButtons = (props) => {
|
|
|
131
132
|
{
|
|
132
133
|
"aria-label": "vote down",
|
|
133
134
|
color: ownVote < 0 ? "primary" : "default",
|
|
135
|
+
className: ownVote < 0 ? "qetaVoteDownSelected" : "qetaVoteDown",
|
|
134
136
|
disabled: own,
|
|
135
137
|
size: "small",
|
|
136
138
|
onClick: voteDown
|
|
@@ -146,6 +148,7 @@ const VoteButtons = (props) => {
|
|
|
146
148
|
/* @__PURE__ */ React.createElement(
|
|
147
149
|
Check,
|
|
148
150
|
{
|
|
151
|
+
className: correct ? "qetaCorrectAnswerSelected" : "qetaCorrectAnswer",
|
|
149
152
|
style: {
|
|
150
153
|
color: correct ? theme.palette.success.main : void 0
|
|
151
154
|
}
|
|
@@ -189,6 +192,7 @@ const DeleteModal = (props) => {
|
|
|
189
192
|
{
|
|
190
193
|
open,
|
|
191
194
|
onClose,
|
|
195
|
+
className: "qetaDeleteModal",
|
|
192
196
|
"aria-labelledby": "modal-modal-title",
|
|
193
197
|
"aria-describedby": "modal-modal-description",
|
|
194
198
|
closeAfterTransition: true,
|
|
@@ -197,7 +201,25 @@ const DeleteModal = (props) => {
|
|
|
197
201
|
timeout: 500
|
|
198
202
|
}
|
|
199
203
|
},
|
|
200
|
-
/* @__PURE__ */ React.createElement(Box, { className: styles.deleteModal }, error && /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, "Failed to delete"), /* @__PURE__ */ React.createElement(
|
|
204
|
+
/* @__PURE__ */ React.createElement(Box, { className: `qetaDeleteModalContent ${styles.deleteModal}` }, error && /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, "Failed to delete"), /* @__PURE__ */ React.createElement(
|
|
205
|
+
Typography,
|
|
206
|
+
{
|
|
207
|
+
id: "modal-modal-title",
|
|
208
|
+
className: "qetaDeleteModalTitle",
|
|
209
|
+
variant: "h6",
|
|
210
|
+
component: "h2"
|
|
211
|
+
},
|
|
212
|
+
title
|
|
213
|
+
), /* @__PURE__ */ React.createElement(
|
|
214
|
+
Button,
|
|
215
|
+
{
|
|
216
|
+
onClick: handleDelete,
|
|
217
|
+
className: "qetaDeleteModalDeleteBtn",
|
|
218
|
+
startIcon: /* @__PURE__ */ React.createElement(Delete, null),
|
|
219
|
+
color: "secondary"
|
|
220
|
+
},
|
|
221
|
+
"Delete"
|
|
222
|
+
), /* @__PURE__ */ React.createElement(Button, { onClick: onClose, className: "qetaDeleteModalCancelBtn" }, "Cancel"))
|
|
201
223
|
);
|
|
202
224
|
};
|
|
203
225
|
|
|
@@ -219,7 +241,8 @@ const FavoriteButton = (props) => {
|
|
|
219
241
|
{
|
|
220
242
|
"aria-label": "unfavorite",
|
|
221
243
|
size: "small",
|
|
222
|
-
onClick: unfavoriteQuestion
|
|
244
|
+
onClick: unfavoriteQuestion,
|
|
245
|
+
className: "qetaUnfavoriteBtn"
|
|
223
246
|
},
|
|
224
247
|
/* @__PURE__ */ React.createElement(StarIcon, null)
|
|
225
248
|
)) : /* @__PURE__ */ React.createElement(Tooltip, { title: "Mark this question as favorite" }, /* @__PURE__ */ React.createElement(
|
|
@@ -227,7 +250,8 @@ const FavoriteButton = (props) => {
|
|
|
227
250
|
{
|
|
228
251
|
"aria-label": "favorite",
|
|
229
252
|
size: "small",
|
|
230
|
-
onClick: favoriteQuestion
|
|
253
|
+
onClick: favoriteQuestion,
|
|
254
|
+
className: "qetaFavoriteBtn"
|
|
231
255
|
},
|
|
232
256
|
/* @__PURE__ */ React.createElement(StarOutlineIcon, null)
|
|
233
257
|
)));
|
|
@@ -244,16 +268,16 @@ const AuthorBox = (props) => {
|
|
|
244
268
|
}, [catalogApi, entity]);
|
|
245
269
|
const name = formatEntityName(entity.author);
|
|
246
270
|
const initials = (name != null ? name : "").split(" ").map((p) => p[0]).join("").substring(0, 2).toUpperCase();
|
|
247
|
-
return /* @__PURE__ */ React.createElement(Box, { className: styles.questionCardAuthor }, /* @__PURE__ */ React.createElement(Grid, { container: true, alignItems: "center" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, style: { paddingBottom: 0 } }, /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, "Posted ", /* @__PURE__ */ React.createElement(RelativeTime, { value: entity.created }))), entity.updated && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, style: { paddingBottom: 0, paddingTop: 0 } }, /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, "Updated ", /* @__PURE__ */ React.createElement(RelativeTime, { value: entity.updated }))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 2 }, /* @__PURE__ */ React.createElement(
|
|
271
|
+
return /* @__PURE__ */ React.createElement(Box, { className: `qetaAuthorBox ${styles.questionCardAuthor}` }, /* @__PURE__ */ React.createElement(Grid, { container: true, alignItems: "center" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, style: { paddingBottom: 0 } }, /* @__PURE__ */ React.createElement(Typography, { className: "qetaAuthorBoxCreated", variant: "caption" }, "Posted ", /* @__PURE__ */ React.createElement(RelativeTime, { value: entity.created }))), entity.updated && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, style: { paddingBottom: 0, paddingTop: 0 } }, /* @__PURE__ */ React.createElement(Typography, { className: "qetaAuthorBoxUpdated", variant: "caption" }, "Updated ", /* @__PURE__ */ React.createElement(RelativeTime, { value: entity.updated }))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 2 }, /* @__PURE__ */ React.createElement(
|
|
248
272
|
Avatar,
|
|
249
273
|
{
|
|
250
274
|
src: (_a = user == null ? void 0 : user.spec.profile) == null ? void 0 : _a.picture,
|
|
251
|
-
className: "avatar",
|
|
275
|
+
className: "qetaAuthorBoxAvatar avatar",
|
|
252
276
|
alt: name,
|
|
253
277
|
variant: "rounded"
|
|
254
278
|
},
|
|
255
279
|
initials
|
|
256
|
-
)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 10, className: styles.authorLink }, /* @__PURE__ */ React.createElement(Link, { to: `/qeta/users/${entity.author}` }, name))));
|
|
280
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 10, className: styles.authorLink }, /* @__PURE__ */ React.createElement(Link, { className: "qetaUserBtn", to: `/qeta/users/${entity.author}` }, name))));
|
|
257
281
|
};
|
|
258
282
|
|
|
259
283
|
const CommentList = (props) => {
|
|
@@ -273,18 +297,19 @@ const CommentList = (props) => {
|
|
|
273
297
|
};
|
|
274
298
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, (_a = entity.comments) == null ? void 0 : _a.map((c) => {
|
|
275
299
|
const name = formatEntityName(c.author);
|
|
276
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { key: c.id }, /* @__PURE__ */ React.createElement(
|
|
300
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { key: c.id, className: "qetaCommentBox" }, /* @__PURE__ */ React.createElement(
|
|
277
301
|
MarkdownContent,
|
|
278
302
|
{
|
|
279
303
|
dialect: "gfm",
|
|
280
304
|
content: c.content,
|
|
281
305
|
className: `${styles.markdownContent} inline`
|
|
282
306
|
}
|
|
283
|
-
), " \u2013 ", /* @__PURE__ */ React.createElement(Link, { to: `/qeta/users/${c.author}
|
|
307
|
+
), " \u2013 ", /* @__PURE__ */ React.createElement(Link, { to: `/qeta/users/${c.author}`, className: "qetaUserBtn" }, name), " ", /* @__PURE__ */ React.createElement(Typography, { variant: "caption", className: "qetaCommentTime" }, /* @__PURE__ */ React.createElement(RelativeTime, { value: c.created })), c.own && /* @__PURE__ */ React.createElement(React.Fragment, null, " / ", /* @__PURE__ */ React.createElement(
|
|
284
308
|
Link,
|
|
285
309
|
{
|
|
286
310
|
underline: "none",
|
|
287
311
|
to: "#",
|
|
312
|
+
className: "qetaCommentDeleteBtn",
|
|
288
313
|
onClick: () => deleteComment(c.id)
|
|
289
314
|
},
|
|
290
315
|
"delete"
|
|
@@ -320,14 +345,23 @@ const CommentSection = (props) => {
|
|
|
320
345
|
onCommentPost(q);
|
|
321
346
|
});
|
|
322
347
|
};
|
|
323
|
-
return /* @__PURE__ */ React.createElement(Box, { marginLeft: 9 }, /* @__PURE__ */ React.createElement(
|
|
348
|
+
return /* @__PURE__ */ React.createElement(Box, { marginLeft: 9, className: "qetaCommentSection" }, /* @__PURE__ */ React.createElement(
|
|
324
349
|
CommentList,
|
|
325
350
|
{
|
|
326
351
|
question,
|
|
327
352
|
answer,
|
|
328
353
|
onCommentDelete
|
|
329
354
|
}
|
|
330
|
-
), !formVisible && /* @__PURE__ */ React.createElement(
|
|
355
|
+
), !formVisible && /* @__PURE__ */ React.createElement(
|
|
356
|
+
Link,
|
|
357
|
+
{
|
|
358
|
+
underline: "none",
|
|
359
|
+
to: "#",
|
|
360
|
+
className: "qetaAddCommentBtn",
|
|
361
|
+
onClick: () => setFormVisible(true)
|
|
362
|
+
},
|
|
363
|
+
"Add comment"
|
|
364
|
+
), formVisible && /* @__PURE__ */ React.createElement("form", { onSubmit: handleSubmit(postComment), className: "qetaCommentForm" }, /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 11 }, /* @__PURE__ */ React.createElement(
|
|
331
365
|
Controller,
|
|
332
366
|
{
|
|
333
367
|
control,
|
|
@@ -342,6 +376,7 @@ const CommentSection = (props) => {
|
|
|
342
376
|
multiline: true,
|
|
343
377
|
minRows: 2,
|
|
344
378
|
fullWidth: true,
|
|
379
|
+
className: "qetaCommentInput",
|
|
345
380
|
value,
|
|
346
381
|
placeholder: "Your commment",
|
|
347
382
|
onChange,
|
|
@@ -356,6 +391,7 @@ const CommentSection = (props) => {
|
|
|
356
391
|
{
|
|
357
392
|
variant: "contained",
|
|
358
393
|
size: "small",
|
|
394
|
+
className: "qetaCommentBtn",
|
|
359
395
|
type: "submit",
|
|
360
396
|
color: "primary"
|
|
361
397
|
},
|
|
@@ -373,36 +409,45 @@ const QuestionCard = (props) => {
|
|
|
373
409
|
const onCommentAction = (q, _) => {
|
|
374
410
|
setQuestionEntity(q);
|
|
375
411
|
};
|
|
376
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
377
|
-
|
|
412
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
413
|
+
Card,
|
|
378
414
|
{
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
className: styles.markdownContent
|
|
382
|
-
}
|
|
383
|
-
)), /* @__PURE__ */ React.createElement(Box, { className: styles.questionCardMetadata }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 0 }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(TagsAndEntities, { question: questionEntity }))), /* @__PURE__ */ React.createElement(Grid, { container: true, justifyContent: "space-around" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 9 }, question.own && /* @__PURE__ */ React.createElement(Box, { className: styles.questionCardActions }, /* @__PURE__ */ React.createElement(
|
|
384
|
-
Link,
|
|
385
|
-
{
|
|
386
|
-
underline: "none",
|
|
387
|
-
to: "#",
|
|
388
|
-
onClick: handleDeleteModalOpen
|
|
389
|
-
},
|
|
390
|
-
"Delete"
|
|
391
|
-
), /* @__PURE__ */ React.createElement(
|
|
392
|
-
Link,
|
|
393
|
-
{
|
|
394
|
-
underline: "none",
|
|
395
|
-
to: `/qeta/questions/${questionEntity.id}/edit`
|
|
415
|
+
variant: "outlined",
|
|
416
|
+
className: `qetaQuestionCard ${styles.questionCard}`
|
|
396
417
|
},
|
|
397
|
-
"
|
|
418
|
+
/* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement("div", { className: styles.questionCardVote }, /* @__PURE__ */ React.createElement(VoteButtons, { entity: questionEntity }), /* @__PURE__ */ React.createElement(FavoriteButton, { entity: questionEntity })), /* @__PURE__ */ React.createElement("div", { className: styles.questionCardContent }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", gutterBottom: true }, /* @__PURE__ */ React.createElement(
|
|
419
|
+
MarkdownContent,
|
|
420
|
+
{
|
|
421
|
+
content: questionEntity.content,
|
|
422
|
+
dialect: "gfm",
|
|
423
|
+
className: styles.markdownContent
|
|
424
|
+
}
|
|
425
|
+
)), /* @__PURE__ */ React.createElement(Box, { className: styles.questionCardMetadata }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 0 }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(TagsAndEntities, { question: questionEntity }))), /* @__PURE__ */ React.createElement(Grid, { container: true, justifyContent: "space-around" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 9 }, question.own && /* @__PURE__ */ React.createElement(Box, { className: styles.questionCardActions }, /* @__PURE__ */ React.createElement(
|
|
426
|
+
Link,
|
|
427
|
+
{
|
|
428
|
+
underline: "none",
|
|
429
|
+
to: "#",
|
|
430
|
+
onClick: handleDeleteModalOpen,
|
|
431
|
+
className: "qetaQuestionCardDeleteBtn"
|
|
432
|
+
},
|
|
433
|
+
"Delete"
|
|
434
|
+
), /* @__PURE__ */ React.createElement(
|
|
435
|
+
Link,
|
|
436
|
+
{
|
|
437
|
+
underline: "none",
|
|
438
|
+
to: `/qeta/questions/${questionEntity.id}/edit`,
|
|
439
|
+
className: "qetaQuestionCardEditBtn"
|
|
440
|
+
},
|
|
441
|
+
"Edit"
|
|
442
|
+
), /* @__PURE__ */ React.createElement(
|
|
443
|
+
DeleteModal,
|
|
444
|
+
{
|
|
445
|
+
open: deleteModalOpen,
|
|
446
|
+
onClose: handleDeleteModalClose,
|
|
447
|
+
entity: questionEntity
|
|
448
|
+
}
|
|
449
|
+
))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 3 }, /* @__PURE__ */ React.createElement(AuthorBox, { entity: questionEntity }))))))
|
|
398
450
|
), /* @__PURE__ */ React.createElement(
|
|
399
|
-
DeleteModal,
|
|
400
|
-
{
|
|
401
|
-
open: deleteModalOpen,
|
|
402
|
-
onClose: handleDeleteModalClose,
|
|
403
|
-
entity: questionEntity
|
|
404
|
-
}
|
|
405
|
-
))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 3 }, /* @__PURE__ */ React.createElement(AuthorBox, { entity: questionEntity }))))))), /* @__PURE__ */ React.createElement(
|
|
406
451
|
CommentSection,
|
|
407
452
|
{
|
|
408
453
|
question: questionEntity,
|
|
@@ -480,7 +525,7 @@ const AnswerForm = (props) => {
|
|
|
480
525
|
permission: qetaCreateAnswerPermission,
|
|
481
526
|
errorPage: /* @__PURE__ */ React.createElement(React.Fragment, null)
|
|
482
527
|
},
|
|
483
|
-
/* @__PURE__ */ React.createElement("form", { onSubmit: handleSubmit(postAnswer) }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, "Your answer"), error && /* @__PURE__ */ React.createElement(WarningPanel, { severity: "error", title: "Could not post answer" }), /* @__PURE__ */ React.createElement(
|
|
528
|
+
/* @__PURE__ */ React.createElement("form", { onSubmit: handleSubmit(postAnswer), className: "qetaAnswerForm" }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, "Your answer"), error && /* @__PURE__ */ React.createElement(WarningPanel, { severity: "error", title: "Could not post answer" }), /* @__PURE__ */ React.createElement(
|
|
484
529
|
Controller,
|
|
485
530
|
{
|
|
486
531
|
control,
|
|
@@ -509,7 +554,7 @@ const AnswerForm = (props) => {
|
|
|
509
554
|
variant: "outlined",
|
|
510
555
|
type: "submit",
|
|
511
556
|
color: "primary",
|
|
512
|
-
className: styles.postButton
|
|
557
|
+
className: `qetaAnswerFormPostBtn ${styles.postButton}`
|
|
513
558
|
},
|
|
514
559
|
id ? "Save" : "Post"
|
|
515
560
|
))
|
|
@@ -533,45 +578,62 @@ const AnswerCard = (props) => {
|
|
|
533
578
|
setAnswerEntity(a);
|
|
534
579
|
}
|
|
535
580
|
};
|
|
536
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
537
|
-
|
|
538
|
-
{
|
|
539
|
-
question,
|
|
540
|
-
onPost: onAnswerEdit,
|
|
541
|
-
id: answerEntity.id
|
|
542
|
-
}
|
|
543
|
-
) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", gutterBottom: true }, /* @__PURE__ */ React.createElement(
|
|
544
|
-
MarkdownContent,
|
|
545
|
-
{
|
|
546
|
-
className: styles.markdownContent,
|
|
547
|
-
content: answerEntity.content,
|
|
548
|
-
dialect: "gfm"
|
|
549
|
-
}
|
|
550
|
-
)), /* @__PURE__ */ React.createElement(Grid, { container: true, justifyContent: "space-around" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 9 }, answerEntity.own && /* @__PURE__ */ React.createElement(Box, { className: styles.questionCardActions }, !answerEntity.correct && /* @__PURE__ */ React.createElement(
|
|
551
|
-
Link,
|
|
581
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
582
|
+
Card,
|
|
552
583
|
{
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
onClick: handleDeleteModalOpen
|
|
584
|
+
id: `a${answer.id}`,
|
|
585
|
+
className: `qetaAnswerCard ${styles.questionCard}`
|
|
556
586
|
},
|
|
557
|
-
"
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
},
|
|
565
|
-
|
|
587
|
+
/* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement("div", { className: styles.questionCardVote }, /* @__PURE__ */ React.createElement(VoteButtons, { entity: answerEntity, question })), /* @__PURE__ */ React.createElement("div", { className: styles.questionCardContent }, editMode ? /* @__PURE__ */ React.createElement(
|
|
588
|
+
AnswerForm,
|
|
589
|
+
{
|
|
590
|
+
question,
|
|
591
|
+
onPost: onAnswerEdit,
|
|
592
|
+
id: answerEntity.id
|
|
593
|
+
}
|
|
594
|
+
) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", gutterBottom: true }, /* @__PURE__ */ React.createElement(
|
|
595
|
+
MarkdownContent,
|
|
596
|
+
{
|
|
597
|
+
className: `qetaAndswerCardAnswerContent ${styles.markdownContent}`,
|
|
598
|
+
content: answerEntity.content,
|
|
599
|
+
dialect: "gfm"
|
|
600
|
+
}
|
|
601
|
+
)), /* @__PURE__ */ React.createElement(Grid, { container: true, justifyContent: "space-around" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 9 }, answerEntity.own && /* @__PURE__ */ React.createElement(
|
|
602
|
+
Box,
|
|
603
|
+
{
|
|
604
|
+
className: `qetaAnswerCardActions ${styles.questionCardActions}`
|
|
605
|
+
},
|
|
606
|
+
!answerEntity.correct && /* @__PURE__ */ React.createElement(
|
|
607
|
+
Link,
|
|
608
|
+
{
|
|
609
|
+
underline: "none",
|
|
610
|
+
to: "#",
|
|
611
|
+
onClick: handleDeleteModalOpen,
|
|
612
|
+
className: "qetaAnswerCardDeleteBtn"
|
|
613
|
+
},
|
|
614
|
+
"Delete"
|
|
615
|
+
),
|
|
616
|
+
/* @__PURE__ */ React.createElement(
|
|
617
|
+
Link,
|
|
618
|
+
{
|
|
619
|
+
underline: "none",
|
|
620
|
+
to: "#",
|
|
621
|
+
onClick: () => setEditMode(true),
|
|
622
|
+
className: "qetaAnswerCardEditBtn"
|
|
623
|
+
},
|
|
624
|
+
"Edit"
|
|
625
|
+
),
|
|
626
|
+
/* @__PURE__ */ React.createElement(
|
|
627
|
+
DeleteModal,
|
|
628
|
+
{
|
|
629
|
+
open: deleteModalOpen,
|
|
630
|
+
onClose: handleDeleteModalClose,
|
|
631
|
+
entity: answerEntity,
|
|
632
|
+
question
|
|
633
|
+
}
|
|
634
|
+
)
|
|
635
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 3 }, /* @__PURE__ */ React.createElement(AuthorBox, { entity: answerEntity }))))))
|
|
566
636
|
), /* @__PURE__ */ React.createElement(
|
|
567
|
-
DeleteModal,
|
|
568
|
-
{
|
|
569
|
-
open: deleteModalOpen,
|
|
570
|
-
onClose: handleDeleteModalClose,
|
|
571
|
-
entity: answerEntity,
|
|
572
|
-
question
|
|
573
|
-
}
|
|
574
|
-
))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 3 }, /* @__PURE__ */ React.createElement(AuthorBox, { entity: answerEntity }))))))), /* @__PURE__ */ React.createElement(
|
|
575
637
|
CommentSection,
|
|
576
638
|
{
|
|
577
639
|
question,
|
|
@@ -610,16 +672,8 @@ const QuestionPage = () => {
|
|
|
610
672
|
title: question.title,
|
|
611
673
|
description: getDescription(question)
|
|
612
674
|
},
|
|
613
|
-
/* @__PURE__ */ React.createElement(
|
|
614
|
-
|
|
615
|
-
{
|
|
616
|
-
className: styles.marginRight,
|
|
617
|
-
to: "/qeta",
|
|
618
|
-
startIcon: /* @__PURE__ */ React.createElement(HomeOutlined, null)
|
|
619
|
-
},
|
|
620
|
-
"Back to questions"
|
|
621
|
-
),
|
|
622
|
-
/* @__PURE__ */ React.createElement(AskQuestionButton, null)
|
|
675
|
+
/* @__PURE__ */ React.createElement(AskQuestionButton, null),
|
|
676
|
+
/* @__PURE__ */ React.createElement(BackToQuestionsButton, null)
|
|
623
677
|
), /* @__PURE__ */ React.createElement(QuestionCard, { question }), /* @__PURE__ */ React.createElement(Box, { sx: { mt: 3, mb: 2 } }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, question.answersCount + newAnswers.length, " answers")), ((_a = question.answers) != null ? _a : []).concat(newAnswers).map((a) => {
|
|
624
678
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Divider, { className: styles.questionDivider }), /* @__PURE__ */ React.createElement(Box, { key: a.id, sx: { mb: 1 } }, /* @__PURE__ */ React.createElement(AnswerCard, { answer: a, question })));
|
|
625
679
|
}), /* @__PURE__ */ React.createElement(Divider, { className: styles.questionDivider }), /* @__PURE__ */ React.createElement(AnswerForm, { question, onPost: onAnswerPost })));
|
|
@@ -645,24 +699,32 @@ const TagsContainer = () => {
|
|
|
645
699
|
return data.filter((t) => t.tag.toLowerCase().includes(query));
|
|
646
700
|
};
|
|
647
701
|
const tags = filterData(searchQuery, response);
|
|
648
|
-
return /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
702
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true, className: "qetaTagsContainer" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
649
703
|
TextField,
|
|
650
704
|
{
|
|
651
705
|
id: "search-bar",
|
|
652
|
-
className: "text",
|
|
706
|
+
className: "text qetaTagsContainerSearchInput",
|
|
653
707
|
onChange: (event) => setSearchQuery(event.target.value),
|
|
654
708
|
label: "Search tag",
|
|
655
709
|
variant: "outlined",
|
|
656
710
|
placeholder: "Search...",
|
|
657
711
|
size: "small"
|
|
658
712
|
}
|
|
659
|
-
), /* @__PURE__ */ React.createElement(IconButton, { type: "submit", "aria-label": "search" })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
713
|
+
), /* @__PURE__ */ React.createElement(IconButton, { type: "submit", "aria-label": "search" })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
714
|
+
Typography,
|
|
715
|
+
{
|
|
716
|
+
variant: "h6",
|
|
717
|
+
className: "qetaTagsContainerTitle"
|
|
718
|
+
},
|
|
719
|
+
`Showing ${tags.length} tags`
|
|
720
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true }, tags.map((tag) => /* @__PURE__ */ React.createElement(
|
|
660
721
|
Chip,
|
|
661
722
|
{
|
|
662
723
|
key: tag.tag,
|
|
663
724
|
variant: "outlined",
|
|
664
725
|
avatar: /* @__PURE__ */ React.createElement(Avatar, null, tag.questionsCount),
|
|
665
726
|
label: tag.tag,
|
|
727
|
+
className: "qetaTagsContainerChip",
|
|
666
728
|
component: "a",
|
|
667
729
|
clickable: true,
|
|
668
730
|
href: `/qeta/tags/${tag.tag}`
|
|
@@ -672,23 +734,13 @@ const TagsContainer = () => {
|
|
|
672
734
|
|
|
673
735
|
const TagPage = () => {
|
|
674
736
|
const { tag } = useParams();
|
|
675
|
-
|
|
676
|
-
return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: tag ? `Questions tagged [${tag}]` : "Tags" }, /* @__PURE__ */ React.createElement(
|
|
677
|
-
LinkButton,
|
|
678
|
-
{
|
|
679
|
-
to: "/qeta",
|
|
680
|
-
className: styles.marginRight,
|
|
681
|
-
startIcon: /* @__PURE__ */ React.createElement(HomeOutlined, null)
|
|
682
|
-
},
|
|
683
|
-
"Back to questions"
|
|
684
|
-
), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), tag ? /* @__PURE__ */ React.createElement(QuestionsContainer, { tags: [tag != null ? tag : ""] }) : /* @__PURE__ */ React.createElement(TagsContainer, null)));
|
|
737
|
+
return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: tag ? `Questions tagged [${tag}]` : "Tags" }, /* @__PURE__ */ React.createElement(BackToQuestionsButton, null), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), tag ? /* @__PURE__ */ React.createElement(QuestionsContainer, { tags: [tag != null ? tag : ""] }) : /* @__PURE__ */ React.createElement(TagsContainer, null)));
|
|
685
738
|
};
|
|
686
739
|
|
|
687
740
|
const UserPage = () => {
|
|
688
741
|
var _a;
|
|
689
742
|
const identity = (_a = useParams()["*"]) != null ? _a : "unknown";
|
|
690
|
-
|
|
691
|
-
return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: `Questions by ${formatEntityName(identity)}` }, /* @__PURE__ */ React.createElement(LinkButton, { to: "/qeta", className: styles.marginRight }, "Back to questions"), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(QuestionsContainer, { author: identity != null ? identity : "" })));
|
|
743
|
+
return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: `Questions by ${formatEntityName(identity)}` }, /* @__PURE__ */ React.createElement(BackToQuestionsButton, null), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(QuestionsContainer, { author: identity != null ? identity : "" })));
|
|
692
744
|
};
|
|
693
745
|
|
|
694
746
|
const QuestionHighlightList = (props) => {
|
|
@@ -703,7 +755,7 @@ const QuestionHighlightList = (props) => {
|
|
|
703
755
|
return /* @__PURE__ */ React.createElement(
|
|
704
756
|
Box,
|
|
705
757
|
{
|
|
706
|
-
className: classes.questionHighlightList
|
|
758
|
+
className: `qetaQuestionHighlightList ${classes.questionHighlightList}`,
|
|
707
759
|
display: { md: "none", lg: "block" }
|
|
708
760
|
},
|
|
709
761
|
/* @__PURE__ */ React.createElement(
|
|
@@ -711,6 +763,7 @@ const QuestionHighlightList = (props) => {
|
|
|
711
763
|
{
|
|
712
764
|
component: "nav",
|
|
713
765
|
"aria-labelledby": "nested-list-subheader",
|
|
766
|
+
className: "qetaQuestionHighlightListList",
|
|
714
767
|
subheader: /* @__PURE__ */ React.createElement(
|
|
715
768
|
ListSubheader,
|
|
716
769
|
{
|
|
@@ -728,6 +781,7 @@ const QuestionHighlightList = (props) => {
|
|
|
728
781
|
!error && questions.map((q) => /* @__PURE__ */ React.createElement(React.Fragment, { key: q.id }, /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
|
|
729
782
|
ListItem,
|
|
730
783
|
{
|
|
784
|
+
className: "qetaQuestionHighlightListListItem",
|
|
731
785
|
button: true,
|
|
732
786
|
dense: true,
|
|
733
787
|
component: "a",
|
|
@@ -740,16 +794,7 @@ const QuestionHighlightList = (props) => {
|
|
|
740
794
|
};
|
|
741
795
|
|
|
742
796
|
const FavoritePage = () => {
|
|
743
|
-
|
|
744
|
-
return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: "Your favorite questions" }, /* @__PURE__ */ React.createElement(
|
|
745
|
-
LinkButton,
|
|
746
|
-
{
|
|
747
|
-
to: "/qeta",
|
|
748
|
-
className: styles.marginRight,
|
|
749
|
-
startIcon: /* @__PURE__ */ React.createElement(HomeOutlined, null)
|
|
750
|
-
},
|
|
751
|
-
"Back to questions"
|
|
752
|
-
), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(QuestionsContainer, { favorite: true })));
|
|
797
|
+
return /* @__PURE__ */ React.createElement(Content, { className: "qetaFavoritePage" }, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(ContentHeader, { title: "Your favorite questions" }, /* @__PURE__ */ React.createElement(BackToQuestionsButton, null), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(QuestionsContainer, { favorite: true })));
|
|
753
798
|
};
|
|
754
799
|
|
|
755
800
|
const MoreMenu = () => {
|
|
@@ -801,7 +846,7 @@ const MoreMenu = () => {
|
|
|
801
846
|
));
|
|
802
847
|
};
|
|
803
848
|
const HomePageContent = () => {
|
|
804
|
-
return /* @__PURE__ */ React.createElement(Content,
|
|
849
|
+
return /* @__PURE__ */ React.createElement(Content, { className: "qetaHomePage" }, /* @__PURE__ */ React.createElement(Container, { maxWidth: "lg" }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, lg: 9, xl: 10 }, /* @__PURE__ */ React.createElement(ContentHeader, { title: "All questions" }, /* @__PURE__ */ React.createElement(MoreMenu, null), /* @__PURE__ */ React.createElement(AskQuestionButton, null)), /* @__PURE__ */ React.createElement(QuestionsContainer, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, lg: 3, xl: 2 }, /* @__PURE__ */ React.createElement(
|
|
805
850
|
QuestionHighlightList,
|
|
806
851
|
{
|
|
807
852
|
type: "hot",
|
|
@@ -831,4 +876,4 @@ const HomePage = (props) => {
|
|
|
831
876
|
};
|
|
832
877
|
|
|
833
878
|
export { HomePage };
|
|
834
|
-
//# sourceMappingURL=index-
|
|
879
|
+
//# sourceMappingURL=index-600a4b78.esm.js.map
|