Skip to content

Commit

Permalink
Merge pull request #9210 from wordpress-mobile/feature/tag-gb-flag-fo…
Browse files Browse the repository at this point in the history
…r-support

Tag for the Gutenberg default flag for Support
  • Loading branch information
hypest authored Feb 12, 2019
2 parents 15372fb + 8ed5012 commit 4647aa7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,4 +498,5 @@ private object TicketFieldIds {

object ZendeskExtraTags {
const val connectingJetpack = "connecting_jetpack"
const val gutenbergIsDefault = "mobile_gutenberg_is_default"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.fluxc.store.AccountStore
import org.wordpress.android.fluxc.store.SiteStore
import org.wordpress.android.support.SupportHelper
import org.wordpress.android.support.ZendeskExtraTags
import org.wordpress.android.support.ZendeskHelper
import org.wordpress.android.ui.ActivityId
import org.wordpress.android.ui.AppLogViewerActivity
Expand Down Expand Up @@ -177,9 +178,27 @@ class HelpActivity : AppCompatActivity() {
if (selectedSite != null) {
intent.putExtra(WordPress.SITE, selectedSite)
}
if (extraSupportTags != null && !extraSupportTags.isEmpty()) {
intent.putStringArrayListExtra(HelpActivity.EXTRA_TAGS_KEY, extraSupportTags as ArrayList<String>?)

val tagsList: ArrayList<String>? = if (AppPrefs.isGutenbergDefaultForNewPosts()) {
// construct a mutable list to add the Gutenberg related extra tag
val list = ArrayList<String>()

// add the provided list of tags if any
extraSupportTags?.let {
list.addAll(extraSupportTags)
}

// Append the "mobile_gutenberg_is_default" tag if gutenberg is set to default for new posts
list.add(ZendeskExtraTags.gutenbergIsDefault)
list // "return" the list
} else {
extraSupportTags as ArrayList<String>?
}

if (tagsList != null && !tagsList.isEmpty()) {
intent.putStringArrayListExtra(HelpActivity.EXTRA_TAGS_KEY, tagsList)
}

return intent
}
}
Expand Down

0 comments on commit 4647aa7

Please sign in to comment.