Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Commit 8f2d143

Browse files
Merge pull request #24 from solace-iot-team/feature-apps
Feature apps
2 parents 488c87c + b49fca9 commit 8f2d143

19 files changed

+857
-47
lines changed

ReleaseNotes.md

+12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
Solace Async API Management.
44

5+
## Version 0.1.4
6+
* [API-M Admin & Developer Portal](https://github.com/solace-iot-team/async-apim/tree/main/apim-portal): 0.1.4
7+
* [API-M Server OpenAPI](https://github.com/solace-iot-team/async-apim/blob/main/apim-server/server/common/api.yml): 0.1.0
8+
* [API-M Server](https://github.com/solace-iot-team/async-apim/tree/main/apim-server): 0.1.0
9+
* [API-M Connector OpenAPI](https://github.com/solace-iot-team/platform-api): 0.7.6
10+
11+
#### API-M Admin & Developer Portal
12+
**New Features:**
13+
* **Recover API Products**
14+
- added `recover api products` module to `Manage API Products`.
15+
- allows users with `organization admin` role to list, edit, delete API Products not containing the business group information
16+
517
## Version 0.1.3
618
* [API-M Admin & Developer Portal](https://github.com/solace-iot-team/async-apim/tree/main/apim-portal): 0.1.3
719
* [API-M Server OpenAPI](https://github.com/solace-iot-team/async-apim/blob/main/apim-server/server/common/api.yml): 0.1.0

apim-portal/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "async-apim-portal",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Solace Async API Management Portal",
55
"repository": {
66
"type": "git",

apim-portal/src/admin-portal/components/ManageApiProducts/EditNewApiProduct/EditNewAccessAndStateForm.tsx

+8-6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { AuthHelper } from "../../../../auth/AuthHelper";
2424
import { EUIAdminPortalResourcePaths } from "../../../../utils/Globals";
2525
import { EditNewBusinessGroupSharingListForm } from "./EditNewBusinessGroupSharingListForm";
2626
import { TAPManagedAssetDisplay_BusinessGroupSharingList } from "../../../../displayServices/APManagedAssetDisplayService";
27+
import APBusinessGroupsDisplayService from "../../../../displayServices/APBusinessGroupsDisplayService";
2728

2829
import '../../../../components/APComponents.css';
2930
import "../ManageApiProducts.css";
@@ -44,7 +45,7 @@ export const EditNewAccessAndStateForm: React.FC<IEditNewAccessAndStateFormProps
4445
type TManagedObjectFormData = {
4546
accessLevel: APIProductAccessLevel;
4647
lifecycleState: EAPLifecycleState;
47-
owningBusinessGroupId: string;
48+
owningBusinessGroupId?: string;
4849
};
4950
type TManagedObjectFormDataEnvelope = {
5051
businessGroupSharingList: TAPManagedAssetDisplay_BusinessGroupSharingList; /** not managed by form */
@@ -55,7 +56,7 @@ export const EditNewAccessAndStateForm: React.FC<IEditNewAccessAndStateFormProps
5556
const fd: TManagedObjectFormData = {
5657
accessLevel: mo.apAccessLevel,
5758
lifecycleState: mo.apLifecycleInfo.apLifecycleState,
58-
owningBusinessGroupId: mo.apBusinessGroupInfo.apOwningBusinessGroupEntityId.id,
59+
owningBusinessGroupId: (mo.apBusinessGroupInfo.apOwningBusinessGroupEntityId.id === APBusinessGroupsDisplayService.get_recovered_BusinessGroupId() ? undefined : mo.apBusinessGroupInfo.apOwningBusinessGroupEntityId.id),
5960
};
6061
return {
6162
businessGroupSharingList: mo.apBusinessGroupInfo.apBusinessGroupSharingList,
@@ -73,6 +74,7 @@ export const EditNewAccessAndStateForm: React.FC<IEditNewAccessAndStateFormProps
7374
const mo: TManagedObject = props.apApiProductDisplay_AccessAndState;
7475
const fd: TManagedObjectFormData = formDataEnvelope.formData;
7576

77+
if(fd.owningBusinessGroupId === undefined) throw new Error(`${logName}: fd.owningBusinessGroupId === undefined`);
7678
const apOwningMemberOfBusinessGroupDisplay: TAPMemberOfBusinessGroupDisplay | undefined = APMemberOfService.find_ApMemberOfBusinessGroupDisplay_From_ApMemberOfBusinessGroupDisplayTreeNodeList({
7779
apMemberOfBusinessGroupDisplayTreeNodeList: apMemberOfBusinessGroupDisplayTreeNodeList,
7880
businessGroupId: fd.owningBusinessGroupId
@@ -174,7 +176,7 @@ export const EditNewAccessAndStateForm: React.FC<IEditNewAccessAndStateFormProps
174176
{...field}
175177
options={apMemberOfBusinessGroupTreeTableNodeList}
176178
onChange={(e) => { field.onChange(e.value); }}
177-
placeholder="Select Business Group"
179+
// placeholder="Select Business Group"
178180
filter={true}
179181
selectionMode="single"
180182
className={classNames({ 'p-invalid': fieldState.invalid })}
@@ -209,9 +211,9 @@ export const EditNewAccessAndStateForm: React.FC<IEditNewAccessAndStateFormProps
209211
if(apMemberOfBusinessGroupDisplayTreeNodeList === undefined) throw new Error(`${logName}: apMemberOfBusinessGroupDisplayTreeNodeList === undefined`);
210212
const uniqueKey_EditNewBusinessGroupSharingListForm = ComponentName+'_EditNewBusinessGroupSharingListForm';
211213

212-
const _owningBusinessGroupId: string = managedObjectUseForm.watch('formData.owningBusinessGroupId');
214+
const _owningBusinessGroupId: string | undefined = managedObjectUseForm.watch('formData.owningBusinessGroupId');
213215
// catch the first render
214-
const owningBusinessGroupId: string = _owningBusinessGroupId === undefined ? managedObjectFormDataEnvelope.formData.owningBusinessGroupId : _owningBusinessGroupId;
216+
const owningBusinessGroupId: string | undefined = _owningBusinessGroupId === undefined ? managedObjectFormDataEnvelope.formData.owningBusinessGroupId : _owningBusinessGroupId;
215217

216218
return (
217219
<div className="card p-mt-4">
@@ -281,7 +283,7 @@ export const EditNewAccessAndStateForm: React.FC<IEditNewAccessAndStateFormProps
281283
uniqueKeyPrefix={uniqueKey_EditNewBusinessGroupSharingListForm}
282284
apManagedAssetDisplay_BusinessGroupSharingList={managedObjectFormDataEnvelope.businessGroupSharingList}
283285
apMemberOfBusinessGroupDisplayTreeNodeList={apMemberOfBusinessGroupDisplayTreeNodeList}
284-
apExcludeBusinessGroupIdList={[owningBusinessGroupId]}
286+
apExcludeBusinessGroupIdList={owningBusinessGroupId === undefined ? [] : [owningBusinessGroupId]}
285287
onChange={onChange_EditNewBusinessGroupSharingList}
286288
/>
287289
</div>

apim-portal/src/admin-portal/components/ManageApiProducts/EditNewApiProduct/EditNewGeneralForm.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const EditNewGeneralForm: React.FC<IEditNewGeneralFormProps> = (props: IE
142142
}
143143

144144
const validate_Id = async(id: string): Promise<string | boolean> => {
145-
if(props.action === EAction.EDIT) return true;
145+
if(props.action !== EAction.NEW) return true;
146146
// check if id exists
147147
const checkResult: boolean | undefined = await apiCheck_ApiProductIdExists(id);
148148
if(checkResult === undefined) return false;

apim-portal/src/admin-portal/components/ManageApiProducts/EditNewApiProduct/ManageEditNewApiProduct.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { APComponentHeader } from "../../../../components/APComponentHeader/APCo
88
import { ApiCallState, TApiCallState } from "../../../../utils/ApiCallState";
99
import { ApiCallStatusError } from "../../../../components/ApiCallStatusError/ApiCallStatusError";
1010
import { TAPEntityId } from "../../../../utils/APEntityIdsService";
11-
import { EAction, E_CALL_STATE_ACTIONS, E_COMPONENT_STATE, E_COMPONENT_STATE_EDIT_NEW } from "../ManageApiProductsCommon";
11+
import { EAction, E_CALL_STATE_ACTIONS, E_COMPONENT_STATE_EDIT_NEW } from "../ManageApiProductsCommon";
1212
import APAdminPortalApiProductsDisplayService, {
1313
TAPAdminPortalApiProductDisplay
1414
} from "../../../displayServices/APAdminPortalApiProductsDisplayService";
@@ -48,7 +48,7 @@ export interface IManageEditNewApiProductProps {
4848
onEditNewSuccess: (apiCallState: TApiCallState, apiProductEntityId: TAPEntityId) => void;
4949
/** edit: required */
5050
apiProductEntityId?: TAPEntityId;
51-
onNavigateToCommand?: (componentState: E_COMPONENT_STATE, apiProductEntityId: TAPEntityId) => void;
51+
onNavigateToCommand?: (apiProductEntityId: TAPEntityId) => void;
5252
}
5353

5454
export const ManageEditNewApiProduct: React.FC<IManageEditNewApiProductProps> = (props: IManageEditNewApiProductProps) => {
@@ -234,7 +234,7 @@ export const ManageEditNewApiProduct: React.FC<IManageEditNewApiProductProps> =
234234
const logName = `${ComponentName}.${funcName}()`;
235235
if(props.onNavigateToCommand === undefined) throw new Error(`${logName}: props.onNavigateToCommand === undefined`);
236236
if(props.apiProductEntityId === undefined) throw new Error(`${logName}: props.apiProductEntityId === undefined`);
237-
props.onNavigateToCommand(E_COMPONENT_STATE.MANAGED_OBJECT_VIEW, props.apiProductEntityId);
237+
props.onNavigateToCommand(props.apiProductEntityId);
238238
}
239239

240240
const setBreadCrumbItemList = () => {

apim-portal/src/admin-portal/components/ManageApiProducts/ListApiProducts.tsx

+11-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { DataTable } from 'primereact/datatable';
55
import { Column } from "primereact/column";
66
import { InputText } from 'primereact/inputtext';
77
import { MenuItem } from "primereact/api";
8+
import { Divider } from "primereact/divider";
89

910
import { ApiCallState, TApiCallState } from "../../../utils/ApiCallState";
1011
import { APComponentHeader } from "../../../components/APComponentHeader/APComponentHeader";
@@ -27,16 +28,14 @@ export interface IListApiProductsProps {
2728
onError: (apiCallState: TApiCallState) => void;
2829
onSuccess: (apiCallState: TApiCallState) => void;
2930
onLoadingChange: (isLoading: boolean) => void;
30-
onManagedObjectEdit: (managedObjectEntityId: TAPEntityId) => void;
31-
onManagedObjectDelete: (managedObjectEntityId: TAPEntityId) => void;
3231
onManagedObjectView: (apAdminPortalApiProductDisplay: TAPAdminPortalApiProductDisplay) => void;
3332
setBreadCrumbItemList: (itemList: Array<MenuItem>) => void;
3433
}
3534

3635
export const ListApiProducts: React.FC<IListApiProductsProps> = (props: IListApiProductsProps) => {
3736
const ComponentName = 'ListApiProducts';
3837

39-
const MessageNoManagedObjectsFoundCreateNew = 'No API Products found - create a new API Product.';
38+
const MessageNoManagedObjectsFound = 'No API Products defined.';
4039
// const GlobalSearchPlaceholder = 'Enter search word list separated by <space> ...';
4140
const GlobalSearchPlaceholder = 'search...';
4241

@@ -87,7 +86,8 @@ export const ListApiProducts: React.FC<IListApiProductsProps> = (props: IListApi
8786
}, []); /* eslint-disable-line react-hooks/exhaustive-deps */
8887

8988
React.useEffect(() => {
90-
if(managedObjectList !== undefined) setIsInitialized(true);
89+
if(managedObjectList === undefined) return;
90+
setIsInitialized(true);
9191
}, [managedObjectList]); /* eslint-disable-line react-hooks/exhaustive-deps */
9292

9393
React.useEffect(() => {
@@ -256,7 +256,13 @@ export const ListApiProducts: React.FC<IListApiProductsProps> = (props: IListApi
256256
if(managedObjectList === undefined) throw new Error(`${logName}: managedObjectList === undefined`);
257257

258258
if(managedObjectList.length === 0) {
259-
return (<h3>{MessageNoManagedObjectsFoundCreateNew}</h3>);
259+
return (
260+
<React.Fragment>
261+
<Divider />
262+
{MessageNoManagedObjectsFound}
263+
<Divider />
264+
</React.Fragment>
265+
);
260266
}
261267
if(managedObjectList.length > 0) {
262268
return renderManagedObjectDataTable();

0 commit comments

Comments
 (0)