@backstage-community/plugin-bazaar 0.2.27 → 0.2.29

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/api.esm.js +120 -0
  4. package/dist/api.esm.js.map +1 -0
  5. package/dist/{esm/index-CM8Pdxty.esm.js → components/About/About.esm.js} +3 -70
  6. package/dist/components/About/About.esm.js.map +1 -0
  7. package/dist/components/AddProjectDialog/AddProjectDialog.esm.js +76 -0
  8. package/dist/components/AddProjectDialog/AddProjectDialog.esm.js.map +1 -0
  9. package/dist/components/BazaarOverviewCard/BazaarOverviewCard.esm.js +107 -0
  10. package/dist/components/BazaarOverviewCard/BazaarOverviewCard.esm.js.map +1 -0
  11. package/dist/components/CardContentFields/AboutField.esm.js +33 -0
  12. package/dist/components/CardContentFields/AboutField.esm.js.map +1 -0
  13. package/dist/components/CardContentFields/CardContentFields.esm.js +87 -0
  14. package/dist/components/CardContentFields/CardContentFields.esm.js.map +1 -0
  15. package/dist/components/ConfirmationDialog/ConfirmationDialog.esm.js +29 -0
  16. package/dist/components/ConfirmationDialog/ConfirmationDialog.esm.js.map +1 -0
  17. package/dist/components/CustomDialogTitle/CustomDialogTitle.esm.js +49 -0
  18. package/dist/components/CustomDialogTitle/CustomDialogTitle.esm.js.map +1 -0
  19. package/dist/components/DateSelector/DateSelector.esm.js +40 -0
  20. package/dist/components/DateSelector/DateSelector.esm.js.map +1 -0
  21. package/dist/components/DoubleDateSelector/DoubleDateSelector.esm.js +34 -0
  22. package/dist/components/DoubleDateSelector/DoubleDateSelector.esm.js.map +1 -0
  23. package/dist/components/EditProjectDialog/EditProjectDialog.esm.js +115 -0
  24. package/dist/components/EditProjectDialog/EditProjectDialog.esm.js.map +1 -0
  25. package/dist/components/EntityBazaarInfoCard/EntityBazaarInfoCard.esm.js +41 -0
  26. package/dist/components/EntityBazaarInfoCard/EntityBazaarInfoCard.esm.js.map +1 -0
  27. package/dist/components/EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js +177 -0
  28. package/dist/components/EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js.map +1 -0
  29. package/dist/components/HomePage/HomePage.esm.js +30 -0
  30. package/dist/components/HomePage/HomePage.esm.js.map +1 -0
  31. package/dist/components/HomePage/index.esm.js +2 -0
  32. package/dist/components/HomePage/index.esm.js.map +1 -0
  33. package/dist/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js +218 -0
  34. package/dist/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js.map +1 -0
  35. package/dist/components/InputField/InputField.esm.js +41 -0
  36. package/dist/components/InputField/InputField.esm.js.map +1 -0
  37. package/dist/components/InputSelector/InputSelector.esm.js +47 -0
  38. package/dist/components/InputSelector/InputSelector.esm.js.map +1 -0
  39. package/dist/components/LinkProjectDialog/LinkProjectDialog.esm.js +68 -0
  40. package/dist/components/LinkProjectDialog/LinkProjectDialog.esm.js.map +1 -0
  41. package/dist/components/ProjectCard/ProjectCard.esm.js +70 -0
  42. package/dist/components/ProjectCard/ProjectCard.esm.js.map +1 -0
  43. package/dist/components/ProjectDialog/ProjectDialog.esm.js +143 -0
  44. package/dist/components/ProjectDialog/ProjectDialog.esm.js.map +1 -0
  45. package/dist/components/ProjectPreview/ProjectPreview.esm.js +79 -0
  46. package/dist/components/ProjectPreview/ProjectPreview.esm.js.map +1 -0
  47. package/dist/components/ProjectSelector/ProjectSelector.esm.js +38 -0
  48. package/dist/components/ProjectSelector/ProjectSelector.esm.js.map +1 -0
  49. package/dist/components/SortMethodSelector/SortMethodSelector.esm.js +35 -0
  50. package/dist/components/SortMethodSelector/SortMethodSelector.esm.js.map +1 -0
  51. package/dist/components/SortView/SortView.esm.js +176 -0
  52. package/dist/components/SortView/SortView.esm.js.map +1 -0
  53. package/dist/components/StatusTag/StatusTag.esm.js +13 -0
  54. package/dist/components/StatusTag/StatusTag.esm.js.map +1 -0
  55. package/dist/index.esm.js +5 -1749
  56. package/dist/index.esm.js.map +1 -1
  57. package/dist/plugin.esm.js +31 -0
  58. package/dist/plugin.esm.js.map +1 -0
  59. package/dist/routes.esm.js +8 -0
  60. package/dist/routes.esm.js.map +1 -0
  61. package/dist/util/fetchMethods.esm.js +26 -0
  62. package/dist/util/fetchMethods.esm.js.map +1 -0
  63. package/dist/util/parseMethods.esm.js +38 -0
  64. package/dist/util/parseMethods.esm.js.map +1 -0
  65. package/dist/util/sortMethods.esm.js +20 -0
  66. package/dist/util/sortMethods.esm.js.map +1 -0
  67. package/package.json +14 -9
  68. package/dist/esm/index-CM8Pdxty.esm.js.map +0 -1
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import Button from '@material-ui/core/Button';
3
+ import Dialog from '@material-ui/core/Dialog';
4
+ import { CustomDialogTitle, DialogContent, DialogActions } from '../CustomDialogTitle/CustomDialogTitle.esm.js';
5
+
6
+ const ConfirmationDialog = ({
7
+ open,
8
+ handleClose,
9
+ message,
10
+ type,
11
+ handleSubmit
12
+ }) => {
13
+ return /* @__PURE__ */ React.createElement(
14
+ Dialog,
15
+ {
16
+ fullWidth: true,
17
+ maxWidth: "xs",
18
+ onClose: handleClose,
19
+ "aria-labelledby": "customized-dialog-title",
20
+ open
21
+ },
22
+ /* @__PURE__ */ React.createElement(CustomDialogTitle, { id: "customized-dialog-title", onClose: handleClose }, type.charAt(0).toLocaleUpperCase("en-US") + type.slice(1), " project"),
23
+ /* @__PURE__ */ React.createElement(DialogContent, { dividers: true }, message),
24
+ /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button, { onClick: handleSubmit, color: "primary", type: "submit" }, type))
25
+ );
26
+ };
27
+
28
+ export { ConfirmationDialog };
29
+ //# sourceMappingURL=ConfirmationDialog.esm.js.map
@@ -0,0 +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 React from 'react';\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":";;;;;AAiCO,MAAM,qBAAqB,CAAC;AAAA,EACjC,IAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AACF,CAAa,KAAA;AACX,EACE,uBAAA,KAAA,CAAA,aAAA;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,KAAA;AAAA,wCAEC,iBAAkB,EAAA,EAAA,EAAA,EAAG,yBAA0B,EAAA,OAAA,EAAS,eACtD,IAAK,CAAA,MAAA,CAAO,CAAC,CAAA,CAAE,kBAAkB,OAAO,CAAA,GAAI,KAAK,KAAM,CAAA,CAAC,GAAE,UAC7D,CAAA;AAAA,oBAEC,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,QAAQ,EAAA,IAAA,EAAA,EAAE,OAAQ,CAAA;AAAA,oBAEjC,KAAA,CAAA,aAAA,CAAC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,MAAO,EAAA,EAAA,OAAA,EAAS,YAAc,EAAA,KAAA,EAAM,SAAU,EAAA,IAAA,EAAK,QACjD,EAAA,EAAA,IACH,CACF,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import IconButton from '@material-ui/core/IconButton';
3
+ import CloseIcon from '@material-ui/icons/Close';
4
+ import Typography from '@material-ui/core/Typography';
5
+ import MuiDialogTitle from '@material-ui/core/DialogTitle';
6
+ import { withStyles, createStyles } from '@material-ui/core/styles';
7
+ import MuiDialogContent from '@material-ui/core/DialogContent';
8
+ import MuiDialogActions from '@material-ui/core/DialogActions';
9
+
10
+ const styles = (theme) => createStyles({
11
+ root: {
12
+ margin: 0,
13
+ padding: theme.spacing(2)
14
+ },
15
+ closeButton: {
16
+ position: "absolute",
17
+ right: theme.spacing(1),
18
+ top: theme.spacing(1),
19
+ color: theme.palette.grey[500]
20
+ }
21
+ });
22
+ const DialogContent = withStyles((theme) => ({
23
+ root: {
24
+ padding: theme.spacing(2)
25
+ }
26
+ }))(MuiDialogContent);
27
+ const DialogActions = withStyles((theme) => ({
28
+ root: {
29
+ margin: 0,
30
+ padding: theme.spacing(1)
31
+ }
32
+ }))(MuiDialogActions);
33
+ const CustomDialogTitle = withStyles(styles)(
34
+ (props) => {
35
+ const { children, classes, onClose, ...other } = props;
36
+ return /* @__PURE__ */ React.createElement(MuiDialogTitle, { disableTypography: true, className: classes.root, ...other }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, children), onClose ? /* @__PURE__ */ React.createElement(
37
+ IconButton,
38
+ {
39
+ "aria-label": "close",
40
+ className: classes.closeButton,
41
+ onClick: onClose
42
+ },
43
+ /* @__PURE__ */ React.createElement(CloseIcon, null)
44
+ ) : null);
45
+ }
46
+ );
47
+
48
+ export { CustomDialogTitle, DialogActions, DialogContent };
49
+ //# sourceMappingURL=CustomDialogTitle.esm.js.map
@@ -0,0 +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,CAAA;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,CAAA;AAAA,GAC/B;AACF,CAAC,CAAA,CAAA;AAEU,MAAA,aAAA,GAAgB,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EACzD,IAAM,EAAA;AAAA,IACJ,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,GAC1B;AACF,CAAA,CAAE,EAAE,gBAAgB,EAAA;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,CAAA;AAAA,GAC1B;AACF,CAAA,CAAE,EAAE,gBAAgB,EAAA;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,CAAA;AACjD,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,iBAAiB,EAAA,IAAA,EAAC,WAAW,OAAQ,CAAA,IAAA,EAAO,GAAG,KAAA,EAAA,sCAC5D,UAAW,EAAA,EAAA,OAAA,EAAQ,IAAM,EAAA,EAAA,QAAS,GAClC,OACC,mBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,YAAW,EAAA,OAAA;AAAA,QACX,WAAW,OAAQ,CAAA,WAAA;AAAA,QACnB,OAAS,EAAA,OAAA;AAAA,OAAA;AAAA,0CAER,SAAU,EAAA,IAAA,CAAA;AAAA,QAEX,IACN,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import FormControl from '@material-ui/core/FormControl';
3
+ import { Controller } from 'react-hook-form';
4
+ import { KeyboardDatePicker } from '@material-ui/pickers/DatePicker';
5
+ import MuiPickersUtilsProvider from '@material-ui/pickers/MuiPickersUtilsProvider';
6
+ import LuxonUtils from '@date-io/luxon';
7
+ import IconButton from '@material-ui/core/IconButton';
8
+ import ClearIcon from '@material-ui/icons/Clear';
9
+
10
+ const DateSelector = ({ name, control, setValue }) => {
11
+ const label = `${name.charAt(0).toLocaleUpperCase("en-US") + name.slice(1, name.indexOf("D"))} date`;
12
+ return /* @__PURE__ */ React.createElement(
13
+ Controller,
14
+ {
15
+ name,
16
+ control,
17
+ render: ({ field }) => /* @__PURE__ */ React.createElement(FormControl, null, /* @__PURE__ */ React.createElement(MuiPickersUtilsProvider, { utils: LuxonUtils }, /* @__PURE__ */ React.createElement(
18
+ KeyboardDatePicker,
19
+ {
20
+ disableToolbar: true,
21
+ format: "dd-MM-yyyy",
22
+ label,
23
+ value: field.value,
24
+ onChange: (date) => {
25
+ setValue(name, date?.toISO());
26
+ },
27
+ InputProps: {
28
+ endAdornment: /* @__PURE__ */ React.createElement(IconButton, { onClick: () => setValue(name, null) }, /* @__PURE__ */ React.createElement(ClearIcon, null))
29
+ },
30
+ InputAdornmentProps: {
31
+ position: "start"
32
+ }
33
+ }
34
+ )))
35
+ }
36
+ );
37
+ };
38
+
39
+ export { DateSelector };
40
+ //# sourceMappingURL=DateSelector.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateSelector.esm.js","sources":["../../../src/components/DateSelector/DateSelector.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 FormControl from '@material-ui/core/FormControl';\nimport { Controller, Control, UseFormSetValue } from 'react-hook-form';\nimport { FormValues } from '../../types';\nimport { KeyboardDatePicker } from '@material-ui/pickers/DatePicker';\nimport MuiPickersUtilsProvider from '@material-ui/pickers/MuiPickersUtilsProvider';\nimport LuxonUtils from '@date-io/luxon';\nimport IconButton from '@material-ui/core/IconButton';\nimport ClearIcon from '@material-ui/icons/Clear';\n\ntype Props = {\n name: 'startDate' | 'endDate';\n control: Control<FormValues, object>;\n setValue: UseFormSetValue<FormValues>;\n};\n\nexport const DateSelector = ({ name, control, setValue }: Props) => {\n const label = `${\n name.charAt(0).toLocaleUpperCase('en-US') + name.slice(1, name.indexOf('D'))\n } date`;\n\n return (\n <Controller\n name={name}\n control={control}\n render={({ field }) => (\n <FormControl>\n <MuiPickersUtilsProvider utils={LuxonUtils}>\n <KeyboardDatePicker\n disableToolbar\n format=\"dd-MM-yyyy\"\n label={label}\n value={field.value}\n onChange={date => {\n setValue(name, date?.toISO());\n }}\n InputProps={{\n endAdornment: (\n <IconButton onClick={() => setValue(name, null)}>\n <ClearIcon />\n </IconButton>\n ),\n }}\n InputAdornmentProps={{\n position: 'start',\n }}\n />\n </MuiPickersUtilsProvider>\n </FormControl>\n )}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAgCO,MAAM,eAAe,CAAC,EAAE,IAAM,EAAA,OAAA,EAAS,UAAsB,KAAA;AAClE,EAAA,MAAM,QAAQ,CACZ,EAAA,IAAA,CAAK,MAAO,CAAA,CAAC,EAAE,iBAAkB,CAAA,OAAO,CAAI,GAAA,IAAA,CAAK,MAAM,CAAG,EAAA,IAAA,CAAK,OAAQ,CAAA,GAAG,CAAC,CAC7E,CAAA,KAAA,CAAA,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA,EAAQ,CAAC,EAAE,KAAM,EAAA,yCACd,WACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,uBAAwB,EAAA,EAAA,KAAA,EAAO,UAC9B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,cAAc,EAAA,IAAA;AAAA,UACd,MAAO,EAAA,YAAA;AAAA,UACP,KAAA;AAAA,UACA,OAAO,KAAM,CAAA,KAAA;AAAA,UACb,UAAU,CAAQ,IAAA,KAAA;AAChB,YAAS,QAAA,CAAA,IAAA,EAAM,IAAM,EAAA,KAAA,EAAO,CAAA,CAAA;AAAA,WAC9B;AAAA,UACA,UAAY,EAAA;AAAA,YACV,YAAA,kBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAS,EAAA,MAAM,QAAS,CAAA,IAAA,EAAM,IAAI,CAAA,EAAA,kBAC3C,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,IAAU,CACb,CAAA;AAAA,WAEJ;AAAA,UACA,mBAAqB,EAAA;AAAA,YACnB,QAAU,EAAA,OAAA;AAAA,WACZ;AAAA,SAAA;AAAA,OAEJ,CACF,CAAA;AAAA,KAAA;AAAA,GAEJ,CAAA;AAEJ;;;;"}
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { DateSelector } from '../DateSelector/DateSelector.esm.js';
3
+ import Typography from '@material-ui/core/Typography';
4
+ import { makeStyles } from '@material-ui/core/styles';
5
+
6
+ const useStyles = makeStyles({
7
+ container: {
8
+ marginTop: "0.25rem",
9
+ textAlign: "center",
10
+ display: "flex",
11
+ flexDirection: "row",
12
+ justifyContent: "space-between"
13
+ },
14
+ startDate: {
15
+ float: "left"
16
+ },
17
+ endDate: {
18
+ float: "right"
19
+ },
20
+ dash: {
21
+ display: "flex",
22
+ justifyContent: "center",
23
+ alignItems: "center",
24
+ fontSize: "1.5rem",
25
+ margin: "0 1rem"
26
+ }
27
+ });
28
+ const DoubleDateSelector = ({ control, setValue }) => {
29
+ const classes = useStyles();
30
+ return /* @__PURE__ */ React.createElement("div", { className: classes.container }, /* @__PURE__ */ React.createElement("div", { className: classes.startDate }, /* @__PURE__ */ React.createElement(DateSelector, { name: "startDate", control, setValue })), /* @__PURE__ */ React.createElement(Typography, { className: classes.dash }, "-"), /* @__PURE__ */ React.createElement("div", { className: classes.endDate }, /* @__PURE__ */ React.createElement(DateSelector, { name: "endDate", control, setValue })));
31
+ };
32
+
33
+ export { DoubleDateSelector };
34
+ //# sourceMappingURL=DoubleDateSelector.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoubleDateSelector.esm.js","sources":["../../../src/components/DoubleDateSelector/DoubleDateSelector.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 { Control, UseFormSetValue } from 'react-hook-form';\nimport { FormValues } from '../../types';\nimport { DateSelector } from '../DateSelector/DateSelector';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\n\ntype Props = {\n control: Control<FormValues, object>;\n setValue: UseFormSetValue<FormValues>;\n};\n\nconst useStyles = makeStyles({\n container: {\n marginTop: '0.25rem',\n textAlign: 'center',\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n startDate: {\n float: 'left',\n },\n endDate: {\n float: 'right',\n },\n dash: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n fontSize: '1.5rem',\n margin: '0 1rem',\n },\n});\n\nexport const DoubleDateSelector = ({ control, setValue }: Props) => {\n const classes = useStyles();\n\n return (\n <div className={classes.container}>\n <div className={classes.startDate}>\n <DateSelector name=\"startDate\" control={control} setValue={setValue} />\n </div>\n\n <Typography className={classes.dash}>-</Typography>\n <div className={classes.endDate}>\n <DateSelector name=\"endDate\" control={control} setValue={setValue} />\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AA4BA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAW,EAAA;AAAA,IACT,SAAW,EAAA,SAAA;AAAA,IACX,SAAW,EAAA,QAAA;AAAA,IACX,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA,KAAA;AAAA,IACf,cAAgB,EAAA,eAAA;AAAA,GAClB;AAAA,EACA,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,MAAA;AAAA,GACT;AAAA,EACA,OAAS,EAAA;AAAA,IACP,KAAO,EAAA,OAAA;AAAA,GACT;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA,QAAA;AAAA,IAChB,UAAY,EAAA,QAAA;AAAA,IACZ,QAAU,EAAA,QAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF,CAAC,CAAA,CAAA;AAEM,MAAM,kBAAqB,GAAA,CAAC,EAAE,OAAA,EAAS,UAAsB,KAAA;AAClE,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAE1B,EAAA,2CACG,KAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,SAAA,EAAA,sCACrB,KAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,SAAA,EAAA,sCACrB,YAAa,EAAA,EAAA,IAAA,EAAK,WAAY,EAAA,OAAA,EAAkB,UAAoB,CACvE,CAAA,kBAEC,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,WAAW,OAAQ,CAAA,IAAA,EAAA,EAAM,GAAC,CAAA,sCACrC,KAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,OAAA,EAAA,sCACrB,YAAa,EAAA,EAAA,IAAA,EAAK,WAAU,OAAkB,EAAA,QAAA,EAAoB,CACrE,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,115 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { useApi, alertApiRef } from '@backstage/core-plugin-api';
3
+ import { ProjectDialog } from '../ProjectDialog/ProjectDialog.esm.js';
4
+ import { bazaarApiRef } from '../../api.esm.js';
5
+ import { ConfirmationDialog } from '../ConfirmationDialog/ConfirmationDialog.esm.js';
6
+ import Button from '@material-ui/core/Button';
7
+ import { makeStyles } from '@material-ui/core/styles';
8
+
9
+ const useStyles = makeStyles({
10
+ button: {
11
+ marginLeft: "0",
12
+ marginRight: "auto"
13
+ },
14
+ wordBreak: {
15
+ wordBreak: "break-all",
16
+ whiteSpace: "normal",
17
+ margin: "-0.25rem 0"
18
+ }
19
+ });
20
+ const EditProjectDialog = ({
21
+ bazaarProject,
22
+ openEdit,
23
+ handleEditClose,
24
+ handleCardClose,
25
+ fetchBazaarProject
26
+ }) => {
27
+ const classes = useStyles();
28
+ const bazaarApi = useApi(bazaarApiRef);
29
+ const alertApi = useApi(alertApiRef);
30
+ const [openDelete, setOpenDelete] = useState(false);
31
+ const [defaultValues, setDefaultValues] = useState({
32
+ ...bazaarProject,
33
+ startDate: bazaarProject.startDate ?? null,
34
+ endDate: bazaarProject.endDate ?? null
35
+ });
36
+ const handleDeleteClose = () => {
37
+ setOpenDelete(false);
38
+ handleEditClose();
39
+ if (handleCardClose) handleCardClose();
40
+ };
41
+ const handleDeleteSubmit = async () => {
42
+ await bazaarApi.deleteProject(bazaarProject.id);
43
+ handleDeleteClose();
44
+ fetchBazaarProject();
45
+ alertApi.post({
46
+ message: `Deleted project '${bazaarProject.title}' from the Bazaar list`,
47
+ severity: "success",
48
+ display: "transient"
49
+ });
50
+ };
51
+ useEffect(() => {
52
+ setDefaultValues({
53
+ ...bazaarProject,
54
+ startDate: bazaarProject.startDate ?? null,
55
+ endDate: bazaarProject.endDate ?? null
56
+ });
57
+ }, [bazaarProject]);
58
+ const handleEditSubmit = async (getValues) => {
59
+ const formValues = getValues();
60
+ const updateResponse = await bazaarApi.updateProject({
61
+ ...formValues,
62
+ id: bazaarProject.id,
63
+ entityRef: bazaarProject.entityRef,
64
+ membersCount: bazaarProject.membersCount,
65
+ startDate: formValues?.startDate ?? null,
66
+ endDate: formValues?.endDate ?? null
67
+ });
68
+ if (updateResponse.status === "ok") fetchBazaarProject();
69
+ handleEditClose();
70
+ alertApi.post({
71
+ message: `Updated project '${formValues.title}' in the Bazaar list`,
72
+ severity: "success",
73
+ display: "transient"
74
+ });
75
+ };
76
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
77
+ ConfirmationDialog,
78
+ {
79
+ open: openDelete,
80
+ handleClose: handleDeleteClose,
81
+ message: [
82
+ "Are you sure you want to delete ",
83
+ /* @__PURE__ */ React.createElement("b", { key: bazaarProject.id, className: classes.wordBreak }, bazaarProject.title),
84
+ " from the Bazaar?"
85
+ ],
86
+ type: "delete",
87
+ handleSubmit: handleDeleteSubmit
88
+ }
89
+ ), /* @__PURE__ */ React.createElement(
90
+ ProjectDialog,
91
+ {
92
+ title: "Edit project",
93
+ handleSave: handleEditSubmit,
94
+ isAddForm: false,
95
+ defaultValues,
96
+ open: openEdit,
97
+ handleClose: handleEditClose,
98
+ deleteButton: /* @__PURE__ */ React.createElement(
99
+ Button,
100
+ {
101
+ color: "primary",
102
+ type: "submit",
103
+ className: classes.button,
104
+ onClick: () => {
105
+ setOpenDelete(true);
106
+ }
107
+ },
108
+ "Delete project"
109
+ )
110
+ }
111
+ ));
112
+ };
113
+
114
+ export { EditProjectDialog };
115
+ //# sourceMappingURL=EditProjectDialog.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditProjectDialog.esm.js","sources":["../../../src/components/EditProjectDialog/EditProjectDialog.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, { useState, useEffect } from 'react';\nimport { useApi, alertApiRef } from '@backstage/core-plugin-api';\nimport { ProjectDialog } from '../ProjectDialog';\nimport { BazaarProject, FormValues } from '../../types';\nimport { bazaarApiRef } from '../../api';\nimport { UseFormGetValues } from 'react-hook-form';\nimport { ConfirmationDialog } from '../ConfirmationDialog';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\n\ntype Props = {\n bazaarProject: BazaarProject;\n openEdit: boolean;\n handleEditClose: () => void;\n handleCardClose?: () => void;\n fetchBazaarProject: () => Promise<BazaarProject | null>;\n};\n\nconst useStyles = makeStyles({\n button: {\n marginLeft: '0',\n marginRight: 'auto',\n },\n wordBreak: {\n wordBreak: 'break-all',\n whiteSpace: 'normal',\n margin: '-0.25rem 0',\n },\n});\n\nexport const EditProjectDialog = ({\n bazaarProject,\n openEdit,\n handleEditClose,\n handleCardClose,\n fetchBazaarProject,\n}: Props) => {\n const classes = useStyles();\n const bazaarApi = useApi(bazaarApiRef);\n const alertApi = useApi(alertApiRef);\n const [openDelete, setOpenDelete] = useState(false);\n const [defaultValues, setDefaultValues] = useState<FormValues>({\n ...bazaarProject,\n startDate: bazaarProject.startDate ?? null,\n endDate: bazaarProject.endDate ?? null,\n });\n\n const handleDeleteClose = () => {\n setOpenDelete(false);\n handleEditClose();\n\n if (handleCardClose) handleCardClose();\n };\n\n const handleDeleteSubmit = async () => {\n await bazaarApi.deleteProject(bazaarProject.id);\n\n handleDeleteClose();\n fetchBazaarProject();\n alertApi.post({\n message: `Deleted project '${bazaarProject.title}' from the Bazaar list`,\n severity: 'success',\n display: 'transient',\n });\n };\n\n useEffect(() => {\n setDefaultValues({\n ...bazaarProject,\n startDate: bazaarProject.startDate ?? null,\n endDate: bazaarProject.endDate ?? null,\n });\n }, [bazaarProject]);\n\n const handleEditSubmit: (\n getValues: UseFormGetValues<FormValues>,\n ) => Promise<void> = async (getValues: UseFormGetValues<FormValues>) => {\n const formValues = getValues();\n\n const updateResponse = await bazaarApi.updateProject({\n ...formValues,\n id: bazaarProject.id,\n entityRef: bazaarProject.entityRef,\n membersCount: bazaarProject.membersCount,\n startDate: formValues?.startDate ?? null,\n endDate: formValues?.endDate ?? null,\n });\n\n if (updateResponse.status === 'ok') fetchBazaarProject();\n handleEditClose();\n alertApi.post({\n message: `Updated project '${formValues.title}' in the Bazaar list`,\n severity: 'success',\n display: 'transient',\n });\n };\n\n return (\n <div>\n <ConfirmationDialog\n open={openDelete}\n handleClose={handleDeleteClose}\n message={[\n 'Are you sure you want to delete ',\n <b key={bazaarProject.id} className={classes.wordBreak}>\n {bazaarProject.title}\n </b>,\n ' from the Bazaar?',\n ]}\n type=\"delete\"\n handleSubmit={handleDeleteSubmit}\n />\n\n <ProjectDialog\n title=\"Edit project\"\n handleSave={handleEditSubmit}\n isAddForm={false}\n defaultValues={defaultValues}\n open={openEdit}\n handleClose={handleEditClose}\n deleteButton={\n <Button\n color=\"primary\"\n type=\"submit\"\n className={classes.button}\n onClick={() => {\n setOpenDelete(true);\n }}\n >\n Delete project\n </Button>\n }\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAkCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,MAAQ,EAAA;AAAA,IACN,UAAY,EAAA,GAAA;AAAA,IACZ,WAAa,EAAA,MAAA;AAAA,GACf;AAAA,EACA,SAAW,EAAA;AAAA,IACT,SAAW,EAAA,WAAA;AAAA,IACX,UAAY,EAAA,QAAA;AAAA,IACZ,MAAQ,EAAA,YAAA;AAAA,GACV;AACF,CAAC,CAAA,CAAA;AAEM,MAAM,oBAAoB,CAAC;AAAA,EAChC,aAAA;AAAA,EACA,QAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA,kBAAA;AACF,CAAa,KAAA;AACX,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AACrC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA,CAAA;AACnC,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAClD,E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AA,QAAA;AAAA,UACC,KAAM,EAAA,SAAA;AAAA,UACN,IAAK,EAAA,QAAA;AAAA,UACL,WAAW,OAAQ,CAAA,MAAA;AAAA,UACnB,SAAS,MAAM;AACb,YAAA,aAAA,CAAc,IAAI,CAAA,CAAA;AAAA,WACpB;AAAA,SAAA;AAAA,QACD,gBAAA;AAAA,OAED;AAAA,KAAA;AAAA,GAGN,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,41 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import useAsyncFn from 'react-use/esm/useAsyncFn';
3
+ import { useApi } from '@backstage/core-plugin-api';
4
+ import { stringifyEntityRef } from '@backstage/catalog-model';
5
+ import { useEntity } from '@backstage/plugin-catalog-react';
6
+ import { bazaarApiRef } from '../../api.esm.js';
7
+ import { EntityBazaarInfoContent } from '../EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js';
8
+ import Card from '@material-ui/core/Card';
9
+ import { parseBazaarResponse } from '../../util/parseMethods.esm.js';
10
+
11
+ const EntityBazaarInfoCard = () => {
12
+ const { entity } = useEntity();
13
+ const bazaarApi = useApi(bazaarApiRef);
14
+ const [bazaarProject, fetchBazaarProject] = useAsyncFn(async () => {
15
+ const response = await bazaarApi.getProjectByRef(
16
+ stringifyEntityRef(entity)
17
+ );
18
+ return await parseBazaarResponse(response);
19
+ });
20
+ const [isBazaar, setIsBazaar] = useState(bazaarProject.value ?? false);
21
+ useEffect(() => {
22
+ fetchBazaarProject();
23
+ }, [fetchBazaarProject]);
24
+ useEffect(() => {
25
+ const isBazaarProject = bazaarProject.value !== void 0;
26
+ setIsBazaar(isBazaarProject);
27
+ }, [bazaarProject.value]);
28
+ if (isBazaar) {
29
+ return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(
30
+ EntityBazaarInfoContent,
31
+ {
32
+ bazaarProject: bazaarProject.value,
33
+ fetchBazaarProject
34
+ }
35
+ ));
36
+ }
37
+ return null;
38
+ };
39
+
40
+ export { EntityBazaarInfoCard };
41
+ //# sourceMappingURL=EntityBazaarInfoCard.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityBazaarInfoCard.esm.js","sources":["../../../src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.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, { useState, useEffect } from 'react';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { bazaarApiRef } from '../../api';\nimport { EntityBazaarInfoContent } from '../EntityBazaarInfoContent';\nimport Card from '@material-ui/core/Card';\nimport { parseBazaarResponse } from '../../util/parseMethods';\n\n/** @public */\nexport const EntityBazaarInfoCard = () => {\n const { entity } = useEntity();\n const bazaarApi = useApi(bazaarApiRef);\n\n const [bazaarProject, fetchBazaarProject] = useAsyncFn(async () => {\n const response = await bazaarApi.getProjectByRef(\n stringifyEntityRef(entity),\n );\n\n return await parseBazaarResponse(response);\n });\n\n const [isBazaar, setIsBazaar] = useState(bazaarProject.value ?? false);\n\n useEffect(() => {\n fetchBazaarProject();\n }, [fetchBazaarProject]);\n\n useEffect(() => {\n const isBazaarProject = bazaarProject.value !== undefined;\n\n setIsBazaar(isBazaarProject);\n }, [bazaarProject.value]);\n\n if (isBazaar) {\n return (\n <Card>\n <EntityBazaarInfoContent\n bazaarProject={bazaarProject.value}\n fetchBazaarProject={fetchBazaarProject}\n />\n </Card>\n );\n }\n return null;\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2BO,MAAM,uBAAuB,MAAM;AACxC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AAErC,EAAA,MAAM,CAAC,aAAA,EAAe,kBAAkB,CAAA,GAAI,WAAW,YAAY;AACjE,IAAM,MAAA,QAAA,GAAW,MAAM,SAAU,CAAA,eAAA;AAAA,MAC/B,mBAAmB,MAAM,CAAA;AAAA,KAC3B,CAAA;AAEA,IAAO,OAAA,MAAM,oBAAoB,QAAQ,CAAA,CAAA;AAAA,GAC1C,CAAA,CAAA;AAED,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,IAAI,QAAS,CAAA,aAAA,CAAc,SAAS,KAAK,CAAA,CAAA;AAErE,EAAA,SAAA,CAAU,MAAM;AACd,IAAmB,kBAAA,EAAA,CAAA;AAAA,GACrB,EAAG,CAAC,kBAAkB,CAAC,CAAA,CAAA;AAEvB,EAAA,SAAA,CAAU,MAAM;AACd,IAAM,MAAA,eAAA,GAAkB,cAAc,KAAU,KAAA,KAAA,CAAA,CAAA;AAEhD,IAAA,WAAA,CAAY,eAAe,CAAA,CAAA;AAAA,GAC1B,EAAA,CAAC,aAAc,CAAA,KAAK,CAAC,CAAA,CAAA;AAExB,EAAA,IAAI,QAAU,EAAA;AACZ,IAAA,2CACG,IACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,eAAe,aAAc,CAAA,KAAA;AAAA,QAC7B,kBAAA;AAAA,OAAA;AAAA,KAEJ,CAAA,CAAA;AAAA,GAEJ;AACA,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
@@ -0,0 +1,177 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import CardHeader from '@material-ui/core/CardHeader';
3
+ import Divider from '@material-ui/core/Divider';
4
+ import IconButton from '@material-ui/core/IconButton';
5
+ import { makeStyles } from '@material-ui/core/styles';
6
+ import Typography from '@material-ui/core/Typography';
7
+ import { HeaderIconLinkRow } from '@backstage/core-components';
8
+ import EditIcon from '@material-ui/icons/Edit';
9
+ import ChatIcon from '@material-ui/icons/Chat';
10
+ import PersonAddIcon from '@material-ui/icons/PersonAdd';
11
+ import DashboardIcon from '@material-ui/icons/Dashboard';
12
+ import LinkOffIcon from '@material-ui/icons/LinkOff';
13
+ import Description from '@material-ui/icons/Description';
14
+ import { EditProjectDialog } from '../EditProjectDialog/EditProjectDialog.esm.js';
15
+ import { useApi, identityApiRef } from '@backstage/core-plugin-api';
16
+ import { bazaarApiRef } from '../../api.esm.js';
17
+ import Alert from '@material-ui/lab/Alert';
18
+ import useAsyncFn from 'react-use/esm/useAsyncFn';
19
+ import ExitToAppIcon from '@material-ui/icons/ExitToApp';
20
+ import { parseEntityRef } from '@backstage/catalog-model';
21
+ import { ConfirmationDialog } from '../ConfirmationDialog/ConfirmationDialog.esm.js';
22
+ import { CardContentFields } from '../CardContentFields/CardContentFields.esm.js';
23
+ import { fetchProjectMembers } from '../../util/fetchMethods.esm.js';
24
+
25
+ const useStyles = makeStyles({
26
+ wordBreak: {
27
+ wordBreak: "break-all",
28
+ whiteSpace: "normal",
29
+ margin: "-0.25rem 0"
30
+ }
31
+ });
32
+ const EntityBazaarInfoContent = ({
33
+ bazaarProject,
34
+ fetchBazaarProject
35
+ }) => {
36
+ const classes = useStyles();
37
+ const bazaarApi = useApi(bazaarApiRef);
38
+ const identity = useApi(identityApiRef);
39
+ const [openEdit, setOpenEdit] = useState(false);
40
+ const [isMember, setIsMember] = useState(false);
41
+ const [openUnlink, setOpenUnlink] = useState(false);
42
+ const [members, fetchMembers] = useAsyncFn(async () => {
43
+ return bazaarProject ? await fetchProjectMembers(bazaarApi, bazaarProject) : [];
44
+ });
45
+ const [userId, fetchUserId] = useAsyncFn(async () => {
46
+ return await (await identity.getProfileInfo()).displayName;
47
+ });
48
+ useEffect(() => {
49
+ fetchMembers();
50
+ fetchUserId();
51
+ }, [fetchMembers, fetchUserId]);
52
+ useEffect(() => {
53
+ if (members.value && userId.value) {
54
+ setIsMember(
55
+ members.value?.map((member) => member.userId).indexOf(userId.value) >= 0
56
+ );
57
+ }
58
+ }, [bazaarProject, members, identity, userId.value]);
59
+ const handleMembersClick = async () => {
60
+ if (userId.value) {
61
+ if (!isMember) {
62
+ await bazaarApi.addMember(bazaarProject?.id, userId.value);
63
+ } else {
64
+ await bazaarApi.deleteMember(bazaarProject.id, userId.value);
65
+ }
66
+ setIsMember(!isMember);
67
+ fetchMembers();
68
+ }
69
+ };
70
+ const links = [
71
+ {
72
+ label: "Entity page",
73
+ icon: /* @__PURE__ */ React.createElement(DashboardIcon, null),
74
+ disabled: true
75
+ },
76
+ {
77
+ label: "Unlink project",
78
+ icon: /* @__PURE__ */ React.createElement(LinkOffIcon, null),
79
+ disabled: false,
80
+ onClick: () => {
81
+ setOpenUnlink(true);
82
+ }
83
+ },
84
+ {
85
+ label: isMember ? "Leave" : "Join",
86
+ icon: isMember ? /* @__PURE__ */ React.createElement(ExitToAppIcon, null) : /* @__PURE__ */ React.createElement(PersonAddIcon, null),
87
+ href: "",
88
+ onClick: async () => {
89
+ handleMembersClick();
90
+ }
91
+ },
92
+ {
93
+ label: "Community",
94
+ icon: /* @__PURE__ */ React.createElement(ChatIcon, null),
95
+ href: bazaarProject?.community,
96
+ disabled: bazaarProject?.community === "" || !isMember
97
+ },
98
+ {
99
+ label: "Docs",
100
+ icon: /* @__PURE__ */ React.createElement(Description, null),
101
+ href: bazaarProject?.docs,
102
+ disabled: bazaarProject?.docs === null || bazaarProject?.docs === ""
103
+ }
104
+ ];
105
+ const handleEditClose = () => {
106
+ setOpenEdit(false);
107
+ };
108
+ const handleUnlinkClose = () => {
109
+ setOpenUnlink(false);
110
+ };
111
+ const handleUnlinkSubmit = async () => {
112
+ const updateResponse = await bazaarApi.updateProject({
113
+ ...bazaarProject,
114
+ entityRef: null
115
+ });
116
+ if (updateResponse.status === "ok") {
117
+ handleUnlinkClose();
118
+ fetchBazaarProject();
119
+ }
120
+ };
121
+ if (members.error) {
122
+ return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, members?.error?.message);
123
+ }
124
+ if (bazaarProject) {
125
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
126
+ EditProjectDialog,
127
+ {
128
+ bazaarProject,
129
+ openEdit,
130
+ handleEditClose,
131
+ fetchBazaarProject
132
+ }
133
+ ), openUnlink && /* @__PURE__ */ React.createElement(
134
+ ConfirmationDialog,
135
+ {
136
+ open: openUnlink,
137
+ handleClose: handleUnlinkClose,
138
+ message: [
139
+ "Are you sure you want to unlink ",
140
+ /* @__PURE__ */ React.createElement("b", { className: classes.wordBreak }, parseEntityRef(bazaarProject.entityRef).name),
141
+ " from ",
142
+ /* @__PURE__ */ React.createElement("b", { className: classes.wordBreak }, bazaarProject.title),
143
+ " ?"
144
+ ],
145
+ type: "unlink",
146
+ handleSubmit: handleUnlinkSubmit
147
+ }
148
+ ), /* @__PURE__ */ React.createElement(
149
+ CardHeader,
150
+ {
151
+ title: /* @__PURE__ */ React.createElement(Typography, { paragraph: true, className: classes.wordBreak }, bazaarProject?.title),
152
+ action: /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
153
+ IconButton,
154
+ {
155
+ onClick: () => {
156
+ setOpenEdit(true);
157
+ }
158
+ },
159
+ /* @__PURE__ */ React.createElement(EditIcon, null)
160
+ )),
161
+ subheader: /* @__PURE__ */ React.createElement(HeaderIconLinkRow, { links })
162
+ }
163
+ ), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
164
+ CardContentFields,
165
+ {
166
+ bazaarProject,
167
+ members: members.value || [],
168
+ descriptionSize: 10,
169
+ membersSize: 2
170
+ }
171
+ ));
172
+ }
173
+ return null;
174
+ };
175
+
176
+ export { EntityBazaarInfoContent };
177
+ //# sourceMappingURL=EntityBazaarInfoContent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityBazaarInfoContent.esm.js","sources":["../../../src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.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, { useState, useEffect } from 'react';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport {\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n} from '@backstage/core-components';\nimport EditIcon from '@material-ui/icons/Edit';\nimport ChatIcon from '@material-ui/icons/Chat';\nimport PersonAddIcon from '@material-ui/icons/PersonAdd';\nimport DashboardIcon from '@material-ui/icons/Dashboard';\nimport LinkOffIcon from '@material-ui/icons/LinkOff';\nimport Description from '@material-ui/icons/Description';\nimport { EditProjectDialog } from '../EditProjectDialog';\nimport { useApi, identityApiRef } from '@backstage/core-plugin-api';\nimport { BazaarProject, Member } from '../../types';\nimport { bazaarApiRef } from '../../api';\nimport Alert from '@material-ui/lab/Alert';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { ConfirmationDialog } from '../ConfirmationDialog';\nimport { CardContentFields } from '../CardContentFields';\nimport { fetchProjectMembers } from '../../util/fetchMethods';\n\nconst useStyles = makeStyles({\n wordBreak: {\n wordBreak: 'break-all',\n whiteSpace: 'normal',\n margin: '-0.25rem 0',\n },\n});\n\ntype Props = {\n bazaarProject: BazaarProject | null | undefined;\n fetchBazaarProject: () => Promise<BazaarProject | null>;\n};\n\nexport const EntityBazaarInfoContent = ({\n bazaarProject,\n fetchBazaarProject,\n}: Props) => {\n const classes = useStyles();\n const bazaarApi = useApi(bazaarApiRef);\n const identity = useApi(identityApiRef);\n const [openEdit, setOpenEdit] = useState(false);\n const [isMember, setIsMember] = useState(false);\n const [openUnlink, setOpenUnlink] = useState(false);\n const [members, fetchMembers] = useAsyncFn(async () => {\n return bazaarProject\n ? await fetchProjectMembers(bazaarApi, bazaarProject)\n : [];\n });\n\n const [userId, fetchUserId] = useAsyncFn(async () => {\n return await (\n await identity.getProfileInfo()\n ).displayName;\n });\n\n useEffect(() => {\n fetchMembers();\n fetchUserId();\n }, [fetchMembers, fetchUserId]);\n\n useEffect(() => {\n if (members.value && userId.value) {\n setIsMember(\n members.value\n ?.map((member: Member) => member.userId)\n .indexOf(userId.value) >= 0,\n );\n }\n }, [bazaarProject, members, identity, userId.value]);\n\n const handleMembersClick = async () => {\n if (userId.value) {\n if (!isMember) {\n await bazaarApi.addMember(bazaarProject?.id!, userId.value);\n } else {\n await bazaarApi.deleteMember(bazaarProject!.id, userId.value);\n }\n setIsMember(!isMember);\n fetchMembers();\n }\n };\n\n const links: IconLinkVerticalProps[] = [\n {\n label: 'Entity page',\n icon: <DashboardIcon />,\n disabled: true,\n },\n {\n label: 'Unlink project',\n icon: <LinkOffIcon />,\n disabled: false,\n onClick: () => {\n setOpenUnlink(true);\n },\n },\n {\n label: isMember ? 'Leave' : 'Join',\n icon: isMember ? <ExitToAppIcon /> : <PersonAddIcon />,\n href: '',\n onClick: async () => {\n handleMembersClick();\n },\n },\n {\n label: 'Community',\n icon: <ChatIcon />,\n href: bazaarProject?.community,\n disabled: bazaarProject?.community === '' || !isMember,\n },\n {\n label: 'Docs',\n icon: <Description />,\n href: bazaarProject?.docs,\n disabled: bazaarProject?.docs === null || bazaarProject?.docs === '',\n },\n ];\n\n const handleEditClose = () => {\n setOpenEdit(false);\n };\n\n const handleUnlinkClose = () => {\n setOpenUnlink(false);\n };\n\n const handleUnlinkSubmit = async () => {\n const updateResponse = await bazaarApi.updateProject({\n ...bazaarProject,\n entityRef: null,\n });\n\n if (updateResponse.status === 'ok') {\n handleUnlinkClose();\n fetchBazaarProject();\n }\n };\n\n if (members.error) {\n return <Alert severity=\"error\">{members?.error?.message}</Alert>;\n }\n\n if (bazaarProject) {\n return (\n <div>\n <EditProjectDialog\n bazaarProject={bazaarProject!}\n openEdit={openEdit}\n handleEditClose={handleEditClose}\n fetchBazaarProject={fetchBazaarProject}\n />\n\n {openUnlink && (\n <ConfirmationDialog\n open={openUnlink}\n handleClose={handleUnlinkClose}\n message={[\n 'Are you sure you want to unlink ',\n <b className={classes.wordBreak}>\n {parseEntityRef(bazaarProject.entityRef!).name}\n </b>,\n ' from ',\n <b className={classes.wordBreak}>{bazaarProject.title}</b>,\n ' ?',\n ]}\n type=\"unlink\"\n handleSubmit={handleUnlinkSubmit}\n />\n )}\n\n <CardHeader\n title={\n <Typography paragraph className={classes.wordBreak}>\n {bazaarProject?.title!}\n </Typography>\n }\n action={\n <div>\n <IconButton\n onClick={() => {\n setOpenEdit(true);\n }}\n >\n <EditIcon />\n </IconButton>\n </div>\n }\n subheader={<HeaderIconLinkRow links={links} />}\n />\n <Divider />\n\n <CardContentFields\n bazaarProject={bazaarProject}\n members={members.value || []}\n descriptionSize={10}\n membersSize={2}\n />\n </div>\n );\n }\n return null;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAW,EAAA;AAAA,IACT,SAAW,EAAA,WAAA;AAAA,IACX,UAAY,EAAA,QAAA;AAAA,IACZ,MAAQ,EAAA,YAAA;AAAA,GACV;AACF,CAAC,CAAA,CAAA;AAOM,MAAM,0BAA0B,CAAC;AAAA,EACtC,aAAA;AAAA,EACA,kBAAA;AAC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A;AAAA,OAAA;AAAA,KAEjB,CAAA,CAAA;AAAA,GAEJ;AACA,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { Header, RoutedTabs } from '@backstage/core-components';
3
+ import { SortView } from '../SortView/SortView.esm.js';
4
+ import { About } from '../About/About.esm.js';
5
+
6
+ const HomePage = (props) => {
7
+ const { title, subtitle, fullWidth, fullHeight } = props;
8
+ const tabContent = [
9
+ {
10
+ path: "/",
11
+ title: "Home",
12
+ children: /* @__PURE__ */ React.createElement(SortView, { fullWidth, fullHeight })
13
+ },
14
+ {
15
+ path: "/about",
16
+ title: "About",
17
+ children: /* @__PURE__ */ React.createElement(About, null)
18
+ }
19
+ ];
20
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
21
+ Header,
22
+ {
23
+ title: title || "Bazaar",
24
+ subtitle: subtitle || "Marketplace for inner source projects"
25
+ }
26
+ ), /* @__PURE__ */ React.createElement(RoutedTabs, { routes: tabContent }));
27
+ };
28
+
29
+ export { HomePage };
30
+ //# sourceMappingURL=HomePage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HomePage.esm.js","sources":["../../../src/components/HomePage/HomePage.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 { Header, RoutedTabs } from '@backstage/core-components';\nimport { SortView } from '../SortView';\nimport { About } from '../About';\n\n/** @public */\nexport type HomePageProps = {\n title?: string;\n subtitle?: string;\n fullWidth?: boolean;\n fullHeight?: boolean;\n};\n\nexport const HomePage = (props: HomePageProps) => {\n const { title, subtitle, fullWidth, fullHeight } = props;\n\n const tabContent = [\n {\n path: '/',\n title: 'Home',\n children: <SortView fullWidth={fullWidth} fullHeight={fullHeight} />,\n },\n {\n path: '/about',\n title: 'About',\n children: <About />,\n },\n ];\n\n return (\n <div>\n <Header\n title={title || 'Bazaar'}\n subtitle={subtitle || 'Marketplace for inner source projects'}\n />\n <RoutedTabs routes={tabContent} />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AA6Ba,MAAA,QAAA,GAAW,CAAC,KAAyB,KAAA;AAChD,EAAA,MAAM,EAAE,KAAA,EAAO,QAAU,EAAA,SAAA,EAAW,YAAe,GAAA,KAAA,CAAA;AAEnD,EAAA,MAAM,UAAa,GAAA;AAAA,IACjB;AAAA,MACE,IAAM,EAAA,GAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,QAAU,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,SAAA,EAAsB,UAAwB,EAAA,CAAA;AAAA,KACpE;AAAA,IACA;AAAA,MACE,IAAM,EAAA,QAAA;AAAA,MACN,KAAO,EAAA,OAAA;AAAA,MACP,QAAA,sCAAW,KAAM,EAAA,IAAA,CAAA;AAAA,KACnB;AAAA,GACF,CAAA;AAEA,EAAA,2CACG,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAO,KAAS,IAAA,QAAA;AAAA,MAChB,UAAU,QAAY,IAAA,uCAAA;AAAA,KAAA;AAAA,GAExB,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,MAAA,EAAQ,YAAY,CAClC,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,2 @@
1
+ export { HomePage } from './HomePage.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}