- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: implement multi-org template gallery#13784
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
25 commits Select commitHold shift + click to select a range
0a5c431 feat: initial changes for multi-org templates page
jaaydenh6f96fee feat: add TemplateCard component
jaaydenh51ebb67 feat: add component stories
jaaydenha0effc6 chore: update template query naming
jaaydenhbe37085 fix: fix formatting
jaaydenh5649166 feat: template card interaction and navigation
jaaydenh3ea3aa2 fix: copy updates
jaaydenhf17a0c3 chore: update TemplateFilter type to include FilterQuery
jaaydenh0077db0 chore: update typesGenerated.ts
jaaydenh461202e feat: update template filter api logic
jaaydenh66e02fb fix: fix format
jaaydenh369c59f fix: get activeOrg
jaaydenhc41cdc4 fix: add format annotation
jaaydenh7f5d35e chore: use organization display name
jaaydenh6e2a6d8 feat: client side org filtering
jaaydenh978c047 fix: use org display name
jaaydenhaaed038 fix: add ExactName
jaaydenh8d84ad9 feat: show orgs filter only if more than 1 org
jaaydenha1c6169 chore: updates for PR review
jaaydenh15542c0 fix: fix format
jaaydenh8f4c56f chore: add story for multi org
jaaydenha282bac fix: aggregate templates by organization id
jaaydenhb092644 fix: fix format
jaaydenh32376e6 fix: check org count
jaaydenh801138a fix: update ExactName type
jaaydenhFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
feat: client side org filtering
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit6e2a6d8482d1eaec9903d59f0eb3dd2e22ee6791
There are no files selected for viewing
6 changes: 3 additions & 3 deletionssite/src/api/queries/templates.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionsite/src/pages/StarterTemplatesPage/StarterTemplatesPage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionsite/src/pages/StarterTemplatesPage/StarterTemplatesPageView.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionsite/src/pages/StarterTemplatesPage/StarterTemplatesPageView.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletionssite/src/pages/TemplatesPage/MultiOrgTemplatePage/TemplatesPageView.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
90 changes: 41 additions & 49 deletionssite/src/pages/TemplatesPage/MultiOrgTemplatePage/TemplatesPageView.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
17 changes: 8 additions & 9 deletionssite/src/pages/TemplatesPage/TemplatesPage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
20 changes: 19 additions & 1 deletionsite/src/utils/starterTemplates.ts → site/src/utils/templateAggregators.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import type {Template,TemplateExample } from "api/typesGenerated"; | ||
| export type StarterTemplatesByTag = Record<string, TemplateExample[]>; | ||
| export type TemplatesByOrg = Record<string, Template[]>; | ||
| export const getTemplatesByTag = ( | ||
| templates: TemplateExample[], | ||
| @@ -22,3 +23,20 @@ export const getTemplatesByTag = ( | ||
| return tags; | ||
| }; | ||
| export const getTemplatesByOrg = (templates: Template[]): TemplatesByOrg => { | ||
| const orgs: TemplatesByOrg = { | ||
| all: templates, | ||
| }; | ||
| templates.forEach((template) => { | ||
| const org = template.organization_name; | ||
| if (orgs[org]) { | ||
| orgs[org].push(template); | ||
| } else { | ||
| orgs[org] = [template]; | ||
| } | ||
| }); | ||
jaaydenh marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| return orgs; | ||
| }; | ||
jaaydenh marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.