-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow geofence property per project #195
Comments
Why not using params? You can use replace for name props.. in your case you want to replace |
Have you checked out the url param documentation? https://koji.vercel.app/api-reference/params they were added for exactly this. |
@TurtIeSocks I'd argue that the |
I'm not sure about less flexible since this allows you to customize it at the API calling level, compared to project wide. And while I agree it's perhaps not the most transparent in the UI, this is why I made the |
Another point is that there might be a desire to transform names beyond trimming and replacement. For example, one may decide to shorten certain common suffixes of cities, such as "Bakersfield" to "Bakersfd" or "Mexico City" to "Mexico C." (now I'm making stuff up, but I guess you get the idea). |
Honestly, I just don't want to touch anything related to names anymore. @Fabio1988 has had me run to the moon and back already, not to mention the queries involved with piecing together the table data into Features and the crud functionality for saving and associating properties are just too gnarly. Should they be made better? Yes, but I'm just not invested in them currently, as I think any non-made-up situations can be resolved with the right combinations of params. |
I get your point, @TurtIeSocks . These things are quite difficult to handle. But now that I'm thinking more about it, there may be a simple solution on the So instead of pub struct ApiQueryArgs {
...
/// If true, the `name` property is added
pub name: Option<bool>, we could do pub struct ApiQueryArgs {
...
/// If set, defines the name of the property which will be used as the `name`.
/// If set to true, the `name` property will be used. If set to false, no name property will be included.
pub name: Option<string>, |
It would be great to allow geofence properties per project. This may be most useful for the
name
property which could slightly differ in various projects, for usability purposes.Example & Reasoning
For example, let's assume I have a geofence combining two close neighborhoods, named
A / B
in Koji. If I'd export this to Poracle which doesn't allow blanks, it will appear asA_/_B
which is ugly to read and annoying to write for an!area
command. So for this Poracle export, I may preferA-B
and I'd set thename
property accordingly. On the other hand, I want the same geofence to appear asA / B
on ReactMap, for better readability, but thename
property is already occupied.With a single
name
property, I have to chose. If I could specify thename
property for each geofence per project, I have all the flexibility I need.Design & Implementation
Option A
This option requires an additional nullable column
project_id
in thegeofence_property
table.In the UI in the Geofence edit view, it needs an additional dropdown in the geofence's property list where the user would select a specific project (or no project in which case the property would behave as it is right now).
If users want to override a geofence property for a specific project, they can do so by editing a geofence, adding a property row, selecting the property key and the project, and enter the desired value.
Option B
This option requires an additional nullable column
project_id
in theproperty
table.In the UI, the Properties edit view would allow to select an optional project along with the mandatory name and category fields.
If users want to override a geofence property for a specific project, they first need to make sure that such a specialized property is defined in the Properties list. Then, they would edit a geofence, add a property row, select the property key for the specific project and enter the desired value.
Alternative proposal
As an alternative, Koji may just allow a property key mapping upon export.
This means a user would just define dedicated properties such as
poracle_name
orreactmap_name
for their various geofences. The actual translation would be defined in the Projects edit view, ie. in the Poracle project the user defines a mapping ofporacle_name
toname
, while in the ReactMap project, the user would define a mapping ofreactmap_name
toname
.The text was updated successfully, but these errors were encountered: