Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cldn 1676 #210

Merged
merged 4 commits into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ export default function transformProps(chartProps: CccsGridChartProps) {
JSON: 'jsonValueRenderer',
};

const formatIpV4 = (v: any) => {
cccs-Dustin marked this conversation as resolved.
Show resolved Hide resolved
const converted = `${(v >> 24) & 0xff}.${(v >> 16) & 0xff}.${
(v >> 8) & 0xff
}.${v & 0xff}`;
return converted;
};

const advancedTypeValueFormatter = (params: any) => {
if (params.colDef.cellRenderer === 'ipv4ValueRenderer') {
return formatIpV4(params.value.toString());
}
return params.value.toString();
};

const percentMetricValueFormatter = function (params: ValueFormatterParams) {
return getNumberFormatter(NumberFormats.PERCENT_3_POINT).format(
params.value,
Expand Down Expand Up @@ -221,6 +235,7 @@ export default function transformProps(chartProps: CccsGridChartProps) {
sort: sortDirection,
sortIndex,
enableRowGroup,
getQuickFilterText: (params: any) => advancedTypeValueFormatter(params),
headerTooltip: columnDescription,
};
});
Expand All @@ -247,6 +262,8 @@ export default function transformProps(chartProps: CccsGridChartProps) {
cellRenderer,
sortable: isSortable,
enableRowGroup,
getQuickFilterText: (params: any) =>
advancedTypeValueFormatter(params),
headerTooltip: columnDescription,
};
});
Expand Down