diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiChanges.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiChanges.jsx index 376484fc65..b240d907af 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiChanges.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiChanges.jsx @@ -146,7 +146,6 @@ function ApiChanges() { setShowDetails={setShowDetails} apiDetail={apiDetail} headers={tableHeaders} - getStatus={() => { return "warning" }} /> ) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiDetails.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiDetails.jsx index 4f643d6c23..8949d233f6 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiDetails.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiDetails.jsx @@ -13,6 +13,7 @@ import transform from "../transform"; import ApiDependency from "./ApiDependency"; import RunTest from "./RunTest"; import PersistStore from "../../../../main/PersistStore"; +import values from "@/util/values"; import { HorizontalDotsMinor, FileMinor } from "@shopify/polaris-icons" @@ -30,6 +31,18 @@ function ApiDetails(props) { const [showMoreActions, setShowMoreActions] = useState(false) const setSelectedSampleApi = PersistStore(state => state.setSelectedSampleApi) + const statusFunc = getStatus ? getStatus : (x) => { + try { + if (paramList && paramList.length > 0 && + paramList.filter(x => x?.nonSensitiveDataType).map(x => x.subTypeString).includes(x)) { + return "info" + } + } catch (e) { + + } + return "warning" + } + const fetchData = async () => { if (showDetails) { setLoading(true) @@ -77,8 +90,16 @@ function ApiDetails(props) { resp.data.params[index].subType = JSON.parse(JSON.stringify(resp.data.params[index].subType)) } } - }) + + try { + resp.data.params?.forEach(x => { + if (!values?.skipList.includes(x.subTypeString) && !x?.savedAsSensitive && !x?.sensitive) { + x.nonSensitiveDataType = true + } + }) + } catch (e){ + } setParamList(resp.data.params) }) }) @@ -190,6 +211,17 @@ function ApiDetails(props) { method: apiDetail.method, endpoint: apiDetail.endpoint } + + try { + newData['nonSensitiveTags'] = [...new Set(paramList.filter(x => x?.nonSensitiveDataType).map(x => x.subTypeString))] + } catch (e){ + } + try { + newData['sensitiveTags'] = apiDetail?.sensitiveTags && apiDetail?.sensitiveTags.length > 0 ? apiDetail?.sensitiveTags : + [...new Set(paramList.filter(x => x?.savedAsSensitive || x?.sensitive).map(x => x.subTypeString))] + } catch (e){ + } + const headingComp = (
@@ -197,7 +229,7 @@ function ApiDetails(props) { width="32vw" data={newData} headers={headers} - getStatus={getStatus} + getStatus={statusFunc} isBadgeClickable={true} badgeClicked={badgeClicked} /> diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiEndpoints.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiEndpoints.jsx index 38eee5a1ce..deb2912e86 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiEndpoints.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiEndpoints.jsx @@ -407,7 +407,7 @@ function ApiEndpoints(props) { }) } - + function handleRefresh() { fetchData() @@ -860,7 +860,6 @@ function ApiEndpoints(props) { setShowDetails={setShowDetails} apiDetail={apiDetail} headers={transform.getDetailsHeaders()} - getStatus={() => { return "warning" }} isGptActive={isGptActive} />, ] @@ -899,7 +898,6 @@ function ApiEndpoints(props) { setShowDetails={setShowDetails} apiDetail={apiDetail} headers={transform.getDetailsHeaders()} - getStatus={() => { return "warning" }} isGptActive={isGptActive} />, { let paramText = element.param.replaceAll("#", ".").replaceAll(".$", "") let isSensitive = func.isSubTypeSensitive(element) + let nonSensitiveDataType = element?.nonSensitiveDataType let comp = [( {paramText} @@ -28,7 +29,13 @@ function prepareTableData (data, handleBadgeClick) { {element.subType.name} - : null + : (nonSensitiveDataType ? + : null) + } ), {func.prepareValuesTooltip(element)} ] diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/transform.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/transform.js index ad1e3ba2a1..5fca9eefa3 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/transform.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/transform.js @@ -112,6 +112,11 @@ const apiDetailsHeaders = [ value: "parameterisedEndpoint", itemOrder: 1, component: (data) => CopyEndpoint(data) + }, + { + text: 'Non-Sensitive Params', + value: 'nonSensitiveTags', + itemOrder: 4, } ] diff --git a/apps/dashboard/web/polaris_web/web/src/util/values.js b/apps/dashboard/web/polaris_web/web/src/util/values.js index 07f8761798..fbd204e7a2 100644 --- a/apps/dashboard/web/polaris_web/web/src/util/values.js +++ b/apps/dashboard/web/polaris_web/web/src/util/values.js @@ -71,4 +71,6 @@ const ranges = [ } ]; -export default { today, yesterday, ranges, yesterdayDayEnd, todayDayEnd }; \ No newline at end of file +const skipList = ["GENERIC", "TRUE", "FALSE","INTEGER_32", "INTEGER_64", "NULL", "OTHER", "DICT", "FLOAT"] + +export default { today, yesterday, ranges, yesterdayDayEnd, todayDayEnd , skipList}; \ No newline at end of file