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

[frontend] fixed workbench creation pop-up in case of error (#8265) #8285

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

stefan1anuby
Copy link
Contributor

Proposed changes

  • When trying to create a workbench with the same name, it currently shows a generic error:
    image
    If I hadn't set that generic error, the message would have been:
    "RRNLRequestError: Relay request for WorkbenchFileCreatorMutation failed for the following reason: 1. A file already exists with this name. uploadPending(file: $file, labels: $labels, errorOnExistin ^^^"
    Would this be too confusing for users?
  • The pop-up no longer freezes after that workflow:
    image

Related issues

part of #8265

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

Should I implement form validation to check for duplicate workbench names when the "Create" button is pressed? Doing so would allow us to display a more specific error message, such as "A file with this name already exists."

Copy link

codecov bot commented Sep 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.21%. Comparing base (b29748b) to head (7014bef).
Report is 95 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8285      +/-   ##
==========================================
- Coverage   66.23%   66.21%   -0.02%     
==========================================
  Files         597      597              
  Lines       60300    60422     +122     
  Branches     6196     6202       +6     
==========================================
+ Hits        39939    40009      +70     
- Misses      20361    20413      +52     
Flag Coverage Δ
66.21% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Kedae Kedae added the community use to identify PR from community label Sep 8, 2024
@@ -130,6 +134,11 @@ const WorkbenchFileCreator: FunctionComponent<WorkbenchFileCreatorProps> = ({
handleCloseCreate();
onCompleted?.();
},
onError: () => {
setSubmitting(false);
Copy link
Member

Choose a reason for hiding this comment

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

As this code is shared between multiple places (onCompleted, onError, twice). I suggest to extract it into a "handleCompleted" or something like that method.

@Kedae
Copy link
Member

Kedae commented Sep 24, 2024

@stefan1anuby You need to sign your commits, can you check GCP to sign your commits ?

…Platform#8265)

Signed-off-by: stefan1anuby <stefaneduard2002@gmail.com>
Signed-off-by: stefan1anuby <stefaneduard2002@gmail.com>
@Kedae Kedae merged commit 1aa3e4b into OpenCTI-Platform:master Sep 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community use to identify PR from community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants