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

[android] Add website:menu tag support #8052

Merged
merged 5 commits into from May 17, 2024
Merged

Conversation

Arthur-GYT
Copy link
Contributor

@Arthur-GYT Arthur-GYT commented May 1, 2024

All is in the title ^^.

Close #2376

I've tested this PR on this node (France_Free County_North.mwm) : https://www.openstreetmap.org/node/6637693465

I leave it to those who wish (and can) to add this to the IOS version. As I don't own a Mac, it's impossible for me to take care of this ^^.

Screenshot_20240508-190830

Screenshot_20240506-165510

@Arthur-GYT
Copy link
Contributor Author

Arthur-GYT commented May 1, 2024

I can't test it, I don't find (and know) any restaurant with this tag in the current state of the map (march 2024). Or maybe I do a mistake. Any suggestion ?

@Arthur-GYT Arthur-GYT changed the title Add website:menu tag support [android] Add website:menu tag support May 1, 2024
@Jean-BaptisteC
Copy link
Member

Good feature
That's require a map generation, to see this tag in place page

@Arthur-GYT
Copy link
Contributor Author

Good feature
That's require a map generation, to see this tag in place page

Okay, I will take a look. Just one more thing, I don't need to commit map generation, right ?

@RedAuburn
Copy link
Sponsor Member

Okay, I will take a look. Just one more thing, I don't need to commit map generation, right ?

nope 👍️

@Arthur-GYT Arthur-GYT force-pushed the website-menu branch 3 times, most recently from 1ce3428 to 995ee09 Compare May 5, 2024 19:51
@Arthur-GYT Arthur-GYT marked this pull request as ready for review May 5, 2024 20:04
@Arthur-GYT Arthur-GYT requested a review from a team as a code owner May 5, 2024 20:04
@Arthur-GYT
Copy link
Contributor Author

Ready for review ^^ !!

@RedAuburn
Copy link
Sponsor Member

can you post a screenshot of how it looks? :)

Copy link
Sponsor Member

@RedAuburn RedAuburn left a comment

Choose a reason for hiding this comment

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

looks good overall! a small nit:

android/app/src/main/res/layout/fragment_editor.xml Outdated Show resolved Hide resolved
@Arthur-GYT
Copy link
Contributor Author

can you post a screenshot of how it looks? :)

It's uploaded in my first message ^^.

@RedAuburn
Copy link
Sponsor Member

RedAuburn commented May 6, 2024

should it show the link to the menu, or would it be better to use the text "Open Menu in Browser"?
the menu link in the screenshot looks good, but often it's a messy link to a PDF:

eg.
https://www.openstreetmap.org/node/10271116595

where the link is (or was at least)
http://79.170.40.239/devthecoriander.com/wp-content/uploads/2020/01/The-Coriander-Buckhurst-Hill_Essex-take-away-menu-proof.pdf

@biodranik
Copy link
Member

  1. Cuisine icons and menu icons are very similar and confusing. They should be distinct and clear.
  2. As it is a menu web URL, then it should clearly say "Menu website link" or "Menu link" or something similar in the editor.
  3. Both cuisine and menu should be nearby in POI (they are closely related) and in the editor (we really want to encourage users to add menus, not wifis or something else, this is very valuable data for planning a visit to a restaurant).
  4. In the Place Page it is not clear what does an icon and a website URL mean. I suggest replacing it with a clear text: Check Menu.

@Arthur-GYT Arthur-GYT force-pushed the website-menu branch 4 times, most recently from 356ffa1 to 71f5ea7 Compare May 6, 2024 14:54
@Arthur-GYT
Copy link
Contributor Author

@biodranik I updated the code with your recommendations ^^.

@Arthur-GYT Arthur-GYT requested a review from RedAuburn May 6, 2024 15:26
@Arthur-GYT
Copy link
Contributor Author

should it show the link to the menu, or would it be better to use the text "Open Menu in Browser"? the menu link in the screenshot looks good, but often it's a messy link to a PDF:

eg. https://www.openstreetmap.org/node/10271116595

where the link is (or was at least) http://79.170.40.239/devthecoriander.com/wp-content/uploads/2020/01/The-Coriander-Buckhurst-Hill_Essex-take-away-menu-proof.pdf

I think it's solved with recent changes ^^.

Signed-off-by: Arthur-GYT <a.gayot@posteo.com>
@kirylkaveryn
Copy link
Contributor

@biodranik i need some time to implement this feature in iOS.
Should this PR be merged first or we can wait a little bit?

Copy link
Member

@biodranik biodranik left a comment

Choose a reason for hiding this comment

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

Thanks, I'm ok to merge it after a few minor fixes.

@vng PTAL, it would be great to run the generator with these changes.

data/strings/strings.txt Show resolved Hide resolved
data/strings/strings.txt Show resolved Hide resolved
data/strings/strings.txt Show resolved Hide resolved
data/strings/strings.txt Show resolved Hide resolved
data/strings/strings.txt Show resolved Hide resolved
data/strings/strings.txt Show resolved Hide resolved
Signed-off-by: Arthur-GYT <a.gayot@posteo.com>
Signed-off-by: Arthur-GYT <a.gayot@posteo.com>
Copy link
Member

@biodranik biodranik left a comment

Choose a reason for hiding this comment

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

Thank you!

@vng merge please

@kirylkaveryn
Copy link
Contributor

@biodranik @Arthur-GYT in iOS we don't have cells with the subtitles in the PP. But without the subtitle, this field may not be clear. Should we add a new cell (it may not be easy because of the current PP implementation) or use the same style as wiki/fb/link?

@biodranik
Copy link
Member

@kirylkaveryn Let's make it simpler, by not showing the URL, and improve later if necessary.

@kirylkaveryn
Copy link
Contributor

@Arthur-GYT @biodranik should the new type be validated in the indexer/editable_map_object.cpp? :

bool EditableMapObject::IsValidMetadata(MetadataID type, std::string const & val
{
  switch (type)
  {
  case MetadataID::FMD_WEBSITE: return ValidateWebsite(value);
  case MetadataID::FMD_WEBSITE_MENU: return ValidateWebsite(value); // <--- ?

void EditableMapObject::SetMetadata(MetadataID type, std::string value)
{
  switch (type)
  {
  case MetadataID::FMD_WEBSITE: value = ValidateAndFormat_website(value); break;
  case MetadataID::FMD_WEBSITE_MENU: value = ValidateAndFormat_website(value); break;  // <--- ?
...

@Arthur-GYT
Copy link
Contributor Author

Arthur-GYT commented May 12, 2024

@kirylkaveryn

I forgot this ^^'. It's added, thanks ^^.

@kirylkaveryn
Copy link
Contributor

@Arthur-GYT also important to add the new key into the editor/editor_config.cpp to te list of fields with metadata. In other case you will get a crash while parsing the editor.config XML tags.

   {"operator", EType::FMD_OPERATOR},
    {"website", EType::FMD_WEBSITE},
    {"website_menu", EType::FMD_WEBSITE_MENU}, // <---
    {"contact_facebook", EType::FMD_CONTACT_FACEBOOK},

And only after that, the editor.config can be updated to support a new tag.
@biodranik @dvdmrtnz can you please correct me if I'm wrong?

@kirylkaveryn
Copy link
Contributor

kirylkaveryn commented May 12, 2024

3. Both cuisine and menu should be nearby in POI (they are closely related) and in the editor (we really want to encourage users to add menus, not wifis or something else, this is very valuable data for planning a visit to a restaurant).

@biodranik
The list of editable objects is autogenerated and the FMD_WEBSITE_MENU is the last in the types enum (46) and manual reordering isn't supported. So in ios it is always appended to the end...
image

Simulator Screen Recording - iPhone 15 Pro - 2024-05-12 at 17 28 09

Simulator Screen Recording - iPhone 15 Pro - 2024-05-12 at 17 27 39

Signed-off-by: Arthur-GYT <a.gayot@posteo.com>
@Arthur-GYT
Copy link
Contributor Author

Arthur-GYT commented May 12, 2024

@kirylkaveryn It's modified ^^.

@biodranik
Copy link
Member

It should be possible to change the order of the visible fields on the screen, the internal order can be anything unrelated.

@kirylkaveryn
Copy link
Contributor

It should be possible to change the order of the visible fields on the screen, the internal order can be anything unrelated.

It requires a refactroing and may be implemented in a separate PR...

@biodranik
Copy link
Member

It requires refactoring and may be implemented in a separate PR...

A separate PR is a good idea!

Copy link
Member

@biodranik biodranik left a comment

Choose a reason for hiding this comment

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

Ready to merge?

@Arthur-GYT
Copy link
Contributor Author

Arthur-GYT commented May 12, 2024

For me, yes ^^

@Arthur-GYT
Copy link
Contributor Author

@biodranik @vng Any news ?

@vng vng merged commit 8d27c32 into organicmaps:master May 17, 2024
16 checks passed
@biodranik
Copy link
Member

@Arthur-GYT congrats and thanks for your hard work and contribution!

@Arthur-GYT Arthur-GYT deleted the website-menu branch May 17, 2024 12:07
@patepelo
Copy link
Contributor

Screenshot_20240518-183453.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for website:menu tag
9 participants