Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 58 additions & 22 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ steps:
- type: getPullRequest
pullRequest: Changes
action_id: metaPR2
- type: getFileContents
action_id: fileContents
filename: 'src/App.jsx'
- type: gate
left: '/^\s*if\s*\(\s*this.state.buttonClicked\s*===\s*"assignments"\)\s*{\s*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*}\s*\n/gm'
operator: test
right: '%actions.fileContents%'
else:
- type: respond
with: bad-uncomment.md
issue: Changes
- type: createPullRequestComment
body: replace-title-activity.md
file: src/List.jsx
Expand All @@ -101,17 +112,6 @@ steps:
- type: getPullRequest
pullRequest: Changes
action_id: metaPR2
- type: getFileContents
action_id: fileContents
filename: 'src/App.jsx'
- type: gate
left: '/^\s*if\s*\(\s*this.state.buttonClicked\s*===\s*"assignments"\)\s*{\s*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*}\s*\n/gm'
operator: test
right: '%actions.fileContents%'
else:
- type: respond
with: bad-uncomment.md
issue: Changes
- type: respond
with: 03-state.md
issue: Changes
Expand All @@ -120,6 +120,18 @@ steps:
file: src/App.jsx
position: 12
pullRequest: '%actions.metaPR2.data.number%'
- title: Add a State Variable
description: Add a students state variable to keep track of students
event: push
link: '{{ repoUrl }}/issues/2'
actions:
- type: gate
left: '%payload.ref%'
operator: ===
right: refs/heads/changes
- type: getPullRequest
pullRequest: Changes
action_id: metaPR2
- type: createPullRequestComment
body: explaining-this-state-activity.md
file: src/App.jsx
Expand All @@ -130,13 +142,8 @@ steps:
file: src/App.jsx
position: 38
pullRequest: '%actions.metaPR2.data.number%'
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-08-01 at 2 27 43 PM

I don't know if this problem is introduced by this PR, but it's kind of awkward that this comment is dropped on a line without a code change. Can you reproduce this, @partyshah? I think this comment makes more sense if it's attached to the comment that describes the expected step (highlighter line on the screenshot below).

Screen Shot 2019-08-01 at 2 30 55 PM

- type: createPullRequestComment
body: bind-function-activity.md
file: src/App.jsx
position: 20
pullRequest: '%actions.metaPR2.data.number%'
- title: Callback Functions
description: Learn how to pass data back to parent components
- title: Create a Function
description: Create a function to add students to our state
event: push
link: '{{ repoUrl }}/issues/2'
actions:
Expand All @@ -151,23 +158,40 @@ steps:
action_id: fileContents
filename: 'src/App.jsx'
- type: gate
left: '/^\s*this\.addStudent\s*=\s*this\.addStudent\.bind\s*\(\s*this\s*\)\s*;\s*\n/gm'
left: '/^\s*addStudent\s*\(\s*studentName\s*\)\s*/gm'
operator: test
right: '%actions.fileContents%'
else:
- type: respond
with: bad-uncomment.md
with: bad-function.md
issue: Changes
- type: createPullRequestComment
body: bind-function-activity.md
file: src/App.jsx
position: 20
pullRequest: '%actions.metaPR2.data.number%'
- title: Bind a Function
description: Bind the addStudents function to our class
event: push
link: '{{ repoUrl }}/issues/2'
actions:
- type: gate
left: '%payload.ref%'
operator: ===
right: refs/heads/changes
- type: getPullRequest
pullRequest: Changes
action_id: metaPR2
- type: getFileContents
action_id: fileContents
filename: 'src/App.jsx'
- type: gate
left: '/^\s*addStudent\s*\(\s*studentName\s*\)\s*/gm'
left: '/^\s*this\.addStudent\s*=\s*this\.addStudent\.bind\s*\(\s*this\s*\)\s*;\s*\n/gm'
operator: test
right: '%actions.fileContents%'
else:
- type: respond
with: bad-function.md
with: bad-uncomment.md
issue: Changes
- type: respond
with: 04-callbackfunctions.md
Expand All @@ -185,6 +209,18 @@ steps:
file: src/App.jsx
position: 68
pullRequest: '%actions.metaPR2.data.number%'
- title: Pass Functions as Props
description: Learn how to pass data back to parent components
event: push
link: '{{ repoUrl }}/issues/2'
actions:
- type: gate
left: '%payload.ref%'
operator: ===
right: refs/heads/changes
- type: getPullRequest
pullRequest: Changes
action_id: metaPR2
- type: createPullRequestComment
body: uncomment-grades-activity.md
file: src/App.jsx
Expand Down
15 changes: 15 additions & 0 deletions responses/add-state-variable-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,18 @@ Currently, in `App`, we have three state variables:
- `grades` - This should store the grade for each student. However, we have no way to store students, so let's fix that!

Add a state variable to `App` and name it `students`. Set it equal to an empty list. Make sure to add the comma!

### Run your code
Run your code with `npm start` to make sure there are no errors.


### Push your code

```
git add src/App.jsx
git commit -m "using students state variable and setting state"
git push origin changes

```

I'll respond after you push.
2 changes: 2 additions & 0 deletions responses/bind-function-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ git commit -m "using students state variable and setting state"
git push origin changes

```

I'll respond after you push.
15 changes: 15 additions & 0 deletions responses/change-props-students-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,18 @@ Let's go ahead and change some props!
- Change the `placeholder` prop to `"Add Student..."`
- Change the `currList` prop to `{this.state.students}`
- Change the `addFunction` prop to `{this.addStudent}`

### Run your code
Run your code with `npm start` to make sure there are no errors.


### Push your code

```
git add src/App.jsx
git commit -m "using students state variable and setting state"
git push origin changes

```

I'll respond after you push.
15 changes: 15 additions & 0 deletions responses/create-addstudent-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,18 @@ Now that we see how it works with assignments, let's try it with students!
create a method called `addStudent` below the comment

`addStudent` should take `studentName` as a parameter and then concat that `studentName` to the end of `students` list that we created earlier.

### Run your code
Run your code with `npm start` to make sure there are no errors.


### Push your code

```
git add src/App.jsx
git commit -m "using students state variable and setting state"
git push origin changes

```

I'll respond after you push.
2 changes: 2 additions & 0 deletions responses/passing-functions-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
So where exactly are those functions we created to set state getting called?

So it looks like we pass the `addAssignment` function as a prop in this chunk of code.

Scroll down to for next steps!