Skip to content

Commit 8e30a40

Browse files
committed
Add end-of-life modal
1 parent 4e465b4 commit 8e30a40

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React from 'react';
2+
import {
3+
css,
4+
Banner,
5+
Link,
6+
spacing,
7+
Body,
8+
BannerVariant,
9+
showConfirmation,
10+
} from '@mongodb-js/compass-components';
11+
import {
12+
getConnectionTitle,
13+
type ConnectionInfo,
14+
} from '@mongodb-js/connection-info';
15+
16+
const modalBodyStyles = css({
17+
marginTop: spacing[400],
18+
marginBottom: spacing[200],
19+
});
20+
21+
export function showEndOfLifeMongoDBWarningModal(
22+
connectionInfo?: ConnectionInfo,
23+
version?: string
24+
) {
25+
return showConfirmation({
26+
title: 'End-of-life MongoDB Detected',
27+
description: (
28+
<>
29+
<Banner variant={BannerVariant.Warning}>
30+
{connectionInfo
31+
? `Server or service "${getConnectionTitle(connectionInfo)}"`
32+
: 'This server or service'}{' '}
33+
appears to be running a version of MongoDB that is no longer
34+
supported.
35+
</Banner>
36+
<Body className={modalBodyStyles}>
37+
Server version{version ? ` (${version})` : ''} is considered
38+
end-of-life, consider upgrading to get the latest features and
39+
performance improvements.{' '}
40+
</Body>
41+
<Link
42+
href="https://www.mongodb.com/docs/manual/release-notes/"
43+
target="_blank"
44+
data-testid="end-of-life-warning-modal-learn-more-link"
45+
>
46+
Learn more from the MongoDB release notes.
47+
</Link>
48+
</>
49+
),
50+
});
51+
}

0 commit comments

Comments
 (0)