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

[WEB-2456] Chore: workspace member list additional info #5604

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

gakshita
Copy link
Collaborator

@gakshita gakshita commented Sep 13, 2024

Summary
Added email and authentication columns in workspace member settings

[WEB-2456]

Summary by CodeRabbit

  • New Features

    • Introduced a new field, last_login_medium, for tracking user login methods.
    • Added a new column for "Authentication" in workspace member settings to display the last login medium.
  • Improvements

    • Standardized naming conventions for column headers in workspace member settings for better readability.

@gakshita gakshita changed the title Chore: workspace member list additional info [WEB-2456] Chore: workspace member list additional info Sep 13, 2024
Copy link
Collaborator

@SatishGandham SatishGandham left a comment

Choose a reason for hiding this comment

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

Remove the yarn lock changes from this pr

Copy link
Contributor

coderabbitai bot commented Sep 16, 2024

Walkthrough

The pull request introduces a new field, last_login_medium, to both the UserSerializer and the IWorkspaceMember interface, enhancing the user and workspace member data models. Additionally, it modifies the useMemberColumns function to standardize column headers and introduce new data points, including the last login medium. These changes collectively improve the representation and management of user interaction data within the application.

Changes

File Change Summary
apiserver/plane/app/serializers/user.py Added last_login_medium to Meta class in UserSerializer.
packages/types/src/workspace.d.ts Introduced optional property last_login_medium to IWorkspaceMember interface.
web/ce/components/workspace/settings/useMemberColumns.tsx Renamed column headers for consistency, replaced "Account Type" with "Email address," added "Authentication" column for last login medium, and standardized naming conventions.

Possibly related PRs

Suggested labels

🌐frontend

Poem

🐇 In the meadow where data flows,
A new field blooms where the user goes.
Last login's tale now softly told,
In columns bright, both new and bold.
Hopping forward, we celebrate,
Enhancements sweet, oh, isn’t it great! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f155a13 and bb57585.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (3)
  • apiserver/plane/app/serializers/user.py (1 hunks)
  • packages/types/src/workspace.d.ts (1 hunks)
  • web/ce/components/workspace/settings/useMemberColumns.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
  • web/ce/components/workspace/settings/useMemberColumns.tsx
Additional comments not posted (2)
packages/types/src/workspace.d.ts (1)

80-80: LGTM!

The addition of the optional last_login_medium property to the IWorkspaceMember interface is a good enhancement. It allows capturing more detailed user interaction data without affecting existing functionality.

The property name is clear and descriptive, and the string type is appropriate for representing the login medium.

apiserver/plane/app/serializers/user.py (1)

179-179: Verify the usage and data consistency of the last_login_medium field.

The addition of the last_login_medium field to the UserAdminLiteSerializer is a valid change that enhances the serialized representation of user data. This change aligns with the broader goal of tracking and displaying the medium through which a user last logged in.

To ensure data consistency and proper usage of the last_login_medium field, please verify the following:

  1. The corresponding last_login_medium field exists in the User model and is being correctly set or updated when a user logs in.
  2. The view or endpoint that utilizes the UserAdminLiteSerializer handles the last_login_medium field appropriately, either by displaying it or allowing it to be modified if necessary.

You can use the following script to search for relevant occurrences of last_login_medium in the codebase:

If any inconsistencies or missing pieces are found, please address them to maintain data integrity and ensure the proper functioning of the last_login_medium field.

Verification successful

These scripts will help us gather more comprehensive information about the last_login_medium field and its usage across the codebase. Once we have these results, we'll be able to make a more informed decision about the consistency and proper implementation of this field.


These simplified commands should help us bypass the file type recognition issue and give us a clearer picture of where and how last_login_medium is being used in the codebase. Once we have these results, we'll be able to make a more informed decision about the consistency and proper implementation of this field.


The addition of last_login_medium to UserAdminLiteSerializer is consistent and valid.

The last_login_medium field is properly integrated throughout the codebase:

  1. It's defined in the User model (apiserver/plane/db/models/user.py).
  2. It's included in the initial database migration.
  3. It's set in the authentication process (authentication adapter).
  4. It's used in frontend components and properly typed in TypeScript definitions.
  5. It appears in multiple serializer classes in the user serializer file.

This change aligns with the field's usage across the application and enhances the consistency of user data representation. The implementation appears to be complete and well-integrated.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage and data consistency of the `last_login_medium` field.

# Test 1: Search for the field in the `User` model. Expect: Field declaration.
rg --type python -A 5 $'last_login_medium' $(fd -e py -E migrations)

# Test 2: Search for the field being set or updated. Expect: Relevant occurrences in views or authentication logic.
rg --type python -A 5 $'last_login_medium\s*=' $(fd -e py -E migrations)

# Test 3: Search for the field in views or endpoints. Expect: Usage in relevant contexts.
rg --type python -A 5 $'last_login_medium' $(fd -e py -E migrations)

Length of output: 45275


Script:

#!/bin/bash
# Description: Further investigation of the `last_login_medium` field

# Check for the field in the User model
echo "Searching for last_login_medium in User model:"
rg --type python "class User\(" -A 20 | rg "last_login_medium"

# Look for references in migration files
echo "\nSearching for last_login_medium in migration files:"
rg --type python "last_login_medium" $(fd -e py -p "migrations")

# Check for usage in views or authentication logic
echo "\nSearching for last_login_medium in views and authentication files:"
rg --type python "last_login_medium" $(fd -e py -p "views|authentication")

# Verify the field in the serializer we're reviewing
echo "\nVerifying last_login_medium in UserAdminLiteSerializer:"
rg --type python "class UserAdminLiteSerializer" -A 20 apiserver/plane/app/serializers/user.py

# Double-check our search command
echo "\nDouble-checking search command for last_login_medium:"
rg --type python "last_login_medium" $(fd -e py)

Length of output: 32609


Script:

#!/bin/bash
# Description: Simplified search for last_login_medium field

# Search for last_login_medium in the entire codebase
echo "Searching for last_login_medium in the entire codebase:"
grep -r "last_login_medium" .

# Focus on the user serializer file
echo "\nChecking the user serializer file:"
cat apiserver/plane/app/serializers/user.py | grep -n "last_login_medium"

# Search for User model definition
echo "\nSearching for User model definition:"
grep -r "class User(" .

# Check for any recent changes related to last_login_medium
echo "\nChecking recent changes related to last_login_medium:"
git log -p | grep "last_login_medium"

Length of output: 1950


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai generate interesting stats about this repository and render them as a table.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pushya22 pushya22 merged commit 7450755 into preview Sep 16, 2024
14 of 15 checks passed
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.

4 participants