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

WIP: Add the ability to create a new Strategy or Moment from an individual Category page #2330

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lenikadali
Copy link

Description

Adds the ability to create a new Strategy or Moment from an individual Category page.

Corresponding Issue

#2300

Added the buttons for creating new Moments and Strategies
to the Categories page. They currently do not go anywhere
meaning that the next commit needs to correctly handle
routing so that the New Moment and New Strategy pages
appear successfully.
@lenikadali lenikadali self-assigned this Oct 16, 2024
Copy link

welcome bot commented Oct 16, 2024

Thank you for opening this pull request with us! Be sure to follow our Pull Request Practices. Let us know if you have any questions on Slack.

@lenikadali lenikadali marked this pull request as draft October 16, 2024 18:36
@lenikadali lenikadali marked this pull request as ready for review October 23, 2024 20:28
@julianguyen
Copy link
Member

Hey @lenikadali do you need any help here?

@lenikadali
Copy link
Author

Hey @lenikadali do you need any help here?

Hi 👋🏿

Thanks for checking in here 🙌🏿 The plan is to try out your suggestions either today or tomorrow and see how it goes 🤞🏿

@lenikadali lenikadali marked this pull request as draft October 26, 2024 14:38
Added form props for Moment and Strategy
to the categories_form_helper
@lenikadali
Copy link
Author

So the view is being rendered https://github.com/ifmeorg/ifme/blob/main/app/views/categories/new.html.erb.
So you’ll want to do it in the form that is being rendered with React. So you’ll need to update the value of new_category_props on the Rails side.
I've attempted to do that in this commit 8b9f8e2

You’ll want to do something like the Moments form where you can add a new Strategy from in there.
This isn’t about adding a link to the index page.

Oh. Then what did this statement mean in the issue description 🤔?

Desired Behavior

  1. Go to the https://www.if-me.org/categories/category-name-slug page
  2. Add two buttons "New Moment" and "New Strategy" aligned right of the Category name heading

Also, I noticed that the documentation for the version used of React on Rails is now not easily accessible. Maybe it could be worth it to first upgrade React on Rails as per this ticket and then attempt this one since it would be easier to reference the documentation as we work on this.

@julianguyen
Copy link
Member

Ohhh sorry I think I misunderstood / forgot about this ticket was asking for even though I wrote it haha.

Yes so what you want to do is modify the form for the show.html.erb page. When you click "New Moment" or "New Strategy" it will automatically have that category pre-checked in their respective new.html.erb forms.

@julianguyen
Copy link
Member

Yeah, we should upgrade React on Rails! It doesn't block this work, but I agree! There's a ticket to do that already with the latest version of React. #2115

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