[editor][ios] Add self_service to editor

Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
This commit is contained in:
David Martinez 2024-08-26 18:28:00 +02:00 committed by Konstantin Pastbin
parent 1664c549b4
commit 3493538c56

View file

@ -68,6 +68,7 @@ std::map<MWMEditorCellID, Class> const kCellType2Class {
{MetadataID::FMD_CUISINE, [MWMEditorSelectTableViewCell class]},
{MetadataID::FMD_INTERNET, [MWMEditorSwitchTableViewCell class]},
{MetadataID::FMD_DRIVE_THROUGH, [MWMEditorSegmentedTableViewCell class]},
{MetadataID::FMD_SELF_SERVICE, [MWMEditorSegmentedTableViewCell class]},
{MWMEditorCellTypeNote, [MWMNoteCell class]},
{MWMEditorCellTypeReportButton, [MWMButtonCell class]}
};
@ -650,6 +651,15 @@ void registerCellsForTableView(std::vector<MWMEditorCellID> const & cells, UITab
value:feature::YesNoUnknownFromString(m_mapObject.GetMetadata(feature::Metadata::FMD_DRIVE_THROUGH))];
break;
}
case MetadataID::FMD_SELF_SERVICE:
{
MWMEditorSegmentedTableViewCell * tCell = static_cast<MWMEditorSegmentedTableViewCell *>(cell);
[tCell configWithDelegate:self
icon:[UIImage imageNamed:@"ic_placepage_self_service"]
text:L(@"self_service")
value:feature::YesNoUnknownFromString(m_mapObject.GetMetadata(feature::Metadata::FMD_SELF_SERVICE))];
break;
}
case MetadataID::FMD_CONTACT_FACEBOOK:
{
[self configTextViewCell:cell
@ -971,6 +981,21 @@ void registerCellsForTableView(std::vector<MWMEditorCellID> const & cells, UITab
break;
}
break;
case MetadataID::FMD_SELF_SERVICE:
switch (changeSegmented)
{
case Yes:
m_mapObject.SetMetadata(feature::Metadata::FMD_SELF_SERVICE, "yes");
break;
case No:
m_mapObject.SetMetadata(feature::Metadata::FMD_SELF_SERVICE, "no");
break;
case Unknown:
m_mapObject.SetMetadata(feature::Metadata::FMD_SELF_SERVICE, "");
break;
}
break;
default: NSAssert(false, @"Invalid field for changeSegmented"); break;
}
}