Second version of the forms created

You’ll need to create a new version of the i18n files for text and for categories for both the /btm and /phm files. We don’t have a use for it on meta yet, but it’s best to keep consistency between the two, and it’s a nice extension of the platforms causticity that will come in handy one day soon :slightly_smiling_face:

Makes sense. So it would be most intuitive to introduce a new file called new-event-modal-2 that is the same as new-event-modal, but with the extra field in both PHM and BTM, right? And then probably modify the React over at NewEvent to accommodate the change.

Yeah, that sounds perfect. The slight question is whether a URL link can open a new form. I believe that it can. That would give us most functionality as we can then drop a hyper link anywhere, or code a button which calls the URL to open the new form.

It’s not a huge issue though, as long as the trigger to call the form is easy to insert and remove.

Yep I assume that should be fairly straightforward to do once the form is up and running. Another question: does it make sense to change the original form by adding the new field, or should that change just be reflected in a new set of files?

Sorry if I’m asking too many questions, but I want to get a full idea of what’s happening here.

Questions are good :slightly_smiling_face:

A new set of files. The idea is that the platform is to empower communities to help period who are homeless nearby which is it’s normal mission. That’s the current form.

It’s also great for disaster relief, so when an emergency occurs like Covid, or an earthquake, we can make the second form visible with things the community can do to help those in need.

So it’s 2 separate forms, although they operate the same. One is always active, the other is edited and made available in response to emergency situations

Ah, that does make sense. Thanks for the info.

Side question: where can I find the documentation for the form code?

I don’t think we have that in our documentation unfortunately. Here’s the components list: Components Directory

@ArtyS might be able to guide you in the right direction if he’s around.

If you want to help Devs who work on it in the future it would be great to keep notes as you work it out and then post them with the ‘documentation’ ‘webdev’ and ‘reactjs’ tags

That sounds like a good idea. I think maybe I will do that. Thanks

1 Like

So I examined the code some more and found all the new changes that need to be made:

  • A new Mongo schema with the new categories that you want
  • The new categories and labels as i18n files (like categories.json and new-event-modal.json)
  • A new FormWizard that makes use of the new schema, I’m assuming this is where the UI is

Is there anything I’m missing?

1 Like

That sounds good to me, although a step above my depth technically.

An exact copy of the existing form with appended labels so it can be customised and a unique URL/trigger

Alright. I can now try to find a solution

1 Like

I noticed that the forms for the PHM and BTM are different, and the UI for the BTM form seems to be designed down at https://github.com/focallocal/fl-maps/tree/master/imports/client/ui/pages/NewEvent/FormWizard

Where is the UI for the PHM form?

Strange, I think it should be the same. Perhaps deploy-PHM is behind deploy-btm and master branches.

Here’s the code loading for BTM: https://github.com/focallocal/fl-maps/tree/deploy-btm/imports/client/ui/pages/NewEvent/FormWizard

Thank you, that makes sense.

So now that we know which files to duplicate to have a copy of the current form, should I go ahead and do so in the Github repo? I would need to create copies of 4-7 files depending on what changes you want to have in the new form.

No changes needed in the new form. Just appended tags like this

Title1 > s-Title
Description 1 > s-Description1

Or something like that.

It would need to call different categories though. There is also a small issue that we are using mLab for the database, and I received an email saying that is being deprecated and we should migrate, so that may change things slightly

That makes sense. I have some experience with MongoDB Atlas so I could help you with that. We would just need to create a new collection.

So you just want the new form to have the same categories and fields except with the s- prefix right?

basically, although s- was totally random. If there is a more industry standard prefix please use that. Then i’ll change the text on the forms once its up.