Skip to content

feat: add user group db schema support - #1144

Merged
czgu merged 8 commits into
pinterest:masterfrom
jczhong84:feat/usergroup
Feb 7, 2023
Merged

czgu merged 8 commits into
pinterest:masterfrom
jczhong84:feat/usergroup

Conversation

@jczhong84

Copy link
Copy Markdown
Collaborator
  • update db schema to support user group
  • add a new component to display user group info
    Snip20230203_1

Comment thread querybook/server/datasources/user.py Outdated
Comment thread querybook/server/datasources/user.py Outdated
Comment thread querybook/server/datasources/user.py Outdated
Comment thread querybook/server/models/user.py Outdated
Comment thread querybook/server/models/user.py
Comment thread querybook/webapp/components/UserGroupCard/UserGroupCard.tsx Outdated
Comment thread querybook/webapp/components/UserGroupCard/UserGroupCard.tsx Outdated
Comment thread querybook/webapp/components/UserGroupCard/UserGroupCard.tsx Outdated
Comment thread querybook/webapp/components/UserGroupCard/UserGroupCard.tsx Outdated
Group members
</AccentText>
<div className="members-container">
{members.map((m) => (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

put a limit on how many member to show

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

should we provide "show more" to allow them to view all the members?

@czgu

czgu commented Feb 7, 2023

Copy link
Copy Markdown
Collaborator

@jczhong84 there is another concern that i just realized. With this change, users will be able to add "groups" as editors of datadocs. For now, can you disable groups being indexed into elasticsearch?



## Load Users and Group
If you're not using the default username/password authentication, you probably need to sync the users/groups regularly from your organization's sysmtem into Querybook. To do this, you can

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oauth/ldap auth both supports auto-creation of users. I guess you can mention groups can only be sync'ed now and cannot be created in UI

A user or a group can have below properties
- username: It is the unique iendifiter of a user or a group.
- fullname: Full name or display name of a user or a group
- password: Password of a user. Only applies to a user.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Only applies to users when using default user/password auth

- fullname: Full name or display name of a user or a group
- password: Password of a user. Only applies to a user.
- email: Email of a user or a group.
- profile_img: Profile image of a user or a group.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

profile image url

Comment thread querybook/server/models/user.py
Comment thread querybook/webapp/const/uiConfig.ts Outdated
* this constant controls the maximum number
* of members to show in the user group popover
*/
export const MAX_USER_GROUP_MEMBERS_TO_SHOW = 1;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

1 is too low?

Comment thread querybook/webapp/const/user.ts Outdated
roles?: number[];

// Properties below are only available when is_group is true
properties?: {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

properties is no longer optional

We use the `User` model to represent a user or a group.

A user or a group can have below properties
- username: It is the unique iendifiter of a user or a group.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

identifier

czgu
czgu previously approved these changes Feb 7, 2023
## Create/Load Users and Group
For users
- default user/password authentication: people can sign up as a new user on UI.
- auth/ldap authentication: they both support auto-creation of users.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oauth

@czgu
czgu merged commit 4734e01 into pinterest:master Feb 7, 2023
@jczhong84
jczhong84 deleted the feat/usergroup branch April 7, 2023 00:41
rohan-sh1 pushed a commit to CAI-TECHNOLOGIES/cai-ext-db-explorer that referenced this pull request Apr 11, 2023
* feat: add user group db schema support

* comments

* disable user group indexing

* addto sidebar

* fix linter

* more comments

* fix linter

* typo
aidenprice pushed a commit to arrowtail-precision/querybook that referenced this pull request Jan 3, 2024
* feat: add user group db schema support

* comments

* disable user group indexing

* addto sidebar

* fix linter

* more comments

* fix linter

* typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants