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

[Feature] - APIM Portal Notifications #695

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2ed1a86
Implement Admin UI for WF Rejection Notifications
HelaniUdara Jan 29, 2024
8ed3065
Implement Publisher UI (hard-coded) for notification feature
HelaniUdara Feb 9, 2024
7a8b5f9
Connect Publisher UI to backend APIs
HelaniUdara Feb 26, 2024
8283d90
Update styles
HelaniUdara Feb 27, 2024
3d1e808
Developer UI completed and Connected to the backend APIs
HelaniUdara Mar 7, 2024
3504012
Updated
HelaniUdara Mar 15, 2024
c1a0620
Complete handleSort function for publisher and developer portals
HelaniUdara Mar 21, 2024
18a28a9
Remove the API call from HeaderOriginal and passed a prop to display …
HelaniUdara Mar 21, 2024
756faaa
Remove API call to get unread count from devportal header and changed…
HelaniUdara Mar 25, 2024
75cc7d3
Handle API calls according to the rowsPerPage
HelaniUdara Mar 26, 2024
ca7d579
Modify the way getting unread notification count
HelaniUdara Mar 27, 2024
03fe85e
Updated
HelaniUdara Mar 27, 2024
b83b215
Add websocket listening part
HelaniUdara Apr 22, 2024
2635de2
Change deleteNotification method's name to deleteNotificationById
HelaniUdara Apr 30, 2024
361547f
Change the bell icon in the publisher portal
HelaniUdara May 9, 2024
a2356ee
Extract the notification icon to new component and set polling
HelaniUdara May 9, 2024
37cbd88
Extract the Notification icon from publisher header
HelaniUdara May 10, 2024
3960220
Add License to newly added pages and add tool tips to the publisher
HelaniUdara May 10, 2024
d2a09a0
Update the code
HelaniUdara May 13, 2024
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
13 changes: 4 additions & 9 deletions portals/admin/src/main/webapp/site/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@
"Workflow.APIRevisionDeployment.permission.denied.title": "Permission Denied",
"Workflow.APIRevisionDeployment.search.default": "Search by Revision Id, API name, Environment or Created by",
"Workflow.APIRevisionDeployment.table.button.approve": "Approve",
"Workflow.APIRevisionDeployment.table.button.reject": "Reject",
"Workflow.APIRevisionDeployment.table.header.Action": "Action",
"Workflow.APIRevisionDeployment.table.header.apiName": "API",
"Workflow.APIRevisionDeployment.table.header.apiVersion": "API",
Expand All @@ -665,7 +664,6 @@
"Workflow.APIStateChange.List.empty.title.apistatechange": "API State Change",
"Workflow.APIStateChange.apicall.has.errors": "Unable to get workflow pending requests for API State Change",
"Workflow.APIStateChange.table.button.approve": "Approve",
"Workflow.APIStateChange.table.button.reject": "Reject",
"Workflow.APIStateChange.table.header.Action": "Action",
"Workflow.APIStateChange.table.header.ApiProvider": "Created by",
"Workflow.APIStateChange.table.header.CurrentState": "Current State",
Expand All @@ -684,7 +682,6 @@
"Workflow.ApplicationCreation.permission.denied.content": "You dont have enough permission to view Application Creation - Approval Tasks. Please contact the site administrator.",
"Workflow.ApplicationCreation.permission.denied.title": "Permission Denied",
"Workflow.ApplicationCreation.table.button.approve": "Approve",
"Workflow.ApplicationCreation.table.button.reject": "Reject",
"Workflow.ApplicationCreation.table.header.Action": "Action",
"Workflow.ApplicationCreation.table.header.ApplicationTier": "Throttling Policy",
"Workflow.ApplicationCreation.table.header.applicationName": "Application",
Expand All @@ -700,7 +697,6 @@
"Workflow.ApplicationDeletion.permission.denied.content": "You dont have enough permission to view Application Creation - Approval Tasks. Please contact the site administrator.",
"Workflow.ApplicationDeletion.permission.denied.title": "Permission Denied",
"Workflow.ApplicationDeletion.table.button.approve": "Approve",
"Workflow.ApplicationDeletion.table.button.reject": "Reject",
"Workflow.ApplicationDeletion.table.header.Action": "Action",
"Workflow.ApplicationDeletion.table.header.ApplicationTier": "Throttling Policy",
"Workflow.ApplicationDeletion.table.header.applicationName": "Application",
Expand All @@ -719,7 +715,6 @@
"Workflow.RegistrationCreation.permission.denied.title": "Permission Denied",
"Workflow.RegistrationCreation.search.default": "Search by Application, Throttling Policy, Key type or Creator",
"Workflow.RegistrationCreation.table.button.approve": "Approve",
"Workflow.RegistrationCreation.table.button.reject": "Reject",
"Workflow.RegistrationCreation.table.header.Action": "Action",
"Workflow.RegistrationCreation.table.header.Application": "Application",
"Workflow.RegistrationCreation.table.header.ApplicationTier": "Throttling Policy",
Expand All @@ -737,7 +732,6 @@
"Workflow.SubscriptionCreation.permission.denied.title": "Permission Denied",
"Workflow.SubscriptionCreation.search.default": "Search by API, Application or Subscriber",
"Workflow.SubscriptionCreation.table.button.approve": "Approve",
"Workflow.SubscriptionCreation.table.button.reject": "Reject",
"Workflow.SubscriptionCreation.table.header.API": "API",
"Workflow.SubscriptionCreation.table.header.Action": "Action",
"Workflow.SubscriptionCreation.table.header.Application": "Application",
Expand All @@ -754,7 +748,6 @@
"Workflow.SubscriptionDeletion.permission.denied.title": "Permission Denied",
"Workflow.SubscriptionDeletion.search.default": "Search by API, Application or Subscriber",
"Workflow.SubscriptionDeletion.table.button.approve": "Approve",
"Workflow.SubscriptionDeletion.table.button.reject": "Reject",
"Workflow.SubscriptionDeletion.table.header.API": "API",
"Workflow.SubscriptionDeletion.table.header.Action": "Action",
"Workflow.SubscriptionDeletion.table.header.Application": "Application",
Expand All @@ -770,7 +763,6 @@
"Workflow.SubscriptionUpdate.permission.denied.title": "Permission Denied",
"Workflow.SubscriptionUpdate.search.default": "Search by API, Application or Subscriber",
"Workflow.SubscriptionUpdate.table.button.approve": "Approve",
"Workflow.SubscriptionUpdate.table.button.reject": "Reject",
"Workflow.SubscriptionUpdate.table.header.API": "API",
"Workflow.SubscriptionUpdate.table.header.Action": "Action",
"Workflow.SubscriptionUpdate.table.header.Application": "Application",
Expand All @@ -786,14 +778,17 @@
"Workflow.UserCreation.permission.denied.content": "You dont have enough permission to view User Creation - Approval Tasks. Please contact the site administrator.",
"Workflow.UserCreation.permission.denied.title": "Permission Denied",
"Workflow.UserCreation.table.button.approve": "Approve",
"Workflow.UserCreation.table.button.reject": "Reject",
"Workflow.UserCreation.table.header.Action": "Action",
"Workflow.UserCreation.table.header.Description": "Description",
"Workflow.UserCreation.table.header.ElapsedTime": "Elapsed time",
"Workflow.UserCreation.table.header.TenantDomain": "Tenant Domain",
"Workflow.UserCreation.table.header.TenantName": "User Name",
"Workflow.UserCreation.update.success": "Workflow status is updated successfully",
"Workflow.UserCreation.updateStatus.has.errors": "Unable to complete User creation approve/reject process.",
"Workflow.WFRejectionPopup.dialog.open.button.reject": "Reject",
"Workflow.WFRejectionPopup.dialog.title": "Workflow Rejection",
"Workflow.WFRejectionPopup.dialogBox.helperText": "Please provide a reason for rejection (optional)",
"Workflow.WFRejectionPopup.dialogBox.label": "Reason for rejection",
"Workflow.api.statechange.search.default": "Search by API, Request state, Current state or Creator",
"Workflow.apiProduct.statechange.search.default": "Search by API Product, Request state, Current state or Creator",
"Workflow.applicationcreation.search.default": "Search by Application, Throttling Policy or Creator",
Expand Down
13 changes: 4 additions & 9 deletions portals/admin/src/main/webapp/site/public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@
"Workflow.APIRevisionDeployment.permission.denied.title": "",
"Workflow.APIRevisionDeployment.search.default": "",
"Workflow.APIRevisionDeployment.table.button.approve": "",
"Workflow.APIRevisionDeployment.table.button.reject": "",
"Workflow.APIRevisionDeployment.table.header.Action": "",
"Workflow.APIRevisionDeployment.table.header.apiName": "",
"Workflow.APIRevisionDeployment.table.header.apiVersion": "",
Expand All @@ -665,7 +664,6 @@
"Workflow.APIStateChange.List.empty.title.apistatechange": "",
"Workflow.APIStateChange.apicall.has.errors": "",
"Workflow.APIStateChange.table.button.approve": "",
"Workflow.APIStateChange.table.button.reject": "",
"Workflow.APIStateChange.table.header.Action": "",
"Workflow.APIStateChange.table.header.ApiProvider": "",
"Workflow.APIStateChange.table.header.CurrentState": "",
Expand All @@ -684,7 +682,6 @@
"Workflow.ApplicationCreation.permission.denied.content": "",
"Workflow.ApplicationCreation.permission.denied.title": "",
"Workflow.ApplicationCreation.table.button.approve": "",
"Workflow.ApplicationCreation.table.button.reject": "",
"Workflow.ApplicationCreation.table.header.Action": "",
"Workflow.ApplicationCreation.table.header.ApplicationTier": "",
"Workflow.ApplicationCreation.table.header.applicationName": "",
Expand All @@ -700,7 +697,6 @@
"Workflow.ApplicationDeletion.permission.denied.content": "",
"Workflow.ApplicationDeletion.permission.denied.title": "",
"Workflow.ApplicationDeletion.table.button.approve": "",
"Workflow.ApplicationDeletion.table.button.reject": "",
"Workflow.ApplicationDeletion.table.header.Action": "",
"Workflow.ApplicationDeletion.table.header.ApplicationTier": "",
"Workflow.ApplicationDeletion.table.header.applicationName": "",
Expand All @@ -719,7 +715,6 @@
"Workflow.RegistrationCreation.permission.denied.title": "",
"Workflow.RegistrationCreation.search.default": "",
"Workflow.RegistrationCreation.table.button.approve": "",
"Workflow.RegistrationCreation.table.button.reject": "",
"Workflow.RegistrationCreation.table.header.Action": "",
"Workflow.RegistrationCreation.table.header.Application": "",
"Workflow.RegistrationCreation.table.header.ApplicationTier": "",
Expand All @@ -737,7 +732,6 @@
"Workflow.SubscriptionCreation.permission.denied.title": "",
"Workflow.SubscriptionCreation.search.default": "",
"Workflow.SubscriptionCreation.table.button.approve": "",
"Workflow.SubscriptionCreation.table.button.reject": "",
"Workflow.SubscriptionCreation.table.header.API": "",
"Workflow.SubscriptionCreation.table.header.Action": "",
"Workflow.SubscriptionCreation.table.header.Application": "",
Expand All @@ -754,7 +748,6 @@
"Workflow.SubscriptionDeletion.permission.denied.title": "",
"Workflow.SubscriptionDeletion.search.default": "",
"Workflow.SubscriptionDeletion.table.button.approve": "",
"Workflow.SubscriptionDeletion.table.button.reject": "",
"Workflow.SubscriptionDeletion.table.header.API": "",
"Workflow.SubscriptionDeletion.table.header.Action": "",
"Workflow.SubscriptionDeletion.table.header.Application": "",
Expand All @@ -770,7 +763,6 @@
"Workflow.SubscriptionUpdate.permission.denied.title": "",
"Workflow.SubscriptionUpdate.search.default": "",
"Workflow.SubscriptionUpdate.table.button.approve": "",
"Workflow.SubscriptionUpdate.table.button.reject": "",
"Workflow.SubscriptionUpdate.table.header.API": "",
"Workflow.SubscriptionUpdate.table.header.Action": "",
"Workflow.SubscriptionUpdate.table.header.Application": "",
Expand All @@ -786,14 +778,17 @@
"Workflow.UserCreation.permission.denied.content": "",
"Workflow.UserCreation.permission.denied.title": "",
"Workflow.UserCreation.table.button.approve": "",
"Workflow.UserCreation.table.button.reject": "",
"Workflow.UserCreation.table.header.Action": "",
"Workflow.UserCreation.table.header.Description": "",
"Workflow.UserCreation.table.header.ElapsedTime": "",
"Workflow.UserCreation.table.header.TenantDomain": "",
"Workflow.UserCreation.table.header.TenantName": "",
"Workflow.UserCreation.update.success": "",
"Workflow.UserCreation.updateStatus.has.errors": "",
"Workflow.WFRejectionPopup.dialog.open.button.reject": "",
"Workflow.WFRejectionPopup.dialog.title": "",
"Workflow.WFRejectionPopup.dialogBox.helperText": "",
"Workflow.WFRejectionPopup.dialogBox.label": "",
"Workflow.api.statechange.search.default": "",
"Workflow.apiProduct.statechange.search.default": "",
"Workflow.applicationcreation.search.default": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function FormDialogBase({
formSaveCallback,
dialogOpenCallback,
triggerIconProps,
setToFullWidth,
}) {
const [open, setOpen] = React.useState(false);
const [saving, setSaving] = useState(false);
Expand Down Expand Up @@ -85,7 +86,7 @@ function FormDialogBase({
</Button>
)}

<Dialog open={open} onClose={handleClose} aria-labelledby='form-dialog-title'>
<Dialog open={open} onClose={handleClose} aria-labelledby='form-dialog-title' fullWidth={setToFullWidth}>
<DialogTitle id='form-dialog-title'>{title}</DialogTitle>
<DialogContent>
{children}
Expand Down Expand Up @@ -118,6 +119,7 @@ FormDialogBase.defaultProps = {
color: 'primary',
component: 'span',
},
setToFullWidth: false,
};

FormDialogBase.propTypes = {
Expand All @@ -136,6 +138,7 @@ FormDialogBase.propTypes = {
triggerIconProps: PropTypes.shape({}),
formSaveCallback: PropTypes.func.isRequired,
dialogOpenCallback: PropTypes.func,
setToFullWidth: PropTypes.bool,
};

export default FormDialogBase;
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ import * as dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import CheckIcon from '@mui/icons-material/Check';
import ClearIcon from '@mui/icons-material/Clear';
import Box from '@mui/material/Box';
import CircularProgress from '@mui/material/CircularProgress';
import WarningBase from 'AppComponents/AdminPages/Addons/WarningBase';
import { Alert as MUIAlert } from '@mui/material';
import WFRejectionPopup from 'AppComponents/Workflow/WFRejectionPopup';

/**
* Render a list
Expand Down Expand Up @@ -125,9 +125,14 @@ function ListLabels() {
fetchData();
}, []);

const updateStatus = (referenceId, value) => {
const updateStatus = (referenceId, value, comment) => {
setButtonValue(value);
const body = { status: value, attributes: {}, description: '' };
const body = {
status: value,
attributes: {},
description: '',
comments: comment,
HelaniUdara marked this conversation as resolved.
Show resolved Hide resolved
};
setIsUpdating(true);
if (value === 'APPROVED') {
body.description = 'Approve workflow request.';
Expand Down Expand Up @@ -302,7 +307,7 @@ function ListLabels() {
color='success'
variant='contained'
size='small'
onClick={() => updateStatus(referenceId, 'APPROVED')}
onClick={() => updateStatus(referenceId, 'APPROVED', 'APPROVED')}
disabled={isUpdating}
>
<CheckIcon />
Expand All @@ -313,20 +318,7 @@ function ListLabels() {
{(isUpdating && buttonValue === 'APPROVED') && <CircularProgress size={15} /> }
</Button>
&nbsp;&nbsp;
<Button
color='error'
variant='contained'
size='small'
onClick={() => updateStatus(referenceId, 'REJECTED')}
disabled={isUpdating}
>
<ClearIcon />
<FormattedMessage
id='Workflow.APIRevisionDeployment.table.button.reject'
defaultMessage='Reject'
/>
{(isUpdating && buttonValue === 'REJECTED') && <CircularProgress size={15} />}
</Button>
<WFRejectionPopup referenceId={referenceId} updateStatus={updateStatus} />
</Box>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ import * as dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import CheckIcon from '@mui/icons-material/Check';
import ClearIcon from '@mui/icons-material/Clear';
import Box from '@mui/material/Box';
import CircularProgress from '@mui/material/CircularProgress';
import WarningBase from 'AppComponents/AdminPages/Addons/WarningBase';
import { Alert as MUIAlert } from '@mui/material';
import WFRejectionPopup from 'AppComponents/Workflow/WFRejectionPopup';

/**
* Render a list
Expand Down Expand Up @@ -138,9 +138,14 @@ function ListLabels(props) {
fetchData();
}, []);

const updateStatus = (referenceId, value) => {
const updateStatus = (referenceId, value, comment) => {
setButtonValue(value);
const body = { status: value, attributes: {}, description: '' };
const body = {
status: value,
attributes: {},
description: '',
comments: comment,
HelaniUdara marked this conversation as resolved.
Show resolved Hide resolved
};
setIsUpdating(true);
if (value === 'APPROVED') {
body.description = 'Approve workflow request.';
Expand Down Expand Up @@ -325,7 +330,7 @@ function ListLabels(props) {
color='success'
variant='contained'
size='small'
onClick={() => updateStatus(referenceId, 'APPROVED')}
onClick={() => updateStatus(referenceId, 'APPROVED', 'APPROVED')}
disabled={isUpdating}
>
<CheckIcon />
Expand All @@ -336,20 +341,7 @@ function ListLabels(props) {
{(isUpdating && buttonValue === 'APPROVED') && <CircularProgress size={15} /> }
</Button>
&nbsp;&nbsp;
<Button
color='error'
variant='contained'
size='small'
onClick={() => updateStatus(referenceId, 'REJECTED')}
disabled={isUpdating}
>
<ClearIcon />
<FormattedMessage
id='Workflow.APIStateChange.table.button.reject'
defaultMessage='Reject'
/>
{(isUpdating && buttonValue === 'REJECTED') && <CircularProgress size={15} />}
</Button>
<WFRejectionPopup referenceId={referenceId} updateStatus={updateStatus} />
</Box>
</div>
);
Expand Down
Loading