@@ -7,6 +7,28 @@ import { api } from '../../../state/backend-api';
77import { DISABLE_SSO_DOCS_LINK } from '../../license/license-utils' ;
88import { PageComponent } from '../page' ;
99
10+ /**
11+ * Formats a list of enabled enterprise feature names into a human-readable string.
12+ * Returns undefined if no features are enabled.
13+ */
14+ function formatEnabledFeatures ( features : { name : string ; enabled : boolean } [ ] ) : string | undefined {
15+ const enabledFeatures = features . filter ( ( f ) => f . enabled ) . map ( ( f ) => f . name ) ;
16+
17+ if ( enabledFeatures . length === 0 ) {
18+ return ;
19+ }
20+
21+ if ( enabledFeatures . length === 1 ) {
22+ return enabledFeatures [ 0 ] ;
23+ }
24+
25+ if ( enabledFeatures . length === 2 ) {
26+ return `${ enabledFeatures [ 0 ] } and ${ enabledFeatures [ 1 ] } ` ;
27+ }
28+
29+ return `${ enabledFeatures . slice ( 0 , - 1 ) . join ( ', ' ) } , and ${ enabledFeatures . at ( - 1 ) } ` ;
30+ }
31+
1032@observer
1133export default class LicenseExpiredPage extends PageComponent {
1234 initPage ( ) : void {
@@ -21,6 +43,8 @@ export default class LicenseExpiredPage extends PageComponent {
2143 }
2244
2345 render ( ) {
46+ const enabledFeaturesText = formatEnabledFeatures ( api . enterpriseFeaturesUsed ) ;
47+
2448 return (
2549 < Flex align = "center" justify = "center" p = { 4 } >
2650 < Box bg = "white" height = "100vh" left = { 0 } opacity = { 0.5 } position = "fixed" top = { 0 } width = "100vw" zIndex = { 1000 } />
@@ -35,7 +59,9 @@ export default class LicenseExpiredPage extends PageComponent {
3559
3660 { /* Subtext */ }
3761 < Text fontSize = "lg" >
38- You were using Console RBAC/SSO and your trial license has expired. To continue using them, you will need
62+ { enabledFeaturesText
63+ ? `You were using ${ enabledFeaturesText } and your license has expired. To continue using these features, you will need`
64+ : 'Your license has expired. To continue using enterprise features, you will need' } { ' ' }
3965 an{ ' ' }
4066 < Link href = "https://redpanda.com/upgrade" rel = "noopener noreferrer" target = "_blank" >
4167 Enterprise license
0 commit comments