From f8f2c1d771fa97698217534be3d742d3e6e77b97 Mon Sep 17 00:00:00 2001 From: manojava-gk Date: Fri, 13 Sep 2024 14:13:28 +0530 Subject: [PATCH] fix(subscription management): update search placeholder text. show only available offer names at the top --- CHANGELOG.md | 3 ++ src/assets/locales/de/main.json | 2 +- src/assets/locales/de/servicerelease.json | 2 +- src/assets/locales/en/main.json | 2 +- src/assets/locales/en/servicerelease.json | 2 +- .../shared/templates/Subscription/index.tsx | 28 +++++++++++++------ 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b3a0efb7..1579984db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ - Display technicalUserManagement button based on role validation [#1073](https://github.com/eclipse-tractusx/portal-frontend/pull/1073) - **OSP Consent form** - Display invited company name in OSP consent form (Previously hard coded with 'BMW') [#1083](https://github.com/eclipse-tractusx/portal-frontend/pull/1083) +- **App & Service Subcription Managemnt** + - Search place holder text updated + - Show only available offer names at the top ## 2.2.0 diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index 519096281..8fa9b9bdb 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -1471,7 +1471,7 @@ "description": "Do you wan't to rather use the autosetup; connect your service to automate marketplace subscription build", "readMore": "Read More", "registerURL": "RegisterURL", - "search": "...search by entering the app name here.", + "search": "...search by entering the company name here.", "noDataMessage": "No data available", "subscriptionHeading": ">> there are already active subscriptions for the service {serviceName}", "subscribeSuccessMsg": "Subscribed Successfully", diff --git a/src/assets/locales/de/servicerelease.json b/src/assets/locales/de/servicerelease.json index e7810fd66..c50d7a8b1 100644 --- a/src/assets/locales/de/servicerelease.json +++ b/src/assets/locales/de/servicerelease.json @@ -152,7 +152,7 @@ "description": "Do you wan't to rather use the autosetup; connect your service to automate marketplace subscription build", "readMore": "Read More", "registerURL": "RegisterURL", - "search": "...search by entering the service name here.", + "search": "...search by entering the company name here.", "noDataMessage": "No data available", "subscriptionHeading": ">> there are already active subscriptions for the service {serviceName}", "subscribeSuccessMsg": "Subscribed Successfully", diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index d259d062b..e98c58faf 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -1439,7 +1439,7 @@ "description": "Do you wan't to rather use the autosetup; connect your service to automate marketplace subscription build", "readMore": "Read More", "registerURL": "RegisterURL", - "search": "...search by entering the app name here.", + "search": "...search by entering the company name here.", "noDataMessage": "No data available", "subscriptionHeading": ">> there are already active subscriptions for the service {serviceName}", "subscribeSuccessMsg": "Subscribed Successfully", diff --git a/src/assets/locales/en/servicerelease.json b/src/assets/locales/en/servicerelease.json index cbd9b1577..d7321a7bc 100644 --- a/src/assets/locales/en/servicerelease.json +++ b/src/assets/locales/en/servicerelease.json @@ -152,7 +152,7 @@ "description": "Do you wan't to rather use the autosetup; connect your service to automate marketplace subscription build", "readMore": "Read More", "registerURL": "RegisterURL", - "search": "...search by entering the service name here.", + "search": "...search by entering the company name here.", "noDataMessage": "No data available", "subscriptionHeading": ">> there are already active subscriptions for the service {serviceName}", "subscribeSuccessMsg": "Subscribed Successfully", diff --git a/src/components/shared/templates/Subscription/index.tsx b/src/components/shared/templates/Subscription/index.tsx index 10b617e77..29380105b 100644 --- a/src/components/shared/templates/Subscription/index.tsx +++ b/src/components/shared/templates/Subscription/index.tsx @@ -304,15 +304,6 @@ export default function Subscription({ appFiltersData = data?.content } - useEffect(() => { - if (appFiltersData?.length) { - setState({ - type: ActionKind.SET_APP_FILTERS, - payload: appFiltersData, - }) - } - }, [appFiltersData, type]) - const { data, refetch, @@ -331,6 +322,25 @@ export default function Subscription({ } }, [data]) + useEffect(() => { + if (data?.content && appFiltersData) { + const fillers: AppFiltersResponse[] = [] + appFiltersData.forEach((item) => { + data.content.forEach((base: { offerId: string }) => { + if (base.offerId === item.id) { + fillers.push(item) + } + }) + }) + if (fillers?.length) { + setState({ + type: ActionKind.SET_APP_FILTERS, + payload: fillers, + }) + } + } + }, [appFiltersData, data]) + const setView = (e: React.MouseEvent) => { let status = '' if (e.currentTarget.value === FilterType.REQUEST) {