Skip to content

BI-2496 When Deleting an Experiment: "Success" message appears even if delete fails.#427

Merged
davedrp merged 2 commits intodevelopfrom
bug/BI-2496
Feb 17, 2025
Merged

BI-2496 When Deleting an Experiment: "Success" message appears even if delete fails.#427
davedrp merged 2 commits intodevelopfrom
bug/BI-2496

Conversation

@davedrp
Copy link
Contributor

@davedrp davedrp commented Feb 6, 2025

Description

BI-2496 When Deleting an Experiment: "Success" message appears even if delete fails.

Please include a summary of the change that was made.
Read the HTTP-status code returned from bi-api and use that to display the correct banner.

Testing

  1. Insure the "success" banner still appears when an experiment is successfully deleted.
  2. An "error" banner should appear when the delete fails. (to insure the delete fails, I temporarily replace ExperimentController::deleteExperiment with:
   @Delete("/${micronaut.bi.api.version}/programs/{programId}/experiments/{experimentId}{?hard}")
    @ProgramSecured(roles = {ProgramSecuredRole.PROGRAM_ADMIN, ProgramSecuredRole.SYSTEM_ADMIN})
    @Produces(MediaType.APPLICATION_JSON)
    public HttpResponse deleteExperiment(
            @PathVariable("programId") UUID programId,
            @PathVariable("experimentId") UUID experimentId,
            @QueryValue(defaultValue = "false") Boolean hard
    ) throws ApiException {
        return HttpResponse.serverError();
    }

Checklist:

  • I have performed a self-review of my own code
  • I have tested my code and ensured it meets the acceptance criteria of the story
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: <link to TAF run>
  • I have run SiteImprove on pages impacted by changes

@davedrp davedrp requested review from a team, HMS17 and mlm483 and removed request for a team February 6, 2025 18:24
@github-actions github-actions bot added the bug Something isn't working label Feb 6, 2025
Copy link
Contributor

@mlm483 mlm483 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, working.

Copy link
Contributor

@HMS17 HMS17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success message appears when experiment is successfully deleted and does not appear when deletion fails!

@davedrp davedrp merged commit 8bbddf3 into develop Feb 17, 2025
1 check passed
@davedrp davedrp deleted the bug/BI-2496 branch February 17, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants