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

Combine index menu defs #940

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

t3azr
Copy link
Contributor

@t3azr t3azr commented Aug 1, 2024

[x] This pull request is on a separate branch and not the main branch

Use useMenuEntriesState to create the index menu options for events/id/index and organizations/id/index. Add idStr to prevent NaN from breaking urls.

Used useMenuEntriesState to create the menu options for both events and organizations. Changed the id used to create URL routes in useMenuEntriesState .

When tested using an example organization, redirected to the correct URL asfaik.

Hope this is good!! I think the commit name may have become messed up when trying to commit if you need that fixed, thank you !!

Use useMenuEntriesState to create the index menu options for events/id/index and organizations/id/index. Add idStr to prevent NaN from breaking urls.
Copy link
Contributor

github-actions bot commented Aug 1, 2024

Thank you for the pull request!

The activist team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Development rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!

Maintainer checklist

  • The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution

    • The contributor's name and icon in remote commits should be the same as what appears in the PR
    • If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for git config user.email in their local activist repo
  • The TypeScript and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The Playwright end to end and Zap penetration tests have been ran and are passing (if necessary)

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

Copy link

netlify bot commented Aug 1, 2024

Deploy Preview for activist-org ready!

Name Link
🔨 Latest commit 1925814
🔍 Latest deploy log https://app.netlify.com/sites/activist-org/deploys/66d62646f791490008af6d65
😎 Deploy Preview https://deploy-preview-940--activist-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@andrewtavis andrewtavis self-requested a review August 2, 2024 22:36
@andrewtavis
Copy link
Member

Thanks so much for the PR, @t3azr! Would you want to give the frontend warnings a quick look? I can also support it needed! 😊

@t3azr
Copy link
Contributor Author

t3azr commented Aug 25, 2024

sorry for taking so long !! im pretty sure the only errors were because I forgot to use prettier to format the file , but if there's anything else wrong please contact me !! hopefully these changes have been updated and work !!

@@ -3,8 +3,11 @@ import { IconMap } from "~/types/icon-map";
const createMenuEntry = (label: string, basePath: string, iconURL: string) => {
const { locale } = useI18n();
const router = useRouter();
// here, afaik, this is returning NaN as the id of a given organization is alphanumeric -- not a number.
// added the raw id which can be used with the routeURL , while maintaining the number version
const idStr = router.currentRoute.value.params.id;
const id = Number(router.currentRoute.value.params.id);
Copy link
Member

Choose a reason for hiding this comment

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

Ya this is a holdover from prior setups where the route URL was an integer. Nice catch! Let's just set id to your value - without the Number() :)

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

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

All's working really well, @t3azr! Really appreciate you taking the time to make these changes and that you reacted to the tests as well! Sorry my review was a bit on the late side :) Getting back into things after needing to focus elsewhere 😊 Hope you pick up another issue soon!

@andrewtavis andrewtavis merged commit f4608bb into activist-org:main Sep 2, 2024
6 checks passed
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