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

fix: remove employee settings apis #707

Closed
wants to merge 3 commits into from
Closed

Conversation

anishfyle
Copy link
Contributor

@anishfyle anishfyle commented Dec 17, 2024

Description

  • remove all api endpoints for map employees page in qbo

Clickup

  • htps://app.clickup.com/t/rem-api-endpoints-map-employee

Summary by CodeRabbit

  • New Features

    • None
  • Bug Fixes

    • None
  • Documentation

    • None
  • Refactor

    • Removed serializers and triggers related to employee mapping functionality.
    • Streamlined the CloneSettingsSerializer by removing employee mappings functionality.
  • Chores

    • Deleted the endpoint for mapping employees in the URL configuration.
    • Removed associated test files and fixtures related to employee mapping.

Copy link

coderabbitai bot commented Dec 17, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request involves the removal of several files and components related to mapping employees in a workspace. The deleted files include serializers.py, triggers.py, and views.py within the apps/workspaces/apis/map_employees/ directory. Additionally, the corresponding URL route for mapping employees has been removed from the urls.py file. These changes indicate a significant refactoring or deprecation of the employee mapping functionality in the workspace API.

Changes

File Change Summary
apps/workspaces/apis/map_employees/serializers.py Removed WorkspaceGeneralSettingsSerializer and MapEmployeesSerializer classes
apps/workspaces/apis/map_employees/triggers.py Removed MapEmployeesTriggers class and its run_workspace_general_settings_triggers method
apps/workspaces/apis/map_employees/views.py Removed MapEmployeesView class that handled workspace mapping endpoints
apps/workspaces/apis/urls.py Deleted URL route for MapEmployeesView
apps/workspaces/apis/clone_settings/serializers.py Removed employee_mappings field and get_employee_mappings method from CloneSettingsSerializer
tests/test_workspaces/test_apis/test_map_employee/fixtures.py Removed test fixture data related to employee mapping
tests/test_workspaces/test_apis/test_map_employee/test_serializers.py Removed unit tests for MapEmployeesSerializer
tests/test_workspaces/test_apis/test_map_employee/test_views.py Removed test function for the MapEmployeesView API endpoint

Poem

🐰 Farewell, mapping magic, your time has passed
Serializers and triggers, no longer to last
Routes vanish like whispers, silent and clean
A code transformation, rarely seen
Rabbit hops forward, embracing the new 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a024d86 and 0e88ee0.

📒 Files selected for processing (1)
  • apps/workspaces/apis/clone_settings/serializers.py (2 hunks)

🪧 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@github-actions github-actions bot added the size/M Medium PR label Dec 17, 2024
Copy link

Tests Skipped Failures Errors Time
1 0 💤 0 ❌ 1 🔥 1.656s ⏱️

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (3)
apps/workspaces/apis/clone_settings/serializers.py (3)

Line range hint 15-24: Remove remaining employee_mappings field declarations

The PR aims to remove employee settings APIs, but the employee_mappings field is still declared in the serializer.

Apply this diff to remove the field:

class CloneSettingsSerializer(serializers.ModelSerializer):
    export_settings = ReadWriteSerializerMethodField()
    import_settings = ReadWriteSerializerMethodField()
    advanced_configurations = ReadWriteSerializerMethodField()
-   employee_mappings = ReadWriteSerializerMethodField()
    workspace_id = serializers.SerializerMethodField()

    class Meta:
        model = Workspace
        fields = [
            'workspace_id',
            'export_settings',
            'import_settings',
            'advanced_configurations',
-           'employee_mappings'
        ]
        read_only_fields = ['workspace_id']

Line range hint 41-45: Remove employee_mapping from update method

The update method still processes employee mappings which should be removed.

Apply this diff:

    def update(self, instance, validated):
        export_settings = validated.pop('export_settings')
        import_settings = validated.pop('import_settings')
        advanced_configurations = validated.pop('advanced_configurations')
-       employee_mapping = validated.pop('employee_mappings')

Line range hint 82-84: Remove employee_mappings validation

The validate method still includes employee mappings validation which should be removed as part of the employee settings API removal.

Apply this diff:

        if not data.get('advanced_configurations'):
            raise serializers.ValidationError('Advanced Settings are required')

-       if not data.get('employee_mappings'):
-           raise serializers.ValidationError('Employee Mappings are required')
        return data
🧹 Nitpick comments (1)
apps/workspaces/apis/clone_settings/serializers.py (1)

62-63: Fix indentation in conditional block

The indentation of the conditional block is inconsistent.

Apply this diff to fix the indentation:

-        if export_settings_serializer.is_valid(raise_exception=True) and \
-            import_settings_serializer.is_valid(raise_exception=True) and  \
+        if export_settings_serializer.is_valid(raise_exception=True) and \
+                import_settings_serializer.is_valid(raise_exception=True) and \
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b21a638 and a024d86.

📒 Files selected for processing (4)
  • apps/workspaces/apis/clone_settings/serializers.py (1 hunks)
  • tests/test_workspaces/test_apis/test_map_employee/fixtures.py (0 hunks)
  • tests/test_workspaces/test_apis/test_map_employee/test_serializers.py (0 hunks)
  • tests/test_workspaces/test_apis/test_map_employee/test_views.py (0 hunks)
💤 Files with no reviewable changes (3)
  • tests/test_workspaces/test_apis/test_map_employee/fixtures.py
  • tests/test_workspaces/test_apis/test_map_employee/test_views.py
  • tests/test_workspaces/test_apis/test_map_employee/test_serializers.py
🔇 Additional comments (1)
apps/workspaces/apis/clone_settings/serializers.py (1)

Line range hint 1-84: Verify the impact of employee mappings removal

Let's verify that all references to employee mappings have been removed from the codebase.

Copy link

Tests Skipped Failures Errors Time
264 0 💤 0 ❌ 0 🔥 54.612s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Medium PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant