From c598261db4197839a59d900297e0de7f2f550321 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Tue, 20 Sep 2022 14:35:30 -0400 Subject: [PATCH 1/3] [CLDN-1676] Added ability to search for the IPv4 rendered value of an IP address instead of the raw value --- .../src/plugin/transformProps.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/plugin/transformProps.ts b/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/plugin/transformProps.ts index c60886f651b39..d981c6ce17641 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/plugin/transformProps.ts +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/plugin/transformProps.ts @@ -171,6 +171,20 @@ export default function transformProps(chartProps: CccsGridChartProps) { JSON: 'jsonValueRenderer', }; + const formatIpV4 = (v: any) => { + 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, @@ -210,6 +224,7 @@ export default function transformProps(chartProps: CccsGridChartProps) { sort: sortDirection, sortIndex, enableRowGroup, + getQuickFilterText: (params: any) => advancedTypeValueFormatter(params), }; }); } else { @@ -234,6 +249,8 @@ export default function transformProps(chartProps: CccsGridChartProps) { cellRenderer, sortable: isSortable, enableRowGroup, + getQuickFilterText: (params: any) => + advancedTypeValueFormatter(params), }; }); columnDefs = columnDefs.concat(groupByColumnDefs); From 473ea5a69aa3a760856a9db8595ea9101190f298 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Wed, 21 Sep 2022 06:58:14 -0400 Subject: [PATCH 2/3] [CLDN-1676] Temp update to img for deploying to UDev --- cccs-build/superset/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index 3a48344597cf6..ad8c91e643ef6 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -1,7 +1,7 @@ # Vault CA container import ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22315d60 FROM $VAULT_CA_CONTAINER AS vault_ca -FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220916135810_b4887 +FROM uchimera.azurecr.io/cccs/superset-base:feature_CLDN-1676_20220920183611_b4915 USER root From 13bc9db0467682acb825f54d0b6e92e44b749e00 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Wed, 21 Sep 2022 07:01:21 -0400 Subject: [PATCH 3/3] [CLDN-1676] Undo temp update to img for deploying to UDev --- cccs-build/superset/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index ad8c91e643ef6..3a48344597cf6 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -1,7 +1,7 @@ # Vault CA container import ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22315d60 FROM $VAULT_CA_CONTAINER AS vault_ca -FROM uchimera.azurecr.io/cccs/superset-base:feature_CLDN-1676_20220920183611_b4915 +FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220916135810_b4887 USER root