feat: implement multi-org template gallery (#13784)

* feat: initial changes for multi-org templates page

* feat: add TemplateCard component

* feat: add component stories

* chore: update template query naming

* fix: fix formatting

* feat: template card interaction and navigation

* fix: copy updates

* chore: update TemplateFilter type to include FilterQuery

* chore: update typesGenerated.ts

* feat: update template filter api logic

* fix: fix format

* fix: get activeOrg

* fix: add format annotation

* chore: use organization display name

* feat: client side org filtering

* fix: use org display name

* fix: add ExactName

* feat: show orgs filter only if more than 1 org

* chore: updates for PR review

* fix: fix format

* chore: add story for multi org

* fix: aggregate templates by organization id

* fix: fix format

* fix: check org count

* fix: update ExactName type
This commit is contained in:
Jaayden Halko
2024-07-19 10:33:08 -04:00
committed by GitHub
parent 40609c26e9
commit 554c4ab1eb
21 changed files with 663 additions and 64 deletions
+8 -2
View File
@@ -400,8 +400,9 @@ func (c *Client) TemplatesByOrganization(ctx context.Context, organizationID uui
}
type TemplateFilter struct {
OrganizationID uuid.UUID
ExactName string
OrganizationID uuid.UUID `json:"organization_id,omitempty" format:"uuid" typescript:"-"`
FilterQuery string `json:"q,omitempty"`
ExactName string `json:"exact_name,omitempty" typescript:"-"`
}
// asRequestOption returns a function that can be used in (*Client).Request.
@@ -419,6 +420,11 @@ func (f TemplateFilter) asRequestOption() RequestOption {
params = append(params, fmt.Sprintf("exact_name:%q", f.ExactName))
}
if f.FilterQuery != "" {
// If custom stuff is added, just add it on here.
params = append(params, f.FilterQuery)
}
q := r.URL.Query()
q.Set("q", strings.Join(params, " "))
r.URL.RawQuery = q.Encode()