diff --git a/ngui/ui/src/components/RecommendationLink/RecommendationLink.js b/ngui/ui/src/components/RecommendationLink/RecommendationLink.js index 08ace136a..4541a8359 100644 --- a/ngui/ui/src/components/RecommendationLink/RecommendationLink.js +++ b/ngui/ui/src/components/RecommendationLink/RecommendationLink.js @@ -7,10 +7,28 @@ import { CATEGORY_CRITICAL, CATEGORY_SECURITY } from "containers/RecommendationsOverviewContainer/recommendations/BaseRecommendation"; +import { + ALIBABA_EBS, + ALIBABA_ECS, + ALIBABA_ECS_VPC, + ALL_SERVICES, + ALIBABA_RDS, + AWS_IAM, + AWS_EC2, + AWS_EC2_EBS, + AWS_EC2_VPC, + AWS_RDS, + AWS_KINESIS, + AWS_S3, + AZURE_COMPUTE, + AZURE_NETWORK, + GCP_COMPUTE_ENGINE, + NEBIUS_SERVICE +} from "hooks/useRecommendationServices"; import { getRecommendationsUrl } from "urls"; -const RecommendationLink = ({ category, children, dataTestId }) => ( - +const RecommendationLink = ({ category, service, children, dataTestId }) => ( + {children} ); @@ -18,6 +36,24 @@ const RecommendationLink = ({ category, children, dataTestId }) => ( RecommendationLink.propTypes = { children: PropTypes.node.isRequired, category: PropTypes.oneOf([CATEGORY_COST, CATEGORY_SECURITY, CATEGORY_CRITICAL]), + service: PropTypes.oneOf([ + ALL_SERVICES, + ALIBABA_ECS, + ALIBABA_ECS_VPC, + ALIBABA_EBS, + ALIBABA_RDS, + AWS_IAM, + AWS_EC2, + AWS_EC2_EBS, + AWS_EC2_VPC, + AWS_RDS, + AWS_KINESIS, + AWS_S3, + AZURE_COMPUTE, + AZURE_NETWORK, + GCP_COMPUTE_ENGINE, + NEBIUS_SERVICE + ]), dataTestId: PropTypes.string }; diff --git a/ngui/ui/src/components/RecommendationsCard/RecommendationsCard.js b/ngui/ui/src/components/RecommendationsCard/RecommendationsCard.js index c6cf588bc..6de6bac4f 100644 --- a/ngui/ui/src/components/RecommendationsCard/RecommendationsCard.js +++ b/ngui/ui/src/components/RecommendationsCard/RecommendationsCard.js @@ -15,6 +15,7 @@ import { CATEGORY_CRITICAL, CATEGORY_SECURITY } from "containers/RecommendationsOverviewContainer/recommendations/BaseRecommendation"; +import { ALL_SERVICES } from "hooks/useRecommendationServices"; import { RECOMMENDATIONS, RECOMMENDATION_CATEGORY_QUERY_PARAMETER, RECOMMENDATION_SERVICE_QUERY_PARAMETER } from "urls"; import { SPACING_2 } from "utils/layouts"; import { InfoCard, PossibleSavingsCard } from "./Components"; @@ -72,7 +73,11 @@ const RecommendationsCard = ({ + } @@ -88,7 +93,11 @@ const RecommendationsCard = ({ + } @@ -104,7 +113,11 @@ const RecommendationsCard = ({ + } diff --git a/ngui/ui/src/urls.js b/ngui/ui/src/urls.js index fbbc02ea4..0d5240ee6 100644 --- a/ngui/ui/src/urls.js +++ b/ngui/ui/src/urls.js @@ -288,10 +288,11 @@ export const RECOMMENDATION_CATEGORY_QUERY_PARAMETER = "category"; export const RECOMMENDATION_SERVICE_QUERY_PARAMETER = "service"; export const RECOMMENDATION_VIEW_QUERY_PARAMETER = "view"; -export const getRecommendationsUrl = ({ category } = {}) => { +export const getRecommendationsUrl = ({ category, service } = {}) => { const categoryParameter = category ? `${RECOMMENDATION_CATEGORY_QUERY_PARAMETER}=${category}` : ""; + const serviceParameter = service ? `${RECOMMENDATION_SERVICE_QUERY_PARAMETER}=${service}` : ""; - return buildQueryParameters(RECOMMENDATIONS, [categoryParameter]); + return buildQueryParameters(RECOMMENDATIONS, [categoryParameter, serviceParameter]); }; // Recommendation archive