@drodil/backstage-plugin-qeta 3.6.1 → 3.7.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/configSchema.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { filterTags } from '@drodil/backstage-plugin-qeta-common';
|
|
|
9
9
|
const AskPage = () => {
|
|
10
10
|
const { id } = useParams();
|
|
11
11
|
const [searchParams] = useSearchParams();
|
|
12
|
-
const {
|
|
12
|
+
const { isNewQuestionsEnabled } = useAI();
|
|
13
13
|
const { value, loading } = useQetaApi((api) => api.getTemplates());
|
|
14
14
|
const [draft, setDraft] = useState(void 0);
|
|
15
15
|
const [template, setTemplate] = useState(
|
|
@@ -43,7 +43,7 @@ const AskPage = () => {
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
const handleFormChange = (data) => {
|
|
46
|
-
if (!
|
|
46
|
+
if (!isNewQuestionsEnabled) {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
setDraft({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AskPage.esm.js","sources":["../../../src/components/AskPage/AskPage.tsx"],"sourcesContent":["import { ContentHeader, InfoCard, Progress } from '@backstage/core-components';\nimport { Grid } from '@material-ui/core';\nimport React, { useState } from 'react';\nimport {\n AIAnswerCard,\n PostForm,\n SelectTemplateList,\n useAI,\n useQetaApi,\n useTranslation,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { filterTags, Template } from '@drodil/backstage-plugin-qeta-common';\n\nexport const AskPage = () => {\n const { id } = useParams();\n const [searchParams] = useSearchParams();\n const {
|
|
1
|
+
{"version":3,"file":"AskPage.esm.js","sources":["../../../src/components/AskPage/AskPage.tsx"],"sourcesContent":["import { ContentHeader, InfoCard, Progress } from '@backstage/core-components';\nimport { Grid } from '@material-ui/core';\nimport React, { useState } from 'react';\nimport {\n AIAnswerCard,\n PostForm,\n SelectTemplateList,\n useAI,\n useQetaApi,\n useTranslation,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { filterTags, Template } from '@drodil/backstage-plugin-qeta-common';\n\nexport const AskPage = () => {\n const { id } = useParams();\n const [searchParams] = useSearchParams();\n const { isNewQuestionsEnabled } = useAI();\n const { value, loading } = useQetaApi(api => api.getTemplates());\n const [draft, setDraft] = useState<\n { title: string; content: string } | undefined\n >(undefined);\n const [template, setTemplate] = useState<Template | null | undefined>(\n undefined,\n );\n\n const entity = searchParams.get('entity') ?? undefined;\n const entityPage = searchParams.get('entityPage') === 'true';\n const tags = filterTags(searchParams.get('tags'));\n const { t } = useTranslation();\n let title;\n if (id) {\n title = t('askPage.title.existingQuestion');\n } else if (entity) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const representation = useEntityPresentation(entity);\n title = t('askPage.title.entityQuestion', {\n entity: representation.primaryTitle,\n });\n } else {\n title = t('askPage.title.newQuestion');\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (\n !id &&\n value &&\n value.templates &&\n value.total > 0 &&\n template === undefined\n ) {\n return (\n <SelectTemplateList\n templates={value}\n onTemplateSelect={temp => setTemplate(temp)}\n />\n );\n }\n\n const handleFormChange = (data: { title: string; content: string }) => {\n if (!isNewQuestionsEnabled) {\n return;\n }\n setDraft({\n title: data.title,\n content: data.content,\n });\n };\n\n return (\n <>\n <ContentHeader title={title} />\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <InfoCard>\n <PostForm\n id={id}\n entity={entity}\n entityPage={entityPage}\n tags={tags}\n type=\"question\"\n template={template}\n onFormChange={handleFormChange}\n />\n <AIAnswerCard draft={draft} />\n </InfoCard>\n </Grid>\n </Grid>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAeO,MAAM,UAAU,MAAM;AAC3B,EAAM,M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@
|
|
|
7
7
|
"frontend",
|
|
8
8
|
"backstage.io"
|
|
9
9
|
],
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.7.0",
|
|
11
11
|
"main": "dist/index.esm.js",
|
|
12
12
|
"types": "dist/index.d.ts",
|
|
13
13
|
"prepublishOnly": "yarn tsc && yarn build",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@backstage/plugin-catalog-react": "^1.14.0",
|
|
55
55
|
"@backstage/plugin-home-react": "^0.1.18",
|
|
56
56
|
"@backstage/plugin-signals-react": "^0.0.6",
|
|
57
|
-
"@drodil/backstage-plugin-qeta-common": "^3.
|
|
58
|
-
"@drodil/backstage-plugin-qeta-react": "^3.
|
|
57
|
+
"@drodil/backstage-plugin-qeta-common": "^3.7.0",
|
|
58
|
+
"@drodil/backstage-plugin-qeta-react": "^3.7.0",
|
|
59
59
|
"@material-ui/core": "^4.12.2",
|
|
60
60
|
"@material-ui/icons": "^4.11.3",
|
|
61
61
|
"@material-ui/lab": "4.0.0-alpha.61",
|