Skip to content

Commit 66fd8a6

Browse files
committed
feat: add common tooltip content constant & sorting by version in chart selector
1 parent b447d1b commit 66fd8a6

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Common/Helper.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { deepEquals } from '@rjsf/utils'
2626
import { ERROR_EMPTY_SCREEN, SortingOrder, EXCLUDED_FALSY_VALUES, DISCORD_LINK, ZERO_TIME_STRING, TOAST_ACCESS_DENIED } from './Constants'
2727
import { ServerErrors } from './ServerError'
2828
import { AsyncOptions, AsyncState, UseSearchString } from './Types'
29-
import { scrollableInterface, DATE_TIME_FORMAT_STRING, ToastManager, ToastVariantType } from '../Shared'
29+
import { scrollableInterface, DATE_TIME_FORMAT_STRING, ToastManager, ToastVariantType, versionComparatorBySortOrder } from '../Shared'
3030
import { ReactComponent as ArrowDown } from '../Assets/Icon/ic-chevron-down.svg'
3131

3232
export function showError(serverError, showToastOnUnknownError = true, hideAccessError = false) {
@@ -621,6 +621,7 @@ export const getFilteredChartVersions = (charts, selectedChartType) =>
621621
// Filter chart versions based on selected chart type
622622
charts
623623
.filter((item) => item?.chartType === selectedChartType.value)
624+
.sort((a, b) => versionComparatorBySortOrder(a?.chartVersion, b?.chartVersion))
624625
.map((item) => ({
625626
value: item?.chartVersion,
626627
label: item?.chartVersion,

src/Common/Tooltip/constants.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const TOOLTIP_CONTENTS = {
2+
INVALID_INPUT: 'Valid input is required for all mandatory fields.',
3+
}

src/Common/Tooltip/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { default as Tooltip } from './Tooltip'
2+
export { TOOLTIP_CONTENTS } from './constants'

0 commit comments

Comments
 (0)