aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/userNotifications
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/userNotifications')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotifications.jsx21
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotificationsConstants.js5
2 files changed, 21 insertions, 5 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotifications.jsx b/openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotifications.jsx
index 635dfa701f..fd5c04db92 100644
--- a/openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotifications.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotifications.jsx
@@ -54,7 +54,10 @@ const Notification = ({notification, users, onActionClicked, getNotificationType
</div>
<div className='notification-action'>
<div className={classnames('action-button', {'hidden': read})} onClick={() => onActionClicked(notification)}>
- {eventType === notificationType.PERMISSION_CHANGED ? i18n('OK') : i18n('Sync')}
+ {eventType === notificationType.PERMISSION_CHANGED
+ || eventType === notificationType.ITEM_DELETED
+ || eventType === notificationType.ITEM_ARCHIVED
+ || eventType === notificationType.ITEM_RESTORED ? i18n('OK') : i18n('Sync')}
</div>
</div>
</div>
@@ -64,11 +67,18 @@ const Notification = ({notification, users, onActionClicked, getNotificationType
function getNotificationTypeDesc(eventType, permission, granted) {
switch (eventType) {
case notificationType.PERMISSION_CHANGED:
- return i18n('Permission {granted}: {permission}', {granted: granted ? 'Granted' : 'Taken', permission: permission});
+ const grantedStr = granted ? i18n('Granted') : i18n('Taken');
+ return `${i18n('Permission')} ${grantedStr}: ${permission}`;
case notificationType.ITEM_CHANGED.COMMIT:
return i18n('Your Copy Is Out Of Sync');
case notificationType.ITEM_CHANGED.SUBMIT:
return i18n('Version Submitted');
+ case notificationType.ITEM_DELETED:
+ return i18n('Item was deleted');
+ case notificationType.ITEM_ARCHIVED:
+ return i18n('Item was archived');
+ case notificationType.ITEM_RESTORED:
+ return i18n('Item was restored from archive');
}
}
@@ -106,8 +116,11 @@ class UserNotifications extends React.Component {
onActionClicked(notification) {
const {onSync, updateNotification, currentScreen, onLoadItemsLists} = this.props;
- const {eventType, eventAttributes: {itemId, itemName, versionId, versionName}} = notification;
- if(eventType !== notificationType.PERMISSION_CHANGED) {
+ const {eventType, eventAttributes: {itemId, itemName, versionId, versionName}} = notification;
+ if(eventType !== notificationType.PERMISSION_CHANGED &&
+ eventType !== notificationType.ITEM_DELETED &&
+ eventType !== notificationType.ITEM_ARCHIVED &&
+ eventType !== notificationType.ITEM_RESTORED) {
onSync({itemId, itemName, versionId, versionName, currentScreen});
}
else {
diff --git a/openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotificationsConstants.js b/openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotificationsConstants.js
index f006b5ae1b..a8e92e29fd 100644
--- a/openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotificationsConstants.js
+++ b/openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotificationsConstants.js
@@ -15,5 +15,8 @@ export const notificationType = keyMirror({
ITEM_CHANGED: {
COMMIT: 'commit',
SUBMIT: 'submit'
- }
+ },
+ ITEM_DELETED: 'delete',
+ ITEM_ARCHIVED: 'archive',
+ ITEM_RESTORED: 'restore'
}); \ No newline at end of file