@backstage-community/plugin-bazaar 0.9.1 → 0.11.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/CHANGELOG.md +12 -0
- package/dist/components/About/About.esm.js +21 -9
- package/dist/components/About/About.esm.js.map +1 -1
- package/dist/components/AddProjectDialog/AddProjectDialog.esm.js +4 -3
- package/dist/components/AddProjectDialog/AddProjectDialog.esm.js.map +1 -1
- package/dist/components/BazaarOverviewCard/BazaarOverviewCard.esm.js +18 -17
- package/dist/components/BazaarOverviewCard/BazaarOverviewCard.esm.js.map +1 -1
- package/dist/components/CardContentFields/AboutField.esm.js +6 -3
- package/dist/components/CardContentFields/AboutField.esm.js.map +1 -1
- package/dist/components/CardContentFields/CardContentFields.esm.js +65 -51
- package/dist/components/CardContentFields/CardContentFields.esm.js.map +1 -1
- package/dist/components/ConfirmationDialog/ConfirmationDialog.esm.js +12 -7
- package/dist/components/ConfirmationDialog/ConfirmationDialog.esm.js.map +1 -1
- package/dist/components/CustomDialogTitle/CustomDialogTitle.esm.js +13 -10
- package/dist/components/CustomDialogTitle/CustomDialogTitle.esm.js.map +1 -1
- package/dist/components/DateSelector/DateSelector.esm.js +5 -5
- package/dist/components/DateSelector/DateSelector.esm.js.map +1 -1
- package/dist/components/DoubleDateSelector/DoubleDateSelector.esm.js +6 -2
- package/dist/components/DoubleDateSelector/DoubleDateSelector.esm.js.map +1 -1
- package/dist/components/EditProjectDialog/EditProjectDialog.esm.js +40 -36
- package/dist/components/EditProjectDialog/EditProjectDialog.esm.js.map +1 -1
- package/dist/components/EntityBazaarInfoCard/EntityBazaarInfoCard.esm.js +4 -3
- package/dist/components/EntityBazaarInfoCard/EntityBazaarInfoCard.esm.js.map +1 -1
- package/dist/components/EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js +61 -54
- package/dist/components/EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +13 -10
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js +72 -59
- package/dist/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js.map +1 -1
- package/dist/components/InputField/InputField.esm.js +3 -3
- package/dist/components/InputField/InputField.esm.js.map +1 -1
- package/dist/components/InputSelector/InputSelector.esm.js +28 -25
- package/dist/components/InputSelector/InputSelector.esm.js.map +1 -1
- package/dist/components/LinkProjectDialog/LinkProjectDialog.esm.js +23 -18
- package/dist/components/LinkProjectDialog/LinkProjectDialog.esm.js.map +1 -1
- package/dist/components/ProjectCard/ProjectCard.esm.js +31 -20
- package/dist/components/ProjectCard/ProjectCard.esm.js.map +1 -1
- package/dist/components/ProjectDialog/ProjectDialog.esm.js +112 -96
- package/dist/components/ProjectDialog/ProjectDialog.esm.js.map +1 -1
- package/dist/components/ProjectPreview/ProjectPreview.esm.js +32 -28
- package/dist/components/ProjectPreview/ProjectPreview.esm.js.map +1 -1
- package/dist/components/ProjectSelector/ProjectSelector.esm.js +5 -5
- package/dist/components/ProjectSelector/ProjectSelector.esm.js.map +1 -1
- package/dist/components/SortMethodSelector/SortMethodSelector.esm.js +11 -9
- package/dist/components/SortMethodSelector/SortMethodSelector.esm.js.map +1 -1
- package/dist/components/SortView/SortView.esm.js +63 -52
- package/dist/components/SortView/SortView.esm.js.map +1 -1
- package/dist/components/StatusTag/StatusTag.esm.js +5 -5
- package/dist/components/StatusTag/StatusTag.esm.js.map +1 -1
- package/dist/components/UserSelector/UserSelector.esm.js +7 -6
- package/dist/components/UserSelector/UserSelector.esm.js.map +1 -1
- package/dist/components/VirtualizedListbox/VirtualizedListbox.esm.js +8 -7
- package/dist/components/VirtualizedListbox/VirtualizedListbox.esm.js.map +1 -1
- package/dist/index.d.ts +5 -7
- package/package.json +16 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @backstage-community/plugin-bazaar
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 716ba31: Backstage version bump to v1.39.0
|
|
8
|
+
|
|
9
|
+
## 0.10.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 5e5f531: Backstage version bump to v1.38.1
|
|
14
|
+
|
|
3
15
|
## 0.9.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import Typography from '@material-ui/core/Typography';
|
|
4
4
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -11,14 +11,26 @@ const useStyles = makeStyles({
|
|
|
11
11
|
});
|
|
12
12
|
const About = () => {
|
|
13
13
|
const classes = useStyles();
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, spacing: 4, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 5, children: /* @__PURE__ */ jsxs(InfoCard, { title: "About Bazaar", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Typography, { className: classes.subheader, variant: "body1", children: "What is the Bazaar?" }),
|
|
16
|
+
/* @__PURE__ */ jsxs(Typography, { paragraph: true, children: [
|
|
17
|
+
"The Bazaar is a place where teams can propose projects for cross-functional team development. Essentially a marketplace for internal projects suitable for",
|
|
18
|
+
" ",
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
Link,
|
|
21
|
+
{
|
|
22
|
+
target: "_blank",
|
|
23
|
+
to: "https://en.wikipedia.org/wiki/Inner_source",
|
|
24
|
+
children: "Inner Sourcing"
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
'. With "Inner Sourcing", we mean projects that are developed internally within a company, but with Open Source best practices.'
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ jsx(Typography, { className: classes.subheader, variant: "body1", children: "Why?" }),
|
|
30
|
+
/* @__PURE__ */ jsx(Typography, { paragraph: true, children: "Many companies today are of high need to increase the ease of cross-team cooperation. In large organizations, engineers often have limited ways of discovering or announcing the projects which could benefit from a wider development effort in terms of different expertise, experiences, and teams spread across the organization. With no good way to find these existing internal projects to join, the possibility of working with Inner Sourcing practices suffers." }),
|
|
31
|
+
/* @__PURE__ */ jsx(Typography, { className: classes.subheader, variant: "body1", children: "How?" }),
|
|
32
|
+
/* @__PURE__ */ jsx(Typography, { paragraph: true, children: "The Bazaar allows engineers and teams to open up and announce their new and exciting projects for transparent cooperation in other parts of larger organizations. The Bazaar ensures that new Inner Sourcing friendly projects gain visibility through Backstage and a way for interested engineers to show their interest and in the future contribute with their specific skill set. The Bazaar also provides an easy way to manage, catalog, and browse these Inner Sourcing friendly projects and components." })
|
|
33
|
+
] }) }) });
|
|
22
34
|
};
|
|
23
35
|
|
|
24
36
|
export { About };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"About.esm.js","sources":["../../../src/components/About/About.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"About.esm.js","sources":["../../../src/components/About/About.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { InfoCard, Link } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n subheader: {\n fontWeight: 'bold',\n },\n});\n\nexport const About = () => {\n const classes = useStyles();\n return (\n <Grid container spacing={4}>\n <Grid item xs={5}>\n <InfoCard title=\"About Bazaar\">\n <Typography className={classes.subheader} variant=\"body1\">\n What is the Bazaar?\n </Typography>\n <Typography paragraph>\n The Bazaar is a place where teams can propose projects for\n cross-functional team development. Essentially a marketplace for\n internal projects suitable for{' '}\n <Link\n target=\"_blank\"\n to=\"https://en.wikipedia.org/wiki/Inner_source\"\n >\n Inner Sourcing\n </Link>\n . With \"Inner Sourcing\", we mean projects that are developed\n internally within a company, but with Open Source best practices.\n </Typography>\n <Typography className={classes.subheader} variant=\"body1\">\n Why?\n </Typography>\n <Typography paragraph>\n Many companies today are of high need to increase the ease of\n cross-team cooperation. In large organizations, engineers often have\n limited ways of discovering or announcing the projects which could\n benefit from a wider development effort in terms of different\n expertise, experiences, and teams spread across the organization.\n With no good way to find these existing internal projects to join,\n the possibility of working with Inner Sourcing practices suffers.\n </Typography>\n <Typography className={classes.subheader} variant=\"body1\">\n How?\n </Typography>\n <Typography paragraph>\n The Bazaar allows engineers and teams to open up and announce their\n new and exciting projects for transparent cooperation in other parts\n of larger organizations. The Bazaar ensures that new Inner Sourcing\n friendly projects gain visibility through Backstage and a way for\n interested engineers to show their interest and in the future\n contribute with their specific skill set. The Bazaar also provides\n an easy way to manage, catalog, and browse these Inner Sourcing\n friendly projects and components.\n </Typography>\n </Info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CAAA,UAAA,EAAA,EAAW,SAAS,EAAA,IAAA,EAAC,QAStB,EAAA,mfAAA,EAAA;AAAA,GAAA,EACF,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
3
4
|
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
|
4
5
|
import { ProjectDialog } from '../ProjectDialog/ProjectDialog.esm.js';
|
|
@@ -49,7 +50,7 @@ const AddProjectDialog = ({
|
|
|
49
50
|
handleClose();
|
|
50
51
|
reset(defaultValues);
|
|
51
52
|
};
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
53
54
|
ProjectDialog,
|
|
54
55
|
{
|
|
55
56
|
handleSave: handleSubmit,
|
|
@@ -57,7 +58,7 @@ const AddProjectDialog = ({
|
|
|
57
58
|
isAddForm: true,
|
|
58
59
|
defaultValues,
|
|
59
60
|
open,
|
|
60
|
-
projectSelector: /* @__PURE__ */
|
|
61
|
+
projectSelector: /* @__PURE__ */ jsx(
|
|
61
62
|
ProjectSelector,
|
|
62
63
|
{
|
|
63
64
|
onChange: handleEntityClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddProjectDialog.esm.js","sources":["../../../src/components/AddProjectDialog/AddProjectDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"AddProjectDialog.esm.js","sources":["../../../src/components/AddProjectDialog/AddProjectDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from 'react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { UseFormReset, UseFormGetValues } from 'react-hook-form';\nimport { useApi, alertApiRef } from '@backstage/core-plugin-api';\nimport { ProjectDialog } from '../ProjectDialog';\nimport { ProjectSelector } from '../ProjectSelector';\nimport { BazaarProject, FormValues, Size, Status } from '../../types';\nimport { bazaarApiRef } from '../../api';\n\ntype Props = {\n catalogEntities: Entity[];\n open: boolean;\n handleClose: () => void;\n fetchBazaarProjects: () => Promise<BazaarProject[]>;\n fetchCatalogEntities: () => Promise<Entity[]>;\n};\n\nexport const AddProjectDialog = ({\n catalogEntities,\n open,\n handleClose,\n fetchBazaarProjects,\n fetchCatalogEntities,\n}: Props) => {\n const bazaarApi = useApi(bazaarApiRef);\n const alertApi = useApi(alertApiRef);\n const [selectedEntity, setSelectedEntity] = useState<Entity | null>(null);\n\n const defaultValues = {\n title: '',\n community: '',\n description: '',\n docs: '',\n status: 'proposed' as Status,\n size: 'medium' as Size,\n responsible: '',\n startDate: null,\n endDate: null,\n };\n\n const handleEntityClick = (entity: Entity) => {\n setSelectedEntity(entity);\n };\n\n const handleSubmit: (\n getValues: UseFormGetValues<FormValues>,\n reset: UseFormReset<FormValues>,\n ) => Promise<void> = async (\n getValues: UseFormGetValues<FormValues>,\n reset: UseFormReset<FormValues>,\n ) => {\n const formValues = getValues();\n\n const response = await bazaarApi.addProject({\n ...formValues,\n entityRef: selectedEntity ? stringifyEntityRef(selectedEntity) : null,\n startDate: formValues.startDate ?? null,\n endDate: formValues.endDate ?? null,\n } as BazaarProject);\n\n if (response.status === 'ok') {\n fetchBazaarProjects();\n fetchCatalogEntities();\n alertApi.post({\n message: `Added project '${formValues.title}' to the Bazaar list`,\n severity: 'success',\n display: 'transient',\n });\n }\n\n handleClose();\n reset(defaultValues);\n };\n\n return (\n <ProjectDialog\n handleSave={handleSubmit}\n title=\"Add project\"\n isAddForm\n defaultValues={defaultValues}\n open={open}\n projectSelector={\n <ProjectSelector\n onChange={handleEntityClick}\n catalogEntities={catalogEntities || []}\n disableClearable={false}\n defaultValue={null}\n label=\"Select a project\"\n />\n }\n handleClose={handleClose}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAiCO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,eAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAa,KAAA;AACX,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAwB,IAAI,CAAA;AAExE,EAAA,MAAM,aAAgB,GAAA;AAAA,IACpB,KAAO,EAAA,EAAA;AAAA,IACP,SAAW,EAAA,EAAA;AAAA,IACX,WAAa,EAAA,EAAA;AAAA,IACb,IAAM,EAAA,EAAA;AAAA,IACN,MAAQ,EAAA,UAAA;AAAA,IACR,IAAM,EAAA,QAAA;AAAA,IACN,WAAa,EAAA,EAAA;AAAA,IACb,SAAW,EAAA,IAAA;AAAA,IACX,OAAS,EAAA;AAAA,GACX;AAEA,EAAM,MAAA,iBAAA,GAAoB,CAAC,MAAmB,KAAA;AAC5C,IAAA,iBAAA,CAAkB,MAAM,CAAA;AAAA,GAC1B;AAEA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} from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import { ProjectPreview } from '../ProjectPreview/ProjectPreview.esm.js';
|
|
3
4
|
import useAsyncFn from 'react-use/esm/useAsyncFn';
|
|
4
5
|
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
@@ -78,28 +79,28 @@ const BazaarOverviewCard = (props) => {
|
|
|
78
79
|
}
|
|
79
80
|
}, [bazaarProjects, catalogEntities]);
|
|
80
81
|
if (catalogEntities.error) {
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ jsx(ErrorPanel, { error: catalogEntities.error });
|
|
82
83
|
}
|
|
83
84
|
if (bazaarProjects.error) {
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ jsx(ErrorPanel, { error: bazaarProjects.error });
|
|
85
86
|
}
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ jsx(
|
|
87
88
|
InfoCard,
|
|
88
89
|
{
|
|
89
90
|
title: title ?? defaultTitle,
|
|
90
|
-
action: /* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
91
|
+
action: /* @__PURE__ */ jsx(IconButton, { children: /* @__PURE__ */ jsx(Link, { to: bazaarLink.link, title: bazaarLink.title, children: /* @__PURE__ */ jsx(StorefrontIcon, {}) }) }),
|
|
92
|
+
children: /* @__PURE__ */ jsx(
|
|
93
|
+
ProjectPreview,
|
|
94
|
+
{
|
|
95
|
+
bazaarProjects: bazaarProjects.value || [],
|
|
96
|
+
fetchBazaarProjects,
|
|
97
|
+
catalogEntities: unlinkedCatalogEntities || [],
|
|
98
|
+
useTablePagination: false,
|
|
99
|
+
gridSize: fullWidth ? 2 : 4,
|
|
100
|
+
height: fullHeight ? "large" : "small"
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
}
|
|
103
104
|
);
|
|
104
105
|
};
|
|
105
106
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BazaarOverviewCard.esm.js","sources":["../../../src/components/BazaarOverviewCard/BazaarOverviewCard.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"BazaarOverviewCard.esm.js","sources":["../../../src/components/BazaarOverviewCard/BazaarOverviewCard.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect, useState } from 'react';\nimport { ProjectPreview } from '../ProjectPreview/ProjectPreview';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport type { BazaarProject } from '../../types';\nimport { bazaarApiRef } from '../../api';\nimport { fetchCatalogItems } from '../../util/fetchMethods';\nimport { parseBazaarProject } from '../../util/parseMethods';\nimport { ErrorPanel, InfoCard, Link } from '@backstage/core-components';\nimport { bazaarPlugin } from '../../plugin';\nimport IconButton from '@material-ui/core/IconButton';\nimport StorefrontIcon from '@material-ui/icons/Storefront';\n\n/** @public */\nexport type BazaarOverviewCardProps = {\n title?: string;\n order: 'latest' | 'random';\n fullWidth?: boolean;\n fullHeight?: boolean;\n};\n\nconst getUnlinkedCatalogEntities = (\n bazaarProjects: BazaarProject[],\n catalogEntities: Entity[],\n) => {\n const bazaarProjectRefs = bazaarProjects.map(\n (project: BazaarProject) => project.entityRef,\n );\n\n return catalogEntities.filter((entity: Entity) => {\n return !bazaarProjectRefs?.includes(stringifyEntityRef(entity));\n });\n};\n\n/** @public */\nexport const BazaarOverviewCard = (props: BazaarOverviewCardProps) => {\n const { title, order, fullWidth = false, fullHeight = false } = props;\n const bazaarApi = useApi(bazaarApiRef);\n const catalogApi = useApi(catalogApiRef);\n const root = useRouteRef(bazaarPlugin.routes.root);\n\n const defaultTitle =\n order === 'latest' ? 'Bazaar Latest Projects' : 'Bazaar Random Projects';\n\n const bazaarLink = {\n title: 'Go to Bazaar',\n link: `${root()}`,\n };\n\n const [unlinkedCatalogEntities, setUnlinkedCatalogEntities] =\n useState<Entity[]>();\n\n const [catalogEntities, fetchCatalogEntities] = useAsyncFn(async () => {\n return await fetchCatalogItems(catalogApi);\n });\n\n const [bazaarProjects, fetchBazaarProjects] = useAsyncFn(async () => {\n const limit = fullWidth ? 6 : 3;\n const response = await bazaarApi.getProjects(limit, order);\n return response.data.map(parseBazaarProject) as BazaarProject[];\n });\n\n const catalogEntityRefs = catalogEntities.value?.map((project: Entity) =>\n stringifyEntityRef(project),\n );\n\n useEffect(() => {\n const filterBrokenLinks = () => {\n if (catalogEntityRefs) {\n bazaarProjects.value?.forEach(async (project: BazaarProject) => {\n if (project.entityRef) {\n if (!catalogEntityRefs?.includes(project.entityRef)) {\n await bazaarApi.updateProject({\n ...project,\n entityRef: null,\n });\n }\n }\n });\n }\n };\n filterBrokenLinks();\n }, [\n bazaarApi,\n bazaarProjects.value,\n catalogEntityRefs,\n catalogEntities.value,\n ]);\n\n useEffect(() => {\n fetchCatalogEntities();\n fetchBazaarProjects();\n }, [fetchBazaarProjects, fetchCatalogEntities]);\n\n useEffect(() => {\n const unlinkedCEntities = getUnlinkedCatalogEntities(\n bazaarProjects.value || [],\n catalogEntities.value || [],\n );\n\n if (unlinkedCEntities) {\n setUnlinkedCatalogEntities(unlinkedCEntities);\n }\n }, [bazaarProjects, catalogEntities]);\n\n if (catalogEntities.error) {\n return <ErrorPanel error={catalogEntities.error} />;\n }\n\n if (bazaarProjects.error) {\n return <ErrorPanel error={bazaarProjects.error} />;\n }\n\n return (\n <InfoCard\n title={title ?? defaultTitle}\n action={\n <IconButton>\n <Link to={bazaarLink.link} title={bazaarLink.title}>\n <StorefrontIcon />\n </Link>\n </IconButton>\n }\n >\n <ProjectPreview\n bazaarProjects={bazaarProjects.value || []}\n fetchBazaarProjects={fetchBazaarProjects}\n catalogEntities={unlinkedCatalogEntities || []}\n useTablePagination={false}\n gridSize={fullWidth ? 2 : 4}\n height={fullHeight ? 'large' : 'small'}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuCA,MAAM,0BAAA,GAA6B,CACjC,cAAA,EACA,eACG,KAAA;AACH,EAAA,MAAM,oBAAoB,cAAe,CAAA,GAAA;AAAA,IACvC,CAAC,YAA2B,OAAQ,CAAA;AAAA,GACtC;AAEA,EAAO,OAAA,eAAA,CAAgB,MAAO,CAAA,CAAC,MAAmB,KAAA;AAChD,IAAA,OAAO,CAAC,iBAAA,EAAmB,QAAS,CAAA,kBAAA,CAAmB,MAAM,CAAC,CAAA;AAAA,GAC/D,CAAA;AACH,CAAA;AAGa,MAAA,kBAAA,GAAqB,CAAC,KAAmC,KAAA;AACpE,EAAA,MAAM,EAAE,KAAO,EAAA,KAAA,EAAO,YAAY,KAAO,EAAA,UAAA,GAAa,OAAU,GAAA,KAAA;AAChE,EAAM,MAAA,SAAA,GAAY,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AO,UAAW,CAAA,KAAA,EAC3C,QAAC,kBAAA,GAAA,CAAA,cAAA,EAAA,EAAe,GAClB,CACF,EAAA,CAAA;AAAA,MAGF,QAAA,kBAAA,GAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UACC,cAAA,EAAgB,cAAe,CAAA,KAAA,IAAS,EAAC;AAAA,UACzC,mBAAA;AAAA,UACA,eAAA,EAAiB,2BAA2B,EAAC;AAAA,UAC7C,kBAAoB,EAAA,KAAA;AAAA,UACpB,QAAA,EAAU,YAAY,CAAI,GAAA,CAAA;AAAA,UAC1B,MAAA,EAAQ,aAAa,OAAU,GAAA;AAAA;AAAA;AACjC;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { useElementFilter } from '@backstage/core-plugin-api';
|
|
2
3
|
import Grid from '@material-ui/core/Grid';
|
|
3
4
|
import Typography from '@material-ui/core/Typography';
|
|
4
5
|
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
-
import React from 'react';
|
|
6
6
|
|
|
7
7
|
const useStyles = makeStyles((theme) => ({
|
|
8
8
|
value: {
|
|
@@ -25,8 +25,11 @@ function AboutField(props) {
|
|
|
25
25
|
const { label, value, gridSizes, children } = props;
|
|
26
26
|
const classes = useStyles();
|
|
27
27
|
const childElements = useElementFilter(children, (c) => c.getElements());
|
|
28
|
-
const content = childElements.length > 0 ? childElements : /* @__PURE__ */
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
const content = childElements.length > 0 ? childElements : /* @__PURE__ */ jsx(Typography, { variant: "body2", className: classes.value, children: value || `unknown` });
|
|
29
|
+
return /* @__PURE__ */ jsxs(Grid, { item: true, ...gridSizes, children: [
|
|
30
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h2", className: classes.label, children: label }),
|
|
31
|
+
content
|
|
32
|
+
] });
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
export { AboutField };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutField.esm.js","sources":["../../../src/components/CardContentFields/AboutField.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useElementFilter } from '@backstage/core-plugin-api';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n value: {\n fontWeight: 'bold',\n overflow: 'hidden',\n lineHeight: '24px',\n wordBreak: 'break-word',\n },\n label: {\n color: theme.palette.text.secondary,\n textTransform: 'uppercase',\n fontSize: '10px',\n fontWeight: 'bold',\n letterSpacing: 0.5,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n },\n}));\n\n/**\n * Props for {@link AboutField}.\n */\nexport interface AboutFieldProps {\n label: string;\n value?: string;\n gridSizes?: Record<string, number>;\n children?: React.ReactNode;\n}\n\nexport function AboutField(props: AboutFieldProps) {\n const { label, value, gridSizes, children } = props;\n const classes = useStyles();\n\n const childElements = useElementFilter(children, c => c.getElements());\n\n // Content is either children or a string prop `value`\n const content =\n childElements.length > 0 ? (\n childElements\n ) : (\n <Typography variant=\"body2\" className={classes.value}>\n {value || `unknown`}\n </Typography>\n );\n return (\n <Grid item {...gridSizes}>\n <Typography variant=\"h2\" className={classes.label}>\n {label}\n </Typography>\n {content}\n </Grid>\n );\n}\n"],"names":[],"mappings":";;;;;;AAsBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,KAAO,EAAA;AAAA,IACL,UAAY,EAAA,MAAA;AAAA,IACZ,QAAU,EAAA,QAAA;AAAA,IACV,UAAY,EAAA,MAAA;AAAA,IACZ,SAAW,EAAA;AAAA,GACb;AAAA,EACA,KAAO,EAAA;AAAA,IACL,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA;AAAA,IAC1B,aAAe,EAAA,WAAA;AAAA,IACf,QAAU,EAAA,MAAA;AAAA,IACV,UAAY,EAAA,MAAA;AAAA,IACZ,aAAe,EAAA,GAAA;AAAA,IACf,QAAU,EAAA,QAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAE,CAAA,CAAA;AAYK,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAA,MAAM,EAAE,KAAA,EAAO,KAAO,EAAA,SAAA,EAAW,UAAa,GAAA,KAAA;AAC9C,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,MAAM,gBAAgB,gBAAiB,CAAA,QAAA,EAAU,CAAK,CAAA,KAAA,CAAA,CAAE,aAAa,CAAA;AAGrE,EAAA,MAAM,OACJ,GAAA,aAAA,CAAc,MAAS,GAAA,CAAA,GACrB,aAEA,mBAAA,
|
|
1
|
+
{"version":3,"file":"AboutField.esm.js","sources":["../../../src/components/CardContentFields/AboutField.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useElementFilter } from '@backstage/core-plugin-api';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport * as React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n value: {\n fontWeight: 'bold',\n overflow: 'hidden',\n lineHeight: '24px',\n wordBreak: 'break-word',\n },\n label: {\n color: theme.palette.text.secondary,\n textTransform: 'uppercase',\n fontSize: '10px',\n fontWeight: 'bold',\n letterSpacing: 0.5,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n },\n}));\n\n/**\n * Props for {@link AboutField}.\n */\nexport interface AboutFieldProps {\n label: string;\n value?: string;\n gridSizes?: Record<string, number>;\n children?: React.ReactNode;\n}\n\nexport function AboutField(props: AboutFieldProps) {\n const { label, value, gridSizes, children } = props;\n const classes = useStyles();\n\n const childElements = useElementFilter(children, c => c.getElements());\n\n // Content is either children or a string prop `value`\n const content =\n childElements.length > 0 ? (\n childElements\n ) : (\n <Typography variant=\"body2\" className={classes.value}>\n {value || `unknown`}\n </Typography>\n );\n return (\n <Grid item {...gridSizes}>\n <Typography variant=\"h2\" className={classes.label}>\n {label}\n </Typography>\n {content}\n </Grid>\n );\n}\n"],"names":[],"mappings":";;;;;;AAsBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,KAAO,EAAA;AAAA,IACL,UAAY,EAAA,MAAA;AAAA,IACZ,QAAU,EAAA,QAAA;AAAA,IACV,UAAY,EAAA,MAAA;AAAA,IACZ,SAAW,EAAA;AAAA,GACb;AAAA,EACA,KAAO,EAAA;AAAA,IACL,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA;AAAA,IAC1B,aAAe,EAAA,WAAA;AAAA,IACf,QAAU,EAAA,MAAA;AAAA,IACV,UAAY,EAAA,MAAA;AAAA,IACZ,aAAe,EAAA,GAAA;AAAA,IACf,QAAU,EAAA,QAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAE,CAAA,CAAA;AAYK,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAA,MAAM,EAAE,KAAA,EAAO,KAAO,EAAA,SAAA,EAAW,UAAa,GAAA,KAAA;AAC9C,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,MAAM,gBAAgB,gBAAiB,CAAA,QAAA,EAAU,CAAK,CAAA,KAAA,CAAA,CAAE,aAAa,CAAA;AAGrE,EAAA,MAAM,OACJ,GAAA,aAAA,CAAc,MAAS,GAAA,CAAA,GACrB,aAEA,mBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,SAAA,EAAW,OAAQ,CAAA,KAAA,EAC5C,mBAAS,CACZ,OAAA,CAAA,EAAA,CAAA;AAEJ,EAAA,uBACG,IAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAE,GAAG,SACb,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAW,OAAQ,EAAA,IAAA,EAAK,SAAW,EAAA,OAAA,CAAQ,OACzC,QACH,EAAA,KAAA,EAAA,CAAA;AAAA,IACC;AAAA,GACH,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import Card from '@material-ui/core/Card';
|
|
4
4
|
import CardContent from '@material-ui/core/CardContent';
|
|
@@ -40,57 +40,71 @@ const CardContentFields = ({
|
|
|
40
40
|
const currentPage = window.location.pathname;
|
|
41
41
|
const isEntityPage = currentPage.includes("/catalog/");
|
|
42
42
|
const classes = useStyles();
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
Grid,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
xs: membersSize
|
|
52
|
-
},
|
|
53
|
-
/* @__PURE__ */ React.createElement(AboutField, { label: "Latest members" }, members.length ? members.slice(0, 7).map((member) => {
|
|
54
|
-
return /* @__PURE__ */ React.createElement(
|
|
55
|
-
"div",
|
|
56
|
-
{
|
|
57
|
-
style: {
|
|
58
|
-
textAlign: "left",
|
|
59
|
-
backgroundColor: "",
|
|
60
|
-
marginBottom: "0.3rem",
|
|
61
|
-
marginTop: "0.3rem",
|
|
62
|
-
display: "block"
|
|
63
|
-
},
|
|
64
|
-
key: member.userId
|
|
43
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs(Grid, { container: true, children: [
|
|
44
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: descriptionSize, children: /* @__PURE__ */ jsx(AboutField, { label: "Description", children: bazaarProject.description.split("\n").map((str, i) => /* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: str }, i)) }) }),
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
Grid,
|
|
47
|
+
{
|
|
48
|
+
style: {
|
|
49
|
+
display: "flex",
|
|
50
|
+
justifyContent: "flex-end"
|
|
65
51
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
52
|
+
item: true,
|
|
53
|
+
xs: membersSize,
|
|
54
|
+
children: /* @__PURE__ */ jsx(AboutField, { label: "Latest members", children: members.length ? members.slice(0, 7).map((member) => {
|
|
55
|
+
return /* @__PURE__ */ jsxs(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
style: {
|
|
59
|
+
textAlign: "left",
|
|
60
|
+
backgroundColor: "",
|
|
61
|
+
marginBottom: "0.3rem",
|
|
62
|
+
marginTop: "0.3rem",
|
|
63
|
+
display: "block"
|
|
64
|
+
},
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
Avatar,
|
|
68
|
+
{
|
|
69
|
+
displayName: member.userId,
|
|
70
|
+
classes,
|
|
71
|
+
picture: member.picture
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
Link,
|
|
76
|
+
{
|
|
77
|
+
target: "_blank",
|
|
78
|
+
to: member.userRef ? `${catalogEntityRoute(
|
|
79
|
+
parseEntityRef(member.userRef)
|
|
80
|
+
)}` : `http://github.com/${member.userId}`,
|
|
81
|
+
children: member?.userId
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
member.userId
|
|
87
|
+
);
|
|
88
|
+
}) : /* @__PURE__ */ jsx("div", {}) })
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
!isEntityPage && isMember && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(AboutField, { label: "I've joined the project, what's next?", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: 'To learn more about this project, click the "Entity Page" link, where you can view more information about the effort and navigate to the source code itself to begin collaborating.' }) }) }),
|
|
92
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(AboutField, { label: "Status", children: /* @__PURE__ */ jsx(StatusTag, { status: bazaarProject.status }) }) }),
|
|
93
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(AboutField, { label: "size", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", children: bazaarProject.size }) }) }),
|
|
94
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(AboutField, { label: "Start date", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", children: bazaarProject.startDate?.substring(0, 10) || "" }) }) }),
|
|
95
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(AboutField, { label: "End date", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", children: bazaarProject.endDate?.substring(0, 10) || "" }) }) }),
|
|
96
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(AboutField, { label: "Responsible", children: /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
97
|
+
(() => {
|
|
98
|
+
try {
|
|
99
|
+
parseEntityRef(bazaarProject.responsible);
|
|
100
|
+
return /* @__PURE__ */ jsx(EntityRefLink, { entityRef: bazaarProject.responsible });
|
|
101
|
+
} catch {
|
|
102
|
+
return bazaarProject.responsible || "";
|
|
103
|
+
}
|
|
104
|
+
})(),
|
|
105
|
+
" "
|
|
106
|
+
] }) }) })
|
|
107
|
+
] }) }) }) });
|
|
94
108
|
};
|
|
95
109
|
|
|
96
110
|
export { CardContentFields };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContentFields.esm.js","sources":["../../../src/components/CardContentFields/CardContentFields.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport { GridSize } from '@material-ui/core/Grid';\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { Avatar, Link } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { AboutField } from './AboutField';\nimport { StatusTag } from '../StatusTag';\nimport { Member, BazaarProject } from '../../types';\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\n\ntype Props = {\n bazaarProject: BazaarProject;\n members: Member[];\n descriptionSize: GridSize;\n membersSize: GridSize;\n isMember: boolean;\n};\n\nconst useStyles = makeStyles(\n {\n avatar: {\n width: '19px',\n height: '19px',\n float: 'left',\n marginRight: '0.3rem',\n marginTop: '0rem',\n marginBottom: '0rem',\n alignItems: 'left',\n },\n avatarText: {\n fontSize: '8px',\n textAlign: 'left',\n },\n },\n { name: 'CardContentFields' },\n);\n\nexport const CardContentFields = ({\n bazaarProject,\n members,\n descriptionSize,\n membersSize,\n isMember,\n}: Props) => {\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const currentPage = window.location.pathname;\n const isEntityPage = currentPage.includes('/catalog/');\n const classes = useStyles();\n return (\n <div>\n <Card>\n <CardContent>\n <Grid container>\n <Grid item xs={descriptionSize}>\n <AboutField label=\"Description\">\n {bazaarProject.description\n .split('\\n')\n .map((str: string, i: number) => (\n <Typography key={i} variant=\"body2\" paragraph>\n {str}\n </Typography>\n ))}\n </AboutField>\n </Grid>\n\n <Grid\n style={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n item\n xs={membersSize}\n >\n <AboutField label=\"Latest members\">\n {members.length ? (\n members.slice(0, 7).map((member: Member) => {\n return (\n <div\n style={{\n textAlign: 'left',\n backgroundColor: '',\n marginBottom: '0.3rem',\n marginTop: '0.3rem',\n display: 'block',\n }}\n key={member.userId}\n >\n <Avatar\n displayName={member.userId}\n classes={classes}\n picture={member.picture}\n />\n <Link\n target=\"_blank\"\n to={\n member.userRef\n ? `${catalogEntityRoute(\n parseEntityRef(member.userRef),\n )}`\n : `http://github.com/${member.userId}`\n }\n >\n {member?.userId}\n </Link>\n </div>\n );\n })\n ) : (\n <div />\n )}\n </AboutField>\n </Grid>\n\n {!isEntityPage && isMember && (\n <Grid item xs={12}>\n <AboutField label=\"I've joined the project, what's next?\">\n <Typography variant=\"body2\" paragraph>\n To learn more about this project, click the \"Entity Page\"\n link, where you can view more information about the effort\n and navigate to the source code itself to begin\n collaborating.\n </Typography>\n </AboutField>\n </Grid>\n )}\n\n <Grid item xs={2}>\n <AboutField label=\"Status\">\n <StatusTag status={bazaarProject.status} />\n </AboutField>\n </Grid>\n\n <Grid item xs={2}>\n <AboutField label=\"size\">\n <Typography variant=\"body2\">{bazaarProject.size}</Typography>\n </AboutField>\n </Grid>\n\n <Grid item xs={2}>\n <AboutField label=\"Start date\">\n <Typography variant=\"body2\">\n {bazaarProject.startDate?.substring(0, 10) || ''}\n </Typography>\n </AboutField>\n </Grid>\n\n <Grid item xs={2}>\n <AboutField label=\"End date\">\n <Typography variant=\"body2\">\n {bazaarProject.endDate?.substring(0, 10) || ''}\n </Typography>\n </AboutField>\n </Grid>\n\n <Grid item xs={4}>\n <AboutField label=\"Responsible\">\n <Typography variant=\"body2\">\n {(() => {\n try {\n parseEntityRef(bazaarProject.responsible);\n return (\n <EntityRefLink entityRef={bazaarProject.responsible} />\n );\n } catch {\n return bazaarProject.responsible || '';\n }\n })()}{' '}\n </Typography>\n </AboutField>\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,MAAQ,EAAA,MAAA;AAAA,MACR,KAAO,EAAA,MAAA;AAAA,MACP,WAAa,EAAA,QAAA;AAAA,MACb,SAAW,EAAA,MAAA;AAAA,MACX,YAAc,EAAA,MAAA;AAAA,MACd,UAAY,EAAA;AAAA,KACd;AAAA,IACA,UAAY,EAAA;AAAA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AA,OAAA,EAAS,SAAU,CAAA,CAAA,EAAG,EAAE,CAAA,IAAK,EAC9C,CACF,CACF,CAAA,kBAEC,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,CAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,KAAM,EAAA,aAAA,EAAA,kBACf,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAA,EAAA,CAChB,MAAM;AACN,IAAI,IAAA;AACF,MAAA,cAAA,CAAe,cAAc,WAAW,CAAA;AACxC,MAAA,uBACG,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,SAAW,EAAA,aAAA,CAAc,WAAa,EAAA,CAAA;AAAA,KAEjD,CAAA,MAAA;AACN,MAAA,OAAO,cAAc,WAAe,IAAA,EAAA;AAAA;AACtC,GACF,KAAM,GACR,CACF,CACF,CACF,CACF,CACF,CACF,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"CardContentFields.esm.js","sources":["../../../src/components/CardContentFields/CardContentFields.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Grid from '@material-ui/core/Grid';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport Typography from '@material-ui/core/Typography';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\n\nimport { GridSize } from '@material-ui/core/Grid';\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { Avatar, Link } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { AboutField } from './AboutField';\nimport { StatusTag } from '../StatusTag';\nimport { Member, BazaarProject } from '../../types';\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\n\ntype Props = {\n bazaarProject: BazaarProject;\n members: Member[];\n descriptionSize: GridSize;\n membersSize: GridSize;\n isMember: boolean;\n};\n\nconst useStyles = makeStyles(\n {\n avatar: {\n width: '19px',\n height: '19px',\n float: 'left',\n marginRight: '0.3rem',\n marginTop: '0rem',\n marginBottom: '0rem',\n alignItems: 'left',\n },\n avatarText: {\n fontSize: '8px',\n textAlign: 'left',\n },\n },\n { name: 'CardContentFields' },\n);\n\nexport const CardContentFields = ({\n bazaarProject,\n members,\n descriptionSize,\n membersSize,\n isMember,\n}: Props) => {\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const currentPage = window.location.pathname;\n const isEntityPage = currentPage.includes('/catalog/');\n const classes = useStyles();\n return (\n <div>\n <Card>\n <CardContent>\n <Grid container>\n <Grid item xs={descriptionSize}>\n <AboutField label=\"Description\">\n {bazaarProject.description\n .split('\\n')\n .map((str: string, i: number) => (\n <Typography key={i} variant=\"body2\" paragraph>\n {str}\n </Typography>\n ))}\n </AboutField>\n </Grid>\n\n <Grid\n style={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n item\n xs={membersSize}\n >\n <AboutField label=\"Latest members\">\n {members.length ? (\n members.slice(0, 7).map((member: Member) => {\n return (\n <div\n style={{\n textAlign: 'left',\n backgroundColor: '',\n marginBottom: '0.3rem',\n marginTop: '0.3rem',\n display: 'block',\n }}\n key={member.userId}\n >\n <Avatar\n displayName={member.userId}\n classes={classes}\n picture={member.picture}\n />\n <Link\n target=\"_blank\"\n to={\n member.userRef\n ? `${catalogEntityRoute(\n parseEntityRef(member.userRef),\n )}`\n : `http://github.com/${member.userId}`\n }\n >\n {member?.userId}\n </Link>\n </div>\n );\n })\n ) : (\n <div />\n )}\n </AboutField>\n </Grid>\n\n {!isEntityPage && isMember && (\n <Grid item xs={12}>\n <AboutField label=\"I've joined the project, what's next?\">\n <Typography variant=\"body2\" paragraph>\n To learn more about this project, click the \"Entity Page\"\n link, where you can view more information about the effort\n and navigate to the source code itself to begin\n collaborating.\n </Typography>\n </AboutField>\n </Grid>\n )}\n\n <Grid item xs={2}>\n <AboutField label=\"Status\">\n <StatusTag status={bazaarProject.status} />\n </AboutField>\n </Grid>\n\n <Grid item xs={2}>\n <AboutField label=\"size\">\n <Typography variant=\"body2\">{bazaarProject.size}</Typography>\n </AboutField>\n </Grid>\n\n <Grid item xs={2}>\n <AboutField label=\"Start date\">\n <Typography variant=\"body2\">\n {bazaarProject.startDate?.substring(0, 10) || ''}\n </Typography>\n </AboutField>\n </Grid>\n\n <Grid item xs={2}>\n <AboutField label=\"End date\">\n <Typography variant=\"body2\">\n {bazaarProject.endDate?.substring(0, 10) || ''}\n </Typography>\n </AboutField>\n </Grid>\n\n <Grid item xs={4}>\n <AboutField label=\"Responsible\">\n <Typography variant=\"body2\">\n {(() => {\n try {\n parseEntityRef(bazaarProject.responsible);\n return (\n <EntityRefLink entityRef={bazaarProject.responsible} />\n );\n } catch {\n return bazaarProject.responsible || '';\n }\n })()}{' '}\n </Typography>\n </AboutField>\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAwCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,MAAQ,EAAA,MAAA;AAAA,MACR,KAAO,EAAA,MAAA;AAAA,MACP,WAAa,EAAA,QAAA;AAAA,MACb,SAAW,EAAA,MAAA;AAAA,MACX,YAAc,EAAA,MAAA;AAAA,MACd,UAAY,EAAA;AAAA,KACd;AAAA,IACA,UAAY,EAAA;AAAA,MACV,QAAU,EAAA,KAAA;AAAA,MACV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,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,KAAM,EAAA,aAAA,EAChB,QAAC,kBAAA,IAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,OAChB,EAAA,QAAA,EAAA;AAAA,MAAM,CAAA,MAAA;AACN,QAAI,IAAA;AACF,UAAA,cAAA,CAAe,cAAc,WAAW,CAAA;AACxC,UAAA,uBACG,GAAA,CAAA,aAAA,EAAA,EAAc,SAAW,EAAA,aAAA,CAAc,WAAa,EAAA,CAAA;AAAA,SAEjD,CAAA,MAAA;AACN,UAAA,OAAO,cAAc,WAAe,IAAA,EAAA;AAAA;AACtC,OACC,GAAA;AAAA,MAAG;AAAA,KAAA,EACR,GACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA,EACF,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Button from '@material-ui/core/Button';
|
|
3
3
|
import Dialog from '@material-ui/core/Dialog';
|
|
4
4
|
import { CustomDialogTitle, DialogContent, DialogActions } from '../CustomDialogTitle/CustomDialogTitle.esm.js';
|
|
@@ -10,18 +10,23 @@ const ConfirmationDialog = ({
|
|
|
10
10
|
type,
|
|
11
11
|
handleSubmit
|
|
12
12
|
}) => {
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
14
|
Dialog,
|
|
15
15
|
{
|
|
16
16
|
fullWidth: true,
|
|
17
17
|
maxWidth: "xs",
|
|
18
18
|
onClose: handleClose,
|
|
19
19
|
"aria-labelledby": "customized-dialog-title",
|
|
20
|
-
open
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
open,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsxs(CustomDialogTitle, { id: "customized-dialog-title", onClose: handleClose, children: [
|
|
23
|
+
type.charAt(0).toLocaleUpperCase("en-US") + type.slice(1),
|
|
24
|
+
" project"
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx(DialogContent, { dividers: true, children: message }),
|
|
27
|
+
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, { onClick: handleSubmit, color: "primary", type: "submit", children: type }) })
|
|
28
|
+
]
|
|
29
|
+
}
|
|
25
30
|
);
|
|
26
31
|
};
|
|
27
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationDialog.esm.js","sources":["../../../src/components/ConfirmationDialog/ConfirmationDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"ConfirmationDialog.esm.js","sources":["../../../src/components/ConfirmationDialog/ConfirmationDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport {\n CustomDialogTitle,\n DialogActions,\n DialogContent,\n} from '../CustomDialogTitle';\n\ntype Props = {\n open: boolean;\n handleClose: () => void;\n message: (string | JSX.Element)[];\n type: 'delete' | 'unlink';\n handleSubmit: () => void;\n};\n\nexport const ConfirmationDialog = ({\n open,\n handleClose,\n message,\n type,\n handleSubmit,\n}: Props) => {\n return (\n <Dialog\n fullWidth\n maxWidth=\"xs\"\n onClose={handleClose}\n aria-labelledby=\"customized-dialog-title\"\n open={open}\n >\n <CustomDialogTitle id=\"customized-dialog-title\" onClose={handleClose}>\n {type.charAt(0).toLocaleUpperCase('en-US') + type.slice(1)} project\n </CustomDialogTitle>\n\n <DialogContent dividers>{message}</DialogContent>\n\n <DialogActions>\n <Button onClick={handleSubmit} color=\"primary\" type=\"submit\">\n {type}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;AAgCO,MAAM,qBAAqB,CAAC;AAAA,EACjC,IAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAa,KAAA;AACX,EACE,uBAAA,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,SAAS,EAAA,IAAA;AAAA,MACT,QAAS,EAAA,IAAA;AAAA,MACT,OAAS,EAAA,WAAA;AAAA,MACT,iBAAgB,EAAA,yBAAA;AAAA,MAChB,IAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,iBAAkB,EAAA,EAAA,EAAA,EAAG,yBAA0B,EAAA,OAAA,EAAS,WACtD,EAAA,QAAA,EAAA;AAAA,UAAK,IAAA,CAAA,MAAA,CAAO,CAAC,CAAE,CAAA,iBAAA,CAAkB,OAAO,CAAI,GAAA,IAAA,CAAK,MAAM,CAAC,CAAA;AAAA,UAAE;AAAA,SAC7D,EAAA,CAAA;AAAA,wBAEC,GAAA,CAAA,aAAA,EAAA,EAAc,QAAQ,EAAA,IAAA,EAAE,QAAQ,EAAA,OAAA,EAAA,CAAA;AAAA,wBAEjC,GAAA,CAAC,aACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,MAAO,EAAA,EAAA,OAAA,EAAS,YAAc,EAAA,KAAA,EAAM,SAAU,EAAA,IAAA,EAAK,QACjD,EAAA,QAAA,EAAA,IAAA,EACH,CACF,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import IconButton from '@material-ui/core/IconButton';
|
|
3
3
|
import CloseIcon from '@material-ui/icons/Close';
|
|
4
4
|
import Typography from '@material-ui/core/Typography';
|
|
@@ -33,15 +33,18 @@ const DialogActions = withStyles((theme) => ({
|
|
|
33
33
|
const CustomDialogTitle = withStyles(styles)(
|
|
34
34
|
(props) => {
|
|
35
35
|
const { children, classes, onClose, ...other } = props;
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
return /* @__PURE__ */ jsxs(MuiDialogTitle, { disableTypography: true, className: classes.root, ...other, children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", children }),
|
|
38
|
+
onClose ? /* @__PURE__ */ jsx(
|
|
39
|
+
IconButton,
|
|
40
|
+
{
|
|
41
|
+
"aria-label": "close",
|
|
42
|
+
className: classes.closeButton,
|
|
43
|
+
onClick: onClose,
|
|
44
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
45
|
+
}
|
|
46
|
+
) : null
|
|
47
|
+
] });
|
|
45
48
|
}
|
|
46
49
|
);
|
|
47
50
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDialogTitle.esm.js","sources":["../../../src/components/CustomDialogTitle/CustomDialogTitle.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport CloseIcon from '@material-ui/icons/Close';\nimport Typography from '@material-ui/core/Typography';\nimport MuiDialogTitle from '@material-ui/core/DialogTitle';\nimport {\n Theme,\n WithStyles,\n withStyles,\n createStyles,\n} from '@material-ui/core/styles';\nimport MuiDialogContent from '@material-ui/core/DialogContent';\nimport MuiDialogActions from '@material-ui/core/DialogActions';\n\n/*\n DialogTitleProps, DialogTitle, DialogContent and DialogActions \n are copied from the git-release plugin\n*/\n\nexport interface DialogTitleProps extends WithStyles<typeof styles> {\n id: string;\n children: React.ReactNode;\n onClose: () => void;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n root: {\n margin: 0,\n padding: theme.spacing(2),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n });\n\nexport const DialogContent = withStyles((theme: Theme) => ({\n root: {\n padding: theme.spacing(2),\n },\n}))(MuiDialogContent);\n\nexport const DialogActions = withStyles((theme: Theme) => ({\n root: {\n margin: 0,\n padding: theme.spacing(1),\n },\n}))(MuiDialogActions);\n\nexport const CustomDialogTitle = withStyles(styles)(\n (props: DialogTitleProps) => {\n const { children, classes, onClose, ...other } = props;\n return (\n <MuiDialogTitle disableTypography className={classes.root} {...other}>\n <Typography variant=\"h6\">{children}</Typography>\n {onClose ? (\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={onClose}\n >\n <CloseIcon />\n </IconButton>\n ) : null}\n </MuiDialogTitle>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AAyCA,MAAM,MAAA,GAAS,CAAC,KAAA,KACd,YAAa,CAAA;AAAA,EACX,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,CAAA;AAAA,IACR,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GAC1B;AAAA,EACA,WAAa,EAAA;AAAA,IACX,QAAU,EAAA,UAAA;AAAA,IACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACtB,GAAA,EAAK,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACpB,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG;AAAA;AAEjC,CAAC,CAAA;AAEU,MAAA,aAAA,GAAgB,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EACzD,IAAM,EAAA;AAAA,IACJ,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAE5B,CAAA,CAAE,EAAE,gBAAgB;AAEP,MAAA,aAAA,GAAgB,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EACzD,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,CAAA;AAAA,IACR,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAE5B,CAAA,CAAE,EAAE,gBAAgB;AAEP,MAAA,iBAAA,GAAoB,WAAW,MAAM,CAAA;AAAA,EAChD,CAAC,KAA4B,KAAA;AAC3B,IAAA,MAAM,EAAE,QAAU,EAAA,OAAA,EAAS,OAAS,EAAA,GAAG,OAAU,GAAA,KAAA;AACjD,
|
|
1
|
+
{"version":3,"file":"CustomDialogTitle.esm.js","sources":["../../../src/components/CustomDialogTitle/CustomDialogTitle.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport CloseIcon from '@material-ui/icons/Close';\nimport Typography from '@material-ui/core/Typography';\nimport MuiDialogTitle from '@material-ui/core/DialogTitle';\nimport {\n Theme,\n WithStyles,\n withStyles,\n createStyles,\n} from '@material-ui/core/styles';\nimport MuiDialogContent from '@material-ui/core/DialogContent';\nimport MuiDialogActions from '@material-ui/core/DialogActions';\n\n/*\n DialogTitleProps, DialogTitle, DialogContent and DialogActions \n are copied from the git-release plugin\n*/\n\nexport interface DialogTitleProps extends WithStyles<typeof styles> {\n id: string;\n children: React.ReactNode;\n onClose: () => void;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n root: {\n margin: 0,\n padding: theme.spacing(2),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n });\n\nexport const DialogContent = withStyles((theme: Theme) => ({\n root: {\n padding: theme.spacing(2),\n },\n}))(MuiDialogContent);\n\nexport const DialogActions = withStyles((theme: Theme) => ({\n root: {\n margin: 0,\n padding: theme.spacing(1),\n },\n}))(MuiDialogActions);\n\nexport const CustomDialogTitle = withStyles(styles)(\n (props: DialogTitleProps) => {\n const { children, classes, onClose, ...other } = props;\n return (\n <MuiDialogTitle disableTypography className={classes.root} {...other}>\n <Typography variant=\"h6\">{children}</Typography>\n {onClose ? (\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={onClose}\n >\n <CloseIcon />\n </IconButton>\n ) : null}\n </MuiDialogTitle>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AAyCA,MAAM,MAAA,GAAS,CAAC,KAAA,KACd,YAAa,CAAA;AAAA,EACX,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,CAAA;AAAA,IACR,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;A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