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

Search owner facet #659

Merged
merged 26 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4dbe7a2
Start of static filters
jeffdaley Mar 21, 2024
d2f891e
Update documents.ts
jeffdaley Mar 21, 2024
55e1879
Dynamic filters (non-owner)
jeffdaley Mar 21, 2024
3d93b49
Design tweaks, start of new Facet methods
jeffdaley Mar 21, 2024
f90e18d
Smaller input
jeffdaley Mar 21, 2024
15e951c
Add headline to filtered docs
jeffdaley Mar 21, 2024
090b7dd
Merge branch 'jeffdaley/filtered-results-headline' into jeffdaley/sta…
jeffdaley Mar 21, 2024
bb99437
Tweak input size
jeffdaley Mar 21, 2024
bdb1a95
Revert `getFacets` changes
jeffdaley Mar 22, 2024
e635a9f
Hook up owner search
jeffdaley Mar 22, 2024
45c369a
Improved dropdown/input design
jeffdaley Mar 22, 2024
5c959da
Exclude existing owners
jeffdaley Mar 22, 2024
003cc25
Redesign `count`
jeffdaley Mar 22, 2024
151976f
`is-active-filter` test
jeffdaley Mar 22, 2024
a2fcd7a
Remove unnecessary args
jeffdaley Mar 22, 2024
cf70f94
Update existing tests
jeffdaley Mar 22, 2024
0a971c3
Add fallback value to `dd.LinkTo` component
jeffdaley Mar 22, 2024
3a9939a
Merge branch 'jeffdaley/link-to' into jeffdaley/static-facets
jeffdaley Mar 22, 2024
a2af5df
Standardize input width
jeffdaley Mar 22, 2024
67a0f56
Merge branch 'main' into jeffdaley/static-facets
jeffdaley Mar 22, 2024
2905c48
Add documentation
jeffdaley Mar 22, 2024
840534b
Update tests
jeffdaley Mar 25, 2024
b5c6b25
Add owner search test
jeffdaley Mar 25, 2024
acf69ee
Add results test
jeffdaley Mar 25, 2024
42c6d51
Cleanup
jeffdaley Mar 25, 2024
4229ba6
Also search Google People API
jeffdaley Mar 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/algolia/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func New(cfg *Config) (*Client, error) {
"approvers",
"approvedBy",
"docType",
"owners",
"searchable(owners)",
"searchable(product)",
"status",
"searchable(tags)",
Expand Down
81 changes: 77 additions & 4 deletions web/app/components/header/toolbar.hbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,93 @@
{{#if this.facetsAreShown}}
<div class="toolbar mb-7">
<div class="mb-6 flex w-full justify-between">
<div class="flex items-center">
<h4 class="hermes-h4 mr-4">
<div class="flex w-full items-center">
<h4 class="hermes-h4 mr-[19px] shrink-0">
Filter by:
</h4>
<ol class="facets flex items-center">
<ol class="facets flex w-full items-center">
{{#each this.facets as |facet|}}
<li>
<li class="shrink-0">
<Header::FacetDropdown
data-test-facet={{facet.name}}
@name={{facet.name}}
@facets={{facet.values}}
/>
</li>
{{/each}}
{{#if this.ownerFacetIsShown}}
{{! Search owners... }}
<li class="w-full">
<X::DropdownList
@items={{this.ownerResults}}
@offset={{hash mainAxis=0 crossAxis=4}}
@placement="bottom-end"
@matchAnchorWidth={{hash enabled=true additionalWidth=8}}
@inputIsShown={{false}}
@isLoading={{this.searchOwners.isRunning}}
@onItemClick={{this.resetOwnersQuery}}
@listIsShown={{not this.searchInputIsEmpty}}
class="theme--neutral
{{unless this.ownerResults.length 'no-matches'}}"
>
<:anchor as |dd|>
<div class="relative">
<Hds::Form::TextInput::Base
data-test-search-owners-input
{{did-insert dd.registerAnchor}}
{{on "input" (perform this.searchOwners dd)}}
{{on "mousedown" (fn this.maybeCloseDropdown dd)}}
{{on "focusin" (fn this.maybeOpenDropdown dd)}}
{{on "focusin" (perform this.maybeSearch)}}
@value={{this.ownerQuery}}
@type="search"
disabled={{this.ownersInputIsDisabled}}
name="owner"
placeholder="Search owners..."
aria-label="Search owners..."
aria-controls={{dd.ariaControls}}
aria-expanded={{dd.contentIsShown}}
aria-haspopup="listbox"
class="relative w-[384px] border-color-border-strong pl-[35px] pr-3 text-body-200
{{if dd.contentIsShown 'mock-focus'}}"
/>
</div>
</:anchor>
<:item as |dd|>
{{log " d d d d" dd}}
<dd.LinkTo
@query={{get-facet-query-hash
"owners"
dd.attrs
(is-active-filter dd.attrs)
}}
class="block"
>
<div class="flex items-center gap-2 overflow-hidden">
<Person::Avatar @email={{dd.attrs}} />
<div class="w-full min-w-0">
<div class="truncate text-body-200 leading-tight">
{{#let
(get-model-attr "person.name" dd.attrs)
as |name|
}}
{{or name dd.attrs}}
{{#if name}}
<span
class="ml-0.5 text-body-100 text-color-foreground-disabled"
>
{{dd.attrs}}
</span>
{{/if}}
{{/let}}
</div>
</div>
</div>
</dd.LinkTo>
</:item>
</X::DropdownList>
</li>
{{/if}}
</ol>
</div>
</div>
Expand Down
Loading
Loading