Introduce possibility of mandatory non-deletable key values#1708
Introduce possibility of mandatory non-deletable key values#1708solita-sabinaf wants to merge 5 commits into
Conversation
52c2549 to
562fce1
Compare
| @@ -0,0 +1,294 @@ | |||
| /* | |||
There was a problem hiding this comment.
The diff looked better on a commit level :/
There was a problem hiding this comment.
That's ok, the benefit is now the file history can be tracked across the rename.
|
Ping @a-limyr, this is ready for review |
a-limyr
left a comment
There was a problem hiding this comment.
Looks good, found two minor things. Good job!
| const keyValuesOrigin = useSelector( | ||
| (state: any) => state.user.keyValuesOrigin?.type, | ||
| ); | ||
| disabled = false; |
There was a problem hiding this comment.
Probably an old bug, but this line will result in always showing the edit, delete and create new buttons even when not logged in.
There was a problem hiding this comment.
Thank you, that's a great catch! That was something I added and forgot to clear away. Along the way removed the const keyValuesOrigin as it wasn't used anywhere
|
|
||
| const handleUpdateValues = (key: string, values: string[]) => { | ||
| setIsEditingOpen(false); | ||
|
|
There was a problem hiding this comment.
For new keyValues there is run two dispatches, one for create and then on for update. I would suggest adding a return statement after create to avoid that.
There was a problem hiding this comment.
Good point 👍
Summary
We would like to have some keys in key values that are already present in UI so that user doesn't need to type them, and that cannot be deleted
Unit tests
Tested with and without mandatory keys specified in the bootstrap.json
Use this to test: