@backstage-community/plugin-bazaar 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/components/About/About.esm.js +21 -9
- package/dist/components/About/About.esm.js.map +1 -1
- package/dist/components/AddProjectDialog/AddProjectDialog.esm.js +4 -3
- package/dist/components/AddProjectDialog/AddProjectDialog.esm.js.map +1 -1
- package/dist/components/BazaarOverviewCard/BazaarOverviewCard.esm.js +18 -17
- package/dist/components/BazaarOverviewCard/BazaarOverviewCard.esm.js.map +1 -1
- package/dist/components/CardContentFields/AboutField.esm.js +6 -3
- package/dist/components/CardContentFields/AboutField.esm.js.map +1 -1
- package/dist/components/CardContentFields/CardContentFields.esm.js +65 -51
- package/dist/components/CardContentFields/CardContentFields.esm.js.map +1 -1
- package/dist/components/ConfirmationDialog/ConfirmationDialog.esm.js +12 -7
- package/dist/components/ConfirmationDialog/ConfirmationDialog.esm.js.map +1 -1
- package/dist/components/CustomDialogTitle/CustomDialogTitle.esm.js +13 -10
- package/dist/components/CustomDialogTitle/CustomDialogTitle.esm.js.map +1 -1
- package/dist/components/DateSelector/DateSelector.esm.js +5 -5
- package/dist/components/DateSelector/DateSelector.esm.js.map +1 -1
- package/dist/components/DoubleDateSelector/DoubleDateSelector.esm.js +6 -2
- package/dist/components/DoubleDateSelector/DoubleDateSelector.esm.js.map +1 -1
- package/dist/components/EditProjectDialog/EditProjectDialog.esm.js +40 -36
- package/dist/components/EditProjectDialog/EditProjectDialog.esm.js.map +1 -1
- package/dist/components/EntityBazaarInfoCard/EntityBazaarInfoCard.esm.js +4 -3
- package/dist/components/EntityBazaarInfoCard/EntityBazaarInfoCard.esm.js.map +1 -1
- package/dist/components/EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js +61 -54
- package/dist/components/EntityBazaarInfoContent/EntityBazaarInfoContent.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +13 -10
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js +72 -59
- package/dist/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.esm.js.map +1 -1
- package/dist/components/InputField/InputField.esm.js +3 -3
- package/dist/components/InputField/InputField.esm.js.map +1 -1
- package/dist/components/InputSelector/InputSelector.esm.js +28 -25
- package/dist/components/InputSelector/InputSelector.esm.js.map +1 -1
- package/dist/components/LinkProjectDialog/LinkProjectDialog.esm.js +23 -18
- package/dist/components/LinkProjectDialog/LinkProjectDialog.esm.js.map +1 -1
- package/dist/components/ProjectCard/ProjectCard.esm.js +31 -20
- package/dist/components/ProjectCard/ProjectCard.esm.js.map +1 -1
- package/dist/components/ProjectDialog/ProjectDialog.esm.js +112 -96
- package/dist/components/ProjectDialog/ProjectDialog.esm.js.map +1 -1
- package/dist/components/ProjectPreview/ProjectPreview.esm.js +32 -28
- package/dist/components/ProjectPreview/ProjectPreview.esm.js.map +1 -1
- package/dist/components/ProjectSelector/ProjectSelector.esm.js +5 -5
- package/dist/components/ProjectSelector/ProjectSelector.esm.js.map +1 -1
- package/dist/components/SortMethodSelector/SortMethodSelector.esm.js +11 -9
- package/dist/components/SortMethodSelector/SortMethodSelector.esm.js.map +1 -1
- package/dist/components/SortView/SortView.esm.js +63 -52
- package/dist/components/SortView/SortView.esm.js.map +1 -1
- package/dist/components/StatusTag/StatusTag.esm.js +5 -5
- package/dist/components/StatusTag/StatusTag.esm.js.map +1 -1
- package/dist/components/UserSelector/UserSelector.esm.js +7 -6
- package/dist/components/UserSelector/UserSelector.esm.js.map +1 -1
- package/dist/components/VirtualizedListbox/VirtualizedListbox.esm.js +8 -7
- package/dist/components/VirtualizedListbox/VirtualizedListbox.esm.js.map +1 -1
- package/dist/index.d.ts +5 -7
- package/package.json +14 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import Button from '@material-ui/core/Button';
|
|
3
4
|
import Dialog from '@material-ui/core/Dialog';
|
|
4
5
|
import { useForm } from 'react-hook-form';
|
|
@@ -44,107 +45,122 @@ const ProjectDialog = ({
|
|
|
44
45
|
useEffect(() => {
|
|
45
46
|
fetchUsers(catalogApi).then(setUsers);
|
|
46
47
|
}, [catalogApi]);
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
48
49
|
Dialog,
|
|
49
50
|
{
|
|
50
51
|
fullWidth: true,
|
|
51
52
|
maxWidth: "xs",
|
|
52
53
|
onClose: handleCloseDialog,
|
|
53
54
|
"aria-labelledby": "customized-dialog-title",
|
|
54
|
-
open
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
55
|
+
open,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
CustomDialogTitle,
|
|
59
|
+
{
|
|
60
|
+
id: "customized-dialog-title",
|
|
61
|
+
onClose: handleCloseDialog,
|
|
62
|
+
children: title
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsxs(DialogContent, { style: { padding: "1rem", paddingTop: "0rem" }, dividers: true, children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
InputField,
|
|
68
|
+
{
|
|
69
|
+
error: errors.title,
|
|
70
|
+
control,
|
|
71
|
+
rules: {
|
|
72
|
+
required: true
|
|
73
|
+
},
|
|
74
|
+
inputType: "title",
|
|
75
|
+
helperText: "Please enter a title for your project"
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
InputField,
|
|
80
|
+
{
|
|
81
|
+
error: errors.description,
|
|
82
|
+
control,
|
|
83
|
+
rules: {
|
|
84
|
+
required: true
|
|
85
|
+
},
|
|
86
|
+
inputType: "description",
|
|
87
|
+
helperText: "Please enter a description"
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ jsx(
|
|
91
|
+
InputSelector,
|
|
92
|
+
{
|
|
93
|
+
control,
|
|
94
|
+
name: "status",
|
|
95
|
+
options: ["proposed", "ongoing", "completed"]
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
InputSelector,
|
|
100
|
+
{
|
|
101
|
+
control,
|
|
102
|
+
name: "size",
|
|
103
|
+
options: ["small", "medium", "large"]
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
UserSelector,
|
|
108
|
+
{
|
|
109
|
+
users,
|
|
110
|
+
disableClearable: false,
|
|
111
|
+
defaultValue: defaultValues.responsible,
|
|
112
|
+
label: "Select or enter responsible user",
|
|
113
|
+
name: "responsible",
|
|
114
|
+
control,
|
|
115
|
+
rules: { required: "Please select or enter a responsible user" }
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
isAddForm && projectSelector,
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
InputField,
|
|
121
|
+
{
|
|
122
|
+
error: errors.community,
|
|
123
|
+
control,
|
|
124
|
+
rules: {
|
|
125
|
+
required: false,
|
|
126
|
+
pattern: RegExp("^(https?)://")
|
|
127
|
+
},
|
|
128
|
+
inputType: "community",
|
|
129
|
+
helperText: "Please enter a link starting with http/https",
|
|
130
|
+
placeholder: "Community link to e.g. Teams or Discord"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ jsx(
|
|
134
|
+
InputField,
|
|
135
|
+
{
|
|
136
|
+
error: errors.docs,
|
|
137
|
+
control,
|
|
138
|
+
rules: {
|
|
139
|
+
required: false,
|
|
140
|
+
pattern: RegExp("^(https?)://")
|
|
141
|
+
},
|
|
142
|
+
inputType: "docs",
|
|
143
|
+
helperText: "Please enter a link starting with http/https",
|
|
144
|
+
placeholder: "Project docs link"
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ jsx(DoubleDateSelector, { setValue, control })
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
150
|
+
!isAddForm && deleteButton,
|
|
151
|
+
/* @__PURE__ */ jsx(
|
|
152
|
+
Button,
|
|
153
|
+
{
|
|
154
|
+
onClick: handleSubmit(handleSaveForm),
|
|
155
|
+
color: "primary",
|
|
156
|
+
type: "submit",
|
|
157
|
+
children: "Submit"
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
) });
|
|
148
164
|
};
|
|
149
165
|
|
|
150
166
|
export { ProjectDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectDialog.esm.js","sources":["../../../src/components/ProjectDialog/ProjectDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"ProjectDialog.esm.js","sources":["../../../src/components/ProjectDialog/ProjectDialog.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 { useEffect, useState } from 'react';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport { useForm, UseFormReset, UseFormGetValues } from 'react-hook-form';\nimport { InputField } from '../InputField/InputField';\nimport { InputSelector } from '../InputSelector/InputSelector';\nimport { FormValues } from '../../types';\nimport { DoubleDateSelector } from '../DoubleDateSelector/DoubleDateSelector';\nimport {\n CustomDialogTitle,\n DialogActions,\n DialogContent,\n} from '../CustomDialogTitle';\nimport { fetchUsers } from '../../util/fetchMethods';\nimport { UserSelector } from '../UserSelector';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\n\ntype Props = {\n handleSave: (\n getValues: UseFormGetValues<FormValues>,\n reset: UseFormReset<FormValues>,\n ) => Promise<void>;\n isAddForm: boolean;\n title: string;\n defaultValues: FormValues;\n open: boolean;\n projectSelector?: JSX.Element;\n deleteButton?: JSX.Element;\n handleClose: () => void;\n};\n\nexport const ProjectDialog = ({\n handleSave,\n isAddForm,\n title,\n defaultValues,\n open,\n projectSelector,\n deleteButton,\n handleClose,\n}: Props) => {\n const catalogApi = useApi(catalogApiRef);\n const [users, setUsers] = useState<Entity[]>([]);\n\n const {\n handleSubmit,\n reset,\n control,\n getValues,\n formState: { errors },\n setValue,\n } = useForm<FormValues>({\n mode: 'onChange',\n defaultValues,\n });\n\n const handleSaveForm = () => {\n handleSave(getValues, reset);\n };\n\n const handleCloseDialog = () => {\n handleClose();\n reset(defaultValues);\n };\n\n useEffect(() => {\n fetchUsers(catalogApi).then(setUsers);\n }, [catalogApi]);\n\n return (\n <div>\n <Dialog\n fullWidth\n maxWidth=\"xs\"\n onClose={handleCloseDialog}\n aria-labelledby=\"customized-dialog-title\"\n open={open}\n >\n <CustomDialogTitle\n id=\"customized-dialog-title\"\n onClose={handleCloseDialog}\n >\n {title}\n </CustomDialogTitle>\n <DialogContent style={{ padding: '1rem', paddingTop: '0rem' }} dividers>\n <InputField\n error={errors.title}\n control={control}\n rules={{\n required: true,\n }}\n inputType=\"title\"\n helperText=\"Please enter a title for your project\"\n />\n <InputField\n error={errors.description}\n control={control}\n rules={{\n required: true,\n }}\n inputType=\"description\"\n helperText=\"Please enter a description\"\n />\n\n <InputSelector\n control={control}\n name=\"status\"\n options={['proposed', 'ongoing', 'completed']}\n />\n\n <InputSelector\n control={control}\n name=\"size\"\n options={['small', 'medium', 'large']}\n />\n\n <UserSelector\n users={users}\n disableClearable={false}\n defaultValue={defaultValues.responsible}\n label=\"Select or enter responsible user\"\n name=\"responsible\"\n control={control}\n rules={{ required: 'Please select or enter a responsible user' }}\n />\n\n {isAddForm && projectSelector}\n\n <InputField\n error={errors.community}\n control={control}\n rules={{\n required: false,\n pattern: RegExp('^(https?)://'),\n }}\n inputType=\"community\"\n helperText=\"Please enter a link starting with http/https\"\n placeholder=\"Community link to e.g. Teams or Discord\"\n />\n\n <InputField\n error={errors.docs}\n control={control}\n rules={{\n required: false,\n pattern: RegExp('^(https?)://'),\n }}\n inputType=\"docs\"\n helperText=\"Please enter a link starting with http/https\"\n placeholder=\"Project docs link\"\n />\n\n <DoubleDateSelector setValue={setValue} control={control} />\n </DialogContent>\n\n <DialogActions>\n {!isAddForm && deleteButton}\n <Button\n onClick={handleSubmit(handleSaveForm)}\n color=\"primary\"\n type=\"submit\"\n >\n Submit\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiDO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,UAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,aAAA;AAAA,EACA,IAAA;AAAA,EACA,eAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAa,KAAA;AACX,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,CAAC,KAAO,EAAA,QAAQ,CAAI,GAAA,QAAA,CAAmB,EAAE,CAAA;AAE/C,EAAM,MAAA;AAAA,IACJ,YAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA,E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OAAO,MAAO,CAAA,IAAA;AAAA,cACd,OAAA;AAAA,cACA,KAAO,EAAA;AAAA,gBACL,QAAU,EAAA,KAAA;AAAA,gBACV,OAAA,EAAS,OAAO,cAAc;AAAA,eAChC;AAAA,cACA,SAAU,EAAA,MAAA;AAAA,cACV,UAAW,EAAA,8CAAA;AAAA,cACX,WAAY,EAAA;AAAA;AAAA,WACd;AAAA,0BAEA,GAAA,CAAC,kBAAmB,EAAA,EAAA,QAAA,EAAoB,OAAkB,EAAA;AAAA,SAC5D,EAAA,CAAA;AAAA,6BAEC,aACE,EAAA,EAAA,QAAA,EAAA;AAAA,UAAA,CAAC,SAAa,IAAA,YAAA;AAAA,0BACf,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAS,aAAa,cAAc,CAAA;AAAA,cACpC,KAAM,EAAA,SAAA;AAAA,cACN,IAAK,EAAA,QAAA;AAAA,cACN,QAAA,EAAA;AAAA;AAAA;AAED,SACF,EAAA;AAAA;AAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { ProjectCard } from '../ProjectCard/ProjectCard.esm.js';
|
|
3
4
|
import Box from '@material-ui/core/Box';
|
|
4
5
|
import Grid from '@material-ui/core/Grid';
|
|
@@ -43,36 +44,39 @@ const ProjectPreview = ({
|
|
|
43
44
|
setPage(1);
|
|
44
45
|
};
|
|
45
46
|
if (!bazaarProjects.length) {
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ jsx("div", { className: classes.empty, children: "Please add projects to the Bazaar." });
|
|
47
48
|
}
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
return /* @__PURE__ */ jsxs(Box, { className: classes.content, children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Grid, { wrap: "wrap", container: true, spacing: 3, children: bazaarProjects.slice((page - 1) * rows, rows * page).map((bazaarProject, i) => {
|
|
51
|
+
return /* @__PURE__ */ jsx(Grid, { item: true, xs: gridSize, children: /* @__PURE__ */ jsx(
|
|
52
|
+
ProjectCard,
|
|
53
|
+
{
|
|
54
|
+
project: bazaarProject,
|
|
55
|
+
fetchBazaarProjects,
|
|
56
|
+
catalogEntities,
|
|
57
|
+
height
|
|
58
|
+
},
|
|
59
|
+
i
|
|
60
|
+
) }, i);
|
|
61
|
+
}) }),
|
|
62
|
+
useTablePagination && /* @__PURE__ */ jsx(
|
|
63
|
+
TablePagination,
|
|
51
64
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
component: "div",
|
|
66
|
+
className: classes.pagination,
|
|
67
|
+
rowsPerPageOptions: [12, 24, 48, 96],
|
|
68
|
+
count: bazaarProjects?.length,
|
|
69
|
+
page: page - 1,
|
|
70
|
+
onPageChange: handlePageChange,
|
|
71
|
+
rowsPerPage: rows,
|
|
72
|
+
onRowsPerPageChange: handleRowChange,
|
|
73
|
+
backIconButtonProps: { disabled: page === 1 },
|
|
74
|
+
nextIconButtonProps: {
|
|
75
|
+
disabled: rows * page >= bazaarProjects.length
|
|
76
|
+
}
|
|
57
77
|
}
|
|
58
|
-
)
|
|
59
|
-
})
|
|
60
|
-
TablePagination,
|
|
61
|
-
{
|
|
62
|
-
component: "div",
|
|
63
|
-
className: classes.pagination,
|
|
64
|
-
rowsPerPageOptions: [12, 24, 48, 96],
|
|
65
|
-
count: bazaarProjects?.length,
|
|
66
|
-
page: page - 1,
|
|
67
|
-
onPageChange: handlePageChange,
|
|
68
|
-
rowsPerPage: rows,
|
|
69
|
-
onRowsPerPageChange: handleRowChange,
|
|
70
|
-
backIconButtonProps: { disabled: page === 1 },
|
|
71
|
-
nextIconButtonProps: {
|
|
72
|
-
disabled: rows * page >= bazaarProjects.length
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
));
|
|
78
|
+
)
|
|
79
|
+
] });
|
|
76
80
|
};
|
|
77
81
|
|
|
78
82
|
export { ProjectPreview };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectPreview.esm.js","sources":["../../../src/components/ProjectPreview/ProjectPreview.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"ProjectPreview.esm.js","sources":["../../../src/components/ProjectPreview/ProjectPreview.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 { ChangeEvent, useState } from 'react';\nimport { ProjectCard } from '../ProjectCard/ProjectCard';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport TablePagination from '@material-ui/core/TablePagination';\nimport { GridSize } from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { BazaarProject } from '../../types';\nimport { Entity } from '@backstage/catalog-model';\n\ntype Props = {\n bazaarProjects: BazaarProject[];\n fetchBazaarProjects: () => Promise<BazaarProject[]>;\n catalogEntities: Entity[];\n useTablePagination?: boolean;\n gridSize?: GridSize;\n height: 'large' | 'small';\n};\n\nconst useStyles = makeStyles({\n content: {\n width: '100%',\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n },\n empty: {\n height: '10rem',\n textAlign: 'center',\n verticalAlign: 'middle',\n lineHeight: '10rem',\n },\n pagination: {\n marginTop: '1rem',\n marginLeft: 'auto',\n marginRight: '0',\n },\n});\n\nexport const ProjectPreview = ({\n bazaarProjects,\n fetchBazaarProjects,\n catalogEntities,\n useTablePagination = true,\n gridSize = 2,\n height = 'large',\n}: Props) => {\n const classes = useStyles();\n const [page, setPage] = useState(1);\n const [rows, setRows] = useState(12);\n\n const handlePageChange = (_: any, newPage: number) => {\n setPage(newPage + 1);\n };\n\n const handleRowChange = (\n event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n setRows(parseInt(event.target.value, 10));\n setPage(1);\n };\n\n if (!bazaarProjects.length) {\n return (\n <div className={classes.empty}>Please add projects to the Bazaar.</div>\n );\n }\n\n return (\n <Box className={classes.content}>\n <Grid wrap=\"wrap\" container spacing={3}>\n {bazaarProjects\n .slice((page - 1) * rows, rows * page)\n .map((bazaarProject: BazaarProject, i: number) => {\n return (\n <Grid key={i} item xs={gridSize}>\n <ProjectCard\n project={bazaarProject}\n key={i}\n fetchBazaarProjects={fetchBazaarProjects}\n catalogEntities={catalogEntities}\n height={height}\n />\n </Grid>\n );\n })}\n </Grid>\n\n {useTablePagination && (\n <TablePagination\n component=\"div\"\n className={classes.pagination}\n rowsPerPageOptions={[12, 24, 48, 96]}\n count={bazaarProjects?.length}\n page={page - 1}\n onPageChange={handlePageChange}\n rowsPerPage={rows}\n onRowsPerPageChange={handleRowChange}\n backIconButtonProps={{ disabled: page === 1 }}\n nextIconButtonProps={{\n disabled: rows * page >= bazaarProjects.length,\n }}\n />\n )}\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAmCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,OAAS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-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Typography from '@material-ui/core/Typography';
|
|
3
3
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
4
4
|
import TextField from '@material-ui/core/TextField';
|
|
@@ -16,7 +16,7 @@ const ProjectSelector = ({
|
|
|
16
16
|
label
|
|
17
17
|
}) => {
|
|
18
18
|
const classes = useStyles();
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsx("div", { className: classes.container, children: /* @__PURE__ */ jsx(
|
|
20
20
|
Autocomplete,
|
|
21
21
|
{
|
|
22
22
|
className: classes.autocomplete,
|
|
@@ -25,13 +25,13 @@ const ProjectSelector = ({
|
|
|
25
25
|
defaultValue,
|
|
26
26
|
options: catalogEntities,
|
|
27
27
|
getOptionLabel: (option) => option?.metadata?.name,
|
|
28
|
-
renderOption: (option) => /* @__PURE__ */
|
|
29
|
-
renderInput: (params) => /* @__PURE__ */
|
|
28
|
+
renderOption: (option) => /* @__PURE__ */ jsx(Typography, { component: "span", children: option?.metadata?.name }),
|
|
29
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, label }),
|
|
30
30
|
onChange: (_, data) => {
|
|
31
31
|
onChange(data);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
));
|
|
34
|
+
) });
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export { ProjectSelector };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectSelector.esm.js","sources":["../../../src/components/ProjectSelector/ProjectSelector.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"ProjectSelector.esm.js","sources":["../../../src/components/ProjectSelector/ProjectSelector.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 { Entity } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport TextField from '@material-ui/core/TextField';\nimport { makeStyles } from '@material-ui/core/styles';\n\ntype Props = {\n catalogEntities: Entity[];\n onChange: (entity: Entity) => void;\n disableClearable: boolean;\n defaultValue: Entity | null | undefined;\n label: string;\n};\n\nconst useStyles = makeStyles({\n container: { width: '100%', minWidth: '22rem' },\n autocomplete: { overflow: 'hidden' },\n});\n\nexport const ProjectSelector = ({\n catalogEntities,\n onChange,\n disableClearable,\n defaultValue,\n label,\n}: Props) => {\n const classes = useStyles();\n return (\n <div className={classes.container}>\n <Autocomplete\n className={classes.autocomplete}\n fullWidth\n disableClearable={disableClearable}\n defaultValue={defaultValue}\n options={catalogEntities}\n getOptionLabel={option => option?.metadata?.name}\n renderOption={option => (\n <Typography component=\"span\">{option?.metadata?.name}</Typography>\n )}\n renderInput={params => <TextField {...params} label={label} />}\n onChange={(_, data) => {\n onChange(data!);\n }}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AA8BA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAW,EAAA,EAAE,KAAO,EAAA,MAAA,EAAQ,UAAU,OAAQ,EAAA;AAAA,EAC9C,YAAA,EAAc,EAAE,QAAA,EAAU,QAAS;AACrC,CAAC,CAAA;AAEM,MAAM,kBAAkB,CAAC;AAAA,EAC9B,eAAA;AAAA,EACA,QAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAa,KAAA;AACX,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAA,uBACG,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,SACtB,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,WAAW,OAAQ,CAAA,YAAA;AAAA,MACnB,SAAS,EAAA,IAAA;AAAA,MACT,gBAAA;AAAA,MACA,YAAA;AAAA,MACA,OAAS,EAAA,eAAA;AAAA,MACT,cAAA,EAAgB,CAAU,MAAA,KAAA,MAAA,EAAQ,QAAU,EAAA,IAAA;AAAA,MAC5C,YAAA,EAAc,4BACX,GAAA,CAAA,UAAA,EAAA,EAAW,WAAU,MAAQ,EAAA,QAAA,EAAA,MAAA,EAAQ,UAAU,IAAK,EAAA,CAAA;AAAA,MAEvD,aAAa,CAAU,MAAA,qBAAA,GAAA,CAAC,SAAW,EAAA,EAAA,GAAG,QAAQ,KAAc,EAAA,CAAA;AAAA,MAC5D,QAAA,EAAU,CAAC,CAAA,EAAG,IAAS,KAAA;AACrB,QAAA,QAAA,CAAS,IAAK,CAAA;AAAA;AAChB;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import FormControl from '@material-ui/core/FormControl';
|
|
3
3
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
4
4
|
import Select from '@material-ui/core/Select';
|
|
@@ -16,19 +16,21 @@ const SortMethodSelector = ({
|
|
|
16
16
|
handleSortMethodChange
|
|
17
17
|
}) => {
|
|
18
18
|
const classes = useStyles();
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsx(FormControl, { fullWidth: true, children: /* @__PURE__ */ jsxs(
|
|
20
20
|
Select,
|
|
21
21
|
{
|
|
22
22
|
className: classes.select,
|
|
23
23
|
disableUnderline: true,
|
|
24
24
|
value: sortMethodNbr,
|
|
25
|
-
onChange: handleSortMethodChange
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
onChange: handleSortMethodChange,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 0, children: "Latest updated" }),
|
|
28
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 1, children: "A-Z" }),
|
|
29
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 2, children: "Z-A" }),
|
|
30
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 3, children: "Most members" })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
) });
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
export { SortMethodSelector };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortMethodSelector.esm.js","sources":["../../../src/components/SortMethodSelector/SortMethodSelector.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"SortMethodSelector.esm.js","sources":["../../../src/components/SortMethodSelector/SortMethodSelector.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 { ChangeEvent, ReactNode } from 'react';\nimport FormControl from '@material-ui/core/FormControl';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles({\n select: {\n fontSize: 'xx-large',\n fontWeight: 'bold',\n width: '16rem',\n },\n});\n\ntype Props = {\n sortMethodNbr: number;\n handleSortMethodChange:\n | ((\n event: ChangeEvent<{ name?: string | undefined; value: unknown }>,\n child: ReactNode,\n ) => void)\n | undefined;\n};\n\nexport const SortMethodSelector = ({\n sortMethodNbr,\n handleSortMethodChange,\n}: Props) => {\n const classes = useStyles();\n return (\n <FormControl fullWidth>\n <Select\n className={classes.select}\n disableUnderline\n value={sortMethodNbr}\n onChange={handleSortMethodChange}\n >\n <MenuItem value={0}>Latest updated</MenuItem>\n <MenuItem value={1}>A-Z</MenuItem>\n <MenuItem value={2}>Z-A</MenuItem>\n <MenuItem value={3}>Most members</MenuItem>\n </Select>\n </FormControl>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,MAAQ,EAAA;AAAA,IACN,QAAU,EAAA,UAAA;AAAA,IACV,UAAY,EAAA,MAAA;AAAA,IACZ,KAAO,EAAA;AAAA;AAEX,CAAC,CAAA;AAYM,MAAM,qBAAqB,CAAC;AAAA,EACjC,aAAA;AAAA,EACA;AACF,CAAa,KAAA;AACX,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EACE,uBAAA,GAAA,CAAC,WAAY,EAAA,EAAA,SAAA,EAAS,IACpB,EAAA,QAAA,kBAAA,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAW,OAAQ,CAAA,MAAA;AAAA,MACnB,gBAAgB,EAAA,IAAA;AAAA,MAChB,KAAO,EAAA,aAAA;AAAA,MACP,QAAU,EAAA,sBAAA;AAAA,MAEV,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,QAAA,EAAA,EAAS,KAAO,EAAA,CAAA,EAAG,QAAc,EAAA,gBAAA,EAAA,CAAA;AAAA,wBACjC,GAAA,CAAA,QAAA,EAAA,EAAS,KAAO,EAAA,CAAA,EAAG,QAAG,EAAA,KAAA,EAAA,CAAA;AAAA,wBACtB,GAAA,CAAA,QAAA,EAAA,EAAS,KAAO,EAAA,CAAA,EAAG,QAAG,EAAA,KAAA,EAAA,CAAA;AAAA,wBACtB,GAAA,CAAA,QAAA,EAAA,EAAS,KAAO,EAAA,CAAA,EAAG,QAAY,EAAA,cAAA,EAAA;AAAA;AAAA;AAAA,GAEpC,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import { Content, SupportButton } from '@backstage/core-components';
|
|
3
4
|
import { AddProjectDialog } from '../AddProjectDialog/AddProjectDialog.esm.js';
|
|
4
5
|
import { ProjectPreview } from '../ProjectPreview/ProjectPreview.esm.js';
|
|
@@ -117,59 +118,69 @@ const SortView = (props) => {
|
|
|
117
118
|
);
|
|
118
119
|
};
|
|
119
120
|
if (catalogEntities.error)
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ jsx(Alert, { severity: "error", children: catalogEntities.error.message });
|
|
121
122
|
if (bazaarProjects.error)
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
123
|
+
return /* @__PURE__ */ jsx(Alert, { severity: "error", children: bazaarProjects.error.message });
|
|
124
|
+
return /* @__PURE__ */ jsxs(Content, { noPadding: true, children: [
|
|
125
|
+
/* @__PURE__ */ jsxs("div", { className: classes.header, children: [
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
SortMethodSelector,
|
|
128
|
+
{
|
|
129
|
+
sortMethodNbr,
|
|
130
|
+
handleSortMethodChange
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ jsx(
|
|
134
|
+
SearchBar,
|
|
135
|
+
{
|
|
136
|
+
className: classes.search,
|
|
137
|
+
value: searchValue,
|
|
138
|
+
onChange: (newSortMethod) => {
|
|
139
|
+
setSearchValue(newSortMethod);
|
|
140
|
+
},
|
|
141
|
+
onCancelSearch: () => {
|
|
142
|
+
setSearchValue("");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
Button,
|
|
148
|
+
{
|
|
149
|
+
className: classes.button,
|
|
150
|
+
variant: "contained",
|
|
151
|
+
color: "primary",
|
|
152
|
+
onClick: () => {
|
|
153
|
+
setOpenAdd(true);
|
|
154
|
+
},
|
|
155
|
+
children: "Add project"
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ jsx(
|
|
159
|
+
AddProjectDialog,
|
|
160
|
+
{
|
|
161
|
+
catalogEntities: unlinkedCatalogEntities || [],
|
|
162
|
+
handleClose: () => {
|
|
163
|
+
setOpenAdd(false);
|
|
164
|
+
},
|
|
165
|
+
open: openAdd,
|
|
166
|
+
fetchBazaarProjects,
|
|
167
|
+
fetchCatalogEntities
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ jsx(SupportButton, {})
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ jsx(
|
|
173
|
+
ProjectPreview,
|
|
174
|
+
{
|
|
175
|
+
bazaarProjects: getSearchResults() || [],
|
|
176
|
+
fetchBazaarProjects,
|
|
177
|
+
catalogEntities: unlinkedCatalogEntities || [],
|
|
178
|
+
gridSize: fullWidth ? 2 : 4,
|
|
179
|
+
height: fullHeight ? "large" : "small"
|
|
149
180
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
)
|
|
153
|
-
AddProjectDialog,
|
|
154
|
-
{
|
|
155
|
-
catalogEntities: unlinkedCatalogEntities || [],
|
|
156
|
-
handleClose: () => {
|
|
157
|
-
setOpenAdd(false);
|
|
158
|
-
},
|
|
159
|
-
open: openAdd,
|
|
160
|
-
fetchBazaarProjects,
|
|
161
|
-
fetchCatalogEntities
|
|
162
|
-
}
|
|
163
|
-
), /* @__PURE__ */ React.createElement(SupportButton, null)), /* @__PURE__ */ React.createElement(
|
|
164
|
-
ProjectPreview,
|
|
165
|
-
{
|
|
166
|
-
bazaarProjects: getSearchResults() || [],
|
|
167
|
-
fetchBazaarProjects,
|
|
168
|
-
catalogEntities: unlinkedCatalogEntities || [],
|
|
169
|
-
gridSize: fullWidth ? 2 : 4,
|
|
170
|
-
height: fullHeight ? "large" : "small"
|
|
171
|
-
}
|
|
172
|
-
), /* @__PURE__ */ React.createElement(Content, { noPadding: true, className: classes.container }));
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ jsx(Content, { noPadding: true, className: classes.container })
|
|
183
|
+
] });
|
|
173
184
|
};
|
|
174
185
|
|
|
175
186
|
export { SortView };
|