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

updates(notification): add credential approval, credential reject and subscription url msgs #175

Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions src/assets/locales/de/notification.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@
"title": "Assigned User Roles Updated - {{app}}",
"content": "Hallo {{username}}, \n\nIhre App-Benutzerrollen wurden von Ihrem Unternehmensadministrator aktualisiert. Mit dem Wechsel der Rolle ändern sich Ihre Zugriffsrechte. Weitere Einzelheiten zu den Rollenänderungen finden sie anbei. \n\nHinzugefügte Rollen: {{addedRoles}} \n\nEntfernte Rollen: {{removedRoles}}"
},
"CREDENTIAL_APPROVAL": {
"title": "Verified Credential {{credentialType}} angelegt",
"content": "Verified Credential {{credentialType}} wurde ihrem Company Wallet hinzugefügt."
},
"CREDENTIAL_REJECTED": {
"title": "Verified Credential {{credentialType}} abgelehnt",
"content": "Verified Credential {{credentialType}} wurde abgelehnt. Sie können jederzeit die Anfrage wiederholen."
},
"SUBSCRIPTION_URL_UPDATE": {
"title": "App URL {{app}} updated",
"content": "Der App Provider hat die hinterlegte App Instance URL für ihre abonnierte App {{app}} geändert.\n\nNeue URL: {{newUrl}}"
},
"link": {
"appmarketplace": "Zum App Marketplace",
"technicalsetup": "Zur Connector Registrierung",
Expand Down
12 changes: 12 additions & 0 deletions src/assets/locales/en/notification.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@
"title": "Assigned User Roles Updated - {{app}}",
"content": "Hallo {{username}}, \n\nyour app user roles got updated by your company administrator. With the change of the role assignment your access rights have changed. You can find all details regarding the role change below. \n\nNew Roles: {{addedRoles}} \n\nRemoved Roles: {{removedRoles}}"
},
"CREDENTIAL_APPROVAL": {
"title": "Verified Credential {{credentialType}} assigned",
"content": "Verified Credential {{credentialType}} got assigned to your company wallet."
},
"CREDENTIAL_REJECTED": {
"title": "Verified Credential {{credentialType}} declined",
"content": "Verified Credential {{credentialType}} got declined. You can start a new request immediately."
},
"SUBSCRIPTION_URL_UPDATE": {
"title": "App URL {{app}} updated",
"content": "The app provider has changed the stored App Instance URL for your subscribed app {{app}}.\n\nNew URL: {{newUrl}}"
},
"link": {
"appmarketplace": "Go to app marketplace",
"technicalsetup": "Go to connector configuration",
Expand Down
13 changes: 12 additions & 1 deletion src/components/pages/NotificationCenter/NotificationItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ const NotificationContent = ({
const userId = item.contentParsed?.userId
const appId = item.contentParsed?.appId
const you = UserService.getName()
const appName = item.contentParsed?.AppName
const appName = item.contentParsed?.AppName ?? item.contentParsed?.appName
const companyName = item.contentParsed?.RequestorCompanyName
const offerName = item.contentParsed?.OfferName
const userName = item.contentParsed?.username
const coreOfferName = item.contentParsed?.coreOfferName
const removedRoles = item.contentParsed?.removedRoles
const addedRoles = item.contentParsed?.addedRoles
const credentialType = item.contentParsed?.type
const newUrl = item.contentParsed?.newUrl

return (
<>
Expand All @@ -104,6 +106,8 @@ const NotificationContent = ({
coreOfferName: coreOfferName,
removedRoles: removedRoles ? removedRoles : '-',
addedRoles: addedRoles ? addedRoles : '-',
credentialType: credentialType,
newUrl: newUrl,
}}
>
<NameLink
Expand Down Expand Up @@ -197,6 +201,12 @@ const NotificationConfig = ({ item }: { item: CXNotificationContent }) => {
return <NotificationContent item={item} />
case NotificationType.ROLE_UPDATE_CORE_OFFER:
return <NotificationContent item={item} navlinks={[PAGES.ROLE_DETAILS]} />
case NotificationType.CREDENTIAL_APPROVAL:
return <NotificationContent item={item} />
case NotificationType.CREDENTIAL_REJECTED:
return <NotificationContent item={item} />
case NotificationType.SUBSCRIPTION_URL_UPDATE:
return <NotificationContent item={item} />
default:
return <pre>{JSON.stringify(item, null, 2)}</pre>
}
Expand Down Expand Up @@ -317,6 +327,7 @@ export default function NotificationItem({
{t(`${item.typeId}.title`, {
app: item.contentParsed?.AppName ?? item.contentParsed?.appName,
offer: item.contentParsed?.OfferName,
credentialType: item.contentParsed?.type,
})}
</Typography>
{open && (
Expand Down
5 changes: 5 additions & 0 deletions src/features/notification/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export enum NotificationType {
SERVICE_RELEASE_REQUEST = 'SERVICE_RELEASE_REQUEST',
ROLE_UPDATE_APP_OFFER = 'ROLE_UPDATE_APP_OFFER',
ROLE_UPDATE_CORE_OFFER = 'ROLE_UPDATE_CORE_OFFER',
CREDENTIAL_REJECTED = 'CREDENTIAL_REJECTED',
CREDENTIAL_APPROVAL = 'CREDENTIAL_APPROVAL',
SUBSCRIPTION_URL_UPDATE = 'SUBSCRIPTION_URL_UPDATE',
}

export interface NotificationContent {
Expand All @@ -110,6 +113,8 @@ export interface NotificationContent {
appName?: string
removedRoles?: string
addedRoles?: string
type?: string | number
newUrl?: string
}

export interface CXNotificationContent {
Expand Down