KKcorps opened a new pull request, #16078: URL: https://github.com/apache/pinot/pull/16078
This pull request introduces a new feature to reset a segment in the Pinot Controller UI. The changes include adding a "Reset Segment" button to the `SegmentDetails` page, implementing the corresponding API call, and handling the reset operation in the frontend logic. ### Frontend Changes: * **New "Reset Segment" Button**: Added a `CustomButton` labeled "Reset Segment" to the `SegmentDetails` page, with a tooltip explaining its functionality. Clicking the button triggers the reset operation. (`pinot-controller/src/main/resources/app/pages/SegmentDetails.tsx`, [pinot-controller/src/main/resources/app/pages/SegmentDetails.tsxR402-R410](diffhunk://#diff-23536ffd8faea49c12bd00541a968335b946315b037944e1512b1bf844a8c3caR402-R410)) * **Reset Segment Logic**: Introduced a `handleResetSegmentClick` function to display a confirmation dialog and a `handleResetOp` function to perform the reset operation, handle success/error messages, and refresh the data. (`pinot-controller/src/main/resources/app/pages/SegmentDetails.tsx`, [pinot-controller/src/main/resources/app/pages/SegmentDetails.tsxR328-R350](diffhunk://#diff-23536ffd8faea49c12bd00541a968335b946315b037944e1512b1bf844a8c3caR328-R350)) ### API Integration: * **Reset Segment API Call**: Added a `resetSegment` function in `requests/index.ts` to make a POST request to the backend for resetting a segment. (`pinot-controller/src/main/resources/app/requests/index.ts`, [pinot-controller/src/main/resources/app/requests/index.tsR268-R270](diffhunk://#diff-b13897d73dad61f05e92f4bb1b1c27b1f602329ae0797dcbbb9d44d06d6cdca4R268-R270)) ### Utility Enhancements: * **Utility Method for Reset**: Added a `resetSegmentOp` method to `PinotMethodUtils` to wrap the `resetSegment` API call and return the response data. (`pinot-controller/src/main/resources/app/utils/PinotMethodUtils.ts`, [[1]](diffhunk://#diff-15df1cdd7056ee59b518965ce03484b9033929df4d271ab1d90ac035cef6ae3bR993-R998) [[2]](diffhunk://#diff-15df1cdd7056ee59b518965ce03484b9033929df4d271ab1d90ac035cef6ae3bR1392) * **Import Update**: Included the `resetSegment` function in the imports of `PinotMethodUtils`. (`pinot-controller/src/main/resources/app/utils/PinotMethodUtils.ts`, [pinot-controller/src/main/resources/app/utils/PinotMethodUtils.tsR83](diffhunk://#diff-15df1cdd7056ee59b518965ce03484b9033929df4d271ab1d90ac035cef6ae3bR83)) -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org