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

Contrib Mode #163

Merged
merged 21 commits into from
Feb 26, 2024
Merged

Contrib Mode #163

merged 21 commits into from
Feb 26, 2024

Conversation

wazolab
Copy link
Member

@wazolab wazolab commented Feb 13, 2024

I think we have to add fr translation for new list headers entries editor_id, osm_note, mapillary_link
And translation in spanish local file for editor_id, osm_note:

@wazolab wazolab requested a review from frodrigo February 13, 2024 18:45
@wazolab wazolab self-assigned this Feb 13, 2024
@wazolab wazolab linked an issue Feb 13, 2024 that may be closed by this pull request
@wazolab wazolab added the enhancement New feature or request label Feb 14, 2024
locales/fr-FR.ts Outdated Show resolved Hide resolved
locales/es-ES.ts Outdated Show resolved Hide resolved
locales/en-GB.ts Outdated Show resolved Hide resolved
@frodrigo
Copy link
Member

Does work from any pages (at least main map and category list) ?

@wazolab
Copy link
Member Author

wazolab commented Feb 19, 2024

Does work from any pages (at least main map and category list) ?

yes It does !

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have the whole logic within a middleware file, which is not the best in my opinion.
On a next work about Contribution, we could convert this code into a Nuxt Module.
This way we would isolate from the main codebase:

  • the store
  • middleware
  • utility functions
  • UI component
  • Types
  • Maybe translations (by merging them within our main translation files)

@frodrigo
Copy link
Member

Please, can you add an entry into the README on how to use this feature.

@frodrigo
Copy link
Member

The mapillary link does not appear in the POICard.

The contrib mode is or not persisted to local storage, I does not see it working ?

@wazolab
Copy link
Member Author

wazolab commented Feb 19, 2024

I can add MapillaryLink to POICard of course. I though from the specs it was unwanted here ...

In fact it's not, I though it was thanks to pinia-shared-state doing the job with localStorage, but we have to activate it by store (disabled by default ... I didn't see it :/ )

@frodrigo
Copy link
Member

I can add MapillaryLink to POICard of course. I though from the specs it was unwanted here ...

Right. Note, from the issue is also required to do in in the detail pages, (there is already and osm link in the footer to be removed)

@wazolab
Copy link
Member Author

wazolab commented Feb 19, 2024

(there is already and osm link in the fo

Are we talking about this Lat / Long link ?
image

@wazolab
Copy link
Member Author

wazolab commented Feb 19, 2024

Alright, do we need to remove only © OpenStreetMap contributors ?

@teritorio teritorio deleted a comment from frodrigo Feb 19, 2024
@frodrigo
Copy link
Member

No, the link to osm.org from the date.

@wazolab
Copy link
Member Author

wazolab commented Feb 19, 2024

Do I need to add mapillary_link in Details page as we already have it under Mapillary Image ?
image

@frodrigo
Copy link
Member

Do I need to add mapillary_link in Details page as we already have it under Mapillary Image ?

Yes, because the image is a configurable field.

@wazolab
Copy link
Member Author

wazolab commented Feb 19, 2024

I can add MapillaryLink to POICard of course. I though from the specs it was unwanted here ...

Right. Note, from the issue is also required to do in in the detail pages, (there is already and osm link in the footer to be removed)

Should we remove this link only on Contributor Mode or for every one ?

@frodrigo
Copy link
Member

I can add MapillaryLink to POICard of course. I though from the specs it was unwanted here ...

Right. Note, from the issue is also required to do in in the detail pages, (there is already and osm link in the footer to be removed)

Should we remove this link only on Contributor Mode or for every one ?

For every one, was "quick" contrib mode hack.

@frodrigo
Copy link
Member

Contrib column lost on list when switching category client side.

@wazolab
Copy link
Member Author

wazolab commented Feb 20, 2024

Contrib column lost on list when switching category client side.

Yes, I need to add the poi.properties contrib transformation on PoisList watcher level.

Note: It would be more convenient to have all the data processing on pages/category/[id].vue level, for the moment I am forced to duplicate code.

@wazolab
Copy link
Member Author

wazolab commented Feb 21, 2024

Translation are also missing for group_contrib (detail) and contrib (list).

Should I add them in local i18n or do we integrate it from Translations API ?
I think it's better from API because it will integrate straight with frontend and it might be low cost of work (just add the keys in API response) ?

If I do it in frontend, I need to isolate contrib case on FieldsHeader as it's based on Translations API:

<FieldsHeader
  v-if="field.label"
  :recursion-stack="recursionStack"
  :class="`field_header_level_${recursionStack.length}`"
>
  {{ fieldTranslateK(field.field) }}
</FieldsHeader>

@frodrigo
Copy link
Member

Like the fields settings, you could inject if in the translations from the API ?

@frodrigo
Copy link
Member

Each time we come back to a POICard it add new fields
image

@wazolab
Copy link
Member Author

wazolab commented Feb 21, 2024

Like the fields settings, you could inject if in the translations from the API ?

Yes from GET /attribute_translations/fr.json
I don't really know how this Translations API works ... Does Translations API is linked to fields settings ?

  • For the moment we are using editorial.(fields_group | popup_group | details_group) in order to have fields keys and pass it to $propertyTranslations and then query Translations API.
  • As we have contrib and group_contrib fields added on top of editorial, we just need to pass the fields to $propertyTranslations and then query Translations API.
  • Later we could add contrib and group_contrib fields to GET /pois/category/${categoryId}.${options.format} in order to have a full integration of the Contrib Mode.

What do you think ?

@wazolab
Copy link
Member Author

wazolab commented Feb 21, 2024

Each time we come back to a POICard it add new fields

Fix here

@wazolab
Copy link
Member Author

wazolab commented Feb 26, 2024

PR updated, now we are injecting Contrib fields on templates, instead of key addition in data.
I've created a Mixin for code reuse.

@frodrigo frodrigo merged commit 205220a into develop Feb 26, 2024
5 checks passed
@wazolab wazolab deleted the 142-contrib-mode branch February 26, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contrib mode
2 participants