-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add blueprint list #385
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
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c40fc54
feat: add blueprint list
pedroferreira1 fd5e23c
fix: add missing arrow when sorting the table
pedroferreira1 846d73a
refactor: EllipsisCell now receives the count of elements as props
pedroferreira1 bd2be41
chore: fix linter
pedroferreira1 9ae898c
feat: search parameters were unified in the APIs
pedroferreira1 fb746a0
style: fix UI bug in the light mode
pedroferreira1 ac00559
feat: ignore pagination params when starting a new search
pedroferreira1 8eb963f
refactor: refactor for new react dom
pedroferreira1 385ac89
refactor: remove empty html id
pedroferreira1 548f41d
fix: use has method to check if parameter exists in url
pedroferreira1 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
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
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,38 @@ | ||
| import React from 'react'; | ||
| import SortableTable from '../SortableTable'; | ||
| import EllipsiCell from '../EllipsiCell'; | ||
|
|
||
| // XXX We should use function component with SortableTable as a component | ||
| // but renderTableHead and renderTableBody are implemented and not | ||
| // expected as a props, so it demands a bigger refactor | ||
|
Comment on lines
+5
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⭐ Thanks for highlighting this tech debt here! This is pending since before the UX revamp. |
||
| class BuiltInBlueprintsTable extends SortableTable { | ||
| renderTableHead() { | ||
| return ( | ||
| <tr> | ||
| <th className="d-lg-table-cell">BLUEPRINT ID</th> | ||
| <th className="d-lg-table-cell">NAME</th> | ||
| </tr> | ||
| ); | ||
| } | ||
|
|
||
| renderTableBody() { | ||
| return this.props.data.map(blueprint => { | ||
| return ( | ||
| <tr key={blueprint.id} onClick={_e => this.props.handleClickRow(blueprint.id)}> | ||
| <td className="d-lg-table-cell pe-3"> | ||
| {this.props.isMobile ? ( | ||
| <EllipsiCell id={blueprint.id} countBefore={10} countAfter={10} /> | ||
| ) : ( | ||
| blueprint.id | ||
| )} | ||
| </td> | ||
| <td className="d-lg-table-cell pe-3">{blueprint.name}</td> | ||
| </tr> | ||
| ); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| BuiltInBlueprintsTable.propTypes = SortableTable.propTypes; | ||
|
|
||
| export default BuiltInBlueprintsTable; | ||
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,76 @@ | ||
| import React from 'react'; | ||
| import SortableTable from '../SortableTable'; | ||
| import EllipsiCell from '../EllipsiCell'; | ||
| import dateFormatter from '../../utils/date'; | ||
|
|
||
| // XXX We should use function component with SortableTable as a component | ||
| // but renderTableHead and renderTableBody are implemented and not | ||
| // expected as a props, so it demands a bigger refactor | ||
| class OnChainBlueprintsTable extends SortableTable { | ||
r4mmer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /* | ||
| * Get header of first column. In the mobile we show the element | ||
| * of two columns in one. | ||
| */ | ||
| getFirstHeaderName() { | ||
| if (this.props.isMobile) { | ||
| return 'BLUEPRINT ID AND NAME'; | ||
| } | ||
|
|
||
| return 'BLUEPRINT ID'; | ||
| } | ||
|
|
||
| renderTableHead() { | ||
| return ( | ||
| <tr> | ||
| <th className="d-lg-table-cell">{this.getFirstHeaderName()}</th> | ||
| {!this.props.isMobile && <th className="d-lg-table-cell">NAME</th>} | ||
| <th | ||
| className="d-lg-table-cell sortable" | ||
| onClick={e => this.props.tableHeaderClicked(e, 'created_at')} | ||
| > | ||
| CREATED AT {this.getArrow('created_at')} | ||
| </th> | ||
| </tr> | ||
| ); | ||
| } | ||
|
|
||
| renderMobileRow(blueprint) { | ||
| return ( | ||
| <> | ||
| <td className="d-lg-table-cell pe-3"> | ||
| <EllipsiCell id={blueprint.id} countBefore={10} countAfter={10} /> | ||
| <p className="mt-2 mb-0">{blueprint.name}</p> | ||
| </td> | ||
| <td className="d-lg-table-cell pe-3"> | ||
| {dateFormatter.parseTimestampNewUi(blueprint.created_at)} | ||
| </td> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| renderDesktopRow(blueprint) { | ||
| return ( | ||
| <> | ||
| <td className="d-lg-table-cell pe-3">{blueprint.id}</td> | ||
| <td className="d-lg-table-cell pe-3">{blueprint.name}</td> | ||
| <td className="d-lg-table-cell pe-3"> | ||
| {dateFormatter.parseTimestampNewUi(blueprint.created_at)} | ||
| </td> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| renderTableBody() { | ||
| return this.props.data.map(blueprint => { | ||
| return ( | ||
| <tr key={blueprint.id} onClick={_e => this.props.handleClickRow(blueprint.id)}> | ||
| {this.props.isMobile ? this.renderMobileRow(blueprint) : this.renderDesktopRow(blueprint)} | ||
| </tr> | ||
| ); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| OnChainBlueprintsTable.propTypes = SortableTable.propTypes; | ||
|
|
||
| export default OnChainBlueprintsTable; | ||
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
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.
Ana decided to remove the active style from table pagination buttons, so both pagination buttons have the same style now.