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

Add hint label to note text #5440

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,12 @@ abstract class AbstractOverlayForm :

protected fun composeNote(element: Element) {
val overlayTitle = englishResources.getString(overlay.title)
val leaveNoteContext = "In context of \"$overlayTitle\" overlay"
val hintLabel = getNameAndLocationLabel(element, englishResources, featureDictionary)
val leaveNoteContext = if (hintLabel.isNullOrBlank()) {
"In context of \"$overlayTitle\" overlay"
} else {
"In context of \"$overlayTitle\" overlay for $hintLabel"
}
listener?.onComposeNote(overlay, element, geometry, leaveNoteContext)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,12 @@ abstract class AbstractOsmQuestForm<T> : AbstractQuestForm(), IsShowingQuestDeta

protected fun composeNote() {
val questTitle = englishResources.getQuestTitle(osmElementQuestType, element.tags)
val leaveNoteContext = "Unable to answer \"$questTitle\""
val hintLabel = getNameAndLocationLabel(element, englishResources, featureDictionary)
val leaveNoteContext = if (hintLabel.isNullOrBlank()) {
"Unable to answer \"$questTitle\""
} else {
"Unable to answer \"$questTitle\" for $hintLabel"
}
listener?.onComposeNote(osmElementQuestType, element, geometry, leaveNoteContext)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class LeaveNoteInsteadFragment : AbstractCreateNoteFragment() {
override fun onComposedNote(text: String, imagePaths: List<String>) {
val fullText = mutableListOf<String>()
leaveNoteContext?.let { fullText += it }
fullText += "for https://osm.org/${elementType.name.lowercase()}/$elementId"
fullText += " <https://osm.org/${elementType.name.lowercase()}/$elementId>"
fullText += "via ${ApplicationConstants.USER_AGENT}:\n\n$text"

viewLifecycleScope.launch {
Expand Down