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

Go to newly created Lexeme #94

Merged
merged 12 commits into from
Mar 23, 2022
Merged

Go to newly created Lexeme #94

merged 12 commits into from
Mar 23, 2022

Conversation

micgro42
Copy link
Collaborator

@micgro42 micgro42 commented Mar 21, 2022

Todo:

  • comments
  • jest test for form submit
  • assert routing in Cypress

Bug: T304397

Copy link
Member

@itamargiv itamargiv left a comment

Choose a reason for hiding this comment

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

All in all, I like this approach of injecting a "WikiRouter" to handle navigation out of the app. I added a couple of comments about things that are not so obvious at first glance, and might require some additional clarification.

src/plugins/WikiRouterPlugin/MediaWikiRouter.ts Outdated Show resolved Hide resolved
private readonly getUrl: MwUtilGetUrl;

public constructor(
getUrl: MwUtilGetUrl,
Copy link
Member

Choose a reason for hiding this comment

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

While I understand why this is injected here, it is not self-evident why we would need to inject a service that gets / generates a URL for us (and why this is better than just having a base URL as a config instead and constructing the URL ourselves). Therefore, I think it would be beneficial to anyone reading this code in the future if a comment was added to document this dependency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is a good point! Though I feel I'm not at my most eloquent today. I added a first comment, but I'd be happy about ideas for how to improve it

@micgro42 micgro42 changed the title PoC: go to newly created Lexeme Go to newly created Lexeme Mar 22, 2022
@micgro42
Copy link
Collaborator Author

I think this is now also ready for review. Happy to hear any suggestions for improvement :)

src/plugins/WikiRouterPlugin/WikiRouter.ts Outdated Show resolved Hide resolved
tests/mocks/unusedWikiRouter.ts Outdated Show resolved Hide resolved
Copy link
Member

@lucaswerkmeister lucaswerkmeister left a comment

Choose a reason for hiding this comment

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

Tested locally, seems to work fine. One optional comment.

src/plugins/WikiRouterPlugin/MediaWikiRouter.ts Outdated Show resolved Hide resolved
We don't need it for now. We can partially readd it when we need it for
getPageUrl.
@micgro42
Copy link
Collaborator Author

(rebased on top of main)

The plugin code is itself not related to MediaWiki, so it should live
with the agnostic interface. Especially, since it only mentions that
interface but not any specific implementation.
@micgro42 micgro42 merged commit 91c9619 into main Mar 23, 2022
@micgro42 micgro42 deleted the LexemeRouter branch March 23, 2022 15:16
micgro42 added a commit that referenced this pull request Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants