Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

search contexts: add backend for querying default search context#45483

Merged
limitedmage merged 5 commits into
jp/defaultcontextdropdownfrom
jp/selectdefault
Dec 12, 2022
Merged

search contexts: add backend for querying default search context#45483
limitedmage merged 5 commits into
jp/defaultcontextdropdownfrom
jp/selectdefault

Conversation

@limitedmage

Copy link
Copy Markdown
Contributor

Stacked on #45430

Part of #44903

This adds a GraphQL API to query the current user's default context.

  • If the user has a default context they don't have access to (eg. it was made private or the user was removed from the owner org after the user had already set it as default), an error is returned by the API.
  • If the user doesn't have an explicitly-set default context (they have never set it, or their explicitly-set default was deleted), the global context is returned.

Test plan

Added unit tests.

@sourcegraph-bot

sourcegraph-bot commented Dec 9, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 2805702...3e52ece.

Notify File(s)
@beyang internal/search/searchcontexts/search_contexts.go
internal/search/searchcontexts/search_contexts_test.go
@camdencheek internal/search/searchcontexts/search_contexts.go
internal/search/searchcontexts/search_contexts_test.go
@fkling client/search-ui/src/input/SearchContextMenu.tsx
client/search/src/backend.ts
client/search/src/index.ts
@keegancsmith cmd/frontend/graphqlbackend/search_contexts.go
internal/search/searchcontexts/search_contexts.go
internal/search/searchcontexts/search_contexts_test.go
@rvantonder cmd/frontend/graphqlbackend/search_contexts.go

@sg-e2e-regression-test-bob

sg-e2e-regression-test-bob commented Dec 9, 2022

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
-0.02% (-0.51 kb) 0.02% (+2.47 kb) 0.02% (+2.98 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 4bf09a0 and 85243de or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

* search contexts: select default context on page load

* search contexts: show alert if default is not available (#45500)
@limitedmage limitedmage merged commit 5253712 into jp/defaultcontextdropdown Dec 12, 2022
@limitedmage limitedmage deleted the jp/selectdefault branch December 12, 2022 17:19
limitedmage added a commit that referenced this pull request Dec 12, 2022
* search contexts: show default context in dropdown

* search contexts: add backend for querying default search context (#45483)

* search contexts: select default context on page load (#45489)

* search contexts: show alert if default is not available (#45500)
limitedmage added a commit that referenced this pull request Dec 12, 2022
…45387)

* search contexts: set default from management page

* search contexts: show default context in dropdown (#45430)

* search contexts: add backend for querying default search context (#45483)

* search contexts: select default context on page load (#45489)

* search contexts: show alert if default is not available (#45500)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants