Skip to content

Commit

Permalink
replace generic ID fields to more specific names (eclipse-xpanse#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
WangLiNaruto authored Jun 6, 2024
1 parent 5a7c29d commit 690e67b
Show file tree
Hide file tree
Showing 47 changed files with 634 additions and 584 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function ServiceDetail({ serviceDetails }: { serviceDetails: ServiceTemplateDeta
<BillingText billing={serviceDetails.billing} />
</Descriptions.Item>
<Descriptions.Item label={'Service API'}>
<ApiDoc id={serviceDetails.id} styleClass={appStyles.serviceApiDocLink} />
<ApiDoc id={serviceDetails.serviceTemplateId} styleClass={appStyles.serviceApiDocLink} />
</Descriptions.Item>
<Descriptions.Item label='Contact Details'>
<ContactDetailsText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ function ServiceProvider({
<>
{activeServiceDetail ? (
<>
<UnregisterResult id={activeServiceDetail.id} category={category} />
<ReRegisterResult id={activeServiceDetail.id} category={category} />
<DeleteResult id={activeServiceDetail.id} category={category} />
<UnregisterResult id={activeServiceDetail.serviceTemplateId} category={category} />
<ReRegisterResult id={activeServiceDetail.serviceTemplateId} category={category} />
<DeleteResult id={activeServiceDetail.serviceTemplateId} category={category} />
<Tabs
items={items}
onChange={onChangeCsp}
Expand All @@ -197,24 +197,24 @@ function ServiceProvider({
/>
<div className={catalogStyles.updateUnregisterBtnClass}>
<UpdateService
id={activeServiceDetail.id}
id={activeServiceDetail.serviceTemplateId}
category={category}
isViewDisabled={isViewDisabled}
/>
<UnregisterService
id={activeServiceDetail.id}
id={activeServiceDetail.serviceTemplateId}
setIsViewDisabled={setIsViewDisabled}
serviceRegistrationState={activeServiceDetail.serviceRegistrationState}
/>
<ReRegisterService
id={activeServiceDetail.id}
id={activeServiceDetail.serviceTemplateId}
setIsViewDisabled={setIsViewDisabled}
isReRegisterDisabled={isReRegisterDisabled}
setIsDeleteDisabled={setIsDeleteDisabled}
serviceRegistrationState={activeServiceDetail.serviceRegistrationState}
/>
<DeleteService
id={activeServiceDetail.id}
id={activeServiceDetail.serviceTemplateId}
setIsViewDisabled={setIsViewDisabled}
isDeleteDisabled={isDeleteDisabled}
setIsReRegisterDisabled={setIsReRegisterDisabled}
Expand All @@ -233,7 +233,7 @@ function ServiceProvider({
/>
<ServiceDetail serviceDetails={activeServiceDetail} />
<ServicePolicies
key={activeServiceDetail.id}
key={activeServiceDetail.serviceTemplateId}
serviceDetails={activeServiceDetail}
isViewDisabled={isViewDisabled}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const AddOrUpdateServicePolicy = ({
};
setCreatePolicyRequest(policyCreateRequest);
createServicePoliciesRequest.mutate(policyCreateRequest);
} else if (currentServicePolicy.id.length > 0) {
} else if (currentServicePolicy.servicePolicyId.length > 0) {
// Check whether the modified data has changed
if (comparePolicyUpdateRequestResult(policyRequest, currentServicePolicy)) {
setIsUpdated(comparePolicyUpdateRequestResult(policyRequest, currentServicePolicy));
Expand All @@ -75,7 +75,7 @@ export const AddOrUpdateServicePolicy = ({
};
setUpdatePolicyRequest(policyUpdateRequest);
updatePoliciesManagementServiceRequest.mutate({
id: currentServicePolicy.id,
id: currentServicePolicy.servicePolicyId,
policyUpdateRequest: policyUpdateRequest,
});
}
Expand Down Expand Up @@ -214,12 +214,12 @@ export const AddOrUpdateServicePolicy = ({
initialValues={{
remember: true,
enabled:
currentServicePolicy !== undefined && currentServicePolicy.id.length > 0
currentServicePolicy !== undefined && currentServicePolicy.servicePolicyId.length > 0
? currentServicePolicy.enabled
: false,
flavors:
currentServicePolicy !== undefined &&
currentServicePolicy.id.length > 0 &&
currentServicePolicy.servicePolicyId.length > 0 &&
currentServicePolicy.flavorNameList
? currentServicePolicy.flavorNameList
: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const ServicePolicies = ({
const [currentServicePolicy, setCurrentServicePolicy] = useState<ServicePolicy | undefined>(undefined);
const [isOpenAddOrUpdatePolicyModal, setIsOpenAddOrUpdatePolicyModal] = useState<boolean>(false);

const servicePolicyListQuery = useGetServicePolicyList(serviceDetails.id);
const servicePolicyListQuery = useGetServicePolicyList(serviceDetails.serviceTemplateId);
const deleteServicePolicyRequest = useDeleteServicePolicy();

const refreshServicePoliciesList = () => {
Expand All @@ -52,7 +52,7 @@ export const ServicePolicies = ({
const columns: ColumnsType<ServicePolicy> = [
{
title: 'Policy ID',
dataIndex: 'id',
dataIndex: 'servicePolicyId',
},
{
title: 'Content',
Expand Down Expand Up @@ -134,7 +134,7 @@ export const ServicePolicies = ({
type='primary'
icon={<CloseCircleOutlined />}
loading={
record.id === currentPolicyId &&
record.servicePolicyId === currentPolicyId &&
!deleteServicePolicyRequest.isSuccess &&
deleteServicePolicyRequest.isError
}
Expand All @@ -156,8 +156,8 @@ export const ServicePolicies = ({
];

const deleteCurrentServicePolicy = (record: ServicePolicy) => {
setCurrentPolicyId(record.id);
deleteServicePolicyRequest.mutate(record.id);
setCurrentPolicyId(record.servicePolicyId);
deleteServicePolicyRequest.mutate(record.servicePolicyId);
};

const addServicePolicies = () => {
Expand Down Expand Up @@ -250,7 +250,7 @@ export const ServicePolicies = ({
onCancel={closeAddOrUpdateServicePolicyModal}
>
<AddOrUpdateServicePolicy
serviceTemplateId={serviceDetails.id}
serviceTemplateId={serviceDetails.serviceTemplateId}
currentServicePolicy={currentServicePolicy}
getCancelUpdateStatus={getCancelUpdateStatus}
serviceDetails={serviceDetails}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function ServicePolicyCreateResultStatus({
description={
<ServicePolicySubmitResult
msg={'Policy created successfully'}
uuid={currentServicePolicy === undefined ? '' : currentServicePolicy.id}
uuid={currentServicePolicy === undefined ? '' : currentServicePolicy.servicePolicyId}
/>
}
showIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function ServicePolicyUpdateResultStatus({
description={
<ServicePolicySubmitResult
msg={'Policy updated successfully'}
uuid={currentServicePolicy === undefined ? '' : currentServicePolicy.id}
uuid={currentServicePolicy === undefined ? '' : currentServicePolicy.servicePolicyId}
/>
}
showIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function UpdateService({
},
onSuccess: (serviceTemplateVo: ServiceTemplateDetailVo) => {
files.current[0].status = 'done';
updateResult.current = [`ID - ${serviceTemplateVo.id}`];
updateResult.current = [`ID - ${serviceTemplateVo.serviceTemplateId}`];
},
onError: (error: Error) => {
files.current[0].status = 'error';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const MyServiceHistory = ({
deployedService: DeployedServiceDetails | VendorHostedDeployedServiceDetails;
}): React.JSX.Element => {
let serviceModificationAuditHistoryList: ServiceModificationAuditDetails[] = [];
const listServiceModifyHistoryQuery = useListServiceModifyHistoryQuery(deployedService.id);
const listServiceModifyHistoryQuery = useListServiceModifyHistoryQuery(deployedService.serviceId);

if (listServiceModifyHistoryQuery.isSuccess && listServiceModifyHistoryQuery.data.length > 0) {
serviceModificationAuditHistoryList = listServiceModifyHistoryQuery.data;
Expand All @@ -33,7 +33,7 @@ export const MyServiceHistory = ({
const columns: ColumnsType<ServiceModificationAuditDetails> = [
{
title: 'ModifyId',
dataIndex: 'id',
dataIndex: 'serviceModificationRequestId',
align: 'center',
width: 100,
className: serviceModifyStyles.modifyHistoryValue,
Expand Down
38 changes: 20 additions & 18 deletions src/components/content/deployedServices/myServices/MyServices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function MyServices(): React.JSX.Element {
const listDeployedServicesQuery = useListDeployedServicesDetailsQuery();
const getOrderableServiceDetails = useGetOrderableServiceDetailsQuery(activeRecord?.serviceTemplateId);
const getServiceDetailsByIdQuery = useServiceDetailsPollingQuery(
activeRecord?.id,
activeRecord?.serviceId,
serviceDestroyQuery.isSuccess,
activeRecord?.serviceHostingType ?? DeployedService.serviceHostingType.SELF,
[
Expand All @@ -117,21 +117,21 @@ function MyServices(): React.JSX.Element {
);

const getStartServiceDetailsQuery = useServiceDetailsByServiceStatePollingQuery(
activeRecord?.id,
activeRecord?.serviceId,
serviceStateStartQuery.isSuccess,
activeRecord?.serviceHostingType ?? DeployedService.serviceHostingType.SELF,
[DeployedServiceDetails.serviceState.RUNNING, DeployedServiceDetails.serviceState.STOPPED]
);

const getStopServiceDetailsQuery = useServiceDetailsByServiceStatePollingQuery(
activeRecord?.id,
activeRecord?.serviceId,
serviceStateStopQuery.isSuccess,
activeRecord?.serviceHostingType ?? DeployedService.serviceHostingType.SELF,
[DeployedServiceDetails.serviceState.STOPPED, DeployedServiceDetails.serviceState.RUNNING]
);

const getRestartServiceDetailsQuery = useServiceDetailsByServiceStatePollingQuery(
activeRecord?.id,
activeRecord?.serviceId,
serviceStateRestartQuery.isSuccess,
activeRecord?.serviceHostingType ?? DeployedService.serviceHostingType.SELF,
[DeployedServiceDetails.serviceState.RUNNING]
Expand All @@ -147,7 +147,7 @@ function MyServices(): React.JSX.Element {
]);

const getPurgeServiceDetailsQuery = usePurgeRequestStatusQuery(
activeRecord?.id,
activeRecord?.serviceId,
activeRecord?.serviceHostingType ?? DeployedService.serviceHostingType.SELF,
servicePurgeQuery.isSuccess
);
Expand All @@ -162,7 +162,9 @@ function MyServices(): React.JSX.Element {
serviceStateInQuery.includes(serviceVo.serviceState)
);
} else if (serviceIdInQuery) {
serviceVoList = listDeployedServicesQuery.data.filter((serviceVo) => serviceVo.id === serviceIdInQuery);
serviceVoList = listDeployedServicesQuery.data.filter(
(serviceVo) => serviceVo.serviceId === serviceIdInQuery
);
} else {
serviceVoList = listDeployedServicesQuery.data;
}
Expand Down Expand Up @@ -645,7 +647,7 @@ function MyServices(): React.JSX.Element {
}

if (
activeRecord?.id === record.id &&
activeRecord?.serviceId === record.serviceId &&
(serviceStateStartQuery.isPending || serviceStateStopQuery.isPending || serviceStateRestartQuery.isPending)
) {
return true;
Expand Down Expand Up @@ -673,7 +675,7 @@ function MyServices(): React.JSX.Element {
}

if (
activeRecord?.id === record.id &&
activeRecord?.serviceId === record.serviceId &&
(serviceStateStartQuery.isPending || serviceStateStopQuery.isPending || serviceStateRestartQuery.isPending)
) {
return true;
Expand Down Expand Up @@ -730,11 +732,11 @@ function MyServices(): React.JSX.Element {
const columns: ColumnsType<DeployedService> = [
{
title: 'Id',
dataIndex: 'id',
dataIndex: 'serviceId',
filters: serviceIdInQuery ? undefined : serviceIdFilters,
filterMode: 'tree',
filterSearch: true,
onFilter: (value: React.Key | boolean, record) => record.id.startsWith(value.toString()),
onFilter: (value: React.Key | boolean, record) => record.serviceId.startsWith(value.toString()),
filtered: !!serviceIdInQuery,
align: 'center',
},
Expand Down Expand Up @@ -911,7 +913,7 @@ function MyServices(): React.JSX.Element {
? (record as DeployedServiceDetails)
: (record as VendorHostedDeployedServiceDetails)
);
servicePurgeQuery.mutate(record.id);
servicePurgeQuery.mutate(record.serviceId);
record.serviceDeploymentState = DeployedService.serviceDeploymentState.DESTROYING;
};

Expand All @@ -936,7 +938,7 @@ function MyServices(): React.JSX.Element {
? (record as DeployedServiceDetails)
: (record as VendorHostedDeployedServiceDetails)
);
serviceDestroyQuery.mutate(record.id);
serviceDestroyQuery.mutate(record.serviceId);
record.serviceDeploymentState = DeployedService.serviceDeploymentState.DESTROYING;
}

Expand Down Expand Up @@ -1031,7 +1033,7 @@ function MyServices(): React.JSX.Element {
const filters: ColumnFilterItem[] = [];
const serviceIdSet = new Set<string>('');
resp.forEach((v) => {
serviceIdSet.add(v.id);
serviceIdSet.add(v.serviceId);
});
serviceIdSet.forEach((id) => {
const filter = {
Expand Down Expand Up @@ -1261,7 +1263,7 @@ function MyServices(): React.JSX.Element {
<div className={tableStyles.genericTableContainer}>
{isDestroyRequestSubmitted && activeRecord ? (
<DestroyServiceStatusAlert
key={activeRecord.id}
key={activeRecord.serviceId}
deployedService={activeRecord}
destroySubmitError={serviceDestroyQuery.error}
statusPollingError={getServiceDetailsByIdQuery.error}
Expand All @@ -1271,7 +1273,7 @@ function MyServices(): React.JSX.Element {
) : null}
{isStartRequestSubmitted && activeRecord ? (
<StartServiceStatusAlert
key={activeRecord.id}
key={activeRecord.serviceId}
deployedService={activeRecord}
serviceStateStartQuery={serviceStateStartQuery}
closeStartResultAlert={closeStartResultAlert}
Expand All @@ -1280,7 +1282,7 @@ function MyServices(): React.JSX.Element {
) : null}
{isStopRequestSubmitted && activeRecord ? (
<StopServiceStatusAlert
key={activeRecord.id}
key={activeRecord.serviceId}
deployedService={activeRecord}
serviceStateStopQuery={serviceStateStopQuery}
closeStopResultAlert={closeStopResultAlert}
Expand All @@ -1289,7 +1291,7 @@ function MyServices(): React.JSX.Element {
) : null}
{isRestartRequestSubmitted && activeRecord ? (
<RestartServiceStatusAlert
key={activeRecord.id}
key={activeRecord.serviceId}
deployedService={activeRecord}
serviceStateRestartQuery={serviceStateRestartQuery}
closeRestartResultAlert={closeRestartResultAlert}
Expand All @@ -1298,7 +1300,7 @@ function MyServices(): React.JSX.Element {
) : null}
{isPurgeRequestSubmitted && activeRecord ? (
<PurgeServiceStatusAlert
key={activeRecord.id}
key={activeRecord.serviceId}
deployedService={activeRecord}
purgeSubmitError={servicePurgeQuery.error}
statusPollingError={getPurgeServiceDetailsQuery.error}
Expand Down
10 changes: 5 additions & 5 deletions src/components/content/deployedServices/reports/Reports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Reports(): React.JSX.Element {
);
} else if (serviceIdInQuery) {
deployedServiceList = listDeployedServicesByIsvQuery.data.filter(
(service) => service.id === serviceIdInQuery
(service) => service.serviceId === serviceIdInQuery
);
} else {
deployedServiceList = listDeployedServicesByIsvQuery.data;
Expand All @@ -72,11 +72,11 @@ function Reports(): React.JSX.Element {
const columns: ColumnsType<DeployedService> = [
{
title: 'Id',
dataIndex: 'id',
dataIndex: 'serviceId',
filters: serviceIdInQuery ? undefined : serviceIdFilters,
filterMode: 'tree',
filterSearch: true,
onFilter: (value: React.Key | boolean, record) => record.id.startsWith(value.toString()),
onFilter: (value: React.Key | boolean, record) => record.serviceId.startsWith(value.toString()),
filtered: !!serviceIdInQuery,
align: 'center',
},
Expand Down Expand Up @@ -220,7 +220,7 @@ function Reports(): React.JSX.Element {
const filters: ColumnFilterItem[] = [];
const serviceIdSet = new Set<string>('');
resp.forEach((v) => {
serviceIdSet.add(v.id);
serviceIdSet.add(v.serviceId);
});
serviceIdSet.forEach((id) => {
const filter = {
Expand Down Expand Up @@ -336,7 +336,7 @@ function Reports(): React.JSX.Element {
}

const handleMyServiceDetailsOpenModal = (deployedService: DeployedService) => {
setServiceIdInModal(deployedService.id);
setServiceIdInModal(deployedService.serviceId);
setIsMyServiceDetailsModalOpen(true);
};

Expand Down
Loading

0 comments on commit 690e67b

Please sign in to comment.