Fixes #545 - Add support for campaigns (#4423)

* Integrate WLM
- Show monuments in maps along with nearby

* BugFix in Monuments
1. Single preference for monuments and campaigns
2. Expand collapse chips container in nearby
3. Typo fix in Monuments card in Nearby
4. If a nearby place is a monument as well - do not show them separately, show it as a monument instead
5. Bug fix, monument radius, use the same one as that of nearby

* More bug fixes
1. Possible NPE in nearby
2. Added column location_address in BookmarkLocationDao
3. Bug Fix - Display Date in WLM card
4. WLM card on click takes to nearby

* Use lowercase country code in WLM uploads

* Bug-Fix, WLM Campaign Icon

* 1. Updated monuments query to use any of the following properties for monuments - [P1435, P2186, P1459, P1460, P1216, P709, P718, P5694] 2. Append WikiData QID to descriptions template

* Updated WLM Banner String, Handle NPE in contributions callback

* Added nearby-monuments query log lines

* Handle WLM Query exception : - if an exception is thrown in WLM query, continue showing the nearby items if that succeeds

* Fix BookmarkLocationDaoTest

* Added Column Address in BookmarkLocationDaoTest

* Use fallback description as usual nearby pins even for WLM pins, instead of relying on P6375

* Test fix in BookmarkLocationDao

* Updated template for WLM, removed redundant feilds

* Fixed WLM template

* Removed categories from WLM template

* Fixed BookmarkControllerTest

* Fixed BookmarkLocationFragmentUnitTest

* fix ModelFunctions

* Fixed BookmarksDaoLocationTest

* Fixed WLM template
This commit is contained in:
Ashish 2021-08-18 13:57:26 +05:30 committed by GitHub
parent 67f5b6c271
commit 6588a6fd0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 2906 additions and 185 deletions

View file

@ -1,9 +1,6 @@
package fr.free.nrw.commons.bookmarks.locations
import android.net.Uri
import com.nhaarman.mockitokotlin2.whenever
import fr.free.nrw.commons.bookmarks.Bookmark
import fr.free.nrw.commons.bookmarks.pictures.BookmarkPicturesDao
import fr.free.nrw.commons.nearby.Place
import org.junit.Assert
import org.junit.Before
@ -33,8 +30,23 @@ class BookmarkLocationControllerTest {
private val mockBookmarkList: List<Place>
private get() {
val list = ArrayList<Place>()
list.add(Place("en","a place",null,"a description",null,"a cat",null,null,true))
list.add(Place("en","another place",null,"another description",null,"another cat",null,null,true))
list.add(
Place(
"en", "a place", null, "a description", null, "a cat", null, null, true)
)
list.add(
Place(
"en",
"another place",
null,
"another description",
null,
"another cat",
null,
null,
true
)
)
return list
}

View file

@ -77,7 +77,18 @@ class BookmarkLocationFragmentUnitTests {
private val mockBookmarkList: List<Place>
private get() {
val list = ArrayList<Place>()
list.add(Place("en","a place",null,"a description",null,"a cat",null,null,true))
list.add(
Place(
"en",
"a place",
null,
"a description",
null,
"a cat",
null,
null,
true)
)
return list
}

View file

@ -265,7 +265,14 @@ class NearbyParentFragmentPresenterTest {
fun testFilterByMarkerTypeMultiSelectCHECKED() {
val state = CheckBoxTriStates.CHECKED
nearbyPresenter.filterByMarkerType(selectedLabels, state, false,true)
verify(nearbyParentFragmentView).filterMarkersByLabels(ArgumentMatchers.anyList(),ArgumentMatchers.anyBoolean(),ArgumentMatchers.anyBoolean(),ArgumentMatchers.anyBoolean(),ArgumentMatchers.anyBoolean());
verify(nearbyParentFragmentView).filterMarkersByLabels(
ArgumentMatchers.anyList(),
ArgumentMatchers.anyBoolean(),
ArgumentMatchers.anyBoolean(),
ArgumentMatchers.anyBoolean(),
ArgumentMatchers.anyBoolean(),
ArgumentMatchers.anyBoolean()
);
verify(nearbyParentFragmentView).setRecyclerViewAdapterAllSelected()
verifyNoMoreInteractions(nearbyParentFragmentView)
}
@ -276,7 +283,14 @@ class NearbyParentFragmentPresenterTest {
@Test
fun testFilterByMarkerTypeSingleSelect() {
nearbyPresenter.filterByMarkerType(selectedLabels, 0, true,false)
verify(nearbyParentFragmentView).filterMarkersByLabels(any(), any(), any(), any(), any());
verify(nearbyParentFragmentView).filterMarkersByLabels(
any(),
any(),
any(),
any(),
any(),
any()
);
verifyNoMoreInteractions(nearbyParentFragmentView)
}