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

Custom app paths #846

Merged
merged 16 commits into from
Nov 8, 2019
Merged

Custom app paths #846

merged 16 commits into from
Nov 8, 2019

Conversation

bpierre
Copy link
Contributor

@bpierre bpierre commented Jun 21, 2019

  • Send the current custom path to the connected app.
  • Update the browser path based on the path requested by the connected app.
  • Routing: history.replace() outside of parsePath(), to remove any side effect.
  • Add tests for routing.js.
  • Remove params (?p=) support.
  • Move from params to app paths in Apps Center.

- Add Jest
- parsePath(): Move history.replace() outside of parsePath(), to remove
  any side effect from the function.
- Send the current custom path to the connected app.
- Update the browser path based on the path requested by the connected
  app.
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

Some in-progress comments as we get closer to this being a reality 🎉

src/empty-string.js Outdated Show resolved Hide resolved
src/routing.test.js Outdated Show resolved Hide resolved
})
)

path = `/p/${ADDRESS}///`
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a valid path?

Copy link
Contributor 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 anyone will use a slash followed by another one, but I don’t see a reason to forbid it. Do you think it should be the case?

src/components/App/AppIFrame.js Outdated Show resolved Hide resolved
src/routing.test.js Outdated Show resolved Hide resolved
src/routing.js Outdated Show resolved Hide resolved
@stale stale bot removed the abandoned label Jul 25, 2019
@stale stale bot added the abandoned label Aug 24, 2019
@aragon aragon deleted a comment from stale bot Aug 24, 2019
@stale stale bot removed the abandoned label Aug 24, 2019
@stale stale bot added the abandoned label Sep 23, 2019
@aragon aragon deleted a comment from stale bot Sep 23, 2019
@stale stale bot removed the abandoned label Sep 23, 2019
@stale stale bot added the abandoned label Oct 23, 2019
@aragon aragon deleted a comment from stale bot Oct 23, 2019
@stale stale bot removed the abandoned label Oct 23, 2019
@vercel vercel bot temporarily deployed to staging October 23, 2019 23:23 Inactive
@vercel vercel bot temporarily deployed to staging October 25, 2019 01:39 Inactive
@bpierre bpierre removed the request for review from AquiGorka October 25, 2019 01:42
@facuspagnuolo facuspagnuolo mentioned this pull request Oct 25, 2019
1 task
@vercel vercel bot temporarily deployed to staging October 27, 2019 23:11 Inactive
@aragon aragon deleted a comment from stale bot Oct 27, 2019
@bpierre bpierre marked this pull request as ready for review October 27, 2019 23:15
src/routing.js Outdated Show resolved Hide resolved
src/routing.js Outdated Show resolved Hide resolved
@@ -107,26 +104,27 @@ export function getAppPath({
return `/${action}`
}

if (!fullDao) {
return `/${search}`
// Only keep the DAO name if it ends in aragonid.eth
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a bit odd that we're doing this here in routing, but moving the redirect out into the app itself.

Copy link
Contributor Author

@bpierre bpierre Nov 8, 2019

Choose a reason for hiding this comment

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

The redirect used to be done here, but I don’t think this function should have any side effect. I don’t think it should stay in App either, I was thinking of moving all of the history / window.location handling in the routing provider that remain to be added. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking of moving all of the history / window.location handling in the routing provider that remain to be added

Yes! This sounds like exactly what we need!

src/routing.js Outdated Show resolved Hide resolved
src/routing.test.js Show resolved Hide resolved
@vercel vercel bot temporarily deployed to staging November 8, 2019 10:36 Inactive
@vercel vercel bot temporarily deployed to staging November 8, 2019 10:39 Inactive
Co-Authored-By: Brett Sun <qisheng.brett.sun@gmail.com>
@vercel vercel bot temporarily deployed to staging November 8, 2019 10:49 Inactive
@vercel vercel bot temporarily deployed to staging November 8, 2019 11:13 Inactive
@vercel vercel bot temporarily deployed to staging November 8, 2019 11:39 Inactive
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

LGTM! So excited for this :D

// params need to be a string
handleParamsRequest = params => {
this.openApp(this.props.locator.instanceId, { params })
handleAppMessage = ({ data: { name, value } }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

😅 I didn't even realize before that we removed this function and we were always passing down undefined

@@ -107,26 +104,27 @@ export function getAppPath({
return `/${action}`
}

if (!fullDao) {
return `/${search}`
// Only keep the DAO name if it ends in aragonid.eth
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking of moving all of the history / window.location handling in the routing provider that remain to be added

Yes! This sounds like exactly what we need!

src/components/App/AppIFrame.js Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to staging November 8, 2019 11:44 Inactive
@vercel vercel bot temporarily deployed to staging November 8, 2019 12:02 Inactive
@sohkai
Copy link
Contributor

sohkai commented Nov 8, 2019

@bpierre I've pushed an update to fix the hook dependencies :).

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