theopenlane / openlane-ui

the openlane ui - holds openlane console and storybook
Apache License 2.0
3 stars 2 forks source link

feat: Global Search Bar #56

Open golanglemonade opened 3 weeks ago

golanglemonade commented 3 weeks ago

Add a global search bar on the top right of the console.

The UI can hit the search resolver for the backend, e.g.:

query Nodes($query: String!) {
  search(query: $query) {
    nodes {
      ... on ControlSearchResult {
        controls {
          id
          name
        }
      }
      ... on OrganizationSearchResult {
        organizations {
          id
          name
        }
      }
      ... on GroupSearchResult {
        groups {
          id
          name
        }
      }
      ... on ControlObjectiveSearchResult {
        controlObjectives {
          id
          name
        }
      }
      ... on EntitySearchResult {
        entities {
          id
          name
        }
      }
      ... on TaskSearchResult {
        tasks {
          id
          title
        }
      }
    }
  }
}
{
  "query": "mitb"
}

It should look for results for our main object types (for now lets start with) :

Add the query to the codegen package: https://github.com/theopenlane/openlane-ui/tree/main/packages/codegen/query and use the generated urql functions for the query to the backend.