@backstage-community/plugin-bazaar 0.2.27 → 0.2.28

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 (67) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/api.esm.js +120 -0
  3. package/dist/api.esm.js.map +1 -0
  4. package/dist/{esm/index-CM8Pdxty.esm.js → components/About/About.esm.js} +3 -70
  5. package/dist/components/About/About.esm.js.map +1 -0
  6. package/dist/components/AddProjectDialog/AddProjectDialog.esm.js +76 -0
  7. package/dist/components/AddProjectDialog/AddProjectDialog.esm.js.map +1 -0
  8. package/dist/components/BazaarOverviewCard/BazaarOverviewCard.esm.js +107 -0
  9. package/dist/components/BazaarOverviewCard/BazaarOverviewCard.esm.js.map +1 -0
  10. package/dist/components/CardContentFields/AboutField.esm.js +33 -0
  11. package/dist/components/CardContentFields/AboutField.esm.js.map +1 -0
  12. package/dist/components/CardContentFields/CardContentFields.esm.js +87 -0
  13. package/dist/components/CardContentFields/CardContentFields.esm.js.map +1 -0
  14. package/dist/components/ConfirmationDialog/ConfirmationDialog.esm.js +29 -0
  15. package/dist/components/ConfirmationDialog/ConfirmationDialog.esm.js.map +1 -0
  16. package/dist/components/CustomDialogTitle/CustomDialogTitle.esm.js +49 -0
  17. package/dist/components/CustomDialogTitle/CustomDialogTitle.esm.js.map +1 -0
  18. package/dist/components/DateSelector/DateSelector.esm.js +40 -0
  19. package/dist/components/DateSelector/DateSelector.esm.js.map +1 -0
  20. package/dist/components/DoubleDateSelector/DoubleDateSelector.esm.js +34 -0
  21. package/dist/components/DoubleDateSelector/DoubleDateSelector.esm.js.map +1 -0
  22. package/dist/components/EditProjectDialog/EditProjectDialog.esm.js +115 -0
  23. package/dist/components/EditProjectDialog/EditProjectDialog.esm.js.map +1 -0
  24. package/dist/components/EntityBazaarInfoCard/EntityBazaarInfoCard.esm.js +41 -0
  25. package/dist/components/EntityBazaarInfoCard/EntityBazaarInfoCard.esm.js.map +1 -0
  26. package/dist/components/EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js +177 -0
  27. package/dist/components/EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js.map +1 -0
  28. package/dist/components/HomePage/HomePage.esm.js +30 -0
  29. package/dist/components/HomePage/HomePage.esm.js.map +1 -0
  30. package/dist/components/HomePage/index.esm.js +2 -0
  31. package/dist/components/HomePage/index.esm.js.map +1 -0
  32. package/dist/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js +218 -0
  33. package/dist/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js.map +1 -0
  34. package/dist/components/InputField/InputField.esm.js +41 -0
  35. package/dist/components/InputField/InputField.esm.js.map +1 -0
  36. package/dist/components/InputSelector/InputSelector.esm.js +47 -0
  37. package/dist/components/InputSelector/InputSelector.esm.js.map +1 -0
  38. package/dist/components/LinkProjectDialog/LinkProjectDialog.esm.js +68 -0
  39. package/dist/components/LinkProjectDialog/LinkProjectDialog.esm.js.map +1 -0
  40. package/dist/components/ProjectCard/ProjectCard.esm.js +70 -0
  41. package/dist/components/ProjectCard/ProjectCard.esm.js.map +1 -0
  42. package/dist/components/ProjectDialog/ProjectDialog.esm.js +143 -0
  43. package/dist/components/ProjectDialog/ProjectDialog.esm.js.map +1 -0
  44. package/dist/components/ProjectPreview/ProjectPreview.esm.js +79 -0
  45. package/dist/components/ProjectPreview/ProjectPreview.esm.js.map +1 -0
  46. package/dist/components/ProjectSelector/ProjectSelector.esm.js +38 -0
  47. package/dist/components/ProjectSelector/ProjectSelector.esm.js.map +1 -0
  48. package/dist/components/SortMethodSelector/SortMethodSelector.esm.js +35 -0
  49. package/dist/components/SortMethodSelector/SortMethodSelector.esm.js.map +1 -0
  50. package/dist/components/SortView/SortView.esm.js +176 -0
  51. package/dist/components/SortView/SortView.esm.js.map +1 -0
  52. package/dist/components/StatusTag/StatusTag.esm.js +13 -0
  53. package/dist/components/StatusTag/StatusTag.esm.js.map +1 -0
  54. package/dist/index.esm.js +5 -1749
  55. package/dist/index.esm.js.map +1 -1
  56. package/dist/plugin.esm.js +31 -0
  57. package/dist/plugin.esm.js.map +1 -0
  58. package/dist/routes.esm.js +8 -0
  59. package/dist/routes.esm.js.map +1 -0
  60. package/dist/util/fetchMethods.esm.js +26 -0
  61. package/dist/util/fetchMethods.esm.js.map +1 -0
  62. package/dist/util/parseMethods.esm.js +38 -0
  63. package/dist/util/parseMethods.esm.js.map +1 -0
  64. package/dist/util/sortMethods.esm.js +20 -0
  65. package/dist/util/sortMethods.esm.js.map +1 -0
  66. package/package.json +14 -9
  67. package/dist/esm/index-CM8Pdxty.esm.js.map +0 -1
@@ -0,0 +1,218 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import Card from '@material-ui/core/Card';
3
+ import CardHeader from '@material-ui/core/CardHeader';
4
+ import Divider from '@material-ui/core/Divider';
5
+ import IconButton from '@material-ui/core/IconButton';
6
+ import { makeStyles } from '@material-ui/core/styles';
7
+ import Typography from '@material-ui/core/Typography';
8
+ import { HeaderIconLinkRow } from '@backstage/core-components';
9
+ import EditIcon from '@material-ui/icons/Edit';
10
+ import ChatIcon from '@material-ui/icons/Chat';
11
+ import PersonAddIcon from '@material-ui/icons/PersonAdd';
12
+ import InsertLinkIcon from '@material-ui/icons/InsertLink';
13
+ import DashboardIcon from '@material-ui/icons/Dashboard';
14
+ import CloseIcon from '@material-ui/icons/Close';
15
+ import LinkOffIcon from '@material-ui/icons/LinkOff';
16
+ import Description from '@material-ui/icons/Description';
17
+ import { EditProjectDialog } from '../EditProjectDialog/EditProjectDialog.esm.js';
18
+ import ExitToAppIcon from '@material-ui/icons/ExitToApp';
19
+ import { useRouteRef, useApi, identityApiRef, alertApiRef } from '@backstage/core-plugin-api';
20
+ import { bazaarApiRef } from '../../api.esm.js';
21
+ import Alert from '@material-ui/lab/Alert';
22
+ import useAsyncFn from 'react-use/esm/useAsyncFn';
23
+ import { entityRouteRef, catalogApiRef } from '@backstage/plugin-catalog-react';
24
+ import { stringifyEntityRef, parseEntityRef } from '@backstage/catalog-model';
25
+ import { ConfirmationDialog } from '../ConfirmationDialog/ConfirmationDialog.esm.js';
26
+ import { CardContentFields } from '../CardContentFields/CardContentFields.esm.js';
27
+ import { LinkProjectDialog } from '../LinkProjectDialog/LinkProjectDialog.esm.js';
28
+ import { fetchCatalogItems, fetchProjectMembers } from '../../util/fetchMethods.esm.js';
29
+ import { parseBazaarResponse } from '../../util/parseMethods.esm.js';
30
+
31
+ const useStyles = makeStyles({
32
+ wordBreak: {
33
+ wordBreak: "break-all",
34
+ whiteSpace: "normal",
35
+ margin: "-0.25rem 0"
36
+ }
37
+ });
38
+ const HomePageBazaarInfoCard = ({
39
+ initProject,
40
+ handleClose,
41
+ initEntity
42
+ }) => {
43
+ const classes = useStyles();
44
+ const entityLink = useRouteRef(entityRouteRef);
45
+ const bazaarApi = useApi(bazaarApiRef);
46
+ const identity = useApi(identityApiRef);
47
+ const alertApi = useApi(alertApiRef);
48
+ const catalogApi = useApi(catalogApiRef);
49
+ const [openEdit, setOpenEdit] = useState(false);
50
+ const [openProjectSelector, setOpenProjectSelector] = useState(false);
51
+ const [openUnlink, setOpenUnlink] = useState(false);
52
+ const [isMember, setIsMember] = useState(false);
53
+ const [catalogEntities, fetchCatalogEntities] = useAsyncFn(async () => {
54
+ const entities = await fetchCatalogItems(catalogApi);
55
+ const bazaarProjects = await bazaarApi.getProjects();
56
+ const bazaarLinkedRefs = bazaarProjects.data.filter((entity) => entity.entity_ref !== null).map((entity) => entity.entity_ref);
57
+ return entities.filter(
58
+ (entity) => !bazaarLinkedRefs.includes(stringifyEntityRef(entity))
59
+ );
60
+ });
61
+ const [bazaarProject, fetchBazaarProject] = useAsyncFn(async () => {
62
+ const response = await bazaarApi.getProjectById(initProject.id);
63
+ return await parseBazaarResponse(response);
64
+ });
65
+ const [members, fetchMembers] = useAsyncFn(async () => {
66
+ return fetchProjectMembers(bazaarApi, bazaarProject.value ?? initProject);
67
+ });
68
+ const [userId, fetchUserId] = useAsyncFn(async () => {
69
+ return await (await identity.getProfileInfo()).displayName;
70
+ });
71
+ useEffect(() => {
72
+ fetchMembers();
73
+ fetchBazaarProject();
74
+ fetchCatalogEntities();
75
+ fetchUserId();
76
+ }, [fetchMembers, fetchBazaarProject, fetchCatalogEntities, fetchUserId]);
77
+ useEffect(() => {
78
+ if (members.value && userId.value) {
79
+ setIsMember(
80
+ members.value?.map((member) => member.userId).indexOf(userId.value) >= 0
81
+ );
82
+ }
83
+ }, [bazaarProject.value, members, identity, userId.value]);
84
+ const handleMembersClick = async () => {
85
+ if (userId.value) {
86
+ if (!isMember) {
87
+ await bazaarApi.addMember(bazaarProject.value.id, userId.value);
88
+ } else {
89
+ await bazaarApi.deleteMember(bazaarProject.value.id, userId.value);
90
+ }
91
+ setIsMember(!isMember);
92
+ fetchMembers();
93
+ }
94
+ };
95
+ const getEntityPageLink = () => {
96
+ if (bazaarProject?.value?.entityRef) {
97
+ const { name, kind, namespace } = parseEntityRef(
98
+ bazaarProject.value.entityRef
99
+ );
100
+ return entityLink({ kind, namespace, name });
101
+ }
102
+ return "";
103
+ };
104
+ const handleLink = () => {
105
+ if (bazaarProject.value?.entityRef) {
106
+ setOpenUnlink(true);
107
+ } else {
108
+ fetchCatalogEntities();
109
+ setOpenProjectSelector(true);
110
+ }
111
+ };
112
+ const links = [
113
+ {
114
+ label: "Entity page",
115
+ icon: /* @__PURE__ */ React.createElement(DashboardIcon, null),
116
+ href: bazaarProject.value?.entityRef ? getEntityPageLink() : "",
117
+ disabled: bazaarProject.value?.entityRef === null
118
+ },
119
+ {
120
+ label: bazaarProject.value?.entityRef ? "Unlink project" : "Link project",
121
+ icon: bazaarProject.value?.entityRef ? /* @__PURE__ */ React.createElement(LinkOffIcon, null) : /* @__PURE__ */ React.createElement(InsertLinkIcon, null),
122
+ onClick: handleLink
123
+ },
124
+ {
125
+ label: isMember ? "Leave" : "Join",
126
+ icon: isMember ? /* @__PURE__ */ React.createElement(ExitToAppIcon, null) : /* @__PURE__ */ React.createElement(PersonAddIcon, null),
127
+ href: "",
128
+ onClick: async () => {
129
+ handleMembersClick();
130
+ }
131
+ },
132
+ {
133
+ label: "Community",
134
+ icon: /* @__PURE__ */ React.createElement(ChatIcon, null),
135
+ href: bazaarProject.value?.community,
136
+ disabled: !bazaarProject.value?.community || !isMember
137
+ },
138
+ {
139
+ label: "Docs",
140
+ icon: /* @__PURE__ */ React.createElement(Description, null),
141
+ href: bazaarProject.value?.docs,
142
+ disabled: bazaarProject.value?.docs === null || bazaarProject.value?.docs === ""
143
+ }
144
+ ];
145
+ const handleUnlinkSubmit = async () => {
146
+ const updateResponse = await bazaarApi.updateProject({
147
+ ...bazaarProject.value,
148
+ entityRef: null
149
+ });
150
+ if (updateResponse.status === "ok") {
151
+ setOpenUnlink(false);
152
+ fetchBazaarProject();
153
+ alertApi.post({
154
+ message: `Unlinked entity '${parseEntityRef(bazaarProject.value?.entityRef).name}' from the project ${bazaarProject.value?.title}`,
155
+ severity: "success",
156
+ display: "transient"
157
+ });
158
+ }
159
+ };
160
+ if (bazaarProject.error) {
161
+ return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, bazaarProject?.error?.message);
162
+ } else if (members.error) {
163
+ return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, members?.error?.message);
164
+ }
165
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
166
+ LinkProjectDialog,
167
+ {
168
+ openProjectSelector,
169
+ handleProjectSelectorClose: () => setOpenProjectSelector(false),
170
+ catalogEntities: catalogEntities.value || [],
171
+ bazaarProject: bazaarProject.value || initProject,
172
+ fetchBazaarProject,
173
+ initEntity
174
+ }
175
+ ), openUnlink && /* @__PURE__ */ React.createElement(
176
+ ConfirmationDialog,
177
+ {
178
+ open: openUnlink,
179
+ handleClose: () => setOpenUnlink(false),
180
+ message: [
181
+ "Are you sure you want to unlink ",
182
+ /* @__PURE__ */ React.createElement("b", { className: classes.wordBreak }, parseEntityRef(bazaarProject.value?.entityRef).name),
183
+ " from ",
184
+ /* @__PURE__ */ React.createElement("b", { className: classes.wordBreak }, bazaarProject.value?.title),
185
+ " ?"
186
+ ],
187
+ type: "unlink",
188
+ handleSubmit: handleUnlinkSubmit
189
+ }
190
+ ), /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(
191
+ EditProjectDialog,
192
+ {
193
+ bazaarProject: bazaarProject.value || initProject,
194
+ openEdit,
195
+ handleEditClose: () => setOpenEdit(false),
196
+ handleCardClose: handleClose,
197
+ fetchBazaarProject
198
+ }
199
+ ), /* @__PURE__ */ React.createElement(
200
+ CardHeader,
201
+ {
202
+ title: /* @__PURE__ */ React.createElement(Typography, { paragraph: true, className: classes.wordBreak }, bazaarProject.value?.title || initProject.title),
203
+ action: /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(IconButton, { onClick: () => setOpenEdit(true) }, /* @__PURE__ */ React.createElement(EditIcon, null)), /* @__PURE__ */ React.createElement(IconButton, { onClick: handleClose }, /* @__PURE__ */ React.createElement(CloseIcon, null))),
204
+ subheader: /* @__PURE__ */ React.createElement(HeaderIconLinkRow, { links })
205
+ }
206
+ ), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
207
+ CardContentFields,
208
+ {
209
+ bazaarProject: bazaarProject.value || initProject,
210
+ members: members.value || [],
211
+ descriptionSize: 9,
212
+ membersSize: 3
213
+ }
214
+ )));
215
+ };
216
+
217
+ export { HomePageBazaarInfoCard };
218
+ //# sourceMappingURL=HomePageBazaarInfoCard.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HomePageBazaarInfoCard.esm.js","sources":["../../../src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.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 Card from '@material-ui/core/Card';\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 InsertLinkIcon from '@material-ui/icons/InsertLink';\nimport DashboardIcon from '@material-ui/icons/Dashboard';\nimport CloseIcon from '@material-ui/icons/Close';\nimport LinkOffIcon from '@material-ui/icons/LinkOff';\nimport Description from '@material-ui/icons/Description';\nimport { EditProjectDialog } from '../EditProjectDialog';\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\nimport {\n useApi,\n identityApiRef,\n useRouteRef,\n alertApiRef,\n} from '@backstage/core-plugin-api';\nimport { Member, BazaarProject } from '../../types';\nimport { bazaarApiRef } from '../../api';\nimport Alert from '@material-ui/lab/Alert';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react';\n\nimport {\n stringifyEntityRef,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\n\nimport { ConfirmationDialog } from '../ConfirmationDialog/ConfirmationDialog';\nimport { CardContentFields } from '../CardContentFields/CardContentFields';\nimport { LinkProjectDialog } from '../LinkProjectDialog';\nimport {\n fetchCatalogItems,\n fetchProjectMembers,\n} from '../../util/fetchMethods';\nimport { parseBazaarResponse } from '../../util/parseMethods';\n\nconst useStyles = makeStyles({\n wordBreak: {\n wordBreak: 'break-all',\n whiteSpace: 'normal',\n margin: '-0.25rem 0',\n },\n});\n\ntype Props = {\n initProject: BazaarProject;\n handleClose: () => void;\n initEntity: Entity;\n};\n\nexport const HomePageBazaarInfoCard = ({\n initProject,\n handleClose,\n initEntity,\n}: Props) => {\n const classes = useStyles();\n const entityLink = useRouteRef(entityRouteRef);\n const bazaarApi = useApi(bazaarApiRef);\n const identity = useApi(identityApiRef);\n const alertApi = useApi(alertApiRef);\n const catalogApi = useApi(catalogApiRef);\n const [openEdit, setOpenEdit] = useState(false);\n const [openProjectSelector, setOpenProjectSelector] = useState(false);\n const [openUnlink, setOpenUnlink] = useState(false);\n const [isMember, setIsMember] = useState(false);\n\n const [catalogEntities, fetchCatalogEntities] = useAsyncFn(async () => {\n const entities = await fetchCatalogItems(catalogApi);\n const bazaarProjects = await bazaarApi.getProjects();\n const bazaarLinkedRefs: string[] = bazaarProjects.data\n .filter((entity: any) => entity.entity_ref !== null)\n .map((entity: any) => entity.entity_ref);\n\n return entities.filter(\n (entity: Entity) =>\n !bazaarLinkedRefs.includes(stringifyEntityRef(entity)),\n );\n });\n\n const [bazaarProject, fetchBazaarProject] = useAsyncFn(async () => {\n const response = await bazaarApi.getProjectById(initProject.id);\n return await parseBazaarResponse(response);\n });\n\n const [members, fetchMembers] = useAsyncFn(async () => {\n return fetchProjectMembers(bazaarApi, bazaarProject.value ?? initProject);\n });\n\n const [userId, fetchUserId] = useAsyncFn(async () => {\n return await (\n await identity.getProfileInfo()\n ).displayName;\n });\n\n useEffect(() => {\n fetchMembers();\n fetchBazaarProject();\n fetchCatalogEntities();\n fetchUserId();\n }, [fetchMembers, fetchBazaarProject, fetchCatalogEntities, 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.value, members, identity, userId.value]);\n\n const handleMembersClick = async () => {\n if (userId.value) {\n if (!isMember) {\n await bazaarApi.addMember(bazaarProject.value!.id, userId.value);\n } else {\n await bazaarApi.deleteMember(bazaarProject.value!.id, userId.value);\n }\n setIsMember(!isMember);\n fetchMembers();\n }\n };\n\n const getEntityPageLink = () => {\n if (bazaarProject?.value?.entityRef) {\n const { name, kind, namespace } = parseEntityRef(\n bazaarProject.value.entityRef,\n );\n return entityLink({ kind, namespace, name });\n }\n return '';\n };\n\n const handleLink = () => {\n if (bazaarProject.value?.entityRef) {\n setOpenUnlink(true);\n } else {\n fetchCatalogEntities();\n setOpenProjectSelector(true);\n }\n };\n\n const links: IconLinkVerticalProps[] = [\n {\n label: 'Entity page',\n icon: <DashboardIcon />,\n href: bazaarProject.value?.entityRef ? getEntityPageLink() : '',\n disabled: bazaarProject.value?.entityRef === null,\n },\n {\n label: bazaarProject.value?.entityRef ? 'Unlink project' : 'Link project',\n icon: bazaarProject.value?.entityRef ? (\n <LinkOffIcon />\n ) : (\n <InsertLinkIcon />\n ),\n onClick: handleLink,\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.value?.community,\n disabled: !bazaarProject.value?.community || !isMember,\n },\n {\n label: 'Docs',\n icon: <Description />,\n href: bazaarProject.value?.docs,\n disabled:\n bazaarProject.value?.docs === null || bazaarProject.value?.docs === '',\n },\n ];\n\n const handleUnlinkSubmit = async () => {\n const updateResponse = await bazaarApi.updateProject({\n ...bazaarProject.value,\n entityRef: null,\n });\n\n if (updateResponse.status === 'ok') {\n setOpenUnlink(false);\n fetchBazaarProject();\n alertApi.post({\n message: `Unlinked entity '${\n parseEntityRef(bazaarProject.value?.entityRef!).name\n }' from the project ${bazaarProject.value?.title}`,\n severity: 'success',\n display: 'transient',\n });\n }\n };\n\n if (bazaarProject.error) {\n return <Alert severity=\"error\">{bazaarProject?.error?.message}</Alert>;\n } else if (members.error) {\n return <Alert severity=\"error\">{members?.error?.message}</Alert>;\n }\n\n return (\n <div>\n <LinkProjectDialog\n openProjectSelector={openProjectSelector}\n handleProjectSelectorClose={() => setOpenProjectSelector(false)}\n catalogEntities={catalogEntities.value || []}\n bazaarProject={bazaarProject.value || initProject}\n fetchBazaarProject={fetchBazaarProject}\n initEntity={initEntity}\n />\n\n {openUnlink && (\n <ConfirmationDialog\n open={openUnlink}\n handleClose={() => setOpenUnlink(false)}\n message={[\n 'Are you sure you want to unlink ',\n <b className={classes.wordBreak}>\n {parseEntityRef(bazaarProject.value?.entityRef!).name}\n </b>,\n ' from ',\n <b className={classes.wordBreak}>{bazaarProject.value?.title}</b>,\n ' ?',\n ]}\n type=\"unlink\"\n handleSubmit={handleUnlinkSubmit}\n />\n )}\n\n <Card>\n <EditProjectDialog\n bazaarProject={bazaarProject.value || initProject}\n openEdit={openEdit}\n handleEditClose={() => setOpenEdit(false)}\n handleCardClose={handleClose}\n fetchBazaarProject={fetchBazaarProject}\n />\n\n <CardHeader\n title={\n <Typography paragraph className={classes.wordBreak}>\n {bazaarProject.value?.title || initProject.title}\n </Typography>\n }\n action={\n <div>\n <IconButton onClick={() => setOpenEdit(true)}>\n <EditIcon />\n </IconButton>\n <IconButton onClick={handleClose}>\n <CloseIcon />\n </IconButton>\n </div>\n }\n subheader={<HeaderIconLinkRow links={links} />}\n />\n <Divider />\n\n <CardContentFields\n bazaarProject={bazaarProject.value || initProject}\n members={members.value || []}\n descriptionSize={9}\n membersSize={3}\n />\n </Card>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,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;AAQM,MAAM,yBAAyB,CAAC;AAAA,EACrC,WAAA;AA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kBAAY,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,KAAc,EAAA,CAAA;AAAA,KAAA;AAAA,GAC9C,kBACC,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,IAAQ,CAET,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAe,cAAc,KAAS,IAAA,WAAA;AAAA,MACtC,OAAA,EAAS,OAAQ,CAAA,KAAA,IAAS,EAAC;AAAA,MAC3B,eAAiB,EAAA,CAAA;AAAA,MACjB,WAAa,EAAA,CAAA;AAAA,KAAA;AAAA,GAEjB,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { Controller } from 'react-hook-form';
3
+ import TextField from '@material-ui/core/TextField';
4
+
5
+ const InputField = ({
6
+ inputType,
7
+ error,
8
+ control,
9
+ helperText,
10
+ placeholder,
11
+ rules
12
+ }) => {
13
+ const label = inputType.charAt(0).toLocaleUpperCase("en-US") + inputType.slice(1);
14
+ return /* @__PURE__ */ React.createElement(
15
+ Controller,
16
+ {
17
+ name: inputType,
18
+ control,
19
+ rules,
20
+ render: ({ field }) => /* @__PURE__ */ React.createElement(
21
+ TextField,
22
+ {
23
+ ...field,
24
+ required: rules?.required,
25
+ margin: "dense",
26
+ multiline: true,
27
+ id: "title",
28
+ type: "text",
29
+ fullWidth: true,
30
+ label,
31
+ placeholder,
32
+ error: !!error,
33
+ helperText: error && helperText
34
+ }
35
+ )
36
+ }
37
+ );
38
+ };
39
+
40
+ export { InputField };
41
+ //# sourceMappingURL=InputField.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputField.esm.js","sources":["../../../src/components/InputField/InputField.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 {\n Controller,\n Control,\n FieldError,\n ValidationRule,\n} from 'react-hook-form';\nimport TextField from '@material-ui/core/TextField';\nimport { FormValues } from '../../types';\n\ntype Rules = {\n required: boolean;\n pattern?: ValidationRule<RegExp> | undefined;\n};\n\ntype Props = {\n inputType: 'description' | 'community' | 'responsible' | 'title' | 'docs';\n error?: FieldError | undefined;\n control: Control<FormValues, object>;\n helperText?: string;\n placeholder?: string;\n rules?: Rules | undefined;\n};\n\nexport const InputField = ({\n inputType,\n error,\n control,\n helperText,\n placeholder,\n rules,\n}: Props) => {\n const label =\n inputType.charAt(0).toLocaleUpperCase('en-US') + inputType.slice(1);\n\n return (\n <Controller\n name={inputType}\n control={control}\n rules={rules}\n render={({ field }) => (\n <TextField\n {...field}\n required={rules?.required}\n margin=\"dense\"\n multiline\n id=\"title\"\n type=\"text\"\n fullWidth\n label={label}\n placeholder={placeholder}\n error={!!error}\n helperText={error && helperText}\n />\n )}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAwCO,MAAM,aAAa,CAAC;AAAA,EACzB,SAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AACF,CAAa,KAAA;AACX,EAAM,MAAA,KAAA,GACJ,SAAU,CAAA,MAAA,CAAO,CAAC,CAAA,CAAE,kBAAkB,OAAO,CAAA,GAAI,SAAU,CAAA,KAAA,CAAM,CAAC,CAAA,CAAA;AAEpE,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,SAAA;AAAA,MACN,OAAA;AAAA,MACA,KAAA;AAAA,MACA,MAAQ,EAAA,CAAC,EAAE,KAAA,EACT,qBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACE,GAAG,KAAA;AAAA,UACJ,UAAU,KAAO,EAAA,QAAA;AAAA,UACjB,MAAO,EAAA,OAAA;AAAA,UACP,SAAS,EAAA,IAAA;AAAA,UACT,EAAG,EAAA,OAAA;AAAA,UACH,IAAK,EAAA,MAAA;AAAA,UACL,SAAS,EAAA,IAAA;AAAA,UACT,KAAA;AAAA,UACA,WAAA;AAAA,UACA,KAAA,EAAO,CAAC,CAAC,KAAA;AAAA,UACT,YAAY,KAAS,IAAA,UAAA;AAAA,SAAA;AAAA,OACvB;AAAA,KAAA;AAAA,GAEJ,CAAA;AAEJ;;;;"}
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import InputLabel from '@material-ui/core/InputLabel';
3
+ import MenuItem from '@material-ui/core/MenuItem';
4
+ import FormControl from '@material-ui/core/FormControl';
5
+ import Select from '@material-ui/core/Select';
6
+ import { Controller } from 'react-hook-form';
7
+
8
+ const InputSelector = ({ name, options, control, error }) => {
9
+ const label = name.charAt(0).toLocaleUpperCase("en-US") + name.slice(1);
10
+ return /* @__PURE__ */ React.createElement(
11
+ Controller,
12
+ {
13
+ name,
14
+ control,
15
+ rules: {
16
+ required: true
17
+ },
18
+ render: ({ field }) => /* @__PURE__ */ React.createElement(FormControl, { fullWidth: true }, /* @__PURE__ */ React.createElement(
19
+ InputLabel,
20
+ {
21
+ required: true,
22
+ htmlFor: "demo-simple-select-outlined",
23
+ id: "demo-simple-select-outlined-label",
24
+ style: {
25
+ marginTop: "0.25rem"
26
+ }
27
+ },
28
+ label
29
+ ), /* @__PURE__ */ React.createElement(
30
+ Select,
31
+ {
32
+ ...field,
33
+ labelId: "demo-simple-select-outlined-label",
34
+ id: "demo-simple-select-outlined",
35
+ label,
36
+ error: !!error
37
+ },
38
+ options.map((option) => {
39
+ return /* @__PURE__ */ React.createElement(MenuItem, { key: option, value: option }, option);
40
+ })
41
+ ))
42
+ }
43
+ );
44
+ };
45
+
46
+ export { InputSelector };
47
+ //# sourceMappingURL=InputSelector.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputSelector.esm.js","sources":["../../../src/components/InputSelector/InputSelector.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 InputLabel from '@material-ui/core/InputLabel';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport FormControl from '@material-ui/core/FormControl';\nimport Select from '@material-ui/core/Select';\nimport { Controller, Control, FieldError } from 'react-hook-form';\nimport { FormValues } from '../../types';\n\ntype Props = {\n options: string[];\n control: Control<FormValues, object>;\n name: 'status' | 'size';\n error?: FieldError | undefined;\n};\n\nexport const InputSelector = ({ name, options, control, error }: Props) => {\n const label = name.charAt(0).toLocaleUpperCase('en-US') + name.slice(1);\n\n return (\n <Controller\n name={name}\n control={control}\n rules={{\n required: true,\n }}\n render={({ field }) => (\n <FormControl fullWidth>\n <InputLabel\n required\n htmlFor=\"demo-simple-select-outlined\"\n id=\"demo-simple-select-outlined-label\"\n style={{\n marginTop: '0.25rem',\n }}\n >\n {label}\n </InputLabel>\n <Select\n {...field}\n labelId=\"demo-simple-select-outlined-label\"\n id=\"demo-simple-select-outlined\"\n label={label}\n error={!!error}\n >\n {options.map(option => {\n return (\n <MenuItem key={option} value={option}>\n {option}\n </MenuItem>\n );\n })}\n </Select>\n </FormControl>\n )}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AA+BO,MAAM,gBAAgB,CAAC,EAAE,MAAM,OAAS,EAAA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Actions';
4
+ import Button from '@material-ui/core/Button';
5
+ import MuiDialogContent from '@material-ui/core/DialogContent';
6
+ import { makeStyles } from '@material-ui/core/styles';
7
+ import { ProjectSelector } from '../ProjectSelector/ProjectSelector.esm.js';
8
+ import { CustomDialogTitle } from '../CustomDialogTitle/CustomDialogTitle.esm.js';
9
+ import { stringifyEntityRef } from '@backstage/catalog-model';
10
+ import { bazaarApiRef } from '../../api.esm.js';
11
+ import { useApi, alertApiRef } from '@backstage/core-plugin-api';
12
+
13
+ const useStyles = makeStyles({
14
+ content: { padding: "0 1rem" }
15
+ });
16
+ const LinkProjectDialog = ({
17
+ openProjectSelector,
18
+ handleProjectSelectorClose,
19
+ catalogEntities,
20
+ bazaarProject,
21
+ fetchBazaarProject,
22
+ initEntity
23
+ }) => {
24
+ const classes = useStyles();
25
+ const bazaarApi = useApi(bazaarApiRef);
26
+ const alertApi = useApi(alertApiRef);
27
+ const [selectedEntity, setSelectedEntity] = useState(initEntity);
28
+ const [selectedEntityName, setSelectedEntityName] = useState("");
29
+ const handleEntityClick = (entity) => {
30
+ setSelectedEntity(entity);
31
+ setSelectedEntityName(entity.metadata.name);
32
+ };
33
+ const handleSubmit = async () => {
34
+ handleProjectSelectorClose();
35
+ const updateResponse = await bazaarApi.updateProject({
36
+ ...bazaarProject,
37
+ entityRef: stringifyEntityRef(selectedEntity)
38
+ });
39
+ if (updateResponse.status === "ok") {
40
+ fetchBazaarProject();
41
+ alertApi.post({
42
+ message: `linked entity '${selectedEntityName}' to the project ${bazaarProject.title}`,
43
+ severity: "success",
44
+ display: "transient"
45
+ });
46
+ }
47
+ };
48
+ return /* @__PURE__ */ React.createElement(Dialog, { onClose: handleProjectSelectorClose, open: openProjectSelector }, /* @__PURE__ */ React.createElement(
49
+ CustomDialogTitle,
50
+ {
51
+ id: "customized-dialog-title",
52
+ onClose: handleProjectSelectorClose
53
+ },
54
+ "Select entity"
55
+ ), /* @__PURE__ */ React.createElement(MuiDialogContent, { className: classes.content, dividers: true }, /* @__PURE__ */ React.createElement(
56
+ ProjectSelector,
57
+ {
58
+ label: "",
59
+ onChange: handleEntityClick,
60
+ catalogEntities: catalogEntities || [],
61
+ disableClearable: true,
62
+ defaultValue: catalogEntities[0] || null
63
+ }
64
+ )), /* @__PURE__ */ React.createElement(MuiDialogActions, null, /* @__PURE__ */ React.createElement(Button, { onClick: handleSubmit, color: "primary", type: "submit" }, "OK")));
65
+ };
66
+
67
+ export { LinkProjectDialog };
68
+ //# sourceMappingURL=LinkProjectDialog.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkProjectDialog.esm.js","sources":["../../../src/components/LinkProjectDialog/LinkProjectDialog.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 } from 'react';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ProjectSelector } from '../ProjectSelector';\nimport { CustomDialogTitle } from '../CustomDialogTitle';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\n\nimport { bazaarApiRef } from '../../api';\nimport { useApi, alertApiRef } from '@backstage/core-plugin-api';\n\nimport { BazaarProject } from '../../types';\n\ntype Props = {\n openProjectSelector: boolean;\n handleProjectSelectorClose: () => void;\n catalogEntities: Entity[];\n bazaarProject: BazaarProject;\n fetchBazaarProject: () => Promise<BazaarProject | null>;\n initEntity: Entity;\n};\n\nconst useStyles = makeStyles({\n content: { padding: '0 1rem' },\n});\n\nexport const LinkProjectDialog = ({\n openProjectSelector,\n handleProjectSelectorClose,\n catalogEntities,\n bazaarProject,\n fetchBazaarProject,\n initEntity,\n}: Props) => {\n const classes = useStyles();\n const bazaarApi = useApi(bazaarApiRef);\n const alertApi = useApi(alertApiRef);\n const [selectedEntity, setSelectedEntity] = useState(initEntity);\n const [selectedEntityName, setSelectedEntityName] = useState('');\n const handleEntityClick = (entity: Entity) => {\n setSelectedEntity(entity);\n setSelectedEntityName(entity.metadata.name);\n };\n\n const handleSubmit = async () => {\n handleProjectSelectorClose();\n\n const updateResponse = await bazaarApi.updateProject({\n ...bazaarProject,\n entityRef: stringifyEntityRef(selectedEntity!),\n });\n if (updateResponse.status === 'ok') {\n fetchBazaarProject();\n alertApi.post({\n message: `linked entity '${selectedEntityName}' to the project ${bazaarProject.title}`,\n severity: 'success',\n display: 'transient',\n });\n }\n };\n\n return (\n <Dialog onClose={handleProjectSelectorClose} open={openProjectSelector}>\n <CustomDialogTitle\n id=\"customized-dialog-title\"\n onClose={handleProjectSelectorClose}\n >\n Select entity\n </CustomDialogTitle>\n <DialogContent className={classes.content} dividers>\n <ProjectSelector\n label=\"\"\n onChange={handleEntityClick}\n catalogEntities={catalogEntities || []}\n disableClearable\n defaultValue={catalogEntities[0] || null}\n />\n </DialogContent>\n\n <DialogActions>\n <Button onClick={handleSubmit} color=\"primary\" type=\"submit\">\n OK\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":["DialogContent","DialogActions"],"mappings":";;;;;;;;;;;;AAwCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,OAAA,EAAS,EAAE,OAAA,EAAS,QAAS,EAAA;AAC/B,CAAC,CAAA,CAAA;AAEM,MAAM,oBAAoB,CAAC;AAAA,EAChC,mBAAA;AAAA,EACA,0BAAA;AAAA,EACA,eAAA;AAAA,EACA,aAAA;AAAA,EACA,kBAAA;AAAA,EACA,UAAA;AACF,CAAa,KAAA;AACX,EAAA,MAAM,U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A,0BAAA;AAAA,KAAA;AAAA,IACV,eAAA;AAAA,qBAGA,KAAA,CAAA,aAAA,CAAAA,gBAAA,EAAA,EAAc,WAAW,OAAQ,CAAA,OAAA,EAAS,UAAQ,IACjD,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,EAAA;AAAA,MACN,QAAU,EAAA,iBAAA;AAAA,MACV,eAAA,EAAiB,mBAAmB,EAAC;AAAA,MACrC,gBAAgB,EAAA,IAAA;AAAA,MAChB,YAAA,EAAc,eAAgB,CAAA,CAAC,CAAK,IAAA,IAAA;AAAA,KAAA;AAAA,GAExC,CAAA,kBAEC,KAAA,CAAA,aAAA,CAAAC,gBAAA,EAAA,IAAA,sCACE,MAAO,EAAA,EAAA,OAAA,EAAS,YAAc,EAAA,KAAA,EAAM,SAAU,EAAA,IAAA,EAAK,QAAS,EAAA,EAAA,IAE7D,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,70 @@
1
+ import React, { useState } from 'react';
2
+ import { ItemCardHeader } from '@backstage/core-components';
3
+ import Card from '@material-ui/core/Card';
4
+ import CardActionArea from '@material-ui/core/CardActionArea';
5
+ import CardContent from '@material-ui/core/CardContent';
6
+ import Dialog from '@material-ui/core/Dialog';
7
+ import Typography from '@material-ui/core/Typography';
8
+ import { makeStyles } from '@material-ui/core/styles';
9
+ import { StatusTag } from '../StatusTag/StatusTag.esm.js';
10
+ import { DateTime } from 'luxon';
11
+ import { HomePageBazaarInfoCard } from '../HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js';
12
+
13
+ const useStyles = makeStyles((theme) => ({
14
+ description: (props) => ({
15
+ height: props.height === "large" ? "10rem" : "4rem",
16
+ WebkitBackgroundClip: "text",
17
+ backgroundImage: `linear-gradient(180deg, ${theme.palette.textContrast} 0%, ${theme.palette.textContrast} 60%, transparent 100%)`,
18
+ color: "transparent"
19
+ }),
20
+ statusTag: {
21
+ display: "inline-block",
22
+ whiteSpace: "nowrap",
23
+ marginBottom: "0.8rem"
24
+ },
25
+ memberCount: {
26
+ float: "right"
27
+ },
28
+ header: {
29
+ whiteSpace: "nowrap",
30
+ overflow: "hidden",
31
+ textOverflow: "ellipsis",
32
+ height: "5rem"
33
+ }
34
+ }));
35
+ const ProjectCard = ({
36
+ project,
37
+ fetchBazaarProjects,
38
+ catalogEntities,
39
+ height
40
+ }) => {
41
+ const classes = useStyles({ height });
42
+ const [openCard, setOpenCard] = useState(false);
43
+ const { id, title, status, updatedAt, description, membersCount } = project;
44
+ const handleClose = () => {
45
+ setOpenCard(false);
46
+ fetchBazaarProjects();
47
+ };
48
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Dialog, { fullWidth: true, onClose: handleClose, open: openCard }, /* @__PURE__ */ React.createElement(
49
+ HomePageBazaarInfoCard,
50
+ {
51
+ initProject: project,
52
+ handleClose,
53
+ initEntity: catalogEntities[0] || null
54
+ }
55
+ )), /* @__PURE__ */ React.createElement(Card, { key: id }, /* @__PURE__ */ React.createElement(CardActionArea, { onClick: () => setOpenCard(true) }, /* @__PURE__ */ React.createElement(
56
+ ItemCardHeader,
57
+ {
58
+ classes: { root: classes.header },
59
+ title,
60
+ subtitle: `updated ${DateTime.fromISO(
61
+ new Date(updatedAt).toISOString()
62
+ ).toRelative({
63
+ base: DateTime.now()
64
+ })}`
65
+ }
66
+ ), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(StatusTag, { styles: classes.statusTag, status }), /* @__PURE__ */ React.createElement(Typography, { variant: "body2", className: classes.memberCount }, Number(membersCount) === Number(1) ? `${membersCount} member` : `${membersCount} members`), /* @__PURE__ */ React.createElement(Typography, { variant: "body2", className: classes.description }, description)))));
67
+ };
68
+
69
+ export { ProjectCard };
70
+ //# sourceMappingURL=ProjectCard.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectCard.esm.js","sources":["../../../src/components/ProjectCard/ProjectCard.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 } from 'react';\nimport { ItemCardHeader } from '@backstage/core-components';\nimport Card from '@material-ui/core/Card';\nimport CardActionArea from '@material-ui/core/CardActionArea';\nimport CardContent from '@material-ui/core/CardContent';\nimport Dialog from '@material-ui/core/Dialog';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { StatusTag } from '../StatusTag/StatusTag';\nimport { BazaarProject } from '../../types';\nimport { DateTime } from 'luxon';\nimport { HomePageBazaarInfoCard } from '../HomePageBazaarInfoCard';\nimport { Entity } from '@backstage/catalog-model';\n\ntype Props = {\n project: BazaarProject;\n fetchBazaarProjects: () => Promise<BazaarProject[]>;\n catalogEntities: Entity[];\n height: 'large' | 'small';\n};\n\ntype StyleProps = {\n height: 'large' | 'small';\n};\n\nconst useStyles = makeStyles(theme => ({\n description: (props: StyleProps) => ({\n height: props.height === 'large' ? '10rem' : '4rem',\n WebkitBackgroundClip: 'text',\n backgroundImage: `linear-gradient(180deg, ${theme.palette.textContrast} 0%, ${theme.palette.textContrast} 60%, transparent 100%)`,\n color: 'transparent',\n }),\n statusTag: {\n display: 'inline-block',\n whiteSpace: 'nowrap',\n marginBottom: '0.8rem',\n },\n memberCount: {\n float: 'right',\n },\n header: {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n height: '5rem',\n },\n}));\n\nexport const ProjectCard = ({\n project,\n fetchBazaarProjects,\n catalogEntities,\n height,\n}: Props) => {\n const classes = useStyles({ height });\n const [openCard, setOpenCard] = useState(false);\n const { id, title, status, updatedAt, description, membersCount } = project;\n\n const handleClose = () => {\n setOpenCard(false);\n fetchBazaarProjects();\n };\n\n return (\n <div>\n <Dialog fullWidth onClose={handleClose} open={openCard}>\n <HomePageBazaarInfoCard\n initProject={project}\n handleClose={handleClose}\n initEntity={catalogEntities[0] || null}\n />\n </Dialog>\n\n <Card key={id}>\n <CardActionArea onClick={() => setOpenCard(true)}>\n <ItemCardHeader\n classes={{ root: classes.header }}\n title={title}\n subtitle={`updated ${DateTime.fromISO(\n new Date(updatedAt!).toISOString(),\n ).toRelative({\n base: DateTime.now(),\n })}`}\n />\n <CardContent>\n <StatusTag styles={classes.statusTag} status={status} />\n <Typography variant=\"body2\" className={classes.memberCount}>\n {Number(membersCount) === Number(1)\n ? `${membersCount} member`\n : `${membersCount} members`}\n </Typography>\n <Typography variant=\"body2\" className={classes.description}>\n {description}\n </Typography>\n </CardContent>\n </CardActionArea>\n </Card>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAyCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,WAAA,EAAa,CAAC,KAAuB,MAAA;AAAA,IACnC,MAAQ,EAAA,KAAA,CAAM,MAAW,KAAA,OAAA,GAAU,OAAU,GAAA,MAAA;AAAA,IAC7C,oBAAsB,EAAA,MAAA;AAAA,IACtB,eAAA,EAAiB,2BAA2B,KAAM,CAAA,OAAA,CAAQ,YAAY,CAAQ,KAAA,EAAA,KAAA,CAAM,QAAQ,YAAY,CAAA,uBAAA,CAAA;AAAA,IACxG,KAAO,EAAA,aAAA;AAAA,GACT,CAAA;AAAA,EACA,SAAW,EAAA;AAAA,IACT,OAAS,EAAA,cAAA;AAAA,IACT,UAAY,EAAA,QAAA;AAAA,IACZ,YAAc,EAAA,QAAA;AAAA,GAChB;AAAA,EACA,WAAa,EAAA;AAAA,IACX,KAAO,EAAA,OAAA;AAAA,GACT;AAAA,EACA,M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