Skip to content

Conversation

@rufman
Copy link
Contributor

@rufman rufman commented May 19, 2016

Adding href to the router state object gives access to the
$state.href function in React code. This allows the creation
of urls for states, which is critical when a component links to
another part of the app and should be crawlable by a crawler.

@rufman rufman force-pushed the master branch 2 times, most recently from 3021d20 to b0a6956 Compare May 19, 2016 18:49
@hally9k
Copy link
Collaborator

hally9k commented Sep 15, 2016

Hi @rufman! Sorry it's taken so long to get around to this. Really appreciate your contribution but the owner of the repo hasn't been able to find the time to maintain the repo so much and I've said I will try and help bring things up to speed. Is this still a need for you? I'm keen to fully understand the use case, I think I've got it but if you want to elaborate a little that would be awesome. As we've let this drag on a bit there are now merge conflicts as we've recently merged a PR for ui router 1.0 beta support. Do you want to resubmit a PR that isn't so far behind? Then I can merge your commits rather than replicating your contribution myself. It would be cool to add you to the contributor list... Thanks again!

@rufman
Copy link
Contributor Author

rufman commented Sep 16, 2016

@hally9k Yeah I'll take a look at it this weekend

@rufman
Copy link
Contributor Author

rufman commented Sep 18, 2016

@hally9k I've rebased my downstream repo with the changes

@hally9k
Copy link
Collaborator

hally9k commented Sep 18, 2016

Hi @rufman,
Sorry, I thought I had already merged in this PR which has conflicts with your actually edited file. While fixing it up before I realised that the current state object contains the url itself. Would this serve your use case without adding the href function to the top level of the router state or am I missing something?

@rufman
Copy link
Contributor Author

rufman commented Sep 19, 2016

@hally9k Take a look at href in the docs. It's actually a function that builds urls for a given state name. Basically so you can generate urls instead of hard coding them.

@hally9k
Copy link
Collaborator

hally9k commented Sep 19, 2016

@rufman ah ha! Sorry, I totally should have gone and had a look and got my facts straight. RTFM and all that... I've been throwing the little snippets of spare time I can find into this project so sometimes I'm a little bit too rushed to do things due diligence. I read the docs on href and now actually understand your use case properly. Apologies for messing you around with this :/ . The PR that conflicts is merged into master now if you want to take a look? It's still just a one liner href: $state.href but yeah rebase with master and i'll merge it in. When ui-router 1.0s we'll publish 0.7.0 on npm I reckon so it would be good to get it into that release. :)

Adding `href` to the router state object gives access to the
`$state.href` function in React code. This allows the creation
of urls for states, which is critical when a component links to
another part of the app and should be crawlable by a crawler.
Include `href` payload key in tests
@hally9k hally9k merged commit ecfac55 into neilff:master Sep 21, 2016
hally9k added a commit that referenced this pull request Jun 4, 2017
* Support for angular-ui-router 1.0.0-beta.1 (#64)

* Support to ui-router 1.0.0-beta.1
- onStateNotFound action was removed
- evt parameter was removed from onStateChangeStart and onStateChangeError
- example using redux-devtools

* The router listener was simplified

* fixed incorrect params being passed in router middleware on  STATE_CHANGE_SUCCESS

* fix #66 missing parameters passed on transition onStart. Add tests for router-listener (#67)

* Fixed the prev state and params in the redux router state getting set… (#68)

* Fixed the prev state and params in the redux router state getting set to the current state and params by changing the way that the STATE_CHANGE_SUCCESS handler in the middleware accesses the previous state and params.

* added options to the state change start action payload for middle wares etc.

* Add `href` property to the router state object (#51)

* Add `href` property to the router state object

Adding `href` to the router state object gives access to the
`$state.href` function in React code. This allows the creation
of urls for states, which is critical when a component links to
another part of the app and should be crawlable by a crawler.

* Update licenser test

Include `href` payload key in tests

* Fix tests and lint (#70)

* Fix tests for `onStart` and `onError`

Adds a stub for the new options param added in commit
994b8d0

* Fix lint error

* Restrict to node v6 and higher (#75)

* Added MIT license (#79)

* Added stateChangeFinish action to ensure state changes are set in the… (#80)

* Added stateChangeFinish action to ensure state changes are set in the app state before components are instantiated

* added and fixed tests

* updated ui-router to 1.0-beta.3

* missing test

* fixed test

* upgraded ui-router to 1.0.0-rc1 and fixed node engine bug

* upgraded ui-router to 1.0.0-rc1 and fixed node engine bug

* 0.7.0-rc.1

* Expose state activation actions as injectable factory (#81)

* Expose state activation actions as a factory

* Integrate default state activation actions

wrap state activation actions into factory

* Create state-activation-actions.test.js

* Update function name

* added the state activation actions as injectable factory

* 0.7.1-rc.1

* Fixed up example

* bumped patch release

* Upgraded to new ui-router package name
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