Skip to content

Commit

Permalink
Replaced updateDescription and added sorting to the versions
Browse files Browse the repository at this point in the history
  • Loading branch information
doracretu3pillar committed Nov 29, 2024
1 parent 89e4fdd commit 13eac7d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const Messages = {
titleOneUpdate: 'New update available',
titleMultipleUpdates: 'New updates available',
howToUpdate: 'How to update',
howToUpdateDescription:
"We are inaugurating a new process for updating PMM. It's a new interface with an improved user experience and is ready for the future of PMM. Click on Go to Updates Page to find out more.",
newVersions: 'New Versions',
readMore: 'Read more',
fullReleaseNotes: 'Full release notes here',
goToUpdatesPage: 'Go to updates page',
snooze: 'Dismiss',
readyForAnUpdate: 'Ready for an upgrade?',
updateDescription:
"We've streamlined our update process with a new, user-friendly interface. One click gets you all the latest improvements.",
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ export const getStyles = ({ v1: { spacing, colors, typography } }: GrafanaTheme2
color: ${colors.textBlue};
},
`,
readyForUpdate: css`
margin-top: 10px;
`,
});
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ const PerconaUpdateVersion = () => {
{Messages.fullReleaseNotes}
</a>
</p>
<h5>{Messages.howToUpdate}</h5>
<p>{Messages.howToUpdateDescription}</p>
<h5 className={styles.readyForUpdate}>{Messages.readyForAnUpdate}</h5>
<span>{Messages.updateDescription}</span>
<div className={styles.updateButtons}>
<Button type="button" variant="secondary" onClick={snoozeUpdate} className={styles.snoozeButton}>
{Messages.snooze}
Expand Down Expand Up @@ -97,8 +97,8 @@ const PerconaUpdateVersion = () => {
</li>
))}
</ul>
<h5 className={styles.howToUpdate}>{Messages.howToUpdate}</h5>
<p>{Messages.howToUpdateDescription}</p>
<h5 className={styles.readyForUpdate}>{Messages.readyForAnUpdate}</h5>
<span>{Messages.updateDescription}</span>
<div className={styles.updateButtons}>
<Button type="button" variant="secondary" onClick={snoozeUpdate} className={styles.snoozeButton}>
{Messages.snooze}
Expand Down
16 changes: 9 additions & 7 deletions public/app/percona/shared/core/reducers/updates/updates.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ export const responseToPayload = (response: CheckUpdatesResponse): CheckUpdatesP
});

export const mapUpdatesChangeLogs = (response: CheckUpdatesChangeLogsResponse): CheckUpdatesChangeLogs => {
const responseMapping = response.updates.map((item) => ({
version: item.version,
tag: item.tag,
timestamp: item.timestamp,
releaseNotesUrl: item.release_notes_url,
releaseNotesText: item.release_notes_text,
}));
const responseMapping = response.updates
.map((item) => ({
version: item.version,
tag: item.tag,
timestamp: item.timestamp,
releaseNotesUrl: item.release_notes_url,
releaseNotesText: item.release_notes_text,
}))
.sort((firstItem, nextItem) => nextItem.version.localeCompare(firstItem.version, undefined, { numeric: true }));
return {
lastCheck: response.last_check,
updates: responseMapping,
Expand Down

0 comments on commit 13eac7d

Please sign in to comment.