@backstage/plugin-notifications 0.5.16-next.1 → 0.5.16-next.2
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 +14 -0
- package/dist/alpha.d.ts +2 -1
- package/dist/alpha.esm.js +1 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/NotificationsFilters/NotificationsFilters.esm.js +88 -103
- package/dist/components/NotificationsFilters/NotificationsFilters.esm.js.map +1 -1
- package/dist/components/NotificationsPage/NotificationsPage.esm.js +7 -8
- package/dist/components/NotificationsPage/NotificationsPage.esm.js.map +1 -1
- package/dist/components/NotificationsSideBarItem/NotificationsSideBarItem.esm.js +65 -58
- package/dist/components/NotificationsSideBarItem/NotificationsSideBarItem.esm.js.map +1 -1
- package/dist/components/NotificationsSideBarItem/NotificationsSideBarItem.module.css.esm.js +8 -0
- package/dist/components/NotificationsSideBarItem/NotificationsSideBarItem.module.css.esm.js.map +1 -0
- package/dist/components/NotificationsTable/BulkActions.esm.js +48 -32
- package/dist/components/NotificationsTable/BulkActions.esm.js.map +1 -1
- package/dist/components/NotificationsTable/NotificationDescription.esm.js +8 -11
- package/dist/components/NotificationsTable/NotificationDescription.esm.js.map +1 -1
- package/dist/components/NotificationsTable/NotificationIcon.esm.js +4 -3
- package/dist/components/NotificationsTable/NotificationIcon.esm.js.map +1 -1
- package/dist/components/NotificationsTable/NotificationsTable.esm.js +90 -114
- package/dist/components/NotificationsTable/NotificationsTable.esm.js.map +1 -1
- package/dist/components/NotificationsTable/NotificationsTable.module.css.esm.js +8 -0
- package/dist/components/NotificationsTable/NotificationsTable.module.css.esm.js.map +1 -0
- package/dist/components/NotificationsTable/SelectAll.esm.js +18 -33
- package/dist/components/NotificationsTable/SelectAll.esm.js.map +1 -1
- package/dist/components/NotificationsTable/SelectAll.module.css.esm.js +8 -0
- package/dist/components/NotificationsTable/SelectAll.module.css.esm.js.map +1 -0
- package/dist/components/NotificationsTable/SeverityIcon.esm.js +37 -25
- package/dist/components/NotificationsTable/SeverityIcon.esm.js.map +1 -1
- package/dist/components/NotificationsTable/SeverityIcon.module.css.esm.js +8 -0
- package/dist/components/NotificationsTable/SeverityIcon.module.css.esm.js.map +1 -0
- package/dist/components/UserNotificationSettingsCard/NoBorderTableCell.esm.js +6 -7
- package/dist/components/UserNotificationSettingsCard/NoBorderTableCell.esm.js.map +1 -1
- package/dist/components/UserNotificationSettingsCard/NoBorderTableCell.module.css.esm.js +8 -0
- package/dist/components/UserNotificationSettingsCard/NoBorderTableCell.module.css.esm.js.map +1 -0
- package/dist/components/UserNotificationSettingsCard/OriginRow.esm.js +35 -43
- package/dist/components/UserNotificationSettingsCard/OriginRow.esm.js.map +1 -1
- package/dist/components/UserNotificationSettingsCard/TopicRow.esm.js +22 -33
- package/dist/components/UserNotificationSettingsCard/TopicRow.esm.js.map +1 -1
- package/dist/components/UserNotificationSettingsCard/UserNotificationSettingsPanel.esm.js +20 -20
- package/dist/components/UserNotificationSettingsCard/UserNotificationSettingsPanel.esm.js.map +1 -1
- package/dist/components/UserNotificationSettingsCard/UserNotificationSettingsPanel.module.css.esm.js +8 -0
- package/dist/components/UserNotificationSettingsCard/UserNotificationSettingsPanel.module.css.esm.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
- package/dist/{package.json.esm.js → plugins/notifications/package.json.esm.js} +1 -4
- package/dist/{package.json.esm.js.map → plugins/notifications/package.json.esm.js.map} +1 -1
- package/dist/translation.esm.js +3 -2
- package/dist/translation.esm.js.map +1 -1
- package/package.json +12 -15
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = "/*\n * Copyright 2024 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\n@layer components {\n .NoBorderTableCell_cell__185c4ff930 {\n border-bottom: none;\n padding: var(--bui-space-2) var(--bui-space-3);\n vertical-align: middle;\n }\n}\n";
|
|
4
|
+
var styles = {"cell":"NoBorderTableCell_cell__185c4ff930"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=NoBorderTableCell.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoBorderTableCell.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,57 +1,49 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { isNotificationsEnabledFor } from '@backstage/plugin-notifications-common';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import TableRow from '@material-ui/core/TableRow';
|
|
6
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
|
7
|
-
import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
|
|
8
|
-
import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp';
|
|
3
|
+
import { TooltipTrigger, ButtonIcon, Tooltip, Switch } from '@backstage/ui';
|
|
4
|
+
import { RiArrowUpSLine, RiArrowDownSLine } from '@remixicon/react';
|
|
9
5
|
import { NoBorderTableCell } from './NoBorderTableCell.esm.js';
|
|
10
6
|
import { useNotificationFormat } from './UserNotificationSettingsCard.esm.js';
|
|
11
7
|
|
|
12
8
|
const OriginRow = (props) => {
|
|
13
9
|
const { origin, settings, handleChange, open, handleRowToggle } = props;
|
|
14
10
|
const { formatOriginName } = useNotificationFormat();
|
|
15
|
-
return /* @__PURE__ */ jsxs(
|
|
16
|
-
/* @__PURE__ */ jsx(NoBorderTableCell, { children: origin.topics && origin.topics.length > 0 && /* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
) }),
|
|
11
|
+
return /* @__PURE__ */ jsxs("tr", { children: [
|
|
12
|
+
/* @__PURE__ */ jsx(NoBorderTableCell, { children: origin.topics && origin.topics.length > 0 && /* @__PURE__ */ jsxs(TooltipTrigger, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx(
|
|
14
|
+
ButtonIcon,
|
|
15
|
+
{
|
|
16
|
+
"aria-label": "expand row",
|
|
17
|
+
onPress: () => handleRowToggle(origin.id),
|
|
18
|
+
icon: open ? /* @__PURE__ */ jsx(RiArrowUpSLine, { size: 16 }) : /* @__PURE__ */ jsx(RiArrowDownSLine, { size: 16 }),
|
|
19
|
+
variant: "secondary"
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
/* @__PURE__ */ jsx(Tooltip, { children: `Show Topics for the ${formatOriginName(
|
|
23
|
+
origin.id
|
|
24
|
+
)} origin` })
|
|
25
|
+
] }) }),
|
|
31
26
|
/* @__PURE__ */ jsx(NoBorderTableCell, { children: formatOriginName(origin.id) }),
|
|
32
27
|
/* @__PURE__ */ jsx(NoBorderTableCell, { children: "all" }),
|
|
33
|
-
settings.channels.map((ch) => /* @__PURE__ */ jsx(NoBorderTableCell, { align: "center", children: /* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
origin.id,
|
|
46
|
-
null
|
|
47
|
-
),
|
|
48
|
-
onChange: (event) => {
|
|
49
|
-
handleChange(ch.id, origin.id, null, event.target.checked);
|
|
50
|
-
}
|
|
28
|
+
settings.channels.map((ch) => /* @__PURE__ */ jsx(NoBorderTableCell, { align: "center", children: /* @__PURE__ */ jsxs(TooltipTrigger, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
Switch,
|
|
31
|
+
{
|
|
32
|
+
isSelected: isNotificationsEnabledFor(
|
|
33
|
+
settings,
|
|
34
|
+
ch.id,
|
|
35
|
+
origin.id,
|
|
36
|
+
null
|
|
37
|
+
),
|
|
38
|
+
onChange: (isSelected) => {
|
|
39
|
+
handleChange(ch.id, origin.id, null, isSelected);
|
|
51
40
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(Tooltip, { children: `Enable or disable ${ch.id.toLocaleLowerCase(
|
|
44
|
+
"en-US"
|
|
45
|
+
)} notifications from ${formatOriginName(origin.id)}` })
|
|
46
|
+
] }) }, ch.id))
|
|
55
47
|
] });
|
|
56
48
|
};
|
|
57
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OriginRow.esm.js","sources":["../../../src/components/UserNotificationSettingsCard/OriginRow.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {\n isNotificationsEnabledFor,\n NotificationSettings,\n OriginSetting,\n} from '@backstage/plugin-notifications-common';\nimport
|
|
1
|
+
{"version":3,"file":"OriginRow.esm.js","sources":["../../../src/components/UserNotificationSettingsCard/OriginRow.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {\n isNotificationsEnabledFor,\n NotificationSettings,\n OriginSetting,\n} from '@backstage/plugin-notifications-common';\nimport { ButtonIcon, Switch, Tooltip, TooltipTrigger } from '@backstage/ui';\nimport { RiArrowDownSLine, RiArrowUpSLine } from '@remixicon/react';\nimport { NoBorderTableCell } from './NoBorderTableCell';\nimport { useNotificationFormat } from './UserNotificationSettingsCard';\n\nexport const OriginRow = (props: {\n origin: OriginSetting;\n settings: NotificationSettings;\n handleChange: (\n channel: string,\n origin: string,\n topic: string | null,\n enabled: boolean,\n ) => void;\n open: boolean;\n handleRowToggle: (originId: string) => void;\n}) => {\n const { origin, settings, handleChange, open, handleRowToggle } = props;\n const { formatOriginName } = useNotificationFormat();\n return (\n <tr>\n <NoBorderTableCell>\n {origin.topics && origin.topics.length > 0 && (\n <TooltipTrigger>\n <ButtonIcon\n aria-label=\"expand row\"\n onPress={() => handleRowToggle(origin.id)}\n icon={\n open ? (\n <RiArrowUpSLine size={16} />\n ) : (\n <RiArrowDownSLine size={16} />\n )\n }\n variant=\"secondary\"\n />\n <Tooltip>{`Show Topics for the ${formatOriginName(\n origin.id,\n )} origin`}</Tooltip>\n </TooltipTrigger>\n )}\n </NoBorderTableCell>\n <NoBorderTableCell>{formatOriginName(origin.id)}</NoBorderTableCell>\n <NoBorderTableCell>all</NoBorderTableCell>\n {settings.channels.map(ch => (\n <NoBorderTableCell key={ch.id} align=\"center\">\n <TooltipTrigger>\n <Switch\n isSelected={isNotificationsEnabledFor(\n settings,\n ch.id,\n origin.id,\n null,\n )}\n onChange={(isSelected: boolean) => {\n handleChange(ch.id, origin.id, null, isSelected);\n }}\n />\n <Tooltip>{`Enable or disable ${ch.id.toLocaleLowerCase(\n 'en-US',\n )} notifications from ${formatOriginName(origin.id)}`}</Tooltip>\n </TooltipTrigger>\n </NoBorderTableCell>\n ))}\n </tr>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA0BO,MAAM,SAAA,GAAY,CAAC,KAAA,KAWpB;AACJ,EAAA,MAAM,EAAE,MAAA,EAAQ,QAAA,EAAU,YAAA,EAAc,IAAA,EAAM,iBAAgB,GAAI,KAAA;AAClE,EAAA,MAAM,EAAE,gBAAA,EAAiB,GAAI,qBAAA,EAAsB;AACnD,EAAA,4BACG,IAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,iBAAA,EAAA,EACE,iBAAO,MAAA,IAAU,MAAA,CAAO,OAAO,MAAA,GAAS,CAAA,yBACtC,cAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,YAAA,EAAW,YAAA;AAAA,UACX,OAAA,EAAS,MAAM,eAAA,CAAgB,MAAA,CAAO,EAAE,CAAA;AAAA,UACxC,IAAA,EACE,IAAA,mBACE,GAAA,CAAC,cAAA,EAAA,EAAe,IAAA,EAAM,IAAI,CAAA,mBAE1B,GAAA,CAAC,gBAAA,EAAA,EAAiB,IAAA,EAAM,EAAA,EAAI,CAAA;AAAA,UAGhC,OAAA,EAAQ;AAAA;AAAA,OACV;AAAA,sBACA,GAAA,CAAC,WAAS,QAAA,EAAA,CAAA,oBAAA,EAAuB,gBAAA;AAAA,QAC/B,MAAA,CAAO;AAAA,OACR,CAAA,OAAA,CAAA,EAAU;AAAA,KAAA,EACb,CAAA,EAEJ,CAAA;AAAA,oBACA,GAAA,CAAC,iBAAA,EAAA,EAAmB,QAAA,EAAA,gBAAA,CAAiB,MAAA,CAAO,EAAE,CAAA,EAAE,CAAA;AAAA,oBAChD,GAAA,CAAC,qBAAkB,QAAA,EAAA,KAAA,EAAG,CAAA;AAAA,IACrB,QAAA,CAAS,SAAS,GAAA,CAAI,CAAA,EAAA,yBACpB,iBAAA,EAAA,EAA8B,KAAA,EAAM,QAAA,EACnC,QAAA,kBAAA,IAAA,CAAC,cAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,UAAA,EAAY,yBAAA;AAAA,YACV,QAAA;AAAA,YACA,EAAA,CAAG,EAAA;AAAA,YACH,MAAA,CAAO,EAAA;AAAA,YACP;AAAA,WACF;AAAA,UACA,QAAA,EAAU,CAAC,UAAA,KAAwB;AACjC,YAAA,YAAA,CAAa,EAAA,CAAG,EAAA,EAAI,MAAA,CAAO,EAAA,EAAI,MAAM,UAAU,CAAA;AAAA,UACjD;AAAA;AAAA,OACF;AAAA,sBACA,GAAA,CAAC,OAAA,EAAA,EAAS,QAAA,EAAA,CAAA,kBAAA,EAAqB,EAAA,CAAG,EAAA,CAAG,iBAAA;AAAA,QACnC;AAAA,OACD,CAAA,oBAAA,EAAuB,gBAAA,CAAiB,MAAA,CAAO,EAAE,CAAC,CAAA,CAAA,EAAG;AAAA,KAAA,EACxD,CAAA,EAAA,EAhBsB,EAAA,CAAG,EAiB3B,CACD;AAAA,GAAA,EACH,CAAA;AAEJ;;;;"}
|
|
@@ -1,48 +1,37 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { isNotificationsEnabledFor } from '@backstage/plugin-notifications-common';
|
|
3
|
-
import
|
|
4
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
|
5
|
-
import Switch from '@material-ui/core/Switch';
|
|
6
|
-
import { withStyles } from '@material-ui/core/styles';
|
|
3
|
+
import { TooltipTrigger, Switch, Tooltip } from '@backstage/ui';
|
|
7
4
|
import { NoBorderTableCell } from './NoBorderTableCell.esm.js';
|
|
8
5
|
import { useNotificationFormat } from './UserNotificationSettingsCard.esm.js';
|
|
9
6
|
|
|
10
|
-
const TopicTableRow = withStyles({
|
|
11
|
-
root: {
|
|
12
|
-
paddingLeft: "4px"
|
|
13
|
-
}
|
|
14
|
-
})(TableRow);
|
|
15
7
|
const TopicRow = (props) => {
|
|
16
8
|
const { topic, origin, settings, handleChange } = props;
|
|
17
9
|
const { formatOriginName, formatTopicName } = useNotificationFormat();
|
|
18
|
-
return /* @__PURE__ */ jsxs(
|
|
10
|
+
return /* @__PURE__ */ jsxs("tr", { children: [
|
|
19
11
|
/* @__PURE__ */ jsx(NoBorderTableCell, {}),
|
|
20
12
|
/* @__PURE__ */ jsx(NoBorderTableCell, {}),
|
|
21
13
|
/* @__PURE__ */ jsx(NoBorderTableCell, { children: formatTopicName(topic.id) }),
|
|
22
|
-
settings.channels.map((ch) => /* @__PURE__ */ jsx(NoBorderTableCell, { align: "center", children: /* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
settings,
|
|
35
|
-
ch.id,
|
|
36
|
-
origin.id,
|
|
37
|
-
topic.id
|
|
38
|
-
),
|
|
39
|
-
onChange: (event) => {
|
|
40
|
-
handleChange(ch.id, origin.id, topic.id, event.target.checked);
|
|
41
|
-
}
|
|
14
|
+
settings.channels.map((ch) => /* @__PURE__ */ jsx(NoBorderTableCell, { align: "center", children: /* @__PURE__ */ jsxs(TooltipTrigger, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
Switch,
|
|
17
|
+
{
|
|
18
|
+
isSelected: isNotificationsEnabledFor(
|
|
19
|
+
settings,
|
|
20
|
+
ch.id,
|
|
21
|
+
origin.id,
|
|
22
|
+
topic.id
|
|
23
|
+
),
|
|
24
|
+
onChange: (isSelected) => {
|
|
25
|
+
handleChange(ch.id, origin.id, topic.id, isSelected);
|
|
42
26
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ jsx(Tooltip, { children: `Enable or disable ${ch.id.toLocaleLowerCase(
|
|
30
|
+
"en-US"
|
|
31
|
+
)} notifications for the ${formatTopicName(
|
|
32
|
+
topic.id
|
|
33
|
+
)} topic from ${formatOriginName(origin.id)}` })
|
|
34
|
+
] }) }, `${ch.id}-${topic.id}`))
|
|
46
35
|
] });
|
|
47
36
|
};
|
|
48
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopicRow.esm.js","sources":["../../../src/components/UserNotificationSettingsCard/TopicRow.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {\n isNotificationsEnabledFor,\n NotificationSettings,\n OriginSetting,\n TopicSetting,\n} from '@backstage/plugin-notifications-common';\nimport
|
|
1
|
+
{"version":3,"file":"TopicRow.esm.js","sources":["../../../src/components/UserNotificationSettingsCard/TopicRow.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {\n isNotificationsEnabledFor,\n NotificationSettings,\n OriginSetting,\n TopicSetting,\n} from '@backstage/plugin-notifications-common';\nimport { Switch, Tooltip, TooltipTrigger } from '@backstage/ui';\nimport { NoBorderTableCell } from './NoBorderTableCell';\nimport { useNotificationFormat } from './UserNotificationSettingsCard';\n\nexport const TopicRow = (props: {\n topic: TopicSetting;\n origin: OriginSetting;\n settings: NotificationSettings;\n handleChange: (\n channel: string,\n origin: string,\n topic: string | null,\n enabled: boolean,\n ) => void;\n}) => {\n const { topic, origin, settings, handleChange } = props;\n const { formatOriginName, formatTopicName } = useNotificationFormat();\n return (\n <tr>\n <NoBorderTableCell />\n <NoBorderTableCell />\n <NoBorderTableCell>{formatTopicName(topic.id)}</NoBorderTableCell>\n {settings.channels.map(ch => (\n <NoBorderTableCell key={`${ch.id}-${topic.id}`} align=\"center\">\n <TooltipTrigger>\n <Switch\n isSelected={isNotificationsEnabledFor(\n settings,\n ch.id,\n origin.id,\n topic.id,\n )}\n onChange={(isSelected: boolean) => {\n handleChange(ch.id, origin.id, topic.id, isSelected);\n }}\n />\n <Tooltip>{`Enable or disable ${ch.id.toLocaleLowerCase(\n 'en-US',\n )} notifications for the ${formatTopicName(\n topic.id,\n )} topic from ${formatOriginName(origin.id)}`}</Tooltip>\n </TooltipTrigger>\n </NoBorderTableCell>\n ))}\n </tr>\n );\n};\n"],"names":[],"mappings":";;;;;;AA0BO,MAAM,QAAA,GAAW,CAAC,KAAA,KAUnB;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,MAAA,EAAQ,QAAA,EAAU,cAAa,GAAI,KAAA;AAClD,EAAA,MAAM,EAAE,gBAAA,EAAkB,eAAA,EAAgB,GAAI,qBAAA,EAAsB;AACpE,EAAA,4BACG,IAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,iBAAA,EAAA,EAAkB,CAAA;AAAA,wBAClB,iBAAA,EAAA,EAAkB,CAAA;AAAA,oBACnB,GAAA,CAAC,iBAAA,EAAA,EAAmB,QAAA,EAAA,eAAA,CAAgB,KAAA,CAAM,EAAE,CAAA,EAAE,CAAA;AAAA,IAC7C,QAAA,CAAS,SAAS,GAAA,CAAI,CAAA,EAAA,yBACpB,iBAAA,EAAA,EAA+C,KAAA,EAAM,QAAA,EACpD,QAAA,kBAAA,IAAA,CAAC,cAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,UAAA,EAAY,yBAAA;AAAA,YACV,QAAA;AAAA,YACA,EAAA,CAAG,EAAA;AAAA,YACH,MAAA,CAAO,EAAA;AAAA,YACP,KAAA,CAAM;AAAA,WACR;AAAA,UACA,QAAA,EAAU,CAAC,UAAA,KAAwB;AACjC,YAAA,YAAA,CAAa,GAAG,EAAA,EAAI,MAAA,CAAO,EAAA,EAAI,KAAA,CAAM,IAAI,UAAU,CAAA;AAAA,UACrD;AAAA;AAAA,OACF;AAAA,sBACA,GAAA,CAAC,OAAA,EAAA,EAAS,QAAA,EAAA,CAAA,kBAAA,EAAqB,EAAA,CAAG,EAAA,CAAG,iBAAA;AAAA,QACnC;AAAA,OACD,CAAA,uBAAA,EAA0B,eAAA;AAAA,QACzB,KAAA,CAAM;AAAA,OACP,CAAA,YAAA,EAAe,gBAAA,CAAiB,MAAA,CAAO,EAAE,CAAC,CAAA,CAAA,EAAG;AAAA,KAAA,EAChD,CAAA,EAAA,EAlBsB,GAAG,EAAA,CAAG,EAAE,IAAI,KAAA,CAAM,EAAE,EAmB5C,CACD;AAAA,GAAA,EACH,CAAA;AAEJ;;;;"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import TableHead from '@material-ui/core/TableHead';
|
|
7
|
-
import Typography from '@material-ui/core/Typography';
|
|
8
|
-
import TableBody from '@material-ui/core/TableBody';
|
|
9
|
-
import TableRow from '@material-ui/core/TableRow';
|
|
3
|
+
import { Text } from '@backstage/ui';
|
|
4
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
5
|
+
import { notificationsTranslationRef } from '../../translation.esm.js';
|
|
10
6
|
import { TopicRow } from './TopicRow.esm.js';
|
|
11
7
|
import { OriginRow } from './OriginRow.esm.js';
|
|
8
|
+
import styles from './UserNotificationSettingsPanel.module.css.esm.js';
|
|
12
9
|
|
|
13
|
-
const TableCell = withStyles({
|
|
14
|
-
root: {
|
|
15
|
-
borderBottom: "none"
|
|
16
|
-
}
|
|
17
|
-
})(MuiTableCell);
|
|
18
10
|
const UserNotificationSettingsPanel = (props) => {
|
|
19
11
|
const { settings, onChange } = props;
|
|
12
|
+
const { t } = useTranslationRef(notificationsTranslationRef);
|
|
20
13
|
const [expandedRows, setExpandedRows] = useState(/* @__PURE__ */ new Set());
|
|
21
14
|
const handleRowToggle = (originId) => {
|
|
22
15
|
setExpandedRows((prevState) => {
|
|
@@ -69,7 +62,7 @@ const UserNotificationSettingsPanel = (props) => {
|
|
|
69
62
|
onChange(updatedSettings);
|
|
70
63
|
};
|
|
71
64
|
if (settings.channels.length === 0) {
|
|
72
|
-
return /* @__PURE__ */ jsx(
|
|
65
|
+
return /* @__PURE__ */ jsx(Text, { variant: "body-medium", children: t("settings.noSettingsAvailable") });
|
|
73
66
|
}
|
|
74
67
|
const uniqueOriginsMap = settings.channels.flatMap((channel) => channel.origins).reduce((map, origin) => {
|
|
75
68
|
if (!map.has(origin.id)) {
|
|
@@ -78,14 +71,21 @@ const UserNotificationSettingsPanel = (props) => {
|
|
|
78
71
|
return map;
|
|
79
72
|
}, /* @__PURE__ */ new Map()).values();
|
|
80
73
|
const uniqueOrigins = Array.from(uniqueOriginsMap);
|
|
81
|
-
return /* @__PURE__ */ jsxs(
|
|
82
|
-
/* @__PURE__ */ jsx(
|
|
83
|
-
/* @__PURE__ */ jsx(
|
|
84
|
-
/* @__PURE__ */ jsx(
|
|
85
|
-
/* @__PURE__ */ jsx(
|
|
86
|
-
settings.channels.map((channel) => /* @__PURE__ */ jsx(
|
|
74
|
+
return /* @__PURE__ */ jsxs("table", { className: styles.table, children: [
|
|
75
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
76
|
+
/* @__PURE__ */ jsx("th", { className: styles.headerCell }),
|
|
77
|
+
/* @__PURE__ */ jsx("th", { className: styles.headerCell, children: /* @__PURE__ */ jsx(Text, { variant: "title-x-small", children: t("settings.table.origin") }) }),
|
|
78
|
+
/* @__PURE__ */ jsx("th", { className: styles.headerCell, children: /* @__PURE__ */ jsx(Text, { variant: "title-x-small", children: t("settings.table.topic") }) }),
|
|
79
|
+
settings.channels.map((channel) => /* @__PURE__ */ jsx("th", { className: styles.headerCell, children: /* @__PURE__ */ jsx(
|
|
80
|
+
Text,
|
|
81
|
+
{
|
|
82
|
+
variant: "title-x-small",
|
|
83
|
+
style: { textAlign: "center", display: "block" },
|
|
84
|
+
children: channel.id
|
|
85
|
+
}
|
|
86
|
+
) }, channel.id))
|
|
87
87
|
] }) }),
|
|
88
|
-
/* @__PURE__ */ jsx(
|
|
88
|
+
/* @__PURE__ */ jsx("tbody", { children: uniqueOrigins.flatMap((origin) => [
|
|
89
89
|
/* @__PURE__ */ jsx(
|
|
90
90
|
OriginRow,
|
|
91
91
|
{
|
package/dist/components/UserNotificationSettingsCard/UserNotificationSettingsPanel.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserNotificationSettingsPanel.esm.js","sources":["../../../src/components/UserNotificationSettingsCard/UserNotificationSettingsPanel.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from 'react';\nimport {\n NotificationSettings,\n OriginSetting,\n} from '@backstage/plugin-notifications-common';\nimport
|
|
1
|
+
{"version":3,"file":"UserNotificationSettingsPanel.esm.js","sources":["../../../src/components/UserNotificationSettingsCard/UserNotificationSettingsPanel.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from 'react';\nimport {\n NotificationSettings,\n OriginSetting,\n} from '@backstage/plugin-notifications-common';\nimport { Text } from '@backstage/ui';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { notificationsTranslationRef } from '../../translation';\nimport { TopicRow } from './TopicRow';\nimport { OriginRow } from './OriginRow';\nimport styles from './UserNotificationSettingsPanel.module.css';\n\nexport const UserNotificationSettingsPanel = (props: {\n settings: NotificationSettings;\n onChange: (settings: NotificationSettings) => void;\n originNames?: Record<string, string>;\n topicNames?: Record<string, string>;\n}) => {\n const { settings, onChange } = props;\n const { t } = useTranslationRef(notificationsTranslationRef);\n const [expandedRows, setExpandedRows] = useState<Set<string>>(new Set());\n\n const handleRowToggle = (originId: string) => {\n setExpandedRows(prevState => {\n const newExpandedRows = new Set(prevState);\n if (newExpandedRows.has(originId)) {\n newExpandedRows.delete(originId);\n } else {\n newExpandedRows.add(originId);\n }\n return newExpandedRows;\n });\n };\n const handleChange = (\n channelId: string,\n originId: string,\n topicId: string | null,\n enabled: boolean,\n ) => {\n const updatedSettings = {\n channels: settings.channels.map(channel => {\n if (channel.id !== channelId) {\n return channel;\n }\n return {\n ...channel,\n origins: channel.origins.map(origin => {\n if (origin.id !== originId) {\n return origin;\n }\n\n if (topicId === null) {\n return {\n ...origin,\n enabled,\n topics:\n origin.topics?.map(topic => {\n return { ...topic, enabled };\n }) ?? [],\n };\n }\n\n return {\n ...origin,\n topics:\n origin.topics?.map(topic => {\n if (topic.id === topicId) {\n return {\n ...topic,\n enabled: origin.enabled ? enabled : origin.enabled,\n };\n }\n return topic;\n }) ?? [],\n };\n }),\n };\n }),\n };\n onChange(updatedSettings);\n };\n\n if (settings.channels.length === 0) {\n return (\n <Text variant=\"body-medium\">{t('settings.noSettingsAvailable')}</Text>\n );\n }\n\n const uniqueOriginsMap = settings.channels\n .flatMap(channel => channel.origins)\n .reduce((map, origin) => {\n if (!map.has(origin.id)) {\n map.set(origin.id, origin);\n }\n return map;\n }, new Map<string, OriginSetting>())\n .values();\n\n const uniqueOrigins = Array.from(uniqueOriginsMap);\n\n return (\n <table className={styles.table}>\n <thead>\n <tr>\n <th className={styles.headerCell} />\n <th className={styles.headerCell}>\n <Text variant=\"title-x-small\">{t('settings.table.origin')}</Text>\n </th>\n <th className={styles.headerCell}>\n <Text variant=\"title-x-small\">{t('settings.table.topic')}</Text>\n </th>\n {settings.channels.map(channel => (\n <th key={channel.id} className={styles.headerCell}>\n <Text\n variant=\"title-x-small\"\n style={{ textAlign: 'center', display: 'block' }}\n >\n {channel.id}\n </Text>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {uniqueOrigins.flatMap(origin => [\n <OriginRow\n key={origin.id}\n origin={origin}\n settings={settings}\n open={expandedRows.has(origin.id)}\n handleChange={handleChange}\n handleRowToggle={handleRowToggle}\n />,\n ...(expandedRows.has(origin.id)\n ? origin.topics?.map(topic => (\n <TopicRow\n key={`${origin.id}-${topic.id}`}\n topic={topic}\n origin={origin}\n settings={settings}\n handleChange={handleChange}\n />\n )) || []\n : []),\n ])}\n </tbody>\n </table>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA4BO,MAAM,6BAAA,GAAgC,CAAC,KAAA,KAKxC;AACJ,EAAA,MAAM,EAAE,QAAA,EAAU,QAAA,EAAS,GAAI,KAAA;AAC/B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,2BAA2B,CAAA;AAC3D,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,IAAI,QAAA,iBAAsB,IAAI,KAAK,CAAA;AAEvE,EAAA,MAAM,eAAA,GAAkB,CAAC,QAAA,KAAqB;AAC5C,IAAA,eAAA,CAAgB,CAAA,SAAA,KAAa;AAC3B,MAAA,MAAM,eAAA,GAAkB,IAAI,GAAA,CAAI,SAAS,CAAA;AACzC,MAAA,IAAI,eAAA,CAAgB,GAAA,CAAI,QAAQ,CAAA,EAAG;AACjC,QAAA,eAAA,CAAgB,OAAO,QAAQ,CAAA;AAAA,MACjC,CAAA,MAAO;AACL,QAAA,eAAA,CAAgB,IAAI,QAAQ,CAAA;AAAA,MAC9B;AACA,MAAA,OAAO,eAAA;AAAA,IACT,CAAC,CAAA;AAAA,EACH,CAAA;AACA,EAAA,MAAM,YAAA,GAAe,CACnB,SAAA,EACA,QAAA,EACA,SACA,OAAA,KACG;AACH,IAAA,MAAM,eAAA,GAAkB;AAAA,MACtB,QAAA,EAAU,QAAA,CAAS,QAAA,CAAS,GAAA,CAAI,CAAA,OAAA,KAAW;AACzC,QAAA,IAAI,OAAA,CAAQ,OAAO,SAAA,EAAW;AAC5B,UAAA,OAAO,OAAA;AAAA,QACT;AACA,QAAA,OAAO;AAAA,UACL,GAAG,OAAA;AAAA,UACH,OAAA,EAAS,OAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,CAAA,MAAA,KAAU;AACrC,YAAA,IAAI,MAAA,CAAO,OAAO,QAAA,EAAU;AAC1B,cAA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ANO,OAAA,CAAQ,EAOjB,CACD;AAAA,KAAA,EACH,CAAA,EACF,CAAA;AAAA,oBACA,GAAA,CAAC,OAAA,EAAA,EACE,QAAA,EAAA,aAAA,CAAc,OAAA,CAAQ,CAAA,MAAA,KAAU;AAAA,sBAC/B,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UAEC,MAAA;AAAA,UACA,QAAA;AAAA,UACA,IAAA,EAAM,YAAA,CAAa,GAAA,CAAI,MAAA,CAAO,EAAE,CAAA;AAAA,UAChC,YAAA;AAAA,UACA;AAAA,SAAA;AAAA,QALK,MAAA,CAAO;AAAA,OAMd;AAAA,MACA,GAAI,aAAa,GAAA,CAAI,MAAA,CAAO,EAAE,CAAA,GAC1B,MAAA,CAAO,MAAA,EAAQ,GAAA,CAAI,CAAA,KAAA,qBACjB,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UAEC,KAAA;AAAA,UACA,MAAA;AAAA,UACA,QAAA;AAAA,UACA;AAAA,SAAA;AAAA,QAJK,CAAA,EAAG,MAAA,CAAO,EAAE,CAAA,CAAA,EAAI,MAAM,EAAE,CAAA;AAAA,OAMhC,CAAA,IAAK,EAAC,GACP;AAAC,KACN,CAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
package/dist/components/UserNotificationSettingsCard/UserNotificationSettingsPanel.module.css.esm.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = "/*\n * Copyright 2024 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\n@layer components {\n .UserNotificationSettingsPanel_table__068df257a9 {\n width: 100%;\n border-collapse: collapse;\n }\n\n .UserNotificationSettingsPanel_headerCell__068df257a9 {\n border-bottom: 1px solid var(--bui-border-1);\n padding: var(--bui-space-2) var(--bui-space-3);\n text-align: left;\n font-weight: var(--bui-font-weight-bold);\n }\n}\n";
|
|
4
|
+
var styles = {"table":"UserNotificationSettingsPanel_table__068df257a9","headerCell":"UserNotificationSettingsPanel_headerCell__068df257a9"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=UserNotificationSettingsPanel.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserNotificationSettingsPanel.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -212,8 +212,9 @@ declare const notificationsTranslationRef: _backstage_frontend_plugin_api.Transl
|
|
|
212
212
|
readonly "table.bulkActions.returnSelectedAmongUnread": "Return selected among unread";
|
|
213
213
|
readonly "table.bulkActions.saveSelectedForLater": "Save selected for later";
|
|
214
214
|
readonly "table.bulkActions.undoSaveForSelected": "Undo save for selected";
|
|
215
|
+
readonly "table.confirmDialog.cancel": "Cancel";
|
|
215
216
|
readonly "table.confirmDialog.title": "Are you sure?";
|
|
216
|
-
readonly "table.confirmDialog.markAllReadDescription": "Mark
|
|
217
|
+
readonly "table.confirmDialog.markAllReadDescription": "Mark all notifications as read.";
|
|
217
218
|
readonly "table.confirmDialog.markAllReadConfirmation": "Mark All";
|
|
218
219
|
readonly "filters.view.all": "All";
|
|
219
220
|
readonly "filters.view.label": "View";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function styleInject(css, ref) {
|
|
2
|
+
if ( ref === void 0 ) ref = {};
|
|
3
|
+
var insertAt = ref.insertAt;
|
|
4
|
+
|
|
5
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
6
|
+
|
|
7
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
8
|
+
var style = document.createElement('style');
|
|
9
|
+
style.type = 'text/css';
|
|
10
|
+
|
|
11
|
+
if (insertAt === 'top') {
|
|
12
|
+
if (head.firstChild) {
|
|
13
|
+
head.insertBefore(style, head.firstChild);
|
|
14
|
+
} else {
|
|
15
|
+
head.appendChild(style);
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
head.appendChild(style);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (style.styleSheet) {
|
|
22
|
+
style.styleSheet.cssText = css;
|
|
23
|
+
} else {
|
|
24
|
+
style.appendChild(document.createTextNode(css));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { styleInject as default };
|
|
29
|
+
//# sourceMappingURL=style-inject.es.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-inject.es.esm.js","sources":["../../../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,CAAC;;AAEzD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC;AAC/C,IAAI,CAAC,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B,IAAI;AACJ,EAAE,CAAC,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,EAAE;;AAEF,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,EAAE,CAAC,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD,EAAE;AACF;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var name = "@backstage/plugin-notifications";
|
|
2
|
-
var version = "0.5.16-next.
|
|
2
|
+
var version = "0.5.16-next.2";
|
|
3
3
|
var backstage = {
|
|
4
4
|
role: "frontend-plugin",
|
|
5
5
|
pluginId: "notifications",
|
|
@@ -58,11 +58,8 @@ var dependencies = {
|
|
|
58
58
|
"@backstage/plugin-signals-react": "workspace:^",
|
|
59
59
|
"@backstage/theme": "workspace:^",
|
|
60
60
|
"@backstage/ui": "workspace:^",
|
|
61
|
-
"@material-ui/core": "^4.9.13",
|
|
62
|
-
"@material-ui/icons": "^4.9.1",
|
|
63
61
|
"@remixicon/react": "^4.6.0",
|
|
64
62
|
lodash: "^4.17.21",
|
|
65
|
-
"material-ui-confirm": "^3.0.12",
|
|
66
63
|
notistack: "^3.0.1",
|
|
67
64
|
"react-relative-time": "^0.0.9",
|
|
68
65
|
"react-use": "^17.2.4"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/translation.esm.js
CHANGED
|
@@ -71,8 +71,9 @@ const notificationsTranslationRef = createTranslationRef({
|
|
|
71
71
|
},
|
|
72
72
|
confirmDialog: {
|
|
73
73
|
title: "Are you sure?",
|
|
74
|
-
markAllReadDescription: "Mark
|
|
75
|
-
markAllReadConfirmation: "Mark All"
|
|
74
|
+
markAllReadDescription: "Mark all notifications as read.",
|
|
75
|
+
markAllReadConfirmation: "Mark All",
|
|
76
|
+
cancel: "Cancel"
|
|
76
77
|
},
|
|
77
78
|
errors: {
|
|
78
79
|
markAllReadFailed: "Failed to mark all notifications as read"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport const notificationsTranslationRef = createTranslationRef({\n id: 'plugin.notifications',\n messages: {\n notificationsPage: {\n title: 'Notifications',\n tableTitle: {\n all_one: 'All notifications ({{count}})',\n all_other: 'All notifications ({{count}})',\n saved_one: 'Saved notifications ({{count}})',\n saved_other: 'Saved notifications ({{count}})',\n unread_one: 'Unread notifications ({{count}})',\n unread_other: 'Unread notifications ({{count}})',\n read_one: 'Read notifications ({{count}})',\n read_other: 'Read notifications ({{count}})',\n },\n },\n filters: {\n title: 'Filters',\n view: {\n label: 'View',\n unread: 'Unread notifications',\n read: 'Read notifications',\n saved: 'Saved',\n all: 'All',\n },\n createdAfter: {\n label: 'Sent out',\n placeholder: 'Notifications since',\n last24h: 'Last 24h',\n lastWeek: 'Last week',\n anyTime: 'Any time',\n },\n sortBy: {\n label: 'Sort by',\n placeholder: 'Field to sort by',\n newest: 'Newest on top',\n oldest: 'Oldest on top',\n topic: 'Topic',\n origin: 'Origin',\n },\n severity: {\n label: 'Min severity',\n critical: 'Critical',\n high: 'High',\n normal: 'Normal',\n low: 'Low',\n },\n topic: {\n label: 'Topic',\n anyTopic: 'Any topic',\n },\n },\n table: {\n emptyMessage: 'No records to display',\n pagination: {\n firstTooltip: 'First Page',\n labelDisplayedRows: '{from}-{to} of {count}',\n labelRowsSelect: 'rows',\n lastTooltip: 'Last Page',\n nextTooltip: 'Next Page',\n previousTooltip: 'Previous Page',\n },\n bulkActions: {\n markAllRead: 'Mark all read',\n markSelectedAsRead: 'Mark selected as read',\n returnSelectedAmongUnread: 'Return selected among unread',\n saveSelectedForLater: 'Save selected for later',\n undoSaveForSelected: 'Undo save for selected',\n },\n confirmDialog: {\n title: 'Are you sure?',\n markAllReadDescription: 'Mark
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport const notificationsTranslationRef = createTranslationRef({\n id: 'plugin.notifications',\n messages: {\n notificationsPage: {\n title: 'Notifications',\n tableTitle: {\n all_one: 'All notifications ({{count}})',\n all_other: 'All notifications ({{count}})',\n saved_one: 'Saved notifications ({{count}})',\n saved_other: 'Saved notifications ({{count}})',\n unread_one: 'Unread notifications ({{count}})',\n unread_other: 'Unread notifications ({{count}})',\n read_one: 'Read notifications ({{count}})',\n read_other: 'Read notifications ({{count}})',\n },\n },\n filters: {\n title: 'Filters',\n view: {\n label: 'View',\n unread: 'Unread notifications',\n read: 'Read notifications',\n saved: 'Saved',\n all: 'All',\n },\n createdAfter: {\n label: 'Sent out',\n placeholder: 'Notifications since',\n last24h: 'Last 24h',\n lastWeek: 'Last week',\n anyTime: 'Any time',\n },\n sortBy: {\n label: 'Sort by',\n placeholder: 'Field to sort by',\n newest: 'Newest on top',\n oldest: 'Oldest on top',\n topic: 'Topic',\n origin: 'Origin',\n },\n severity: {\n label: 'Min severity',\n critical: 'Critical',\n high: 'High',\n normal: 'Normal',\n low: 'Low',\n },\n topic: {\n label: 'Topic',\n anyTopic: 'Any topic',\n },\n },\n table: {\n emptyMessage: 'No records to display',\n pagination: {\n firstTooltip: 'First Page',\n labelDisplayedRows: '{from}-{to} of {count}',\n labelRowsSelect: 'rows',\n lastTooltip: 'Last Page',\n nextTooltip: 'Next Page',\n previousTooltip: 'Previous Page',\n },\n bulkActions: {\n markAllRead: 'Mark all read',\n markSelectedAsRead: 'Mark selected as read',\n returnSelectedAmongUnread: 'Return selected among unread',\n saveSelectedForLater: 'Save selected for later',\n undoSaveForSelected: 'Undo save for selected',\n },\n confirmDialog: {\n title: 'Are you sure?',\n markAllReadDescription: 'Mark all notifications as read.',\n markAllReadConfirmation: 'Mark All',\n cancel: 'Cancel',\n },\n errors: {\n markAllReadFailed: 'Failed to mark all notifications as read',\n },\n },\n sidebar: {\n title: 'Notifications',\n errors: {\n markAsReadFailed: 'Failed to mark notification as read',\n fetchNotificationFailed: 'Failed to fetch notification',\n },\n },\n settings: {\n title: 'Notification settings',\n errorTitle: 'Failed to load settings',\n noSettingsAvailable:\n 'No notification settings available, check back later',\n table: {\n origin: 'Origin',\n topic: 'Topic',\n },\n errors: {\n useNotificationFormat:\n 'useNotificationFormat must be used within a NotificationFormatProvider',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,8BAA8B,oBAAA,CAAqB;AAAA,EAC9D,EAAA,EAAI,sBAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,eAAA;AAAA,MACP,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,+BAAA;AAAA,QACT,SAAA,EAAW,+BAAA;AAAA,QACX,SAAA,EAAW,iCAAA;AAAA,QACX,WAAA,EAAa,iCAAA;AAAA,QACb,UAAA,EAAY,kCAAA;AAAA,QACZ,YAAA,EAAc,kCAAA;AAAA,QACd,QAAA,EAAU,gCAAA;AAAA,QACV,UAAA,EAAY;AAAA;AACd,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,QACJ,KAAA,EAAO,MAAA;AAAA,QACP,MAAA,EAAQ,sBAAA;AAAA,QACR,IAAA,EAAM,oBAAA;AAAA,QACN,KAAA,EAAO,OAAA;AAAA,QACP,GAAA,EAAK;AAAA,OACP;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO,UAAA;AAAA,QACP,WAAA,EAAa,qBAAA;AAAA,QACb,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IACA,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,eAAA;AAAA,MACP,MAAA,EAAQ;AAAA,QACN,gBAAA,EAAkB,qCAAA;AAAA,QAClB,uBAAA,EAAyB;AAAA;AAC3B,KACF;AAAA,IACA,QAAA,EAAU;AAAA,MACR,KAAA,EAAO,uBAAA;AAAA,MACP,UAAA,EAAY,yBAAA;AAAA,MACZ,mBAAA,EACE,sDAAA;AAAA,MACF,KAAA,EAAO;AAAA,QACL,MAAA,EAAQ,QAAA;AAAA,QACR,KAAA,EAAO;AAAA,OACT;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,qBAAA,EACE;AAAA;AACJ;AACF;AAEJ,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-notifications",
|
|
3
|
-
"version": "0.5.16-next.
|
|
3
|
+
"version": "0.5.16-next.2",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "notifications",
|
|
@@ -63,28 +63,25 @@
|
|
|
63
63
|
"test": "backstage-cli package test"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@backstage/core-components": "0.18.9-next.
|
|
67
|
-
"@backstage/core-plugin-api": "1.12.5-next.
|
|
68
|
-
"@backstage/errors": "1.
|
|
69
|
-
"@backstage/frontend-plugin-api": "0.16.0-next.
|
|
70
|
-
"@backstage/plugin-notifications-common": "0.2.
|
|
66
|
+
"@backstage/core-components": "0.18.9-next.1",
|
|
67
|
+
"@backstage/core-plugin-api": "1.12.5-next.2",
|
|
68
|
+
"@backstage/errors": "1.3.0-next.0",
|
|
69
|
+
"@backstage/frontend-plugin-api": "0.16.0-next.2",
|
|
70
|
+
"@backstage/plugin-notifications-common": "0.2.2-next.0",
|
|
71
71
|
"@backstage/plugin-signals-react": "0.0.21-next.0",
|
|
72
|
-
"@backstage/theme": "0.7.
|
|
73
|
-
"@backstage/ui": "0.14.0-next.
|
|
74
|
-
"@material-ui/core": "^4.9.13",
|
|
75
|
-
"@material-ui/icons": "^4.9.1",
|
|
72
|
+
"@backstage/theme": "0.7.3-next.0",
|
|
73
|
+
"@backstage/ui": "0.14.0-next.2",
|
|
76
74
|
"@remixicon/react": "^4.6.0",
|
|
77
75
|
"lodash": "^4.17.21",
|
|
78
|
-
"material-ui-confirm": "^3.0.12",
|
|
79
76
|
"notistack": "^3.0.1",
|
|
80
77
|
"react-relative-time": "^0.0.9",
|
|
81
78
|
"react-use": "^17.2.4"
|
|
82
79
|
},
|
|
83
80
|
"devDependencies": {
|
|
84
|
-
"@backstage/cli": "0.36.1-next.
|
|
85
|
-
"@backstage/dev-utils": "1.1.22-next.
|
|
86
|
-
"@backstage/plugin-signals": "0.0.30-next.
|
|
87
|
-
"@backstage/test-utils": "1.7.17-next.
|
|
81
|
+
"@backstage/cli": "0.36.1-next.2",
|
|
82
|
+
"@backstage/dev-utils": "1.1.22-next.2",
|
|
83
|
+
"@backstage/plugin-signals": "0.0.30-next.2",
|
|
84
|
+
"@backstage/test-utils": "1.7.17-next.2",
|
|
88
85
|
"@testing-library/jest-dom": "^6.0.0",
|
|
89
86
|
"@testing-library/react": "^16.0.0",
|
|
90
87
|
"@types/react": "^18.0.0",
|