DigitalCommons / mykomap

A web application for mapping initiatives in the Solidarity Economy
3 stars 0 forks source link

Support filtering on ad-hoc vocab fields #201

Open wu-lee opened 1 year ago

wu-lee commented 1 year ago

Is your feature request related to a problem? Please describe. What we call "ad-hoc vocabs" is defined in #199, bit in brief it means a vocab which is inferred from the data values present in a field. An example is "Sector - Simplified" in the CUK data, which contains a fixed set of values, but we aren't provided with a complete list of identifiers, and their translations as for cases like the ICA's "Economic Activites".

Currently these ad-hoc vocabs can be used in the directory panel - to do this they get put into the filterableFields config as the first item. This nominally defines the set of drop-down filters - ad-hoc vocabs are permitted but ignored, so that this special case can be supported.

For Owned by Oxford, and likely in other cases, we want to include an ad-hoc vocab "Nature of Organisation" as a filter, not as a the directory. This is because it only has two items. However, we cannot.

There is also a problem with the search history, since directory selection operations are not implemented as a filter operation, and are not included in the search history. This means they interact in unintuitive ways.

Describe the solution you'd like We would like any non-vocab field to be used as an ad-hoc vocab field in the filterableFields config, and have it appear as a drop-down in the search panel.

We would like it also to be included in the search history as a first-class citizen, so that selections on these filters works like the selection of the other filters.

We would like directory selections to be included in the search history too, which field it is listing, ad-hoc or not.

The above are all related and dependent, and so I think probably belong in the same issue.

We would like these ad-hoc vocabs to be localisable, so that we can add translations - although that may be tantamount to promoting them into a full vocab, and probably belongs in a separate issue.

[edit: The documentation should also be updated to reflect these changes, including that in https://github.com/DigitalCommons/mykomap-site-example]

Describe alternatives you've considered Most alternatives simply sidestep the problem and are suitable only in specific cases.

We could implement filtering without including it in the history. I'm not sure if that gains anything, as including it isn't a big step if it's written with that in mind.

We could not bother to implement directory selections as filters - but ditto.

Additional context none currently

@ColmDC

wu-lee commented 1 year ago

Time estimate - in T-shirt sizes, medium. In hours, maybe best case about a day, worst a small number of days.

ColmDC commented 1 year ago

We would like these ad-hoc vocabs to be localisable, so that we can add translations - although that may be tantamount to promoting them into a full vocab, and probably belongs in a separate issue.

Shall we drop this requirement. I feel it would be more useful to make it much easier to support a full vocab? Does dropping that requirement materially effect your time estimate?

wu-lee commented 1 year ago

Shall we drop this requirement.

Yes, I think we should, and possibly spin it off as a new issue.

I wasn't really taking it into account, so no it doesn't affect the time estimate.