From 091edfdac90f66d91caff1b93131f99ba74f9aeb Mon Sep 17 00:00:00 2001
From: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Date: Mon, 19 Mar 2018 12:15:19 +0200
Subject: ui support for archive items

Issue-ID: SDC-1088
Change-Id: I836e4896a8ec6bb065f9d2571f514916ccf6759f
Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
---
 .../userNotifications/UserNotifications.jsx         | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

(limited to 'openecomp-ui/src/sdc-app/onboarding/userNotifications/UserNotifications.jsx')

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 {
-- 
cgit 1.2.3-korg

