1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-31 13:47:02 +02:00

feat: outdated SDKs UI (#6391)

This commit is contained in:
Mateusz Kwasniewski 2024-02-29 15:48:44 +01:00 committed by GitHub
parent bddc508582
commit 677beb190a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 25 additions and 12 deletions

View File

@ -292,14 +292,16 @@ export const ApplicationChart = ({ data }: IApplicationChartProps) => {
<tr> <tr>
<StyledCell>Last seen:</StyledCell> <StyledCell>Last seen:</StyledCell>
<StyledCell> <StyledCell>
<TimeAgo {environment.lastSeen && (
minPeriod={60} <TimeAgo
date={ minPeriod={60}
new Date( date={
environment.lastSeen, new Date(
) environment.lastSeen,
} )
/> }
/>
)}
</StyledCell> </StyledCell>
</tr> </tr>
</tbody> </tbody>

View File

@ -13,6 +13,10 @@ test('Display all application issues', async () => {
type: 'missingStrategies', type: 'missingStrategies',
items: ['defaultStrategy', 'mainStrategy'], items: ['defaultStrategy', 'mainStrategy'],
}, },
{
type: 'outdatedSdks',
items: ['unleash-client-php:1.13.0'],
},
]; ];
render(<ApplicationIssues issues={issues} />); render(<ApplicationIssues issues={issues} />);
@ -24,4 +28,6 @@ test('Display all application issues', async () => {
await screen.findByText( await screen.findByText(
`We detected 2 strategy types defined in the SDK that do not exist in Unleash`, `We detected 2 strategy types defined in the SDK that do not exist in Unleash`,
); );
await screen.findByText(`We detected the following outdated SDKs`);
await screen.findByText(`unleash-client-php:1.13.0`);
}); });

View File

@ -87,6 +87,10 @@ const resolveIssueText = (issue: ApplicationOverviewIssuesSchema) => {
const issueCount = issue.items.length; const issueCount = issue.items.length;
let issueText = ''; let issueText = '';
if (issue.type === 'outdatedSdks') {
return 'We detected the following outdated SDKs';
}
switch (issue.type) { switch (issue.type) {
case 'missingFeatures': case 'missingFeatures':
issueText = `feature flag${issueCount !== 1 ? 's' : ''}`; issueText = `feature flag${issueCount !== 1 ? 's' : ''}`;
@ -111,8 +115,8 @@ export const ApplicationIssues = ({ issues }: IApplicationIssuesProps) => {
<WarningHeader> <WarningHeader>
<WarningAmberRounded /> <WarningAmberRounded />
<WarningHeaderText> <WarningHeaderText>
We detected {issues.length} issues in this We detected {issues.length} issue
application {issues.length !== 1 ? 's' : ''} in this application
</WarningHeaderText> </WarningHeaderText>
</WarningHeader> </WarningHeader>
<IssueContainer> <IssueContainer>

View File

@ -11,7 +11,7 @@ export interface ApplicationOverviewEnvironmentSchema {
/** The number of instances of the application environment */ /** The number of instances of the application environment */
instanceCount: number; instanceCount: number;
/** The last time the application environment was seen */ /** The last time the application environment was seen */
lastSeen: string; lastSeen: string | null;
/** Name of the application environment */ /** Name of the application environment */
name: string; name: string;
/** SDKs used in the application environment */ /** SDKs used in the application environment */

View File

@ -14,4 +14,5 @@ export type ApplicationOverviewIssuesSchemaType =
export const ApplicationOverviewIssuesSchemaType = { export const ApplicationOverviewIssuesSchemaType = {
missingFeatures: 'missingFeatures', missingFeatures: 'missingFeatures',
missingStrategies: 'missingStrategies', missingStrategies: 'missingStrategies',
outdatedSdks: 'outdatedSdks',
} as const; } as const;

View File

@ -11,7 +11,7 @@ const config: SDKConfig = {
'unleash-client-python': '5.9.2', 'unleash-client-python': '5.9.2',
'unleash-client-ruby': '5.0.0', 'unleash-client-ruby': '5.0.0',
'unleash-client-dotnet': '4.1.3', 'unleash-client-dotnet': '4.1.3',
'unleash-client-php': '1.13.1', 'unleash-client-php': '1.13.0',
}; };
export function findOutdatedSDKs(sdkVersions: string[]): string[] { export function findOutdatedSDKs(sdkVersions: string[]): string[] {