Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitef80b4f

Browse files
committed
frontend changes
1 parentb3da98f commitef80b4f

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

‎site/src/modules/dashboard/LicenseBanner/LicenseBannerView.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
useTheme,
77
}from"@emotion/react";
88
importLinkfrom"@mui/material/Link";
9+
import{LicenseTelemetryRequiredErrorText}from"api/typesGenerated";
910
import{Expander}from"components/Expander/Expander";
1011
import{Pill}from"components/Pill/Pill";
1112
import{typeFC,useState}from"react";
@@ -14,6 +15,7 @@ export const Language = {
1415
licenseIssue:"License Issue",
1516
licenseIssues:(num:number):string=>`${num} License Issues`,
1617
upgrade:"Contact sales@coder.com.",
18+
exception:"Contact sales@coder.com if you need an exception.",
1719
exceeded:"It looks like you've exceeded some limits of your license.",
1820
lessDetails:"Less",
1921
moreDetails:"More",
@@ -26,6 +28,14 @@ const styles = {
2628
},
2729
}satisfiesRecord<string,Interpolation<Theme>>;
2830

31+
constformatMessage=(message:string)=>{
32+
// If the message ends with an alphanumeric character, add a period.
33+
if(/[a-z0-9]$/i.test(message)){
34+
return`${message}.`;
35+
}
36+
returnmessage;
37+
};
38+
2939
exportinterfaceLicenseBannerViewProps{
3040
errors:readonlystring[];
3141
warnings:readonlystring[];
@@ -57,14 +67,16 @@ export const LicenseBannerView: FC<LicenseBannerViewProps> = ({
5767
<divcss={containerStyles}>
5868
<Pilltype={type}>{Language.licenseIssue}</Pill>
5969
<divcss={styles.leftContent}>
60-
<span>{messages[0]}</span>
70+
<span>{formatMessage(messages[0])}</span>
6171
&nbsp;
6272
<Link
6373
color={textColor}
6474
fontWeight="medium"
6575
href="mailto:sales@coder.com"
6676
>
67-
{Language.upgrade}
77+
{messages[0]===LicenseTelemetryRequiredErrorText
78+
?Language.exception
79+
:Language.upgrade}
6880
</Link>
6981
</div>
7082
</div>
@@ -90,7 +102,7 @@ export const LicenseBannerView: FC<LicenseBannerViewProps> = ({
90102
<ulcss={{padding:8,margin:0}}>
91103
{messages.map((message)=>(
92104
<licss={{margin:4}}key={message}>
93-
{message}
105+
{formatMessage(message)}
94106
</li>
95107
))}
96108
</ul>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp