[promo] new promo gallery type Outdoor is added

This commit is contained in:
Arsentiy Milchakov 2019-10-31 18:22:32 +03:00 committed by Daria Volvenkova
parent fee8ebf513
commit 2d3aedcbfe
7 changed files with 48 additions and 12 deletions

View file

@ -30,10 +30,11 @@ public final class Sponsored
public static final int TYPE_HOLIDAY = 4;
public static final int TYPE_PROMO_CATALOG_CITY = 5;
public static final int TYPE_PROMO_CATALOG_SIGHTSEEINGS = 6;
public static final int TYPE_PROMO_CATALOG_OUTDOOR = 7;
@Retention(RetentionPolicy.SOURCE)
@IntDef({ TYPE_NONE, TYPE_BOOKING, TYPE_OPENTABLE, TYPE_PARTNER, TYPE_HOLIDAY,
TYPE_PROMO_CATALOG_CITY, TYPE_PROMO_CATALOG_SIGHTSEEINGS })
TYPE_PROMO_CATALOG_CITY, TYPE_PROMO_CATALOG_SIGHTSEEINGS, TYPE_PROMO_CATALOG_OUTDOOR })
public @interface SponsoredType {}
static class FacilityType

View file

@ -1303,9 +1303,8 @@ public enum Statistics
case Sponsored.TYPE_PARTNER:
return PARTNER;
case Sponsored.TYPE_PROMO_CATALOG_CITY:
return MAPSME_GUIDES;
case Sponsored.TYPE_PROMO_CATALOG_SIGHTSEEINGS:
// TODO: Dummy, fix with correct value when documentation will be done.
case Sponsored.TYPE_PROMO_CATALOG_OUTDOOR:
return MAPSME_GUIDES;
case Sponsored.TYPE_NONE:
return "N/A";

View file

@ -925,6 +925,13 @@ void Framework::FillInfoFromFeatureType(FeatureType & ft, place_page::Info & inf
: place_page::OpeningMode::PreviewPlus);
info.SetSponsoredType(SponsoredType::PromoCatalogSightseeings);
}
else if (ftypes::IsPromoCatalogOutdoorChecker::Instance()(ft))
{
info.SetOpeningMode(m_routingManager.IsRoutingActive() || !GetPlatform().IsConnected()
? place_page::OpeningMode::Preview
: place_page::OpeningMode::PreviewPlus);
info.SetSponsoredType(SponsoredType::PromoCatalogOutdoor);
}
FillLocalExperts(ft, info);
FillDescription(ft, info);

View file

@ -50,6 +50,7 @@ enum class SponsoredType
Holiday,
PromoCatalogCity,
PromoCatalogSightseeings,
PromoCatalogOutdoor,
};
enum class LocalAdsStatus

View file

@ -20,14 +20,17 @@ protected:
}
};
class IsPromoCatalogSightseeingsChecker : public IsPromoCatalogPoiChecker
{
public:
DECLARE_CHECKER_INSTANCE(IsPromoCatalogSightseeingsChecker);
#define PROMO_CATALOG_CHECKER(ClassName, TypesGetter) \
class ClassName : public IsPromoCatalogPoiChecker \
{ \
public: \
DECLARE_CHECKER_INSTANCE(ClassName); \
private: \
ClassName() \
: IsPromoCatalogPoiChecker(TypesGetter) \
{} \
};
private:
IsPromoCatalogSightseeingsChecker()
: IsPromoCatalogPoiChecker(promo::GetPromoCatalogSightseeingsTypes())
{}
};
PROMO_CATALOG_CHECKER(IsPromoCatalogSightseeingsChecker, promo::GetPromoCatalogSightseeingsTypes())
PROMO_CATALOG_CHECKER(IsPromoCatalogOutdoorChecker, promo::GetPromoCatalogOutdoorTypes())
} // namespace ftypes

View file

@ -23,6 +23,25 @@ promo::TypesList kSightseeingsTypes = {
{"tourism", "viewpoint"},
{"amenity", "place_of_worship"},
};
promo::TypesList kOutdoorTypes = {
{"place", "village"},
{"place", "hamlet"},
{"natural", "volcano"},
{"waterway", "waterfall"},
{"natural", "cave_entrance"},
{"landuse", "forest"},
{"leisure", "nature_reserve"},
{"natural", "cliff"},
{"natural", "peak"},
{"natural", "rock"},
{"natural", "wood"},
{"natural", "bare_rock"},
{"natural", "glacier"},
{"leisure", "park"},
{"boundary", "national_park"}
};
} // namespace
namespace promo
@ -31,4 +50,9 @@ TypesList const & GetPromoCatalogSightseeingsTypes()
{
return kSightseeingsTypes;
}
TypesList const & GetPromoCatalogOutdoorTypes()
{
return kOutdoorTypes;
}
} // namespace promo

View file

@ -6,4 +6,5 @@ namespace promo
{
using TypesList = std::initializer_list<std::initializer_list<char const *>>;
TypesList const & GetPromoCatalogSightseeingsTypes();
TypesList const & GetPromoCatalogOutdoorTypes();
} // namespace promo