summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/userNotifications
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-03-19 12:15:19 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-03-20 07:51:05 +0000
commit091edfdac90f66d91caff1b93131f99ba74f9aeb (patch)
treea6a24fc4a295b7f804aeb2a2211e58b38bbf922a /openecomp-ui/src/sdc-app/onboarding/userNotifications
parentfefa3e408f77289594e47edc878d1bee61fca90b (diff)
ui support for archive items
Issue-ID: SDC-1088 Change-Id: I836e4896a8ec6bb065f9d2571f514916ccf6759f Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
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