Skip to content

Commit f65f3b3

Browse files
committed
Implement UI changes for API Revision Deployment Monitoring
1 parent 00e9a34 commit f65f3b3

File tree

11 files changed

+600
-24
lines changed

11 files changed

+600
-24
lines changed

.github/workflows/ui-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
node-version: '22'
3636
- name: Cache maven packages
37-
uses: actions/cache@v2
37+
uses: actions/cache@v3
3838
with:
3939
path: ~/.m2
4040
key: ${{ runner.os }}-m2

portals/admin/src/main/webapp/site/public/locales/en.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@
144144
"AdminPages.Gateways.Delete.form.delete.confirmation.message": "Are you sure you want to delete this Gateway Environment?",
145145
"AdminPages.Gateways.Delete.form.delete.confirmation.message.title": "Delete Gateway Environment?",
146146
"AdminPages.Gateways.Delete.form.delete.successful": "Gateway Environment deleted successfully",
147+
"AdminPages.Gateways.GatewayInstances.dialog.close": "Close",
148+
"AdminPages.Gateways.GatewayInstances.dialog.title": "Gateways in {env} Environment",
149+
"AdminPages.Gateways.GatewayInstances.table.header.gatewayID": "Gateway ID",
150+
"AdminPages.Gateways.GatewayInstances.table.header.lastActive": "Last Active",
151+
"AdminPages.Gateways.GatewayInstances.table.header.status": "Status",
152+
"AdminPages.Gateways.GatewayInstances.table.no.records.found": "No live gateway instances found for this environment.",
147153
"AdminPages.Gateways.List.addButtonProps.title": "Add Gateway Environment",
148154
"AdminPages.Gateways.List.addButtonProps.triggerButtonText": "Add Gateway Environment",
149155
"AdminPages.Gateways.List.empty.content.Gateways": "It is possible to create a Gateway environment with virtual hosts to access APIs. API revisions can be attached with Vhost to access it.",
@@ -152,6 +158,7 @@
152158
"AdminPages.Gateways.List.title": "Gateway Environments",
153159
"AdminPages.Gateways.table.header.description": "Description",
154160
"AdminPages.Gateways.table.header.displayName": "Name",
161+
"AdminPages.Gateways.table.header.gatewayInstances": "Gateway Instances",
155162
"AdminPages.Gateways.table.header.gatewayType": "Gateway Type",
156163
"AdminPages.Gateways.table.header.permission": "Visibility",
157164
"AdminPages.Gateways.table.header.type": "Type",

portals/admin/src/main/webapp/site/public/locales/fr.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@
144144
"AdminPages.Gateways.Delete.form.delete.confirmation.message": "Are you sure you want to delete this Gateway Environment?",
145145
"AdminPages.Gateways.Delete.form.delete.confirmation.message.title": "Delete Gateway Environment?",
146146
"AdminPages.Gateways.Delete.form.delete.successful": "Gateway Environment deleted successfully",
147+
"AdminPages.Gateways.GatewayInstances.dialog.close": "Close",
148+
"AdminPages.Gateways.GatewayInstances.dialog.title": "Gateways in {env} Environment",
149+
"AdminPages.Gateways.GatewayInstances.table.header.gatewayID": "Gateway ID",
150+
"AdminPages.Gateways.GatewayInstances.table.header.lastActive": "Last Active",
151+
"AdminPages.Gateways.GatewayInstances.table.header.status": "Status",
152+
"AdminPages.Gateways.GatewayInstances.table.no.records.found": "No live gateway instances found for this environment.",
147153
"AdminPages.Gateways.List.addButtonProps.title": "Add Gateway Environment",
148154
"AdminPages.Gateways.List.addButtonProps.triggerButtonText": "Add Gateway Environment",
149155
"AdminPages.Gateways.List.empty.content.Gateways": "It is possible to create a Gateway environment with virtual hosts to access APIs. API revisions can be attached with Vhost to access it.",
@@ -152,6 +158,7 @@
152158
"AdminPages.Gateways.List.title": "Gateway Environments",
153159
"AdminPages.Gateways.table.header.description": "Description",
154160
"AdminPages.Gateways.table.header.displayName": "Name",
161+
"AdminPages.Gateways.table.header.gatewayInstances": "Gateway Instances",
155162
"AdminPages.Gateways.table.header.gatewayType": "Gateway Type",
156163
"AdminPages.Gateways.table.header.permission": "Visibility",
157164
"AdminPages.Gateways.table.header.type": "Type",

portals/admin/src/main/webapp/source/src/app/components/GatewayEnvironments/ListGWEnviornments.jsx

Lines changed: 99 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* under the License.
1717
*/
1818

19-
import React from 'react';
19+
import React, { useState } from 'react';
2020
import API from 'AppData/api';
2121
import { FormattedMessage, useIntl } from 'react-intl';
2222
import { Link as RouterLink } from 'react-router-dom';
@@ -27,7 +27,10 @@ import AddEdit from 'AppComponents/GatewayEnvironments/AddEditGWEnvironment';
2727
import { useAppContext } from 'AppComponents/Shared/AppContext';
2828
import Button from '@mui/material/Button';
2929
import EditIcon from '@mui/icons-material/Edit';
30+
import FormatListBulletedIcon from '@mui/icons-material/FormatListBulleted';
31+
import IconButton from '@mui/material/IconButton';
3032
import Permission from './Permission';
33+
import ListGatewayInstances from './ListGatewayInstances';
3134

3235
/**
3336
* API call to get Gateway labels
@@ -53,6 +56,23 @@ export default function ListGWEnviornments() {
5356
const intl = useIntl();
5457
let columProps;
5558
const { settings } = useAppContext();
59+
// Dialog state for Live Gateways
60+
const [liveGatewaysOpen, setLiveGatewaysOpen] = useState(false);
61+
const [selectedEnvId, setSelectedEnvId] = useState(null);
62+
const [selectedEnvName, setSelectedEnvName] = useState('');
63+
64+
const handleOpenLiveGateways = (envId, envName) => {
65+
setSelectedEnvId(envId);
66+
setSelectedEnvName(envName);
67+
setLiveGatewaysOpen(true);
68+
};
69+
70+
const handleCloseLiveGateways = () => {
71+
setLiveGatewaysOpen(false);
72+
setSelectedEnvId(null);
73+
setSelectedEnvName('');
74+
};
75+
5676
const isGatewayTypeAvailable = settings.gatewayTypes.length >= 2;
5777
if (isGatewayTypeAvailable) {
5878
columProps = [
@@ -139,6 +159,33 @@ export default function ListGWEnviornments() {
139159
},
140160
},
141161
},
162+
...(settings.isGatewayNotificationEnabled ? [
163+
{
164+
name: 'gatewayInstances',
165+
label: intl.formatMessage({
166+
id: 'AdminPages.Gateways.table.header.gatewayInstances',
167+
defaultMessage: 'Gateway Instances',
168+
}),
169+
options: {
170+
sort: false,
171+
customBodyRender: (value, tableMeta) => {
172+
if (typeof tableMeta.rowData === 'object') {
173+
const envId = tableMeta.rowData[8]; // 'id' is the last column
174+
const envName = tableMeta.rowData[1]; // 'displayName'
175+
return (
176+
<IconButton
177+
onClick={() => handleOpenLiveGateways(envId, envName)}
178+
>
179+
<FormatListBulletedIcon aria-label='gateway-instances-list-icon' />
180+
</IconButton>
181+
);
182+
} else {
183+
return <div />;
184+
}
185+
},
186+
},
187+
},
188+
] : []),
142189
{ name: 'id', options: { display: false } },
143190
];
144191
} else {
@@ -216,6 +263,33 @@ export default function ListGWEnviornments() {
216263
},
217264
},
218265
},
266+
...(settings.isGatewayNotificationEnabled ? [
267+
{
268+
name: 'gatewayInstances',
269+
label: intl.formatMessage({
270+
id: 'AdminPages.Gateways.table.header.gatewayInstances',
271+
defaultMessage: 'Gateway Instances',
272+
}),
273+
options: {
274+
sort: false,
275+
customBodyRender: (value, tableMeta) => {
276+
if (typeof tableMeta.rowData === 'object') {
277+
const envId = tableMeta.rowData[8]; // 'id' is the last column
278+
const envName = tableMeta.rowData[1]; // 'displayName'
279+
return (
280+
<IconButton
281+
onClick={() => handleOpenLiveGateways(envId, envName)}
282+
>
283+
<FormatListBulletedIcon aria-label='gateway-instances-list-icon' />
284+
</IconButton>
285+
);
286+
} else {
287+
return <div />;
288+
}
289+
},
290+
},
291+
},
292+
] : []),
219293
{ name: 'id', options: { display: false } },
220294
];
221295
}
@@ -284,21 +358,29 @@ export default function ListGWEnviornments() {
284358
};
285359

286360
return (
287-
<ListBase
288-
columProps={columProps}
289-
pageProps={pageProps}
290-
addButtonProps={addButtonProps}
291-
searchProps={searchProps}
292-
emptyBoxProps={emptyBoxProps}
293-
apiCall={apiCall}
294-
EditComponent={AddEdit}
295-
addButtonOverride={addCreateButton()}
296-
editComponentProps={{
297-
icon: <EditIcon />,
298-
title: 'Edit Gateway Label',
299-
routeTo: '/settings/environments/',
300-
}}
301-
DeleteComponent={Delete}
302-
/>
361+
<>
362+
<ListBase
363+
columProps={columProps}
364+
pageProps={pageProps}
365+
addButtonProps={addButtonProps}
366+
searchProps={searchProps}
367+
emptyBoxProps={emptyBoxProps}
368+
apiCall={apiCall}
369+
EditComponent={AddEdit}
370+
addButtonOverride={addCreateButton()}
371+
editComponentProps={{
372+
icon: <EditIcon />,
373+
title: 'Edit Gateway Label',
374+
routeTo: '/settings/environments/',
375+
}}
376+
DeleteComponent={Delete}
377+
/>
378+
<ListGatewayInstances
379+
open={liveGatewaysOpen}
380+
onClose={handleCloseLiveGateways}
381+
environmentId={selectedEnvId}
382+
environmentName={selectedEnvName}
383+
/>
384+
</>
303385
);
304386
}

0 commit comments

Comments
 (0)