ComponentApi VS FeildApi for geo data

I’m working on a a project where I’d prefer to use the strapi admin I stead of adding an extra fill blown cra. I’ve been able to successfully use the fields api to add custom editing (albeit not optimal). But what I’d like to do now is add a custom component field, where the Component controls editing a full component relation.

Ive been able to do it but I’m curious what the better practice would be to reduce long term annoyances.

At this point i:

  • created my components, in the main api, since they cannot yet be added in a plugin. The component just contains mapping related fields, without geojson (solely because Id still prefer separate columns. It makes lon/lat searchable with less DB plugin headache for me.

(I saw the closed pull request for the plugin supplied components. I may take a second stab at this as I feel like it makes sense to provide both the content, field component and component definition in the same spot)

  • I have my ui component which works. Which I’m adding to the componentApi in the plugin index. Allows picking lon/lat/alt and saving the component as a whole with one click.

  • To do this Im extending FieldComponent from content manager so that it’s select and connect functions include onChange and other data management items.

  • I’m then replacing the NonRepeatableComponent when componentApi. GetComponent(componentUid) is found.

So essentially I’m curious about:

Is componentApi a better choice that FeildApi? Or should I use FeildApi with the component uid? Or something else?

Is field component a good spot? I chose it since it looked the most similar to Inputs (due to connect and select). It just requires the 2 files being managed each upgrade (which as the docs say is annoying).

Any points or suggestions to make this more maintainable would be appreciated.

Thanks in advance.

Ps. If my idea of using components is wrong please let me know and I’ll spend a little. More time working on the geojson dB plug-in.