Skip to content
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

make challenges easier to navigate #10239

Closed

Conversation

sachinmour
Copy link
Contributor

@sachinmour sachinmour commented Aug 16, 2016

Pre-Submission Checklist

  • Your pull request targets the staging branch of FreeCodeCamp.
  • Branch starts with either fix/, feature/, or translate/.
  • You have only one commit.
  • All new and existing tests pass the command npm run test-challenges.

Type of Change

  • New feature (non-breaking change which adds new functionality)

Checklist:

Description

  • Added two functions in mouse-trap-saga.js which makes navigation easier by allowing user to navigate through left and right key.
  • set a fixed height to step challenge images so as to always keep navigation buttons in the view.

@BerkeleyTrue BerkeleyTrue added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Aug 16, 2016
@@ -111,6 +111,7 @@ export class StepChallenge extends PureComponent {
href={ action }
onClick={ completeAction }
target='_blank'
className='unlockStep'

This comment was marked as off-topic.

@raisedadead
Copy link
Member

  • Tested changes locally.

Please ensure you actually test the things locally by manual testing, and executing npm test

@raisedadead raisedadead added status: blocked Is waiting on followup from either the Opening Poster of the issue or PR, or a maintainer. and removed status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. labels Aug 16, 2016
@camperbot
Copy link
Contributor

@sachinmour updated the pull request.

@sachinmour
Copy link
Contributor Author

@raisedadead why is snyk checks are failing... it is not showing in my local branch..

@@ -134,7 +135,7 @@ export class StepChallenge extends PureComponent {
<Button
bsSize='large'
bsStyle='primary'
className='col-sm-4 col-xs-12'
className='col-sm-4 col-xs-12 previousStep'

This comment was marked as off-topic.

@BerkeleyTrue BerkeleyTrue self-assigned this Aug 16, 2016
@sachinmour
Copy link
Contributor Author

To do it with react and redux....
We have to dispatch an action named goToStep(stepNo.) In Step.jsx
But then we have to bound keys with mousetrap eveytime it reloads.

@QuincyLarson
Copy link
Contributor

@sachinmour Awesome - once you are done with that let me know - I'm excited to try it out :)

What happens when there's a "click here to open link in new tab" button on the slide?

@camperbot
Copy link
Contributor

@sachinmour updated the pull request.

1 similar comment
@camperbot
Copy link
Contributor

@sachinmour updated the pull request.

@camperbot
Copy link
Contributor

@sachinmour updated the pull request.

@sachinmour
Copy link
Contributor Author

@QuincyLarson when there's a click - button "click here to open link in new tab" slides into view.

const { Mousetrap } = global;
Mousetrap.bind('right', this.handleNextClick);
Mousetrap.bind('left', this.handleBackClick);
}

This comment was marked as off-topic.

@sachinmour
Copy link
Contributor Author

sachinmour commented Aug 20, 2016

@BerkeleyTrue can i use dom to get current Index.(i.e from counters).
If not how do i get current index.

@BerkeleyTrue
Copy link
Contributor

Through the getState function. The whole app is a function of the state. You then use actions dispatched through redux to change the view, which in turn update the state

@sachinmour
Copy link
Contributor Author

ok.. now i can get current index from the state.. but don't have total number of steps in the state... how do i get that..

@BerkeleyTrue
Copy link
Contributor

@sachinmour
Copy link
Contributor Author

I saw that too.. but it isn't showing in getState...
State

@BerkeleyTrue
Copy link
Contributor

It's coming from the challengeSelector, which in-turn gets it from the entities.

I might need to add a step epic to handle step transitions as there is to much info needed ahead of time and would make the mouse trap epic coupled with the step challenge.

@BerkeleyTrue
Copy link
Contributor

@sachinmour This PR should make it easier #10417 once it is merged

@BerkeleyTrue
Copy link
Contributor

@sachinmour That PR has been merged. It should now be trivial to add those navigation traps without needing to access state.

@@ -178,6 +190,7 @@ export class StepChallenge extends PureComponent {
key={ imgUrl }
>
<a
className='fixed-height'

This comment was marked as off-topic.

This comment was marked as off-topic.

@BerkeleyTrue
Copy link
Contributor

@sachinmour Are you still working on this?

@sachinmour
Copy link
Contributor Author

I don't have total number of steps in the state... i am not able to get that even after the change..

@BerkeleyTrue
Copy link
Contributor

you don't need them. That was the point of the change.

@sachinmour
Copy link
Contributor Author

sachinmour commented Sep 8, 2016

ok.. but then if i don't know if the user is on the last step and i call stepForward instead of submitChallenge, that results in an error.

@BerkeleyTrue
Copy link
Contributor

That shouldn't be the case. StepForward should submit the challenge on the last step

@sachinmour
Copy link
Contributor Author

You are right about that.. but there is this error whenever i call stepForward on the last step..
error
submitChallenge is firing
action

@BerkeleyTrue
Copy link
Contributor

Can you provide a stack trace?

@sachinmour
Copy link
Contributor Author

sachinmour commented Sep 9, 2016

Its a very long stack trace...
It's divided into parts one after the other..

@BerkeleyTrue
Copy link
Contributor

@sachinmour I can't replicate. Looks like you are going to need to do some debugging to figure out the issue on your end.

@BerkeleyTrue
Copy link
Contributor

@sachinmour Are you still able to work on this?

@sachinmour
Copy link
Contributor Author

@BerkeleyTrue i am not able to figure out what my machine is doing wrong.. as you don't see any errors in your machine.. can you fix this..

@BerkeleyTrue
Copy link
Contributor

Try blowing away your node_modules. rebase off of current staging, and npm install. Also make sure you are using node 6 and npm 3

@camperbot
Copy link
Contributor

@sachinmour updated the pull request.

@BerkeleyTrue BerkeleyTrue removed the status: blocked Is waiting on followup from either the Opening Poster of the issue or PR, or a maintainer. label Oct 3, 2016
@ghost
Copy link

ghost commented Oct 7, 2016

@sachinmour, what's the status of this PR @sachinmour ?

@sachinmour
Copy link
Contributor Author

@atjonathan this doesn't work.. i have tried all possible ways.. blowing my node modules folder and everything..
part of the functionality works.. i can move around with left and right arrow keys but as soon as you reach the last step and i press right key.. the above mentioned error pops up... i haven't been able to figure that out..

@ghost
Copy link

ghost commented Oct 7, 2016

@sachinmour try asking in the Contributors room for help, otherwise we can reopen this issue as help wanted.

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.

None yet

5 participants