Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to restart jobs upon comment submission #5971

Merged
merged 2 commits into from
Nov 7, 2024

Commits on Nov 1, 2024

  1. Add option to restart jobs upon comment submission

    - Renamed `addComments` to `restartOrCommentJobs` to handle both commenting and
    restarting jobs.
    - Added button-specific actions using `form.clickedButton`.
    - Updated `fetchWithCSRF` logic to dynamically determine request URLs based on
    the button clicked.
    - Introduced separate success and error messages for restarting and commenting
    actions.
    - Updated HTML to include "Restart and Comment" and "Comment" buttons with
    individual API endpoints via formaction. That removes action attribute from
    the form element.
    - Let "comments" be `btn-warning` and "restart" show more severe operation
    using `btn-danger`.
    - Adjusted modal to allow submission of comments or restarts through the
    correct action handlers.
    - Inform overview page with warning in case of errors in Response.
    - Redesign `restartOrCommentJobs` (previews addComments) to reflect the new
    features.
    
    These updates enhance the user experience by allowing users to either comment
    on jobs, or perform restart with a comment simultaneously from the
    overview page. Comments always add to the original job of the overview
    page. By integrating this functionality we provide a workflow for
    users managing multiple jobs on the overview page using the already existing
    API implementations.
    
    https://progress.opensuse.org/issues/166559
    
    Signed-off-by: Ioannis Bonatakis <[email protected]>
    b10n1k committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    3d3dbc9 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2024

  1. Reuse restartJob in order of restart jobs in Overview page

    Refactor restartJob in order to make sure that is able to handle request for
    multiple restarts. This follows up with some changes to the form and the
    javascript part of the overview.html.ep, which triggers the restart with the
    use of restartJob, as opposed of reimplement the logic.
    The advantage is that we have one common behavior and error handling on the
    restart operation.
    
    - An optional comment can be passed not to restartJob, which is included to
    the request.
    - restartJob handles both single and multible job restarts.
    - The form is designed to handle each occasion in separate functions making
    the code becomes more modular and easier to maintain.
    - The overvies's restartJobs function will restart only jobs with valid id.
    
    https://progress.opensuse.org/issues/166559
    
    Signed-off-by: Ioannis Bonatakis <[email protected]>
    b10n1k committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    29fdf01 View commit details
    Browse the repository at this point in the history