@drodil/backstage-plugin-qeta 3.18.0 → 3.18.2

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.
@@ -51,7 +51,7 @@ const AskPage = () => {
51
51
  content: data.content
52
52
  });
53
53
  };
54
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title }), /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(InfoCard, null, /* @__PURE__ */ React.createElement(
54
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title }), /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true, style: { width: "100%" } }, /* @__PURE__ */ React.createElement(InfoCard, null, /* @__PURE__ */ React.createElement(
55
55
  PostForm,
56
56
  {
57
57
  id,
@@ -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 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';\nimport { Grid } from '@material-ui/core';\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,MAAA,EAAE,EAAG,EAAA,GAAI,SAAU,EAAA;AACzB,EAAM,MAAA,CAAC,YAAY,CAAA,GAAI,eAAgB,EAAA;AACvC,EAAM,MAAA,EAAE,qBAAsB,EAAA,GAAI,KAAM,EAAA;AACxC,EAAM,MAAA,EAAE,OAAO,OAAQ,EAAA,GAAI,WAAW,CAAO,GAAA,KAAA,GAAA,CAAI,cAAc,CAAA;AAC/D,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAExB,KAAS,CAAA,CAAA;AACX,EAAM,MAAA,CAAC,QAAU,EAAA,WAAW,CAAI,GAAA,QAAA;AAAA,IAC9B,KAAA;AAAA,GACF;AAEA,EAAA,MAAM,MA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ACH;AAEA,EAAA,iFAEK,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,OAAc,CAC7B,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,SAAS,EAAA,IAAA,EAAC,OAAS,EAAA,CAAA,EAAG,WAAU,QACpC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAA,sCACP,QACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAK,EAAA,UAAA;AAAA,MACL,QAAA;AAAA,MACA,YAAc,EAAA;AAAA;AAAA,qBAEf,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,OAAc,CAC9B,CACF,CACF,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AskPage.esm.js","sources":["../../../src/components/AskPage/AskPage.tsx"],"sourcesContent":["import { ContentHeader, InfoCard, Progress } from '@backstage/core-components';\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';\nimport { Grid } from '@material-ui/core';\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 style={{ width: '100%' }}>\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,MAAA,EAAE,EAAG,EAAA,GAAI,SAAU,EAAA;AACzB,EAAM,MAAA,CAAC,YAAY,CAAA,GAAI,eAAgB,EAAA;AACvC,EAAM,MAAA,EAAE,qBAAsB,EAAA,GAAI,KAAM,EAAA;AACxC,EAAM,MAAA,EAAE,OAAO,OAAQ,EAAA,GAAI,WAAW,CAAO,GAAA,KAAA,GAAA,CAAI,cAAc,CAAA;AAC/D,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAExB,KAAS,CAAA,CAAA;AACX,EAAM,MAAA,CAAC,QAAU,EAAA,WAAW,CAAI,GAAA,QAAA;AAAA,IAC9B,KAAA;AAAA,GACF;AAEA,EAAA,MAAM,MAAS,GAAA,YAAA,CAAa,GAAI,CAAA,QAAQ,CAAK,IAAA,KAAA,CAAA;A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AA,IAAA,sCACG,aAAc,EAAA,EAAA,KAAA,EAAc,mBAC5B,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAC,OAAS,EAAA,CAAA,EAAG,WAAU,QACpC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,KAAA,EAAO,EAAE,KAAO,EAAA,MAAA,EACzB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAK,EAAA,UAAA;AAAA,MACL,QAAA;AAAA,MACA,YAAc,EAAA;AAAA;AAAA,qBAEf,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,OAAc,CAC9B,CACF,CACF,CACF,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "frontend",
8
8
  "backstage.io"
9
9
  ],
10
- "version": "3.18.0",
10
+ "version": "3.18.2",
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.15.1",
55
55
  "@backstage/plugin-home-react": "^0.1.22",
56
56
  "@backstage/plugin-signals-react": "^0.0.9",
57
- "@drodil/backstage-plugin-qeta-common": "^3.18.0",
58
- "@drodil/backstage-plugin-qeta-react": "^3.18.0",
57
+ "@drodil/backstage-plugin-qeta-common": "^3.18.2",
58
+ "@drodil/backstage-plugin-qeta-react": "^3.18.2",
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",