smitajoshi12 commented on code in PR #5521:
URL: https://github.com/apache/ozone/pull/5521#discussion_r1461889715
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -777,6 +820,66 @@ export class Om extends React.Component<Record<string,
object>, IOmdbInsightsSta
});
};
+ // Pending Delete Directories
+ fetchDeletePendingDir = (limit: number, prevKeyDirDelete: string) => {
+ this.setState({
+ loading: true,
+ nextClickable: true,
+ prevClickable: true
+ });
+
+ //Cancel any previous pending request
+ cancelRequests([
+ cancelMismatchedEndpointSignal,
+ cancelOpenKeysSignal,
+ cancelDeletePendingSignal,
+ cancelDeletedKeysSignal,
+ cancelRowExpandSignal,
+ cancelDeletedPendingDirSignal
+ ]);
+
+ let deletePendingDirEndpoint;
+ if (prevKeyDirDelete === "" || prevKeyDirDelete === undefined ) {
+ deletePendingDirEndpoint =
`/api/v1/keys/deletePending/dirs?limit=${limit}`;
+ }
+ else {
+ deletePendingDirEndpoint =
`/api/v1/keys/deletePending/dirs?limit=${limit}&prevKey=${prevKeyDirDelete}`;
+ }
+
+ const { request, controller } = AxiosGetHelper(deletePendingDirEndpoint,
cancelDeletedPendingDirSignal);
+ cancelDeletedPendingDirSignal = controller
+ request.then(deletePendingDirResponse => {
+ const deletedDirInfo = deletePendingDirResponse &&
deletePendingDirResponse.data && deletePendingDirResponse.data.deletedDirInfo;
+ if (deletePendingDirResponse && deletePendingDirResponse.data &&
deletePendingDirResponse.data.lastKey === "") {
+ //last key of api is empty may be last record no further records
+ dirPendingPrevList =[""];
+ this.setState({
+ loading: false,
+ nextClickable: false,
+ pendingDeleteDirDataSource: deletedDirInfo
+ })
+ }
+ else {
+ if (this.state.prevKeyDirDelete === "" ||
this.state.prevKeyDirDelete === undefined ) {
Review Comment:
undefined and ! operators are slightly having difference as explained in
above comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]