-
Notifications
You must be signed in to change notification settings - Fork 44
Bug 1520857- add support in tc-web for displaying information from the lastFire table #413
base: master
Are you sure you want to change the base?
Conversation
The error panel slighty goes out in very small screens as seen in the 2nd pic. When fixing the width there were some other very bad overlapping with other fired hooks info |
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.
Good progress :) Added some requested changes.
src/views/Hooks/ViewHook/index.jsx
Outdated
hookId: decodeURIComponent(params.hookId), | ||
}, | ||
}), | ||
name: 'lastFiresData', | ||
}), |
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.
No need to create hookLastFires.graphql
. You should be able to add everything in hook.graphql
.
src/views/Hooks/ViewHook/index.jsx
Outdated
@@ -128,13 +142,13 @@ export default class ViewHook extends Component { | |||
}; | |||
|
|||
render() { | |||
const { isNewHook, data } = this.props; | |||
const { isNewHook, hookData, lastFiresData } = this.props; |
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.
One you merge the last fires data in hook.graphql
then everything will be under data
.
@@ -0,0 +1,9 @@ | |||
query HookLastFires($hookGroupId: ID!, $hookId: ID!) { |
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.
Delete this file. See reason in other comment.
src/components/HookForm/index.jsx
Outdated
</Fragment> | ||
{hookLastFires.map( | ||
({ taskId, taskCreateTime, firedBy, result, error }) => ( | ||
<ListItem key={taskId}> |
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.
Let's use the DataTable
component in src/components/DataTable
to display the result? The table will be similar to something like http://localhost:5080/provisioners/aws-provisioner-v1.
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.
I don't think a DataTable would be a good fit for the data. If result is success
then expandable panel has nothing to show. If result is error
then there is very large error text to show on opening the panel. In any column it could be trouble to fit the error text especially.
src/components/HookForm/index.jsx
Outdated
@@ -131,6 +139,8 @@ export default class HookForm extends Component { | |||
static propTypes = { | |||
/** A GraphQL hook response. Not needed when creating a new hook */ | |||
hook: hook.isRequired, | |||
/** Object */ |
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.
Let's use a different comment here to describe the property.
src/components/HookForm/index.jsx
Outdated
</Grid> | ||
</ExpansionPanelSummary> | ||
<ExpansionPanelDetails> | ||
<ErrorPanel error={error} onClose={null} /> |
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.
We could probably have errors be a separate column in the table and use simple text to display the error instead of having it in a error panel. We use error panels for when the server fails to return data or the user is trying to do something not allowed.
have a look @helfi92 |
Awesome, I'll have a look soon. |
@helfi92 - I'm a bit out of the loop on the plans for this repository. It's not being archived after having merged to the monorepo? |
@owlishDeveloper I unarchived the repo so @Biboswan and I can continue iterating on this PR. Once we are happy with the PR, @Biboswan will create a PR on on the monorepo and we will re-archive this repo. The discussion happened in Bug 1520857. |
@@ -7,13 +7,15 @@ import { | |||
oneOf, | |||
oneOfType, | |||
object, | |||
bool, |
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.
Why are we adding pagination? Is the last fire endpoint paginated (i.e., uses continuation token)?
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.
As per discussion with Dustin in irc we are keeping as many as 100 lastfire info rows for each hookId (expiration logic). Hence I think showing all rows at once won't be good.
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.
We also only purge those once per day, so a particularly active hook might have many more rows than that at some time during the day!
src/components/HookForm/index.jsx
Outdated
{(hookFire.result === 'SUCCESS' && ( | ||
<Link to={`/tasks/${hookFire.taskId}`}> | ||
<Typography>{hookFire.taskId}</Typography> | ||
</Link> |
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.
Right now it looks like:
It should look like this:
This will make it look like any other link in a table to the rest of the app. Here's an example: The Worker ID column in the Workers view.
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.
If the lastfire result is success
then the taskId links to another route. But if result is error
then no task of the mentioned taskId
is actually created hence there is no link to the corresponding task. So I'm underlinking taskId for the sucess ones and no underline for error
ones to distinguish them. Shall I change it ?
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.
From https://github.com/taskcluster/taskcluster-web/pull/413/files#r254810845, we could remove the link icon when the task has an error.
src/components/HookForm/index.jsx
Outdated
/> | ||
</ExpansionPanelDetails> | ||
</ExpansionPanel> | ||
)) || <Typography>N/A</Typography>} |
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.
Use lower case n/a
.
src/components/HookForm/index.jsx
Outdated
</TableCell> | ||
<TableCell className={classes.errorTableCell}> | ||
{(hookFire.result === 'ERROR' && ( | ||
<ExpansionPanel> |
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.
Is there a hook I can see where hookFire.result === 'ERROR'
? I want to see how it looks in the UI.
src/views/Hooks/ViewHook/index.jsx
Outdated
hookLastFires={data.hookLastFires.sort( | ||
(a, b) => | ||
new Date(b.taskCreateTime) - new Date(a.taskCreateTime) | ||
)} |
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.
Extract logic from jsx:
const hookLastFires = // ...
// ...
hookLastFires={hookLastFires}
@Biboswan How can I get to see the list of errors in the UI when I pull the code down locally? I want to try to make some tweaks on my local machine. |
@helfi92 generally hooks with |
Thanks! I'll take a look. |
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.
Added requested changes.
src/components/HookForm/index.jsx
Outdated
</TableCell> | ||
<TableCell className={classes.errorTableCell}> | ||
{(hookFire.result === 'ERROR' && ( | ||
<ExpansionPanel> |
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.
Instead of having an expansion panel for each error, we should instead have a button that opens a drawer with the error on click. This is similar to https://taskcluster-web.netlify.com/provisioners/aws-provisioner-v1 when clicking the info icon. The drawer can display the ErrorPanel
component.
src/components/HookForm/index.jsx
Outdated
{(hookFire.result === 'SUCCESS' && ( | ||
<Link to={`/tasks/${hookFire.taskId}`}> | ||
<Typography>{hookFire.taskId}</Typography> | ||
</Link> |
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.
From https://github.com/taskcluster/taskcluster-web/pull/413/files#r254810845, we could remove the link icon when the task has an error.
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.
Actual: The error is shown in the table
Expected: The error is displayed outside the table in a Drawer
component. To see what I mean:
- Navigate to https://taskcluster-web.netlify.com/provisioners/aws-provisioner-v1
- Click on the info icon. You will see a drawer that will slide from the right hand side of the screen.
the info button in the worker types view
the drawer in the worker type view after clicking the info button
Coming back to this issue, we want to display the error inside the drawer, not inside the table. You can look at the code of https://taskcluster-web.netlify.com/provisioners/aws-provisioner-v1 to see how the drawer is implemented.
Hope that helps. Let me know if you had any questions/concerns.
ah i just skipped the drawer :(. making the changes |
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.
Looks a lot better! A couple of points:
- https://github.com/taskcluster/taskcluster-web/pull/413/files#r254810845 is not done yet.
- Let's show "n/a" (without the quotes) instead of the information icon when there's no error.
Did I misunderstood something. When the task has an error there is no link icon aka underline as you said.When there is no error the task exists so taskId has the link icon as |
Instead of the underline, it should match the following style (look at the link icon beside the id): https://user-images.githubusercontent.com/3766511/52433650-8ccd9b00-2adb-11e9-9df7-a5e272407a82.png. There is also a hover effect that comes from |
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.
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.
A couple of changes:
- The "<" and ">" buttons should be to the right of the table, similar to how they are show in https://material-ui.com/demos/tables/#tables.
-
Set
rowsPerPage
to 5 -
Remove the option to change row count
-
Rename "Last Hook Fire Attempts" to "Last Fired Results"
-
The
FiredBy
column should be shown asFired By
. You can use thechange-case
package to modify the title. See how we do it for the other tables in the app.
@helfi92 you want to shift just the '< >' buttons rightward and not the page no. (1-20) part ? |
If we can remove the (1-20) part then that would be the best because it will make it consistent with the other tables we use on the site. |
i was asking whether to shift right both arrows and 1-20 or only arrows. If we remove 1-20 then user will not know total count is that ok |
Yes that's okay. We want to maintain consistency across our tables. None of our tables that have that (1-20) extra information. |
How is it going @Biboswan. I am back now :) |
Few days ago when I tried to resume the work I got errors on running the web server. I tried both |
I pushed taskcluster/taskcluster@8494476 today. Try pulling the recent changes and see if that fixes it :) |
it's done will push today |
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.
Good progress!
src/components/DataTable/index.jsx
Outdated
}, | ||
tablePaginationRoot: { | ||
position: 'relative', | ||
left: '207%', |
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.
I don't think we need this. You can look at how they do it in https://material-ui.com/demos/tables/.
src/components/DataTable/index.jsx
Outdated
{isPaginate && ( | ||
<TableFooter> | ||
<TableRow> | ||
<TablePagination |
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.
We should:
- Have the TablePagination outside the table. This would make sure the pagination is always displayed to the user even when the table is being viewed on a small screen where scrolling is required to view the data. There's an example of that in https://material-ui.com/demos/tables/#sorting-amp-selecting. Basically you will need to remove
TableFooter
andTableRow
and then haveTablePagination
outside the table. - The table should be scrollable similar to how all the tables are in the material site.
src/components/HookForm/index.jsx
Outdated
whiteSpace: 'normal', | ||
}, | ||
errorPanel: { | ||
maxHeight: '300px', |
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.
No need to put quotations when the units are px
.
maxHeight: 300,
Second 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.
@Biboswan I don't seem to be able to open a hook for some reason. Anyways, I think we are in a better shape now to open a PR under taskcluster/taskcluster. Do you want to do that?
Yes! Will do that. |
No description provided.