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] disable field to edit default value in settings if needed (#6037) #6076

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

lndrtrbn
Copy link
Member

Proposed changes

  • disable field to edit default value in settings if not editable
  • disable open form if can neither edit mandatory or default value

Related issues

Checklist

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

@lndrtrbn lndrtrbn self-assigned this Feb 22, 2024
@lndrtrbn lndrtrbn added the filigran team use to identify PR from the Filigran team label Feb 22, 2024
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b21a6fe) 65.94% compared to head (4a548bd) 66.13%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6076      +/-   ##
==========================================
+ Coverage   65.94%   66.13%   +0.18%     
==========================================
  Files         541      541              
  Lines       64286    64287       +1     
  Branches     5199     5228      +29     
==========================================
+ Hits        42393    42513     +120     
+ Misses      21893    21774     -119     

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

@@ -60,6 +61,7 @@ Omit<OpenVocabProps, 'type'>
containerStyle,
editContext,
queryRef,
disabled = false,
Copy link
Member

Choose a reason for hiding this comment

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

Already initialized to false into DefaultValueField.tsx, not necessary here. Or if it's really necessary here, isn't it also necessary in the other files (KillChainPhasesField, ObservableTypesField) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed it's not necessary as in JS the boolean value of undefined is false. Still I think it's a good practice to initialize the value to a boolean as it is optional. Could be done in other components but nothing mandatory

@lndrtrbn lndrtrbn changed the title [frontend] disable default value field if needed (#6037) [frontend] disable field to edit default value in settings if needed (#6037) Feb 26, 2024
Copy link
Member

@marieflorescontact marieflorescontact left a comment

Choose a reason for hiding this comment

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

tested locally by playing with attributes definition. looks good. 👌

@lndrtrbn lndrtrbn merged commit d212280 into master Feb 26, 2024
8 checks passed
@lndrtrbn lndrtrbn deleted the issue/6037 branch February 26, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entity settings display edit default value input even if attribute has "editDefault" false
3 participants