@backstage-community/plugin-entity-feedback 0.13.0 → 0.15.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 +22 -0
- package/dist/alpha.d.ts +6 -25
- package/dist/components/FeedbackResponseDialog/FeedbackResponseDialog.esm.js +17 -3
- package/dist/components/FeedbackResponseDialog/FeedbackResponseDialog.esm.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/package.json.esm.js +11 -11
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @backstage-community/plugin-entity-feedback
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 227f90a: Backstage version bump to v1.47.2
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [227f90a]
|
|
12
|
+
- @backstage-community/plugin-entity-feedback-common@0.13.0
|
|
13
|
+
|
|
14
|
+
## 0.14.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- a3c15ac: Backstage version bump to v1.46.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [a3c15ac]
|
|
23
|
+
- @backstage-community/plugin-entity-feedback-common@0.12.0
|
|
24
|
+
|
|
3
25
|
## 0.13.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
5
|
-
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
6
5
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -16,11 +15,11 @@ declare const entityFeedbackPlugin: _backstage_frontend_plugin_api.OverridableFr
|
|
|
16
15
|
name: undefined;
|
|
17
16
|
config: {};
|
|
18
17
|
configInput: {};
|
|
19
|
-
output: _backstage_frontend_plugin_api.ExtensionDataRef<
|
|
18
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
20
19
|
inputs: {};
|
|
21
20
|
params: <TApi, TImpl extends TApi, TDeps extends {
|
|
22
21
|
[x: string]: unknown;
|
|
23
|
-
}>(params:
|
|
22
|
+
}>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
24
23
|
}>;
|
|
25
24
|
"entity-card:entity-feedback/ratings-buttons": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
26
25
|
config: {
|
|
@@ -32,20 +31,18 @@ declare const entityFeedbackPlugin: _backstage_frontend_plugin_api.OverridableFr
|
|
|
32
31
|
id: string;
|
|
33
32
|
label: string;
|
|
34
33
|
}[] | undefined;
|
|
35
|
-
} & {
|
|
36
34
|
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
37
35
|
type: "content" | "summary" | "info" | undefined;
|
|
38
36
|
};
|
|
39
37
|
configInput: {
|
|
40
|
-
title?: string | undefined;
|
|
41
38
|
variant?: "starred" | "like-dislike" | undefined;
|
|
39
|
+
title?: string | undefined;
|
|
42
40
|
requestResponse?: boolean | undefined;
|
|
43
41
|
dialogTitle?: string | undefined;
|
|
44
42
|
dialogResponses?: {
|
|
45
43
|
id: string;
|
|
46
44
|
label: string;
|
|
47
45
|
}[] | undefined;
|
|
48
|
-
} & {
|
|
49
46
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
50
47
|
type?: "content" | "summary" | "info" | undefined;
|
|
51
48
|
};
|
|
@@ -56,14 +53,7 @@ declare const entityFeedbackPlugin: _backstage_frontend_plugin_api.OverridableFr
|
|
|
56
53
|
}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_plugin_catalog_react_alpha.EntityCardType, "catalog.entity-card-type", {
|
|
57
54
|
optional: true;
|
|
58
55
|
}>;
|
|
59
|
-
inputs: {
|
|
60
|
-
[x: string]: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ExtensionDataRef<unknown, string, {
|
|
61
|
-
optional?: true | undefined;
|
|
62
|
-
}>, {
|
|
63
|
-
singleton: boolean;
|
|
64
|
-
optional: boolean;
|
|
65
|
-
}>;
|
|
66
|
-
};
|
|
56
|
+
inputs: {};
|
|
67
57
|
kind: "entity-card";
|
|
68
58
|
name: "ratings-buttons";
|
|
69
59
|
params: {
|
|
@@ -77,15 +67,13 @@ declare const entityFeedbackPlugin: _backstage_frontend_plugin_api.OverridableFr
|
|
|
77
67
|
title: string | undefined;
|
|
78
68
|
allEntities: boolean | undefined;
|
|
79
69
|
variant: "starred" | "like-dislike";
|
|
80
|
-
} & {
|
|
81
70
|
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
82
71
|
type: "content" | "summary" | "info" | undefined;
|
|
83
72
|
};
|
|
84
73
|
configInput: {
|
|
74
|
+
variant?: "starred" | "like-dislike" | undefined;
|
|
85
75
|
title?: string | undefined;
|
|
86
76
|
allEntities?: boolean | undefined;
|
|
87
|
-
variant?: "starred" | "like-dislike" | undefined;
|
|
88
|
-
} & {
|
|
89
77
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
90
78
|
type?: "content" | "summary" | "info" | undefined;
|
|
91
79
|
};
|
|
@@ -96,14 +84,7 @@ declare const entityFeedbackPlugin: _backstage_frontend_plugin_api.OverridableFr
|
|
|
96
84
|
}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_plugin_catalog_react_alpha.EntityCardType, "catalog.entity-card-type", {
|
|
97
85
|
optional: true;
|
|
98
86
|
}>;
|
|
99
|
-
inputs: {
|
|
100
|
-
[x: string]: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ExtensionDataRef<unknown, string, {
|
|
101
|
-
optional?: true | undefined;
|
|
102
|
-
}>, {
|
|
103
|
-
singleton: boolean;
|
|
104
|
-
optional: boolean;
|
|
105
|
-
}>;
|
|
106
|
-
};
|
|
87
|
+
inputs: {};
|
|
107
88
|
kind: "entity-card";
|
|
108
89
|
name: "ratings-table";
|
|
109
90
|
params: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
3
3
|
import { Progress } from '@backstage/core-components';
|
|
4
|
-
import { useApi, errorApiRef } from '@backstage/core-plugin-api';
|
|
4
|
+
import { useApi, errorApiRef, useRouteRef } from '@backstage/core-plugin-api';
|
|
5
|
+
import { entityRouteRef, entityRouteParams } from '@backstage/plugin-catalog-react';
|
|
5
6
|
import Button from '@material-ui/core/Button';
|
|
6
7
|
import Checkbox from '@material-ui/core/Checkbox';
|
|
7
8
|
import Collapse from '@material-ui/core/Collapse';
|
|
@@ -62,6 +63,7 @@ const FeedbackResponseDialog = (props) => {
|
|
|
62
63
|
const classes = useStyles();
|
|
63
64
|
const errorApi = useApi(errorApiRef);
|
|
64
65
|
const feedbackApi = useApi(entityFeedbackApiRef);
|
|
66
|
+
const entityRoute = useRouteRef(entityRouteRef);
|
|
65
67
|
const [responseSelections, setResponseSelections] = useState(
|
|
66
68
|
Object.fromEntries(feedbackDialogResponses.map((r) => [r.id, false]))
|
|
67
69
|
);
|
|
@@ -70,6 +72,9 @@ const FeedbackResponseDialog = (props) => {
|
|
|
70
72
|
additionalComments: ""
|
|
71
73
|
});
|
|
72
74
|
const [consent, setConsent] = useState(true);
|
|
75
|
+
const entityUrl = entityRoute(
|
|
76
|
+
entityRouteParams(entity, { encodeParams: true })
|
|
77
|
+
);
|
|
73
78
|
const [{ loading: saving }, saveResponse] = useAsyncFn(async () => {
|
|
74
79
|
const filteredResponseComments = Object.entries(
|
|
75
80
|
comments.responseComments
|
|
@@ -87,13 +92,22 @@ const FeedbackResponseDialog = (props) => {
|
|
|
87
92
|
await feedbackApi.recordResponse(stringifyEntityRef(entity), {
|
|
88
93
|
comments: JSON.stringify(filteredComments),
|
|
89
94
|
consent,
|
|
90
|
-
response: Object.keys(responseSelections).filter((id) => responseSelections[id]).join(",")
|
|
95
|
+
response: Object.keys(responseSelections).filter((id) => responseSelections[id]).join(","),
|
|
96
|
+
link: entityUrl
|
|
91
97
|
});
|
|
92
98
|
onClose();
|
|
93
99
|
} catch (e) {
|
|
94
100
|
errorApi.post(e);
|
|
95
101
|
}
|
|
96
|
-
}, [
|
|
102
|
+
}, [
|
|
103
|
+
comments,
|
|
104
|
+
consent,
|
|
105
|
+
entity,
|
|
106
|
+
entityUrl,
|
|
107
|
+
feedbackApi,
|
|
108
|
+
onClose,
|
|
109
|
+
responseSelections
|
|
110
|
+
]);
|
|
97
111
|
return /* @__PURE__ */ jsxs(Dialog, { open, onClose: () => !saving && onClose(), children: [
|
|
98
112
|
saving && /* @__PURE__ */ jsx(Progress, {}),
|
|
99
113
|
/* @__PURE__ */ jsx(DialogTitle, { children: feedbackDialogTitle }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackResponseDialog.esm.js","sources":["../../../src/components/FeedbackResponseDialog/FeedbackResponseDialog.tsx"],"sourcesContent":["/*\n * Copyright 2023 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, stringifyEntityRef } from '@backstage/catalog-model';\nimport { Progress } from '@backstage/core-components';\nimport { ErrorApiError, errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport Button from '@material-ui/core/Button';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Collapse from '@material-ui/core/Collapse';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport FormGroup from '@material-ui/core/FormGroup';\nimport FormLabel from '@material-ui/core/FormLabel';\nimport Grid from '@material-ui/core/Grid';\nimport Switch from '@material-ui/core/Switch';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { ReactNode, useState } from 'react';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\n\nimport { entityFeedbackApiRef } from '../../api';\n\n/**\n * @public\n */\nexport interface EntityFeedbackResponse {\n id: string;\n label: string;\n}\nexport interface Comments {\n responseComments: {\n [key: string]: string;\n };\n additionalComments?: string;\n}\n\nconst defaultFeedbackResponses: EntityFeedbackResponse[] = [\n { id: 'incorrect', label: 'Incorrect info' },\n { id: 'missing', label: 'Missing info' },\n { id: 'other', label: 'Other' },\n];\n\n/**\n * @public\n */\nexport interface FeedbackResponseDialogProps {\n entity: Entity;\n feedbackDialogResponses?: EntityFeedbackResponse[];\n feedbackDialogTitle?: ReactNode;\n open: boolean;\n onClose: () => void;\n}\n\nconst useStyles = makeStyles<Theme>(\n theme => ({\n contactConsent: {\n marginTop: theme.spacing(1.5),\n },\n commentBoxes: {\n marginBottom: theme.spacing(1.5),\n },\n boxContainer: {\n marginBottom: theme.spacing(1.5),\n marginTop: theme.spacing(1.5),\n marginLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n },\n formLabel: {\n marginBottom: theme.spacing(1.5),\n },\n dialogActions: {\n justifyContent: 'flex-start',\n },\n }),\n { name: 'BackstageEntityFeedbackDialog' },\n);\n\nexport const FeedbackResponseDialog = (props: FeedbackResponseDialogProps) => {\n const {\n entity,\n feedbackDialogResponses = defaultFeedbackResponses,\n feedbackDialogTitle = 'Tell us what could be better',\n open,\n onClose,\n } = props;\n const classes = useStyles();\n const errorApi = useApi(errorApiRef);\n const feedbackApi = useApi(entityFeedbackApiRef);\n const [responseSelections, setResponseSelections] = useState(\n Object.fromEntries(feedbackDialogResponses.map(r => [r.id, false])),\n );\n const [comments, setComments] = useState<Comments>({\n responseComments: {},\n additionalComments: '',\n });\n const [consent, setConsent] = useState(true);\n\n const [{ loading: saving }, saveResponse] = useAsyncFn(async () => {\n // filter out responses that were not selected\n const filteredResponseComments = Object.entries(\n comments.responseComments,\n ).reduce((entry, [key, value]) => {\n if (responseSelections[key]) {\n entry[key] = value;\n }\n return entry;\n }, {} as { [key: string]: string });\n\n const filteredComments = {\n ...comments,\n responseComments: filteredResponseComments,\n };\n try {\n await feedbackApi.recordResponse(stringifyEntityRef(entity), {\n comments: JSON.stringify(filteredComments),\n consent,\n response: Object.keys(responseSelections)\n .filter(id => responseSelections[id])\n .join(','),\n });\n onClose();\n } catch (e) {\n errorApi.post(e as ErrorApiError);\n }\n }, [comments, consent, entity, feedbackApi, onClose, responseSelections]);\n\n return (\n <Dialog open={open} onClose={() => !saving && onClose()}>\n {saving && <Progress />}\n <DialogTitle>{feedbackDialogTitle}</DialogTitle>\n <DialogContent>\n <FormControl component=\"fieldset\" fullWidth>\n <FormLabel component=\"legend\">Select all that apply</FormLabel>\n <FormGroup className={classes.boxContainer}>\n {feedbackDialogResponses.map((response: EntityFeedbackResponse) => (\n <Grid container key={response.id} direction=\"column\" spacing={1}>\n <FormControlLabel\n control={\n <Checkbox\n checked={responseSelections[response.id]}\n disabled={saving}\n name={response.id}\n onChange={e =>\n setResponseSelections({\n ...responseSelections,\n [e.target.name]: e.target.checked,\n })\n }\n color=\"primary\"\n />\n }\n label={response.label}\n />\n <Collapse in={responseSelections[response.id]}>\n <TextField\n data-testid={`feedback-response-dialog-collapse-comments-input-${\n responseSelections[response.id]\n }`}\n disabled={saving}\n className={classes.commentBoxes}\n multiline\n minRows={2}\n fullWidth\n variant=\"outlined\"\n value={comments.responseComments[response.id] || ''}\n onChange={e =>\n setComments(prevComments => ({\n responseComments: {\n ...prevComments.responseComments,\n [response.id]: e.target.value,\n },\n additionalComments: prevComments.additionalComments,\n }))\n }\n />\n </Collapse>\n </Grid>\n ))}\n </FormGroup>\n </FormControl>\n <FormControl fullWidth>\n <FormLabel component=\"legend\" className={classes.formLabel}>\n Additional comments\n </FormLabel>\n <TextField\n data-testid=\"feedback-response-dialog-comments-input\"\n disabled={saving}\n multiline\n minRows={2}\n onChange={e =>\n setComments(prevComments => ({\n responseComments: {\n ...prevComments.responseComments,\n },\n additionalComments: e.target.value,\n }))\n }\n variant=\"outlined\"\n value={comments.additionalComments || ''}\n />\n </FormControl>\n <Typography className={classes.contactConsent}>\n May we contact you about your feedback?\n <Grid component=\"label\" container alignItems=\"center\" spacing={1}>\n <Grid item>No</Grid>\n <Grid item>\n <Switch\n checked={consent}\n disabled={saving}\n onChange={e => setConsent(e.target.checked)}\n />\n </Grid>\n <Grid item>Yes</Grid>\n </Grid>\n </Typography>\n </DialogContent>\n <DialogActions className={classes.dialogActions}>\n <Button\n color=\"primary\"\n data-testid=\"feedback-response-dialog-submit-button\"\n disabled={saving}\n onClick={saveResponse}\n >\n Submit\n </Button>\n <Button color=\"primary\" disabled={saving} onClick={onClose}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,wBAAqD,GAAA;AAAA,EACzD,EAAE,EAAA,EAAI,WAAa,EAAA,KAAA,EAAO,gB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ACC,IAAA,CAAA,aAAA,EAAA,EAAc,SAAW,EAAA,OAAA,CAAQ,aAChC,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,KAAM,EAAA,SAAA;AAAA,UACN,aAAY,EAAA,wCAAA;AAAA,UACZ,QAAU,EAAA,MAAA;AAAA,UACV,OAAS,EAAA,YAAA;AAAA,UACV,QAAA,EAAA;AAAA;AAAA,OAED;AAAA,sBACA,GAAA,CAAC,UAAO,KAAM,EAAA,SAAA,EAAU,UAAU,MAAQ,EAAA,OAAA,EAAS,SAAS,QAE5D,EAAA,OAAA,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"FeedbackResponseDialog.esm.js","sources":["../../../src/components/FeedbackResponseDialog/FeedbackResponseDialog.tsx"],"sourcesContent":["/*\n * Copyright 2023 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, stringifyEntityRef } from '@backstage/catalog-model';\nimport { Progress } from '@backstage/core-components';\nimport {\n ErrorApiError,\n errorApiRef,\n useApi,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport {\n entityRouteParams,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport Button from '@material-ui/core/Button';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Collapse from '@material-ui/core/Collapse';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport FormGroup from '@material-ui/core/FormGroup';\nimport FormLabel from '@material-ui/core/FormLabel';\nimport Grid from '@material-ui/core/Grid';\nimport Switch from '@material-ui/core/Switch';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { ReactNode, useState } from 'react';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\n\nimport { entityFeedbackApiRef } from '../../api';\n\n/**\n * @public\n */\nexport interface EntityFeedbackResponse {\n id: string;\n label: string;\n}\nexport interface Comments {\n responseComments: {\n [key: string]: string;\n };\n additionalComments?: string;\n}\n\nconst defaultFeedbackResponses: EntityFeedbackResponse[] = [\n { id: 'incorrect', label: 'Incorrect info' },\n { id: 'missing', label: 'Missing info' },\n { id: 'other', label: 'Other' },\n];\n\n/**\n * @public\n */\nexport interface FeedbackResponseDialogProps {\n entity: Entity;\n feedbackDialogResponses?: EntityFeedbackResponse[];\n feedbackDialogTitle?: ReactNode;\n open: boolean;\n onClose: () => void;\n}\n\nconst useStyles = makeStyles<Theme>(\n theme => ({\n contactConsent: {\n marginTop: theme.spacing(1.5),\n },\n commentBoxes: {\n marginBottom: theme.spacing(1.5),\n },\n boxContainer: {\n marginBottom: theme.spacing(1.5),\n marginTop: theme.spacing(1.5),\n marginLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n },\n formLabel: {\n marginBottom: theme.spacing(1.5),\n },\n dialogActions: {\n justifyContent: 'flex-start',\n },\n }),\n { name: 'BackstageEntityFeedbackDialog' },\n);\n\nexport const FeedbackResponseDialog = (props: FeedbackResponseDialogProps) => {\n const {\n entity,\n feedbackDialogResponses = defaultFeedbackResponses,\n feedbackDialogTitle = 'Tell us what could be better',\n open,\n onClose,\n } = props;\n const classes = useStyles();\n const errorApi = useApi(errorApiRef);\n const feedbackApi = useApi(entityFeedbackApiRef);\n const entityRoute = useRouteRef(entityRouteRef);\n const [responseSelections, setResponseSelections] = useState(\n Object.fromEntries(feedbackDialogResponses.map(r => [r.id, false])),\n );\n const [comments, setComments] = useState<Comments>({\n responseComments: {},\n additionalComments: '',\n });\n const [consent, setConsent] = useState(true);\n\n // Derive the entity URL using the same logic as EntityRefLink\n const entityUrl = entityRoute(\n entityRouteParams(entity, { encodeParams: true }),\n );\n\n const [{ loading: saving }, saveResponse] = useAsyncFn(async () => {\n // filter out responses that were not selected\n const filteredResponseComments = Object.entries(\n comments.responseComments,\n ).reduce((entry, [key, value]) => {\n if (responseSelections[key]) {\n entry[key] = value;\n }\n return entry;\n }, {} as { [key: string]: string });\n\n const filteredComments = {\n ...comments,\n responseComments: filteredResponseComments,\n };\n try {\n await feedbackApi.recordResponse(stringifyEntityRef(entity), {\n comments: JSON.stringify(filteredComments),\n consent,\n response: Object.keys(responseSelections)\n .filter(id => responseSelections[id])\n .join(','),\n link: entityUrl,\n });\n onClose();\n } catch (e) {\n errorApi.post(e as ErrorApiError);\n }\n }, [\n comments,\n consent,\n entity,\n entityUrl,\n feedbackApi,\n onClose,\n responseSelections,\n ]);\n\n return (\n <Dialog open={open} onClose={() => !saving && onClose()}>\n {saving && <Progress />}\n <DialogTitle>{feedbackDialogTitle}</DialogTitle>\n <DialogContent>\n <FormControl component=\"fieldset\" fullWidth>\n <FormLabel component=\"legend\">Select all that apply</FormLabel>\n <FormGroup className={classes.boxContainer}>\n {feedbackDialogResponses.map((response: EntityFeedbackResponse) => (\n <Grid container key={response.id} direction=\"column\" spacing={1}>\n <FormControlLabel\n control={\n <Checkbox\n checked={responseSelections[response.id]}\n disabled={saving}\n name={response.id}\n onChange={e =>\n setResponseSelections({\n ...responseSelections,\n [e.target.name]: e.target.checked,\n })\n }\n color=\"primary\"\n />\n }\n label={response.label}\n />\n <Collapse in={responseSelections[response.id]}>\n <TextField\n data-testid={`feedback-response-dialog-collapse-comments-input-${\n responseSelections[response.id]\n }`}\n disabled={saving}\n className={classes.commentBoxes}\n multiline\n minRows={2}\n fullWidth\n variant=\"outlined\"\n value={comments.responseComments[response.id] || ''}\n onChange={e =>\n setComments(prevComments => ({\n responseComments: {\n ...prevComments.responseComments,\n [response.id]: e.target.value,\n },\n additionalComments: prevComments.additionalComments,\n }))\n }\n />\n </Collapse>\n </Grid>\n ))}\n </FormGroup>\n </FormControl>\n <FormControl fullWidth>\n <FormLabel component=\"legend\" className={classes.formLabel}>\n Additional comments\n </FormLabel>\n <TextField\n data-testid=\"feedback-response-dialog-comments-input\"\n disabled={saving}\n multiline\n minRows={2}\n onChange={e =>\n setComments(prevComments => ({\n responseComments: {\n ...prevComments.responseComments,\n },\n additionalComments: e.target.value,\n }))\n }\n variant=\"outlined\"\n value={comments.additionalComments || ''}\n />\n </FormControl>\n <Typography className={classes.contactConsent}>\n May we contact you about your feedback?\n <Grid component=\"label\" container alignItems=\"center\" spacing={1}>\n <Grid item>No</Grid>\n <Grid item>\n <Switch\n checked={consent}\n disabled={saving}\n onChange={e => setConsent(e.target.checked)}\n />\n </Grid>\n <Grid item>Yes</Grid>\n </Grid>\n </Typography>\n </DialogContent>\n <DialogActions className={classes.dialogActions}>\n <Button\n color=\"primary\"\n data-testid=\"feedback-response-dialog-submit-button\"\n disabled={saving}\n onClick={saveResponse}\n >\n Submit\n </Button>\n <Button color=\"primary\" disabled={saving} onClick={onClose}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAM,wBAAqD,GAAA;AAAA,EACzD,EAAE,EAAA,EAAI,WAAa,EAAA,KAAA,EAAO,gBAAiB,EAAA;AAAA,EAC3C,EAAE,EAAA,EAAI,SAAW,EAAA,KAAA,EAAO,cAAe,EAAA;AAAA,EACvC,EAAE,EAAA,EAAI,OAAS,EAAA,KAAA,EAAO,OAAQ;AAChC,CAAA;AAaA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,M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,KACF,EAAA,CAAA;AAAA,oBACC,IAAA,CAAA,aAAA,EAAA,EAAc,SAAW,EAAA,OAAA,CAAQ,aAChC,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,KAAM,EAAA,SAAA;AAAA,UACN,aAAY,EAAA,wCAAA;AAAA,UACZ,QAAU,EAAA,MAAA;AAAA,UACV,OAAS,EAAA,YAAA;AAAA,UACV,QAAA,EAAA;AAAA;AAAA,OAED;AAAA,sBACA,GAAA,CAAC,UAAO,KAAM,EAAA,SAAA,EAAU,UAAU,MAAQ,EAAA,OAAA,EAAS,SAAS,QAE5D,EAAA,OAAA,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
4
4
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
5
5
|
import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';
|
|
6
6
|
import { EntityRatingsData, Rating, Ratings, FeedbackResponse } from '@backstage-community/plugin-entity-feedback-common';
|
|
7
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @public
|
|
@@ -114,7 +115,7 @@ declare const StarredRatingsTable: (props: StarredRatingsTableProps) => react_js
|
|
|
114
115
|
/**
|
|
115
116
|
* @public
|
|
116
117
|
*/
|
|
117
|
-
declare const entityFeedbackApiRef:
|
|
118
|
+
declare const entityFeedbackApiRef: _backstage_frontend_plugin_api.ApiRef<EntityFeedbackApi>;
|
|
118
119
|
/**
|
|
119
120
|
* @public
|
|
120
121
|
*/
|
package/dist/package.json.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var name = "@backstage-community/plugin-entity-feedback";
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.15.0";
|
|
3
3
|
var backstage = {
|
|
4
4
|
role: "frontend-plugin",
|
|
5
5
|
pluginId: "entity-feedback",
|
|
@@ -53,23 +53,23 @@ var scripts = {
|
|
|
53
53
|
var dependencies = {
|
|
54
54
|
"@backstage-community/plugin-entity-feedback-common": "workspace:^",
|
|
55
55
|
"@backstage/catalog-model": "^1.7.6",
|
|
56
|
-
"@backstage/core-compat-api": "^0.5.
|
|
57
|
-
"@backstage/core-components": "^0.18.
|
|
58
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
56
|
+
"@backstage/core-compat-api": "^0.5.7",
|
|
57
|
+
"@backstage/core-components": "^0.18.6",
|
|
58
|
+
"@backstage/core-plugin-api": "^1.12.2",
|
|
59
59
|
"@backstage/errors": "^1.2.7",
|
|
60
|
-
"@backstage/frontend-plugin-api": "^0.13.
|
|
61
|
-
"@backstage/plugin-catalog-react": "^1.21.
|
|
60
|
+
"@backstage/frontend-plugin-api": "^0.13.4",
|
|
61
|
+
"@backstage/plugin-catalog-react": "^1.21.6",
|
|
62
62
|
"@material-ui/core": "^4.9.13",
|
|
63
63
|
"@material-ui/icons": "^4.9.1",
|
|
64
64
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
65
65
|
"react-use": "^17.2.4"
|
|
66
66
|
};
|
|
67
67
|
var devDependencies = {
|
|
68
|
-
"@backstage/cli": "^0.
|
|
69
|
-
"@backstage/dev-utils": "^1.1.
|
|
70
|
-
"@backstage/frontend-defaults": "^0.3.
|
|
71
|
-
"@backstage/plugin-catalog": "^1.32.
|
|
72
|
-
"@backstage/test-utils": "^1.7.
|
|
68
|
+
"@backstage/cli": "^0.35.3",
|
|
69
|
+
"@backstage/dev-utils": "^1.1.19",
|
|
70
|
+
"@backstage/frontend-defaults": "^0.3.6",
|
|
71
|
+
"@backstage/plugin-catalog": "^1.32.2",
|
|
72
|
+
"@backstage/test-utils": "^1.7.14",
|
|
73
73
|
"@testing-library/dom": "^10.0.0",
|
|
74
74
|
"@testing-library/jest-dom": "^6.0.0",
|
|
75
75
|
"@testing-library/react": "^15.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-entity-feedback",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "entity-feedback",
|
|
@@ -64,25 +64,25 @@
|
|
|
64
64
|
"test": "backstage-cli package test"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@backstage-community/plugin-entity-feedback-common": "^0.
|
|
67
|
+
"@backstage-community/plugin-entity-feedback-common": "^0.13.0",
|
|
68
68
|
"@backstage/catalog-model": "^1.7.6",
|
|
69
|
-
"@backstage/core-compat-api": "^0.5.
|
|
70
|
-
"@backstage/core-components": "^0.18.
|
|
71
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
69
|
+
"@backstage/core-compat-api": "^0.5.7",
|
|
70
|
+
"@backstage/core-components": "^0.18.6",
|
|
71
|
+
"@backstage/core-plugin-api": "^1.12.2",
|
|
72
72
|
"@backstage/errors": "^1.2.7",
|
|
73
|
-
"@backstage/frontend-plugin-api": "^0.13.
|
|
74
|
-
"@backstage/plugin-catalog-react": "^1.21.
|
|
73
|
+
"@backstage/frontend-plugin-api": "^0.13.4",
|
|
74
|
+
"@backstage/plugin-catalog-react": "^1.21.6",
|
|
75
75
|
"@material-ui/core": "^4.9.13",
|
|
76
76
|
"@material-ui/icons": "^4.9.1",
|
|
77
77
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
78
78
|
"react-use": "^17.2.4"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@backstage/cli": "^0.
|
|
82
|
-
"@backstage/dev-utils": "^1.1.
|
|
83
|
-
"@backstage/frontend-defaults": "^0.3.
|
|
84
|
-
"@backstage/plugin-catalog": "^1.32.
|
|
85
|
-
"@backstage/test-utils": "^1.7.
|
|
81
|
+
"@backstage/cli": "^0.35.3",
|
|
82
|
+
"@backstage/dev-utils": "^1.1.19",
|
|
83
|
+
"@backstage/frontend-defaults": "^0.3.6",
|
|
84
|
+
"@backstage/plugin-catalog": "^1.32.2",
|
|
85
|
+
"@backstage/test-utils": "^1.7.14",
|
|
86
86
|
"@testing-library/dom": "^10.0.0",
|
|
87
87
|
"@testing-library/jest-dom": "^6.0.0",
|
|
88
88
|
"@testing-library/react": "^15.0.0",
|