Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Bug 1520857- add support in tc-web for displaying information from the lastFire table #413

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Biboswan
Copy link

No description provided.

@Biboswan Biboswan requested a review from helfi92 as a code owner January 24, 2019 19:10
@Biboswan
Copy link
Author

hook1
hook3

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
cc @djmitche

Copy link
Contributor

@helfi92 helfi92 left a 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.

hookId: decodeURIComponent(params.hookId),
},
}),
name: 'lastFiresData',
}),
Copy link
Contributor

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.

@@ -128,13 +142,13 @@ export default class ViewHook extends Component {
};

render() {
const { isNewHook, data } = this.props;
const { isNewHook, hookData, lastFiresData } = this.props;
Copy link
Contributor

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!) {
Copy link
Contributor

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.

</Fragment>
{hookLastFires.map(
({ taskId, taskCreateTime, firedBy, result, error }) => (
<ListItem key={taskId}>
Copy link
Contributor

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.

Copy link
Author

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.

@@ -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 */
Copy link
Contributor

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.

</Grid>
</ExpansionPanelSummary>
<ExpansionPanelDetails>
<ErrorPanel error={error} onClose={null} />
Copy link
Contributor

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.

@Biboswan
Copy link
Author

Biboswan commented Feb 6, 2019

lastfires

@Biboswan
Copy link
Author

Biboswan commented Feb 6, 2019

have a look @helfi92

@helfi92
Copy link
Contributor

helfi92 commented Feb 6, 2019

Awesome, I'll have a look soon.

@helfi92 helfi92 self-requested a review February 6, 2019 19:39
@owlishDeveloper
Copy link
Contributor

@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?

@helfi92
Copy link
Contributor

helfi92 commented Feb 7, 2019

@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,
Copy link
Contributor

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)?

Copy link
Author

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.

Copy link
Contributor

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!

{(hookFire.result === 'SUCCESS' && (
<Link to={`/tasks/${hookFire.taskId}`}>
<Typography>{hookFire.taskId}</Typography>
</Link>
Copy link
Contributor

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:

screen shot 2019-02-07 at 1 22 09 pm

It should look like this:

screen shot 2019-02-07 at 1 23 11 pm

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.

Copy link
Author

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 ?

Copy link
Contributor

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.

/>
</ExpansionPanelDetails>
</ExpansionPanel>
)) || <Typography>N/A</Typography>}
Copy link
Contributor

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.

</TableCell>
<TableCell className={classes.errorTableCell}>
{(hookFire.result === 'ERROR' && (
<ExpansionPanel>
Copy link
Contributor

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.

hookLastFires={data.hookLastFires.sort(
(a, b) =>
new Date(b.taskCreateTime) - new Date(a.taskCreateTime)
)}
Copy link
Contributor

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
Copy link
Author

Biboswan commented Feb 7, 2019

lastfire3

@helfi92
Copy link
Contributor

helfi92 commented Feb 11, 2019

@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.

@Biboswan
Copy link
Author

@helfi92 generally hooks with hookGroup "project-mobile" have a lot of error and success. Sorry I missed your previous comment on that

@helfi92
Copy link
Contributor

helfi92 commented Feb 11, 2019

Thanks! I'll take a look.

Copy link
Contributor

@helfi92 helfi92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added requested changes.

</TableCell>
<TableCell className={classes.errorTableCell}>
{(hookFire.result === 'ERROR' && (
<ExpansionPanel>
Copy link
Contributor

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.

screen shot 2019-02-11 at 10 59 46 am

{(hookFire.result === 'SUCCESS' && (
<Link to={`/tasks/${hookFire.taskId}`}>
<Typography>{hookFire.taskId}</Typography>
</Link>
Copy link
Contributor

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.

@Biboswan
Copy link
Author

t
Only error message i could find at the moment

@helfi92 helfi92 self-requested a review February 16, 2019 13:04
Copy link
Contributor

@helfi92 helfi92 left a 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:

  1. Navigate to https://taskcluster-web.netlify.com/provisioners/aws-provisioner-v1
  2. 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
screen shot 2019-02-19 at 3 04 57 pm

the drawer in the worker type view after clicking the info button

screen shot 2019-02-19 at 3 08 44 pm

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.

@Biboswan
Copy link
Author

ah i just skipped the drawer :(. making the changes

@Biboswan
Copy link
Author

screenshot from 2019-02-22 23-19-04

Copy link
Contributor

@helfi92 helfi92 left a 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:

@Biboswan
Copy link
Author

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 /tasks/${hookFire.taskId} exists. So do you want me to remove link in both the cases ?

@helfi92
Copy link
Contributor

helfi92 commented Feb 22, 2019

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 /tasks/${hookFire.taskId} exists. So do you want me to remove link in both the cases ?

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 theme.mixins.listItemButton.

Copy link
Contributor

@helfi92 helfi92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements :) A couple of points:

  • A task ID that has no link should not be wrapped in a TableCellListItem since it shouldn't be a list item. It should be just regular text.

screen shot 2019-02-25 at 9 38 30 am

  • There seems to be )) beside the information icon

screen shot 2019-02-25 at 9 38 02 am

Copy link
Contributor

@helfi92 helfi92 left a 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:

  1. 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.

screen shot 2019-02-25 at 3 03 50 pm

  1. Set rowsPerPage to 5

  2. Remove the option to change row count

screen shot 2019-02-25 at 3 09 00 pm

  1. Rename "Last Hook Fire Attempts" to "Last Fired Results"

  2. The FiredBy column should be shown as Fired By. You can use the change-case package to modify the title. See how we do it for the other tables in the app.

@Biboswan
Copy link
Author

@helfi92 you want to shift just the '< >' buttons rightward and not the page no. (1-20) part ?

@helfi92
Copy link
Contributor

helfi92 commented Feb 26, 2019

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.

@Biboswan
Copy link
Author

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

@helfi92
Copy link
Contributor

helfi92 commented Feb 26, 2019

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.

@helfi92
Copy link
Contributor

helfi92 commented Mar 11, 2019

How is it going @Biboswan. I am back now :)

@Biboswan
Copy link
Author

Few days ago when I tried to resume the work I got errors on running the web server. I tried both Yarn start and Yarn start devSever

@helfi92
Copy link
Contributor

helfi92 commented Mar 11, 2019

I pushed taskcluster/taskcluster@8494476 today. Try pulling the recent changes and see if that fixes it :)

@Biboswan
Copy link
Author

it's done will push today

@Biboswan
Copy link
Author

t

Copy link
Contributor

@helfi92 helfi92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress!

},
tablePaginationRoot: {
position: 'relative',
left: '207%',
Copy link
Contributor

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/.

{isPaginate && (
<TableFooter>
<TableRow>
<TablePagination
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2019-03-13 at 9 03 49 AM

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 and TableRow and then have TablePagination outside the table.
  • The table should be scrollable similar to how all the tables are in the material site.

whiteSpace: 'normal',
},
errorPanel: {
maxHeight: '300px',
Copy link
Contributor

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,

@Biboswan
Copy link
Author

d

@Biboswan
Copy link
Author

Biboswan commented Mar 15, 2019

d3
Which one is more appealing?

@helfi92
Copy link
Contributor

helfi92 commented Mar 15, 2019

Second one.

Copy link
Contributor

@helfi92 helfi92 left a 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?

@Biboswan
Copy link
Author

Yes! Will do that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants