-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3102 from wordpress-mobile/issue/12696-keep-json-…
…values [Custom Fields] Store Json values
- Loading branch information
Showing
6 changed files
with
21 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
...main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/order/StripOrderMetaData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
package org.wordpress.android.fluxc.network.rest.wpcom.wc.order | ||
|
||
import org.wordpress.android.fluxc.model.metadata.WCMetaData | ||
import org.wordpress.android.fluxc.model.metadata.WCMetaData.OrderAttributionInfoKeys | ||
import org.wordpress.android.fluxc.model.metadata.WCMetaData.SubscriptionMetadataKeys | ||
import javax.inject.Inject | ||
|
||
class StripOrderMetaData @Inject internal constructor() { | ||
companion object { | ||
private val SUPPORTED_KEYS: Set<String> = buildSet { | ||
add(SubscriptionMetadataKeys.SUBSCRIPTION_RENEWAL) | ||
addAll(OrderAttributionInfoKeys.ALL_KEYS) | ||
} | ||
} | ||
|
||
operator fun invoke(metaData: List<WCMetaData>): List<WCMetaData> { | ||
return metaData | ||
.filter { | ||
(it.isDisplayable || it.key in WCMetaData.SUPPORTED_KEYS) | ||
&& !it.isJson | ||
it.isDisplayable || it.key in SUPPORTED_KEYS | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters