|
@@ -8,7 +8,7 @@ import { DropdownItem } from 'reactstrap';
|
|
|
|
|
|
|
|
import { IInAppNotificationOpenable } from '~/client/interfaces/in-app-notification-openable';
|
|
import { IInAppNotificationOpenable } from '~/client/interfaces/in-app-notification-openable';
|
|
|
import { apiv3Post } from '~/client/util/apiv3-client';
|
|
import { apiv3Post } from '~/client/util/apiv3-client';
|
|
|
-import { SupportedTargetModel } from '~/interfaces/activity';
|
|
|
|
|
|
|
+import { SupportedTargetModel, SupportedAction } from '~/interfaces/activity';
|
|
|
import { IInAppNotification, InAppNotificationStatuses } from '~/interfaces/in-app-notification';
|
|
import { IInAppNotification, InAppNotificationStatuses } from '~/interfaces/in-app-notification';
|
|
|
|
|
|
|
|
// Change the display for each targetmodel
|
|
// Change the display for each targetmodel
|
|
@@ -91,51 +91,51 @@ const InAppNotificationElm: FC<Props> = (props: Props) => {
|
|
|
let actionIcon: string;
|
|
let actionIcon: string;
|
|
|
|
|
|
|
|
switch (actionType) {
|
|
switch (actionType) {
|
|
|
- case 'PAGE_LIKE':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_LIKE:
|
|
|
actionMsg = 'liked';
|
|
actionMsg = 'liked';
|
|
|
actionIcon = 'icon-like';
|
|
actionIcon = 'icon-like';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_BOOKMARK':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_BOOKMARK:
|
|
|
actionMsg = 'bookmarked on';
|
|
actionMsg = 'bookmarked on';
|
|
|
actionIcon = 'icon-star';
|
|
actionIcon = 'icon-star';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_UPDATE':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_UPDATE:
|
|
|
actionMsg = 'updated on';
|
|
actionMsg = 'updated on';
|
|
|
actionIcon = 'ti ti-agenda';
|
|
actionIcon = 'ti ti-agenda';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_RENAME':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_RENAME:
|
|
|
actionMsg = 'renamed';
|
|
actionMsg = 'renamed';
|
|
|
actionIcon = 'icon-action-redo';
|
|
actionIcon = 'icon-action-redo';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_DUPLICATE':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_DUPLICATE:
|
|
|
actionMsg = 'duplicated';
|
|
actionMsg = 'duplicated';
|
|
|
actionIcon = 'icon-docs';
|
|
actionIcon = 'icon-docs';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_DELETE':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_DELETE:
|
|
|
actionMsg = 'deleted';
|
|
actionMsg = 'deleted';
|
|
|
actionIcon = 'icon-trash';
|
|
actionIcon = 'icon-trash';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_DELETE_COMPLETELY':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_DELETE_COMPLETELY:
|
|
|
actionMsg = 'completely deleted';
|
|
actionMsg = 'completely deleted';
|
|
|
actionIcon = 'icon-fire';
|
|
actionIcon = 'icon-fire';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_REVERT':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_REVERT:
|
|
|
actionMsg = 'reverted';
|
|
actionMsg = 'reverted';
|
|
|
actionIcon = 'icon-action-undo';
|
|
actionIcon = 'icon-action-undo';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_RECURSIVELY_RENAME':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_RECURSIVELY_RENAME:
|
|
|
actionMsg = 'renamed under';
|
|
actionMsg = 'renamed under';
|
|
|
actionIcon = 'icon-action-redo';
|
|
actionIcon = 'icon-action-redo';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_RECURSIVELY_DELETE':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_RECURSIVELY_DELETE:
|
|
|
actionMsg = 'deleted under';
|
|
actionMsg = 'deleted under';
|
|
|
actionIcon = 'icon-trash';
|
|
actionIcon = 'icon-trash';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_RECURSIVELY_DELETE_COMPLETELY':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_RECURSIVELY_DELETE_COMPLETELY:
|
|
|
actionMsg = 'deleted completely under';
|
|
actionMsg = 'deleted completely under';
|
|
|
actionIcon = 'icon-fire';
|
|
actionIcon = 'icon-fire';
|
|
|
break;
|
|
break;
|
|
|
- case 'PAGE_RECURSIVELY_REVERT':
|
|
|
|
|
|
|
+ case SupportedAction.ACTION_PAGE_RECURSIVELY_REVERT:
|
|
|
actionMsg = 'reverted under';
|
|
actionMsg = 'reverted under';
|
|
|
actionIcon = 'icon-action-undo';
|
|
actionIcon = 'icon-action-undo';
|
|
|
break;
|
|
break;
|
|
@@ -175,8 +175,6 @@ const InAppNotificationElm: FC<Props> = (props: Props) => {
|
|
|
<PageModelNotification
|
|
<PageModelNotification
|
|
|
ref={notificationRef}
|
|
ref={notificationRef}
|
|
|
notification={notification}
|
|
notification={notification}
|
|
|
- actionMsg={actionMsg}
|
|
|
|
|
- actionIcon={actionIcon}
|
|
|
|
|
actionUsers={actionUsers}
|
|
actionUsers={actionUsers}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|