@backstage/plugin-notifications 0.5.17-next.0 → 0.5.17-next.1

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @backstage/plugin-notifications
2
2
 
3
+ ## 0.5.17-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f635139: Limited `@remixicon/react` dependency to versions below 4.9.0 due to a license change in that release.
8
+ - 03311e3: The notification description used in the notifications table is now a swappable component, so that apps can replace its rendering with a custom implementation.
9
+ - Updated dependencies
10
+ - @backstage/ui@0.15.0-next.1
11
+ - @backstage/frontend-plugin-api@0.17.0-next.1
12
+ - @backstage/core-plugin-api@1.12.6-next.1
13
+
3
14
  ## 0.5.17-next.0
4
15
 
5
16
  ### Patch Changes
@@ -7,6 +7,7 @@ import { useSignal } from '@backstage/plugin-signals-react';
7
7
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
8
8
  import { notificationsTranslationRef } from '../../translation.esm.js';
9
9
  import { NotificationsTable } from '../NotificationsTable/NotificationsTable.esm.js';
10
+ import '../NotificationsTable/NotificationDescription.esm.js';
10
11
  import { useNotificationsApi } from '../../hooks/useNotificationsApi.esm.js';
11
12
  import '@backstage/core-plugin-api';
12
13
  import '../../api/NotificationsApi.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsPage.esm.js","sources":["../../../src/components/NotificationsPage/NotificationsPage.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 { useEffect, useMemo, useState } from 'react';\nimport throttle from 'lodash/throttle';\nimport {\n Content,\n PageWithHeader,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { Grid } from '@backstage/ui';\nimport { useSignal } from '@backstage/plugin-signals-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { notificationsTranslationRef } from '../../translation';\n\nconst TableTitleKeys = {\n all: 'notificationsPage.tableTitle.all',\n saved: 'notificationsPage.tableTitle.saved',\n unread: 'notificationsPage.tableTitle.unread',\n read: 'notificationsPage.tableTitle.read',\n} as const;\n\nimport { NotificationsTable } from '../NotificationsTable';\nimport { useNotificationsApi } from '../../hooks';\nimport {\n CreatedAfterOptions,\n NotificationsFilters,\n SortBy,\n SortByOptions,\n} from '../NotificationsFilters';\nimport {\n GetNotificationsOptions,\n GetNotificationsResponse,\n GetTopicsResponse,\n} from '../../api';\nimport {\n NotificationSeverity,\n NotificationStatus,\n} from '@backstage/plugin-notifications-common';\n\nconst ThrottleDelayMs = 2000;\n\n/** @public */\nexport type NotificationsPageProps = {\n /** Mark notification as read when opening the link it contains, defaults to false */\n markAsReadOnLinkOpen?: boolean;\n title?: string;\n themeId?: string;\n subtitle?: string;\n tooltip?: string;\n type?: string;\n typeLink?: string;\n};\n\nfunction NotificationsPageContent(\n props: NotificationsPageProps & { headerVariant: 'legacy' | 'bui' },\n) {\n const { t } = useTranslationRef(notificationsTranslationRef);\n const {\n title = t('notificationsPage.title'),\n themeId = 'tool',\n subtitle,\n tooltip,\n type,\n typeLink,\n markAsReadOnLinkOpen,\n headerVariant,\n } = props;\n\n const [refresh, setRefresh] = useState(false);\n const { lastSignal } = useSignal('notifications');\n const [unreadOnly, setUnreadOnly] = useState<boolean | undefined>(true);\n const [saved, setSaved] = useState<boolean | undefined>(undefined);\n const [pageNumber, setPageNumber] = useState(0);\n const [pageSize, setPageSize] = useState(5);\n const [containsText, setContainsText] = useState<string>();\n const [createdAfter, setCreatedAfter] = useState<string>('all');\n const [sorting, setSorting] = useState<SortBy>(SortByOptions.newest.sortBy);\n const [severity, setSeverity] = useState<NotificationSeverity>('low');\n const [topic, setTopic] = useState<string>();\n\n const { error, value, retry, loading } = useNotificationsApi<\n [GetNotificationsResponse, NotificationStatus, GetTopicsResponse]\n >(\n api => {\n const options: GetNotificationsOptions = {\n search: containsText,\n limit: pageSize,\n offset: pageNumber * pageSize,\n minimumSeverity: severity,\n ...(sorting || {}),\n };\n if (unreadOnly !== undefined) {\n options.read = !unreadOnly;\n }\n if (saved !== undefined) {\n options.saved = saved;\n }\n if (topic !== undefined) {\n options.topic = topic;\n }\n\n const createdAfterDate =\n CreatedAfterOptions[\n createdAfter as keyof typeof CreatedAfterOptions\n ].getDate();\n if (createdAfterDate.valueOf() > 0) {\n options.createdAfter = createdAfterDate;\n }\n\n return Promise.all([\n api.getNotifications(options),\n api.getStatus(),\n api.getTopics(options),\n ]);\n },\n [\n containsText,\n unreadOnly,\n createdAfter,\n pageNumber,\n pageSize,\n sorting,\n saved,\n severity,\n topic,\n ],\n );\n\n const throttledSetRefresh = useMemo(\n () => throttle(setRefresh, ThrottleDelayMs),\n [setRefresh],\n );\n\n useEffect(() => {\n if (refresh && !loading) {\n retry();\n setRefresh(false);\n }\n }, [refresh, setRefresh, retry, loading]);\n\n useEffect(() => {\n if (lastSignal && lastSignal.action) {\n throttledSetRefresh(true);\n }\n }, [lastSignal, throttledSetRefresh]);\n\n const onUpdate = () => {\n throttledSetRefresh(true);\n };\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const notifications = value?.[0]?.notifications;\n const totalCount = value?.[0]?.totalCount;\n const isUnread = !!value?.[1]?.unread;\n const allTopics = value?.[2]?.topics;\n\n let tableTitle: string = t(TableTitleKeys.all, {\n count: totalCount ?? 0,\n });\n if (saved) {\n tableTitle = t(TableTitleKeys.saved, {\n count: totalCount ?? 0,\n });\n } else if (unreadOnly === true) {\n tableTitle = t(TableTitleKeys.unread, {\n count: totalCount ?? 0,\n });\n } else if (unreadOnly === false) {\n tableTitle = t(TableTitleKeys.read, {\n count: totalCount ?? 0,\n });\n }\n\n const pageContent = (\n <Content>\n <Grid.Root columns=\"12\" gap=\"6\">\n <Grid.Item colSpan=\"2\">\n <NotificationsFilters\n unreadOnly={unreadOnly}\n onUnreadOnlyChanged={setUnreadOnly}\n createdAfter={createdAfter}\n onCreatedAfterChanged={setCreatedAfter}\n onSortingChanged={setSorting}\n sorting={sorting}\n saved={saved}\n onSavedChanged={setSaved}\n severity={severity}\n onSeverityChanged={setSeverity}\n topic={topic}\n onTopicChanged={setTopic}\n allTopics={allTopics}\n />\n </Grid.Item>\n <Grid.Item colSpan=\"10\">\n <NotificationsTable\n title={tableTitle}\n isLoading={loading}\n isUnread={isUnread}\n markAsReadOnLinkOpen={markAsReadOnLinkOpen}\n notifications={notifications}\n onUpdate={onUpdate}\n setContainsText={setContainsText}\n onPageChange={setPageNumber}\n onRowsPerPageChange={setPageSize}\n page={pageNumber}\n pageSize={pageSize}\n totalCount={totalCount}\n />\n </Grid.Item>\n </Grid.Root>\n </Content>\n );\n\n if (headerVariant === 'bui') {\n return pageContent;\n }\n\n return (\n <PageWithHeader\n title={title}\n themeId={themeId}\n tooltip={tooltip}\n subtitle={subtitle}\n type={type}\n typeLink={typeLink}\n >\n {pageContent}\n </PageWithHeader>\n );\n}\n\nexport const NotificationsPage = (props?: NotificationsPageProps) => (\n <NotificationsPageContent {...(props ?? {})} headerVariant=\"legacy\" />\n);\n\nexport const NfsNotificationsPage = (props?: NotificationsPageProps) => (\n <NotificationsPageContent {...(props ?? {})} headerVariant=\"bui\" />\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAM,cAAA,GAAiB;AAAA,EACrB,GAAA,EAAK,kCAAA;AAAA,EACL,KAAA,EAAO,oCAAA;AAAA,EACP,MAAA,EAAQ,qCAAA;AAAA,EACR,IAAA,EAAM;AACR,CAAA;AAoBA,MAAM,eAAA,GAAkB,GAAA;AAcxB,SAAS,yBACP,KAAA,EACA;AACA,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,OAAO,WAAA;AAAA,EACT;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,QAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,iBAAA,GAAoB,CAAC,KAAA,qBAChC,GAAA,CAAC,wBAAA,EAAA,EAA0B,GAAI,KAAA,IAAS,EAAC,EAAI,aAAA,EAAc,QAAA,EAAS;AAG/D,MAAM,oBAAA,GAAuB,CAAC,KAAA,qBACnC,GAAA,CAAC,wBAAA,EAAA,EAA0B,GAAI,KAAA,IAAS,EAAC,EAAI,aAAA,EAAc,KAAA,EAAM;;;;"}
1
+ {"version":3,"file":"NotificationsPage.esm.js","sources":["../../../src/components/NotificationsPage/NotificationsPage.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 { useEffect, useMemo, useState } from 'react';\nimport throttle from 'lodash/throttle';\nimport {\n Content,\n PageWithHeader,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { Grid } from '@backstage/ui';\nimport { useSignal } from '@backstage/plugin-signals-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { notificationsTranslationRef } from '../../translation';\n\nconst TableTitleKeys = {\n all: 'notificationsPage.tableTitle.all',\n saved: 'notificationsPage.tableTitle.saved',\n unread: 'notificationsPage.tableTitle.unread',\n read: 'notificationsPage.tableTitle.read',\n} as const;\n\nimport { NotificationsTable } from '../NotificationsTable';\nimport { useNotificationsApi } from '../../hooks';\nimport {\n CreatedAfterOptions,\n NotificationsFilters,\n SortBy,\n SortByOptions,\n} from '../NotificationsFilters';\nimport {\n GetNotificationsOptions,\n GetNotificationsResponse,\n GetTopicsResponse,\n} from '../../api';\nimport {\n NotificationSeverity,\n NotificationStatus,\n} from '@backstage/plugin-notifications-common';\n\nconst ThrottleDelayMs = 2000;\n\n/** @public */\nexport type NotificationsPageProps = {\n /** Mark notification as read when opening the link it contains, defaults to false */\n markAsReadOnLinkOpen?: boolean;\n title?: string;\n themeId?: string;\n subtitle?: string;\n tooltip?: string;\n type?: string;\n typeLink?: string;\n};\n\nfunction NotificationsPageContent(\n props: NotificationsPageProps & { headerVariant: 'legacy' | 'bui' },\n) {\n const { t } = useTranslationRef(notificationsTranslationRef);\n const {\n title = t('notificationsPage.title'),\n themeId = 'tool',\n subtitle,\n tooltip,\n type,\n typeLink,\n markAsReadOnLinkOpen,\n headerVariant,\n } = props;\n\n const [refresh, setRefresh] = useState(false);\n const { lastSignal } = useSignal('notifications');\n const [unreadOnly, setUnreadOnly] = useState<boolean | undefined>(true);\n const [saved, setSaved] = useState<boolean | undefined>(undefined);\n const [pageNumber, setPageNumber] = useState(0);\n const [pageSize, setPageSize] = useState(5);\n const [containsText, setContainsText] = useState<string>();\n const [createdAfter, setCreatedAfter] = useState<string>('all');\n const [sorting, setSorting] = useState<SortBy>(SortByOptions.newest.sortBy);\n const [severity, setSeverity] = useState<NotificationSeverity>('low');\n const [topic, setTopic] = useState<string>();\n\n const { error, value, retry, loading } = useNotificationsApi<\n [GetNotificationsResponse, NotificationStatus, GetTopicsResponse]\n >(\n api => {\n const options: GetNotificationsOptions = {\n search: containsText,\n limit: pageSize,\n offset: pageNumber * pageSize,\n minimumSeverity: severity,\n ...(sorting || {}),\n };\n if (unreadOnly !== undefined) {\n options.read = !unreadOnly;\n }\n if (saved !== undefined) {\n options.saved = saved;\n }\n if (topic !== undefined) {\n options.topic = topic;\n }\n\n const createdAfterDate =\n CreatedAfterOptions[\n createdAfter as keyof typeof CreatedAfterOptions\n ].getDate();\n if (createdAfterDate.valueOf() > 0) {\n options.createdAfter = createdAfterDate;\n }\n\n return Promise.all([\n api.getNotifications(options),\n api.getStatus(),\n api.getTopics(options),\n ]);\n },\n [\n containsText,\n unreadOnly,\n createdAfter,\n pageNumber,\n pageSize,\n sorting,\n saved,\n severity,\n topic,\n ],\n );\n\n const throttledSetRefresh = useMemo(\n () => throttle(setRefresh, ThrottleDelayMs),\n [setRefresh],\n );\n\n useEffect(() => {\n if (refresh && !loading) {\n retry();\n setRefresh(false);\n }\n }, [refresh, setRefresh, retry, loading]);\n\n useEffect(() => {\n if (lastSignal && lastSignal.action) {\n throttledSetRefresh(true);\n }\n }, [lastSignal, throttledSetRefresh]);\n\n const onUpdate = () => {\n throttledSetRefresh(true);\n };\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const notifications = value?.[0]?.notifications;\n const totalCount = value?.[0]?.totalCount;\n const isUnread = !!value?.[1]?.unread;\n const allTopics = value?.[2]?.topics;\n\n let tableTitle: string = t(TableTitleKeys.all, {\n count: totalCount ?? 0,\n });\n if (saved) {\n tableTitle = t(TableTitleKeys.saved, {\n count: totalCount ?? 0,\n });\n } else if (unreadOnly === true) {\n tableTitle = t(TableTitleKeys.unread, {\n count: totalCount ?? 0,\n });\n } else if (unreadOnly === false) {\n tableTitle = t(TableTitleKeys.read, {\n count: totalCount ?? 0,\n });\n }\n\n const pageContent = (\n <Content>\n <Grid.Root columns=\"12\" gap=\"6\">\n <Grid.Item colSpan=\"2\">\n <NotificationsFilters\n unreadOnly={unreadOnly}\n onUnreadOnlyChanged={setUnreadOnly}\n createdAfter={createdAfter}\n onCreatedAfterChanged={setCreatedAfter}\n onSortingChanged={setSorting}\n sorting={sorting}\n saved={saved}\n onSavedChanged={setSaved}\n severity={severity}\n onSeverityChanged={setSeverity}\n topic={topic}\n onTopicChanged={setTopic}\n allTopics={allTopics}\n />\n </Grid.Item>\n <Grid.Item colSpan=\"10\">\n <NotificationsTable\n title={tableTitle}\n isLoading={loading}\n isUnread={isUnread}\n markAsReadOnLinkOpen={markAsReadOnLinkOpen}\n notifications={notifications}\n onUpdate={onUpdate}\n setContainsText={setContainsText}\n onPageChange={setPageNumber}\n onRowsPerPageChange={setPageSize}\n page={pageNumber}\n pageSize={pageSize}\n totalCount={totalCount}\n />\n </Grid.Item>\n </Grid.Root>\n </Content>\n );\n\n if (headerVariant === 'bui') {\n return pageContent;\n }\n\n return (\n <PageWithHeader\n title={title}\n themeId={themeId}\n tooltip={tooltip}\n subtitle={subtitle}\n type={type}\n typeLink={typeLink}\n >\n {pageContent}\n </PageWithHeader>\n );\n}\n\nexport const NotificationsPage = (props?: NotificationsPageProps) => (\n <NotificationsPageContent {...(props ?? {})} headerVariant=\"legacy\" />\n);\n\nexport const NfsNotificationsPage = (props?: NotificationsPageProps) => (\n <NotificationsPageContent {...(props ?? {})} headerVariant=\"bui\" />\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAM,cAAA,GAAiB;AAAA,EACrB,GAAA,EAAK,kCAAA;AAAA,EACL,KAAA,EAAO,oCAAA;AAAA,EACP,MAAA,EAAQ,qCAAA;AAAA,EACR,IAAA,EAAM;AACR,CAAA;AAoBA,MAAM,eAAA,GAAkB,GAAA;AAcxB,SAAS,yBACP,KAAA,EACA;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,2BAA2B,CAAA;AAC3D,EAAA,MAAM;AAAA,IACJ,KAAA,GAAQ,EAAE,yBAAyB,CAAA;AAAA,IACnC,OAAA,GAAU,MAAA;AAAA,IACV,QAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,oBAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KA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AAc,QAAA,EAAS;AAG/D,MAAM,oBAAA,GAAuB,CAAC,KAAA,qBACnC,GAAA,CAAC,wBAAA,EAAA,EAA0B,GAAI,KAAA,IAAS,EAAC,EAAI,aAAA,EAAc,KAAA,EAAM;;;;"}
@@ -0,0 +1,47 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { Text, Button } from '@backstage/ui';
3
+ import { useState } from 'react';
4
+
5
+ const MAX_LENGTH = 100;
6
+ const DefaultNotificationDescription = (props) => {
7
+ const { description } = props;
8
+ const [shown, setShown] = useState(false);
9
+ const isLong = description.length > MAX_LENGTH;
10
+ if (!isLong) {
11
+ return /* @__PURE__ */ jsx(Text, { variant: "body-small", children: description });
12
+ }
13
+ if (shown) {
14
+ return /* @__PURE__ */ jsxs(Text, { variant: "body-small", children: [
15
+ description,
16
+ " ",
17
+ /* @__PURE__ */ jsx(
18
+ Button,
19
+ {
20
+ variant: "tertiary",
21
+ onPress: () => {
22
+ setShown(false);
23
+ },
24
+ children: "Show less"
25
+ }
26
+ )
27
+ ] });
28
+ }
29
+ return /* @__PURE__ */ jsxs(Text, { variant: "body-small", children: [
30
+ description.substring(0, MAX_LENGTH),
31
+ "...",
32
+ " ",
33
+ /* @__PURE__ */ jsx(
34
+ Button,
35
+ {
36
+ variant: "tertiary",
37
+ onPress: () => {
38
+ setShown(true);
39
+ },
40
+ children: "Show more"
41
+ }
42
+ )
43
+ ] });
44
+ };
45
+
46
+ export { DefaultNotificationDescription };
47
+ //# sourceMappingURL=DefaultNotificationDescription.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultNotificationDescription.esm.js","sources":["../../../src/components/NotificationsTable/DefaultNotificationDescription.tsx"],"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 */\nimport { Text, Button } from '@backstage/ui';\nimport { useState } from 'react';\nimport type { NotificationDescriptionProps } from './NotificationDescription';\n\nconst MAX_LENGTH = 100;\n\nexport const DefaultNotificationDescription = (\n props: NotificationDescriptionProps,\n) => {\n const { description } = props;\n const [shown, setShown] = useState(false);\n const isLong = description.length > MAX_LENGTH;\n\n if (!isLong) {\n return <Text variant=\"body-small\">{description}</Text>;\n }\n\n if (shown) {\n return (\n <Text variant=\"body-small\">\n {description}{' '}\n <Button\n variant=\"tertiary\"\n onPress={() => {\n setShown(false);\n }}\n >\n Show less\n </Button>\n </Text>\n );\n }\n return (\n <Text variant=\"body-small\">\n {description.substring(0, MAX_LENGTH)}...{' '}\n <Button\n variant=\"tertiary\"\n onPress={() => {\n setShown(true);\n }}\n >\n Show more\n </Button>\n </Text>\n );\n};\n"],"names":[],"mappings":";;;;AAmBA,MAAM,UAAA,GAAa,GAAA;AAEZ,MAAM,8BAAA,GAAiC,CAC5C,KAAA,KACG;AACH,EAAA,MAAM,EAAE,aAAY,GAAI,KAAA;AACxB,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAS,KAAK,CAAA;AACxC,EAAA,MAAM,MAAA,GAAS,YAAY,MAAA,GAAS,UAAA;AAEpC,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,YAAA,EAAc,QAAA,EAAA,WAAA,EAAY,CAAA;AAAA,EACjD;AAEA,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,YAAA,EACX,QAAA,EAAA;AAAA,MAAA,WAAA;AAAA,MAAa,GAAA;AAAA,sBACd,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,UAAA;AAAA,UACR,SAAS,MAAM;AACb,YAAA,QAAA,CAAS,KAAK,CAAA;AAAA,UAChB,CAAA;AAAA,UACD,QAAA,EAAA;AAAA;AAAA;AAED,KAAA,EACF,CAAA;AAAA,EAEJ;AACA,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,YAAA,EACX,QAAA,EAAA;AAAA,IAAA,WAAA,CAAY,SAAA,CAAU,GAAG,UAAU,CAAA;AAAA,IAAE,KAAA;AAAA,IAAI,GAAA;AAAA,oBAC1C,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,UAAA;AAAA,QACR,SAAS,MAAM;AACb,UAAA,QAAA,CAAS,IAAI,CAAA;AAAA,QACf,CAAA;AAAA,QACD,QAAA,EAAA;AAAA;AAAA;AAED,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1,47 +1,11 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { Text, Button } from '@backstage/ui';
3
- import { useState } from 'react';
1
+ import { createSwappableComponent } from '@backstage/frontend-plugin-api';
4
2
 
5
- const MAX_LENGTH = 100;
6
- const NotificationDescription = (props) => {
7
- const { description } = props;
8
- const [shown, setShown] = useState(false);
9
- const isLong = description.length > MAX_LENGTH;
10
- if (!isLong) {
11
- return /* @__PURE__ */ jsx(Text, { variant: "body-small", children: description });
12
- }
13
- if (shown) {
14
- return /* @__PURE__ */ jsxs(Text, { variant: "body-small", children: [
15
- description,
16
- " ",
17
- /* @__PURE__ */ jsx(
18
- Button,
19
- {
20
- variant: "tertiary",
21
- onPress: () => {
22
- setShown(false);
23
- },
24
- children: "Show less"
25
- }
26
- )
27
- ] });
28
- }
29
- return /* @__PURE__ */ jsxs(Text, { variant: "body-small", children: [
30
- description.substring(0, MAX_LENGTH),
31
- "...",
32
- " ",
33
- /* @__PURE__ */ jsx(
34
- Button,
35
- {
36
- variant: "tertiary",
37
- onPress: () => {
38
- setShown(true);
39
- },
40
- children: "Show more"
41
- }
42
- )
43
- ] });
44
- };
3
+ const NotificationDescription = createSwappableComponent({
4
+ id: "notifications.notification-description",
5
+ loader: () => import('./DefaultNotificationDescription.esm.js').then(
6
+ (m) => m.DefaultNotificationDescription
7
+ )
8
+ });
45
9
 
46
10
  export { NotificationDescription };
47
11
  //# sourceMappingURL=NotificationDescription.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationDescription.esm.js","sources":["../../../src/components/NotificationsTable/NotificationDescription.tsx"],"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 */\nimport { Text, Button } from '@backstage/ui';\nimport { useState } from 'react';\n\nconst MAX_LENGTH = 100;\n\nexport const NotificationDescription = (props: { description: string }) => {\n const { description } = props;\n const [shown, setShown] = useState(false);\n const isLong = description.length > MAX_LENGTH;\n\n if (!isLong) {\n return <Text variant=\"body-small\">{description}</Text>;\n }\n\n if (shown) {\n return (\n <Text variant=\"body-small\">\n {description}{' '}\n <Button\n variant=\"tertiary\"\n onPress={() => {\n setShown(false);\n }}\n >\n Show less\n </Button>\n </Text>\n );\n }\n return (\n <Text variant=\"body-small\">\n {description.substring(0, MAX_LENGTH)}...{' '}\n <Button\n variant=\"tertiary\"\n onPress={() => {\n setShown(true);\n }}\n >\n Show more\n </Button>\n </Text>\n );\n};\n"],"names":[],"mappings":";;;;AAkBA,MAAM,UAAA,GAAa,GAAA;AAEZ,MAAM,uBAAA,GAA0B,CAAC,KAAA,KAAmC;AACzE,EAAA,MAAM,EAAE,aAAY,GAAI,KAAA;AACxB,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAS,KAAK,CAAA;AACxC,EAAA,MAAM,MAAA,GAAS,YAAY,MAAA,GAAS,UAAA;AAEpC,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,YAAA,EAAc,QAAA,EAAA,WAAA,EAAY,CAAA;AAAA,EACjD;AAEA,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,YAAA,EACX,QAAA,EAAA;AAAA,MAAA,WAAA;AAAA,MAAa,GAAA;AAAA,sBACd,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,UAAA;AAAA,UACR,SAAS,MAAM;AACb,YAAA,QAAA,CAAS,KAAK,CAAA;AAAA,UAChB,CAAA;AAAA,UACD,QAAA,EAAA;AAAA;AAAA;AAED,KAAA,EACF,CAAA;AAAA,EAEJ;AACA,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,YAAA,EACX,QAAA,EAAA;AAAA,IAAA,WAAA,CAAY,SAAA,CAAU,GAAG,UAAU,CAAA;AAAA,IAAE,KAAA;AAAA,IAAI,GAAA;AAAA,oBAC1C,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,UAAA;AAAA,QACR,SAAS,MAAM;AACb,UAAA,QAAA,CAAS,IAAI,CAAA;AAAA,QACf,CAAA;AAAA,QACD,QAAA,EAAA;AAAA;AAAA;AAED,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"NotificationDescription.esm.js","sources":["../../../src/components/NotificationsTable/NotificationDescription.tsx"],"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 */\nimport { createSwappableComponent } from '@backstage/frontend-plugin-api';\n\n/**\n * Props for the {@link NotificationDescription} swappable component.\n *\n * @public\n */\nexport interface NotificationDescriptionProps {\n /**\n * The plain-text description of the notification.\n */\n description: string;\n}\n\n/**\n * Swappable component that renders the description of a notification in the\n * notifications table. Apps can override this to customize how descriptions\n * are displayed.\n *\n * @public\n */\nexport const NotificationDescription =\n createSwappableComponent<NotificationDescriptionProps>({\n id: 'notifications.notification-description',\n loader: () =>\n import('./DefaultNotificationDescription').then(\n m => m.DefaultNotificationDescription,\n ),\n });\n"],"names":[],"mappings":";;AAoCO,MAAM,0BACX,wBAAA,CAAuD;AAAA,EACrD,EAAA,EAAI,wCAAA;AAAA,EACJ,MAAA,EAAQ,MACN,OAAO,yCAAkC,CAAA,CAAE,IAAA;AAAA,IACzC,OAAK,CAAA,CAAE;AAAA;AAEb,CAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -84,6 +84,29 @@ type NotificationsTableProps = Pick<TableProps, 'onPageChange' | 'onRowsPerPageC
84
84
  /** @public */
85
85
  declare const NotificationsTable: ({ title, markAsReadOnLinkOpen, isLoading, notifications, isUnread, onUpdate, setContainsText, onPageChange, onRowsPerPageChange, page, pageSize, totalCount, }: NotificationsTableProps) => react_jsx_runtime.JSX.Element;
86
86
 
87
+ /**
88
+ * Props for the {@link NotificationDescription} swappable component.
89
+ *
90
+ * @public
91
+ */
92
+ interface NotificationDescriptionProps {
93
+ /**
94
+ * The plain-text description of the notification.
95
+ */
96
+ description: string;
97
+ }
98
+ /**
99
+ * Swappable component that renders the description of a notification in the
100
+ * notifications table. Apps can override this to customize how descriptions
101
+ * are displayed.
102
+ *
103
+ * @public
104
+ */
105
+ declare const NotificationDescription: {
106
+ (props: NotificationDescriptionProps): JSX.Element | null;
107
+ ref: _backstage_frontend_plugin_api.SwappableComponentRef<NotificationDescriptionProps, NotificationDescriptionProps>;
108
+ };
109
+
87
110
  /** @public */
88
111
  declare const UserNotificationSettingsCard: (props: {
89
112
  originNames?: Record<string, string>;
@@ -260,5 +283,5 @@ declare const notificationsTranslationRef: _backstage_frontend_plugin_api.Transl
260
283
  readonly "notificationsPage.tableTitle.read_other": "Read notifications ({{count}})";
261
284
  }>;
262
285
 
263
- export { NotificationsClient, NotificationsPage, NotificationsSidebarItem, NotificationsTable, UserNotificationSettingsCard, notificationsApiRef, notificationsPlugin, notificationsTranslationRef, useNotificationsApi };
264
- export type { GetNotificationsCommonOptions, GetNotificationsOptions, GetNotificationsResponse, GetTopicsOptions, GetTopicsResponse, NotificationSnackbarProperties, NotificationsApi, NotificationsPageProps, NotificationsRenderItemProps, NotificationsSideBarItemProps, NotificationsTableProps, UpdateNotificationsOptions };
286
+ export { NotificationDescription, NotificationsClient, NotificationsPage, NotificationsSidebarItem, NotificationsTable, UserNotificationSettingsCard, notificationsApiRef, notificationsPlugin, notificationsTranslationRef, useNotificationsApi };
287
+ export type { GetNotificationsCommonOptions, GetNotificationsOptions, GetNotificationsResponse, GetTopicsOptions, GetTopicsResponse, NotificationDescriptionProps, NotificationSnackbarProperties, NotificationsApi, NotificationsPageProps, NotificationsRenderItemProps, NotificationsSideBarItemProps, NotificationsTableProps, UpdateNotificationsOptions };
package/dist/index.esm.js CHANGED
@@ -8,6 +8,7 @@ import './routes.esm.js';
8
8
  import './hooks/useTitleCounter.esm.js';
9
9
  export { NotificationsSidebarItem } from './components/NotificationsSideBarItem/NotificationsSideBarItem.esm.js';
10
10
  export { NotificationsTable } from './components/NotificationsTable/NotificationsTable.esm.js';
11
+ export { NotificationDescription } from './components/NotificationsTable/NotificationDescription.esm.js';
11
12
  export { UserNotificationSettingsCard } from './components/UserNotificationSettingsCard/UserNotificationSettingsCard.esm.js';
12
13
  export { notificationsTranslationRef } from './translation.esm.js';
13
14
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-notifications";
2
- var version = "0.5.17-next.0";
2
+ var version = "0.5.17-next.1";
3
3
  var backstage = {
4
4
  role: "frontend-plugin",
5
5
  pluginId: "notifications",
@@ -58,7 +58,7 @@ var dependencies = {
58
58
  "@backstage/plugin-signals-react": "workspace:^",
59
59
  "@backstage/theme": "workspace:^",
60
60
  "@backstage/ui": "workspace:^",
61
- "@remixicon/react": "^4.6.0",
61
+ "@remixicon/react": ">=4.6.0 <4.9.0",
62
62
  lodash: "^4.17.21",
63
63
  notistack: "^3.0.1",
64
64
  "react-aria-components": "~1.17.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-notifications",
3
- "version": "0.5.17-next.0",
3
+ "version": "0.5.17-next.1",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "notifications",
@@ -64,14 +64,14 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@backstage/core-components": "0.18.10-next.0",
67
- "@backstage/core-plugin-api": "1.12.6-next.0",
67
+ "@backstage/core-plugin-api": "1.12.6-next.1",
68
68
  "@backstage/errors": "1.3.1-next.0",
69
- "@backstage/frontend-plugin-api": "0.17.0-next.0",
69
+ "@backstage/frontend-plugin-api": "0.17.0-next.1",
70
70
  "@backstage/plugin-notifications-common": "0.2.3-next.0",
71
71
  "@backstage/plugin-signals-react": "0.0.22-next.0",
72
72
  "@backstage/theme": "0.7.3",
73
- "@backstage/ui": "0.15.0-next.0",
74
- "@remixicon/react": "^4.6.0",
73
+ "@backstage/ui": "0.15.0-next.1",
74
+ "@remixicon/react": ">=4.6.0 <4.9.0",
75
75
  "lodash": "^4.17.21",
76
76
  "notistack": "^3.0.1",
77
77
  "react-aria-components": "~1.17.0",
@@ -79,9 +79,9 @@
79
79
  "react-use": "^17.2.4"
80
80
  },
81
81
  "devDependencies": {
82
- "@backstage/cli": "0.36.2-next.0",
82
+ "@backstage/cli": "0.36.2-next.1",
83
83
  "@backstage/dev-utils": "1.1.23-next.0",
84
- "@backstage/plugin-signals": "0.0.31-next.0",
84
+ "@backstage/plugin-signals": "0.0.31-next.1",
85
85
  "@backstage/test-utils": "1.7.18-next.0",
86
86
  "@testing-library/jest-dom": "^6.0.0",
87
87
  "@testing-library/react": "^16.0.0",