Skip to content

Conversation

@iFlameing
Copy link
Collaborator

Fixes #164

@helfi92 can you review my initial commit?
screenshot from 2019-02-14 19-25-16

@iFlameing iFlameing requested a review from a team as a code owner February 14, 2019 13:58
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.

Sorry, I probably didn't explain this properly. We want a table of recent created task definitions. Clicking on a task definition should update the editor with the saved copy. An example of a task definition can be seen in https://taskcluster-web.netlify.com/tasks/create/ (notice how metadata.name was modifed to foo-bar-baz):

provisionerId: aws-provisioner-v1
workerType: tutorial
created: '2019-02-14T14:17:27.131Z'
deadline: '2019-02-14T17:17:27.131Z'
dependencies: YrHJCEpnSda_R08SGy3cqA
payload:
  image: 'ubuntu:13.10'
  command:
    - /bin/bash
    - '-c'
    - for ((i=1;i<=600;i++)); do echo $i; sleep 1; done
  maxRunTime: 630
metadata:
  name: foo-bar-baz
  description: Markdown description of **what** this task does
  owner: name@example.com
  source: 'https://taskcluster-web.netlify.com/tasks/create'

When the user clicks the plus icon "Create Task", an entry should be added to the database so that when the user navigates back to https://taskcluster-web.netlify.com/tasks/create/, there is a list with the label (e.g., "foo-bar-baz" considering the above task definition).

@iFlameing
Copy link
Collaborator Author

@helfi92 how I can convert the value of task(which is a string) to object so that I can extract the metadata.name from it?

@helfi92
Copy link
Contributor

helfi92 commented Feb 14, 2019

You'd have to use the js-yaml package that is already imported at the top.

@iFlameing
Copy link
Collaborator Author

@helfi92 I amend a new commit as you suggested. Now createTask component shows the recent task based on metadata.name and if you click on that it updated the editor with its content.

screenshot from 2019-02-15 00-54-33

can you review this once again?

@helfi92 helfi92 self-requested a review February 14, 2019 20:33
@iFlameing
Copy link
Collaborator Author

@helfi92 Can you make some comment on the pr. I don't want to disturb you. sorry!

@helfi92
Copy link
Contributor

helfi92 commented Feb 15, 2019

I am currently reviewing. One moment please :)

@iFlameing
Copy link
Collaborator Author

ok, thanks

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 awesome! I added some requested changes but overall I'm pretty happy with how it's going :)

@iFlameing
Copy link
Collaborator Author

@helfi92 I amend a new commit which solves all the problems which you mention above. can you take a look once again? :)

@helfi92 helfi92 self-requested a review February 15, 2019 18:33
@helfi92
Copy link
Contributor

helfi92 commented Feb 15, 2019

I'll review it when I get the chance. In the meantime, feel free to tackle another UI issue like #208. I haven't heard back from the other person...

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.

Almost :)

@helfi92
Copy link
Contributor

helfi92 commented Feb 15, 2019

@iFlameing When adding requested changes, try not to rebase and force push please. That way I could look at the diff and see what changed since the previous commit :)

@helfi92 helfi92 self-requested a review February 16, 2019 13:05
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.

Last small change then we should be ready to merge :)

diff --git a/ui/src/views/Tasks/CreateTask/index.jsx b/ui/src/views/Tasks/CreateTask/index.jsx
index 135b0eaa4..a07e80392 100644
--- a/ui/src/views/Tasks/CreateTask/index.jsx
+++ b/ui/src/views/Tasks/CreateTask/index.jsx
@@ -73,6 +73,9 @@ const defaultTask = {
     ...theme.mixins.actionButton,
     right: theme.spacing.unit * 11,
   },
+  listItemButton: {
+    ...theme.mixins.listItemButton,
+  },
 }))
 export default class CreateTask extends Component {
   static defaultProps = {
@@ -313,6 +316,7 @@ export default class CreateTask extends Component {
                   }>
                   {this.state.recentTaskDefinitions.map(task => (
                     <ListItem
+                      className={classes.listItemButton}
                       button
                       onClick={() => {
                         this.handleRecentTaskDefinitionClick(task);

@iFlameing
Copy link
Collaborator Author

iFlameing commented Feb 19, 2019

@helfi92 I amend a new commit including your change. You can merge this now and also #271

@helfi92
Copy link
Contributor

helfi92 commented Feb 19, 2019

Oops, next time don't rebase please :) FYI, the GitHub UI always gives me the chance to squash all commits before merging to master.

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.

💯 Thank you!

@helfi92 helfi92 merged commit aa3df5f into taskcluster:master Feb 19, 2019
petemoore added a commit that referenced this pull request Feb 6, 2020
Bug 1568471 - close HTTP response bodies when finished with them
imbstack pushed a commit that referenced this pull request May 5, 2020
Expand scopes before validating task scopes
imbstack pushed a commit that referenced this pull request May 7, 2020
Expand scopes before validating task scopes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants