-
Notifications
You must be signed in to change notification settings - Fork 361
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 Group Description #8448
base: master
Are you sure you want to change the base?
Add Group Description #8448
Conversation
🎊 PR Preview f7b9e69 has been successfully built and deployed to https://treeverse-lakeFS-preview-pr-8448.surge.sh 🕐 Build time: 0.01s 🤖 By surge-preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a drive-by comment about a strange protection mechanism.
@@ -171,6 +175,9 @@ const GroupsContainer = () => { | |||
placeholder="Group Name (e.g. 'DataTeam')" | |||
actionName={"Create"} | |||
validationFunction={disallowPercentSign(INVALID_GROUP_NAME_ERROR_MESSAGE)} | |||
showExtraField={true} | |||
extraPlaceholder="Group Description (optional)" | |||
extraValidationFunction={disallowPercentSign(INVALID_GROUP_DESCRIPTION_ERROR_MESSAGE)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please only add such protections if there is an actual broken case. I always prefer to employ correct quotation mechanisms rather than to attempt to prevent all "bad" cases.
I would expect URI component encoding or whatever to protect percent signs. If things break when descriptions have percent signs, then I expect them also to break in many other cases, such as descriptions with plus signs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I wrote some comments...
async getGroup(groupId) { | ||
const response = await apiRequest(`/auth/groups/${encodeURIComponent(groupId)}`); | ||
if (response.status !== 200) { | ||
throw new Error(`could not get groups: ${await extractError(response)}`); | ||
} | ||
return response.json(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need get group, can't we use the information from listing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No -
This page is rendered from the auth/groups/{group-id}/
URL,
So it's rendered without calling the list
API.
@@ -959,6 +961,7 @@ func (c *Controller) GetGroup(w http.ResponseWriter, r *http.Request, groupID st | |||
|
|||
response := apigen.Group{ | |||
Id: g.DisplayName, | |||
Description: g.Description, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about list groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't a requirement -
But added now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comments are resolved
Change Description
Background
To make Auth Group more usable, adding a
description
field to (Auth)Group
entities, so there will be easier to distinguish.New Feature
Add the
description
field to theGroup
entity,And support it in Group creation and Group fetching.
Testing Details
Tested locally,
Added unit-tests.