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

fix(subscription management): updates on search place holder & offer filter buttons #1111

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locales/de/servicerelease.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locales/en/servicerelease.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
28 changes: 19 additions & 9 deletions src/components/shared/templates/Subscription/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<HTMLInputElement>) => {
let status = ''
if (e.currentTarget.value === FilterType.REQUEST) {
Expand Down
Loading