Skip to content

Commit

Permalink
add clickable urls to notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman committed Sep 19, 2024
1 parent 1948c4c commit 6f16dad
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 25 deletions.
2 changes: 1 addition & 1 deletion assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@nivo/pie": "0.87.0",
"@nivo/radial-bar": "0.87.0",
"@nivo/tooltip": "0.87.0",
"@pluralsh/design-system": "3.67.2",
"@pluralsh/design-system": "3.69.0",
"@react-hooks-library/core": "0.6.0",
"@saas-ui/use-hotkeys": "1.1.3",
"@tanstack/react-virtual": "3.0.1",
Expand Down
14 changes: 0 additions & 14 deletions assets/src/components/cd/clusters/ClusterUpgradeFlyover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -419,21 +419,7 @@ export function ClusterUpgradeFlyover({
header={`Upgrade Plan for ${cluster?.name}`}
open={open}
onClose={onClose}
portal
size="large"
minWidth={920}
actions={
<Button
type="button"
secondary
onClick={(e) => {
e.preventDefault()
onClose()
}}
>
Cancel
</Button>
}
>
<FlyoverContent
open={open}
Expand Down
10 changes: 5 additions & 5 deletions assets/src/components/notifications/Notification.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useTheme } from 'styled-components'
import React, { useEffect, useRef, useState } from 'react'
import { Button } from '@pluralsh/design-system'
import { Button, Markdown } from '@pluralsh/design-system'
import moment from 'moment/moment'
import { useEffect, useRef, useState } from 'react'
import { useTheme } from 'styled-components'

import { AppNotificationFragment } from '../../generated/graphql'

Expand Down Expand Up @@ -43,7 +43,6 @@ export default function Notification({
flexDirection: 'column',
gap: theme.spacing.small,
padding: `${theme.spacing.large}px ${theme.spacing.medium}px `,
width: '100%',
}}
>
<div
Expand All @@ -61,6 +60,7 @@ export default function Notification({
<div
ref={contentRef}
css={{
wordBreak: 'break-word',
...(expand
? {}
: {
Expand All @@ -71,7 +71,7 @@ export default function Notification({
}),
}}
>
{notification.text}
<Markdown text={notification.text ?? ''} />
</div>
{clamped && (
<Button
Expand Down
232 changes: 227 additions & 5 deletions assets/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4274,9 +4274,9 @@ __metadata:
languageName: node
linkType: hard

"@pluralsh/design-system@npm:3.67.2":
version: 3.67.2
resolution: "@pluralsh/design-system@npm:3.67.2"
"@pluralsh/design-system@npm:3.69.0":
version: 3.69.0
resolution: "@pluralsh/design-system@npm:3.69.0"
dependencies:
"@floating-ui/react-dom-interactions": 0.13.3
"@loomhq/loom-embed": 1.5.0
Expand Down Expand Up @@ -4310,6 +4310,7 @@ __metadata:
react-stately: 3.29.1
react-use-measure: 2.1.1
rehype-raw: 7.0.0
remark-gfm: 4.0.0
resize-observer-polyfill: 1.5.1
styled-container-query: 1.3.5
type-fest: 4.8.3
Expand All @@ -4324,7 +4325,7 @@ __metadata:
react-dom: ">=18.3.1"
react-transition-group: ">=4.4.5"
styled-components: ">=5.3.11"
checksum: f84cfc700e3b467ba71fba40a66e1c81e4e326bdabfb19cb523aff5a8979bf2e3c4d73cbc12afea93368ccecf328485957148b4654a5b60bf5c56546687da2f1
checksum: 649dd429a94def27d43b86381d8e146852760f708e449684e74c78dc8e9f7b5d1b27d3409de88c33335cc9af2ab10f3336c22f0990041496f458486a7100d79b
languageName: node
linkType: hard

Expand Down Expand Up @@ -10112,7 +10113,7 @@ __metadata:
"@nivo/pie": 0.87.0
"@nivo/radial-bar": 0.87.0
"@nivo/tooltip": 0.87.0
"@pluralsh/design-system": 3.67.2
"@pluralsh/design-system": 3.69.0
"@pluralsh/eslint-config-typescript": 2.5.150
"@pluralsh/stylelint-config": 2.0.10
"@react-hooks-library/core": 0.6.0
Expand Down Expand Up @@ -11893,6 +11894,13 @@ __metadata:
languageName: node
linkType: hard

"escape-string-regexp@npm:^5.0.0":
version: 5.0.0
resolution: "escape-string-regexp@npm:5.0.0"
checksum: 20daabe197f3cb198ec28546deebcf24b3dbb1a5a269184381b3116d12f0532e06007f4bc8da25669d6a7f8efb68db0758df4cd981f57bc5b57f521a3e12c59e
languageName: node
linkType: hard

"escodegen@npm:^1.8.1":
version: 1.14.3
resolution: "escodegen@npm:1.14.3"
Expand Down Expand Up @@ -15510,6 +15518,13 @@ __metadata:
languageName: node
linkType: hard

"markdown-table@npm:^3.0.0":
version: 3.0.3
resolution: "markdown-table@npm:3.0.3"
checksum: 8fcd3d9018311120fbb97115987f8b1665a603f3134c93fbecc5d1463380c8036f789e2a62c19432058829e594fff8db9ff81c88f83690b2f8ed6c074f8d9e10
languageName: node
linkType: hard

"mathml-tag-names@npm:^2.1.3":
version: 2.1.3
resolution: "mathml-tag-names@npm:2.1.3"
Expand All @@ -15528,6 +15543,18 @@ __metadata:
languageName: node
linkType: hard

"mdast-util-find-and-replace@npm:^3.0.0":
version: 3.0.1
resolution: "mdast-util-find-and-replace@npm:3.0.1"
dependencies:
"@types/mdast": ^4.0.0
escape-string-regexp: ^5.0.0
unist-util-is: ^6.0.0
unist-util-visit-parents: ^6.0.0
checksum: 05d5c4ff02e31db2f8a685a13bcb6c3f44e040bd9dfa54c19a232af8de5268334c8755d79cb456ed4cced1300c4fb83e88444c7ae8ee9ff16869a580f29d08cd
languageName: node
linkType: hard

"mdast-util-from-markdown@npm:^2.0.0":
version: 2.0.1
resolution: "mdast-util-from-markdown@npm:2.0.1"
Expand All @@ -15548,6 +15575,83 @@ __metadata:
languageName: node
linkType: hard

"mdast-util-gfm-autolink-literal@npm:^2.0.0":
version: 2.0.1
resolution: "mdast-util-gfm-autolink-literal@npm:2.0.1"
dependencies:
"@types/mdast": ^4.0.0
ccount: ^2.0.0
devlop: ^1.0.0
mdast-util-find-and-replace: ^3.0.0
micromark-util-character: ^2.0.0
checksum: 5630b12e072d7004cb132231c94f667fb5813486779cb0dfb0a196d7ae0e048897a43b0b37e080017adda618ddfcbea1d7bf23c0fa31c87bfc683e0898ea1cfe
languageName: node
linkType: hard

"mdast-util-gfm-footnote@npm:^2.0.0":
version: 2.0.0
resolution: "mdast-util-gfm-footnote@npm:2.0.0"
dependencies:
"@types/mdast": ^4.0.0
devlop: ^1.1.0
mdast-util-from-markdown: ^2.0.0
mdast-util-to-markdown: ^2.0.0
micromark-util-normalize-identifier: ^2.0.0
checksum: 45d26b40e7a093712e023105791129d76e164e2168d5268e113298a22de30c018162683fb7893cdc04ab246dac0087eed708b2a136d1d18ed2b32b3e0cae4a79
languageName: node
linkType: hard

"mdast-util-gfm-strikethrough@npm:^2.0.0":
version: 2.0.0
resolution: "mdast-util-gfm-strikethrough@npm:2.0.0"
dependencies:
"@types/mdast": ^4.0.0
mdast-util-from-markdown: ^2.0.0
mdast-util-to-markdown: ^2.0.0
checksum: fe9b1d0eba9b791ff9001c008744eafe3dd7a81b085f2bf521595ce4a8e8b1b44764ad9361761ad4533af3e5d913d8ad053abec38172031d9ee32a8ebd1c7dbd
languageName: node
linkType: hard

"mdast-util-gfm-table@npm:^2.0.0":
version: 2.0.0
resolution: "mdast-util-gfm-table@npm:2.0.0"
dependencies:
"@types/mdast": ^4.0.0
devlop: ^1.0.0
markdown-table: ^3.0.0
mdast-util-from-markdown: ^2.0.0
mdast-util-to-markdown: ^2.0.0
checksum: 063a627fd0993548fd63ca0c24c437baf91ba7d51d0a38820bd459bc20bf3d13d7365ef8d28dca99176dd5eb26058f7dde51190479c186dfe6af2e11202957c9
languageName: node
linkType: hard

"mdast-util-gfm-task-list-item@npm:^2.0.0":
version: 2.0.0
resolution: "mdast-util-gfm-task-list-item@npm:2.0.0"
dependencies:
"@types/mdast": ^4.0.0
devlop: ^1.0.0
mdast-util-from-markdown: ^2.0.0
mdast-util-to-markdown: ^2.0.0
checksum: 37db90c59b15330fc54d790404abf5ef9f2f83e8961c53666fe7de4aab8dd5e6b3c296b6be19797456711a89a27840291d8871ff0438e9b4e15c89d170efe072
languageName: node
linkType: hard

"mdast-util-gfm@npm:^3.0.0":
version: 3.0.0
resolution: "mdast-util-gfm@npm:3.0.0"
dependencies:
mdast-util-from-markdown: ^2.0.0
mdast-util-gfm-autolink-literal: ^2.0.0
mdast-util-gfm-footnote: ^2.0.0
mdast-util-gfm-strikethrough: ^2.0.0
mdast-util-gfm-table: ^2.0.0
mdast-util-gfm-task-list-item: ^2.0.0
mdast-util-to-markdown: ^2.0.0
checksum: 62039d2f682ae3821ea1c999454863d31faf94d67eb9b746589c7e136076d7fb35fabc67e02f025c7c26fd7919331a0ee1aabfae24f565d9a6a9ebab3371c626
languageName: node
linkType: hard

"mdast-util-mdx-expression@npm:^2.0.0":
version: 2.0.1
resolution: "mdast-util-mdx-expression@npm:2.0.1"
Expand Down Expand Up @@ -15753,6 +15857,99 @@ __metadata:
languageName: node
linkType: hard

"micromark-extension-gfm-autolink-literal@npm:^2.0.0":
version: 2.1.0
resolution: "micromark-extension-gfm-autolink-literal@npm:2.1.0"
dependencies:
micromark-util-character: ^2.0.0
micromark-util-sanitize-uri: ^2.0.0
micromark-util-symbol: ^2.0.0
micromark-util-types: ^2.0.0
checksum: e00a570c70c837b9cbbe94b2c23b787f44e781cd19b72f1828e3453abca2a9fb600fa539cdc75229fa3919db384491063645086e02249481e6ff3ec2c18f767c
languageName: node
linkType: hard

"micromark-extension-gfm-footnote@npm:^2.0.0":
version: 2.1.0
resolution: "micromark-extension-gfm-footnote@npm:2.1.0"
dependencies:
devlop: ^1.0.0
micromark-core-commonmark: ^2.0.0
micromark-factory-space: ^2.0.0
micromark-util-character: ^2.0.0
micromark-util-normalize-identifier: ^2.0.0
micromark-util-sanitize-uri: ^2.0.0
micromark-util-symbol: ^2.0.0
micromark-util-types: ^2.0.0
checksum: ac6fb039e98395d37b71ebff7c7a249aef52678b5cf554c89c4f716111d4be62ef99a5d715a5bd5d68fa549778c977d85cb671d1d8506dc8a3a1b46e867ae52f
languageName: node
linkType: hard

"micromark-extension-gfm-strikethrough@npm:^2.0.0":
version: 2.1.0
resolution: "micromark-extension-gfm-strikethrough@npm:2.1.0"
dependencies:
devlop: ^1.0.0
micromark-util-chunked: ^2.0.0
micromark-util-classify-character: ^2.0.0
micromark-util-resolve-all: ^2.0.0
micromark-util-symbol: ^2.0.0
micromark-util-types: ^2.0.0
checksum: cdb7a38dd6eefb6ceb6792a44a6796b10f951e8e3e45b8579f599f43e7ae26ccd048c0aa7e441b3c29dd0c54656944fe6eb0098de2bc4b5106fbc0a42e9e016c
languageName: node
linkType: hard

"micromark-extension-gfm-table@npm:^2.0.0":
version: 2.1.0
resolution: "micromark-extension-gfm-table@npm:2.1.0"
dependencies:
devlop: ^1.0.0
micromark-factory-space: ^2.0.0
micromark-util-character: ^2.0.0
micromark-util-symbol: ^2.0.0
micromark-util-types: ^2.0.0
checksum: 249d695f5f8bd222a0d8a774ec78ea2a2d624cb50a4d008092a54aa87dad1f9d540e151d29696cf849eb1cee380113c4df722aebb3b425a214832a2de5dea1d7
languageName: node
linkType: hard

"micromark-extension-gfm-tagfilter@npm:^2.0.0":
version: 2.0.0
resolution: "micromark-extension-gfm-tagfilter@npm:2.0.0"
dependencies:
micromark-util-types: ^2.0.0
checksum: cf21552f4a63592bfd6c96ae5d64a5f22bda4e77814e3f0501bfe80e7a49378ad140f827007f36044666f176b3a0d5fea7c2e8e7973ce4b4579b77789f01ae95
languageName: node
linkType: hard

"micromark-extension-gfm-task-list-item@npm:^2.0.0":
version: 2.1.0
resolution: "micromark-extension-gfm-task-list-item@npm:2.1.0"
dependencies:
devlop: ^1.0.0
micromark-factory-space: ^2.0.0
micromark-util-character: ^2.0.0
micromark-util-symbol: ^2.0.0
micromark-util-types: ^2.0.0
checksum: b1ad86a4e9d68d9ad536d94fb25a5182acbc85cc79318f4a6316034342f6a71d67983cc13f12911d0290fd09b2bda43cdabe8781a2d9cca2ebe0d421e8b2b8a4
languageName: node
linkType: hard

"micromark-extension-gfm@npm:^3.0.0":
version: 3.0.0
resolution: "micromark-extension-gfm@npm:3.0.0"
dependencies:
micromark-extension-gfm-autolink-literal: ^2.0.0
micromark-extension-gfm-footnote: ^2.0.0
micromark-extension-gfm-strikethrough: ^2.0.0
micromark-extension-gfm-table: ^2.0.0
micromark-extension-gfm-tagfilter: ^2.0.0
micromark-extension-gfm-task-list-item: ^2.0.0
micromark-util-combine-extensions: ^2.0.0
micromark-util-types: ^2.0.0
checksum: 2060fa62666a09532d6b3a272d413bc1b25bbb262f921d7402795ac021e1362c8913727e33d7528d5b4ccaf26922ec51208c43f795a702964817bc986de886c9
languageName: node
linkType: hard

"micromark-factory-destination@npm:^2.0.0":
version: 2.0.0
resolution: "micromark-factory-destination@npm:2.0.0"
Expand Down Expand Up @@ -18441,6 +18638,20 @@ __metadata:
languageName: node
linkType: hard

"remark-gfm@npm:4.0.0":
version: 4.0.0
resolution: "remark-gfm@npm:4.0.0"
dependencies:
"@types/mdast": ^4.0.0
mdast-util-gfm: ^3.0.0
micromark-extension-gfm: ^3.0.0
remark-parse: ^11.0.0
remark-stringify: ^11.0.0
unified: ^11.0.0
checksum: 84bea84e388061fbbb697b4b666089f5c328aa04d19dc544c229b607446bc10902e46b67b9594415a1017bbbd7c811c1f0c30d36682c6d1a6718b66a1558261b
languageName: node
linkType: hard

"remark-parse@npm:^11.0.0":
version: 11.0.0
resolution: "remark-parse@npm:11.0.0"
Expand All @@ -18466,6 +18677,17 @@ __metadata:
languageName: node
linkType: hard

"remark-stringify@npm:^11.0.0":
version: 11.0.0
resolution: "remark-stringify@npm:11.0.0"
dependencies:
"@types/mdast": ^4.0.0
mdast-util-to-markdown: ^2.0.0
unified: ^11.0.0
checksum: 59e07460eb629d6c3b3c0f438b0b236e7e6858fd5ab770303078f5a556ec00354d9c7fb9ef6d5f745a4617ac7da1ab618b170fbb4dac120e183fecd9cc86bce6
languageName: node
linkType: hard

"remedial@npm:^1.0.7":
version: 1.0.8
resolution: "remedial@npm:1.0.8"
Expand Down

0 comments on commit 6f16dad

Please sign in to comment.