-
Notifications
You must be signed in to change notification settings - Fork 8
Dyn 9702 template files support #89
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
Merged
jasonstratton
merged 13 commits into
DynamoDS:master
from
Chloepeg:DYN-9702-template-files-support
Jun 16, 2026
+348
−60
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
cd47c5d
Add template files support to New dropdown
Chloepeg b7b87fa
Add Templates section to home page
Chloepeg 8a871bf
Open templates in a new editable workspace from template sidebar drop…
Chloepeg 362f23a
template data to use React Context
Chloepeg 249dce7
Update sidebar to match renamed template files
Chloepeg 1cf3efb
Drop down menu on side panel removed
Chloepeg 20f21b0
fix development build
Chloepeg 9f777ab
Fix build errors
Chloepeg f3b6fa4
Swap Recent and Templates order on home page
Chloepeg 5d62553
Add tooltip to Templates heading
Chloepeg e6ba9d2
Move Templates tooltip to question mark icon
Chloepeg 291de24
Merge remote-tracking branch 'upstream/master' into DYN-9702-template…
Chloepeg 1de53e8
Pr feedback changes
Chloepeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
|---|---|---|
|
|
@@ -61,3 +61,5 @@ export const graphs = [ | |
| Thumbnail: img | ||
| } | ||
| ]; | ||
|
|
||
| export const templates = graphs; | ||
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
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
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
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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
|
|
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 |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import { FormattedMessage } from 'react-intl'; | ||
| import { GraphGridItem } from './GraphGridItem'; | ||
| import { GraphTable } from './GraphTable'; | ||
| import { GridViewIcon, ListViewIcon, QuestionMarkIcon } from '../Common/CustomIcons'; | ||
| import { Tooltip } from '../Common/Tooltip'; | ||
|
|
||
| type TemplateItem = Graph & { | ||
| Author: string; | ||
| Description: string; | ||
| }; | ||
|
|
||
| interface TemplatesSectionProps { | ||
| columns: Column[]; | ||
| templates: TemplateItem[]; | ||
| templatesViewMode: string; | ||
| setTemplatesViewMode: (viewMode: string) => void; | ||
| onRowClick: (row: Row) => void; | ||
| setIsDisabled: (disable: boolean) => void; | ||
| } | ||
|
|
||
| export const TemplatesSection = ({ | ||
| columns, | ||
| templates, | ||
| templatesViewMode, | ||
| setTemplatesViewMode, | ||
| onRowClick, | ||
| setIsDisabled, | ||
| }: TemplatesSectionProps) => { | ||
| return ( | ||
| <> | ||
| <div className='drop-shadow-2xl' style={{ display: 'flex', alignItems: 'center' }}> | ||
| <p className='title-paragraph' style={{ display: 'inline-block', width: 'fit-content' }}> | ||
| <FormattedMessage id="title.text.templates"/> | ||
| </p> | ||
| <Tooltip | ||
| content={<FormattedMessage id="recent.templates.tooltip" />} | ||
| position="right" | ||
| tooltipClassName="template-info-tooltip"> | ||
| <QuestionMarkIcon /> | ||
| </Tooltip> | ||
| </div> | ||
| <div style={{ display: 'flex', alignItems: 'center', marginBottom:'10px' }}> | ||
| <button | ||
| className={`viewmode-button ${templatesViewMode === 'grid' ? 'active' : ''}`} | ||
| onClick={() => setTemplatesViewMode('grid')} | ||
| disabled={templatesViewMode === 'grid'} | ||
| data-testid="templates-view-toggle-grid"> | ||
| <Tooltip content={<FormattedMessage id="tooltip.text.grid.view.button" />}> | ||
| <GridViewIcon/> | ||
| </Tooltip> | ||
| </button> | ||
| <button | ||
| className={`viewmode-button ${templatesViewMode === 'list' ? 'active' : ''}`} | ||
| onClick={() => setTemplatesViewMode('list')} | ||
| disabled={templatesViewMode === 'list'} | ||
| data-testid="templates-view-toggle-list"> | ||
| <Tooltip content={<FormattedMessage id="tooltip.text.list.view.button" />}> | ||
| <ListViewIcon/> | ||
| </Tooltip> | ||
| </button> | ||
| </div> | ||
| <div style={{ marginRight: '20px', paddingBottom: '35px' }}> | ||
| {templatesViewMode === 'list' && ( | ||
| <GraphTable columns={columns} data={templates} onRowClick={onRowClick}/> | ||
| )} | ||
| {templatesViewMode === 'grid' && ( | ||
| <div className="main-graph-grid" id="templatesContainer"> | ||
| {templates.map(template => ( | ||
| <GraphGridItem | ||
| key={template.id} | ||
| {...template} | ||
| setIsDisabled={setIsDisabled} | ||
| /> | ||
| ))} | ||
| </div> | ||
| )} | ||
| </div> | ||
| </> | ||
| ); | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Minor 9 — Missing newline at EOF] File ends without a trailing newline. Add one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed