keyshade icon indicating copy to clipboard operation
keyshade copied to clipboard

feat(api): Implement global search feature in workspace

Open Tirthchoksi22 opened this issue 7 months ago • 6 comments

User description

Description

feat: Implement global search functionality

  • Added globalSearch method in WorkspaceService to search projects, environments, secrets, and variables by partial name or description.
  • Updated ProjectService's getProjectsOfWorkspace method to filter projects based on search term and user access, excluding sensitive fields.
  • Implemented getEnvironmentsOfWorkspace, getSecretsOfWorkspace, and getVariablesOfWorkspace methods in respective services.
  • Added excludeFields utility function to remove specified fields from objects.

Fixes #309


PR Type

Enhancement


Description

  • Implemented global search functionality across projects, environments, secrets, and variables within a workspace.
  • Added getEnvironmentsOfWorkspace method in EnvironmentService to search environments by name or description.
  • Enhanced getProjectsOfWorkspace method in ProjectService to include search functionality and removed pagination and sorting.
  • Added getSecretsOfWorkspace method in SecretService to search secrets by name or note.
  • Added getVariablesOfWorkspace method in VariableService to search variables by name or note.
  • Added globalSearch endpoint in WorkspaceController to search across multiple entities.
  • Implemented globalSearch method in WorkspaceService to aggregate search results.

Changes walkthrough 📝

Relevant files
Enhancement
environment.service.ts
Add method to search environments within a workspace         

apps/api/src/environment/service/environment.service.ts

  • Added getEnvironmentsOfWorkspace method to search environments by name
    or description.
  • Implemented authority check for workspace access.
  • Included user-specific environment filtering.
  • +25/-0   
    project.service.ts
    Enhance project search within a workspace                               

    apps/api/src/project/service/project.service.ts

  • Modified getProjectsOfWorkspace method to include search
    functionality.
  • Removed pagination and sorting parameters.
  • Filtered projects based on user access and search term.
  • +5/-9     
    secret.service.ts
    Add method to search secrets within a workspace                   

    apps/api/src/secret/service/secret.service.ts

  • Added getSecretsOfWorkspace method to search secrets by name or note.
  • Implemented authority check for workspace access.
  • Included user-specific secret filtering.
  • +25/-0   
    variable.service.ts
    Add method to search variables within a workspace               

    apps/api/src/variable/service/variable.service.ts

  • Added getVariablesOfWorkspace method to search variables by name or
    note.
  • Implemented authority check for workspace access.
  • Included user-specific variable filtering.
  • +25/-0   
    workspace.controller.ts
    Add global search endpoint for workspace                                 

    apps/api/src/workspace/controller/workspace.controller.ts

  • Added globalSearch endpoint to search across projects, environments,
    secrets, and variables.
  • Implemented authority check for workspace access.
  • +11/-0   
    workspace.service.ts
    Implement global search functionality in workspace service

    apps/api/src/workspace/service/workspace.service.ts

  • Added globalSearch method to aggregate search results from projects,
    environments, secrets, and variables.
  • Integrated search methods from respective services.
  • +19/-0   

    💡 PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Tirthchoksi22 avatar Jul 04 '24 07:07 Tirthchoksi22