diff --git a/Podfile b/Podfile index 5a4b8738d9c4..2a47db4b1c41 100644 --- a/Podfile +++ b/Podfile @@ -47,7 +47,7 @@ def wordpress_ui end def wordpress_kit - pod 'WordPressKit', '~> 4.58.1-beta.1' + pod 'WordPressKit', '~> 4.58', '>= 4.58.1' # pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :tag => '' # pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => '' # pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => '' @@ -222,7 +222,7 @@ abstract_target 'Apps' do pod 'Gridicons', '~> 1.1.0' - pod 'WordPressAuthenticator', '~> 3.2', '>= 3.2.2-beta.1' + pod 'WordPressAuthenticator', '~> 3.2', '>= 3.2.2' # pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: 'fix/prologue-nav-bar' # pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => '' # 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS' diff --git a/Podfile.lock b/Podfile.lock index 066d8c7346ac..905f10afa669 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -481,9 +481,9 @@ PODS: - SDWebImageWebPCoder (0.8.5): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.10) - - Sentry (7.27.0): - - Sentry/Core (= 7.27.0) - - Sentry/Core (7.27.0) + - Sentry (7.28.0): + - Sentry/Core (= 7.28.0) + - Sentry/Core (7.28.0) - Sodium (0.9.1) - Starscream (3.0.6) - SVProgressHUD (2.2.5) @@ -491,7 +491,7 @@ PODS: - WordPress-Aztec-iOS (1.19.8) - WordPress-Editor-iOS (1.19.8): - WordPress-Aztec-iOS (= 1.19.8) - - WordPressAuthenticator (3.2.2-beta.1): + - WordPressAuthenticator (3.2.2): - Alamofire (~> 4.8) - CocoaLumberjack (~> 3.5) - GoogleSignIn (~> 6.0.1) @@ -501,7 +501,7 @@ PODS: - WordPressKit (~> 4.18-beta) - WordPressShared (~> 1.12-beta) - WordPressUI (~> 1.7-beta) - - WordPressKit (4.58.1-beta.1): + - WordPressKit (4.58.1): - Alamofire (~> 4.8.0) - CocoaLumberjack (~> 3.4) - NSObject-SafeExpectations (= 0.0.4) @@ -601,8 +601,8 @@ DEPENDENCIES: - Starscream (= 3.0.6) - SVProgressHUD (= 2.2.5) - WordPress-Editor-iOS (~> 1.19.8) - - WordPressAuthenticator (>= 3.2.2-beta.1, ~> 3.2) - - WordPressKit (~> 4.58.1-beta.1) + - WordPressAuthenticator (>= 3.2.2, ~> 3.2) + - WordPressKit (>= 4.58.1, ~> 4.58) - WordPressShared (~> 1.18.0) - WordPressUI (~> 1.12.5) - WPMediaPicker (~> 1.8.4) @@ -613,7 +613,6 @@ DEPENDENCIES: SPEC REPOS: https://github.com/wordpress-mobile/cocoapods-specs.git: - WordPressAuthenticator - - WordPressKit trunk: - Alamofire - AlamofireImage @@ -651,6 +650,7 @@ SPEC REPOS: - UIDeviceIdentifier - WordPress-Aztec-iOS - WordPress-Editor-iOS + - WordPressKit - WordPressShared - WordPressUI - WPMediaPicker @@ -857,15 +857,15 @@ SPEC CHECKSUMS: RNTAztecView: 168824a26c9e9b19f6f032a739efab296771b351 SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d - Sentry: 026b36fdc09531604db9279e55f047fe652e3f4a + Sentry: 2c6053e4cfe6dea6608135dea1928ffbb4ecfba5 Sodium: 23d11554ecd556196d313cf6130d406dfe7ac6da Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5 SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 UIDeviceIdentifier: e6a801d25f4f178de5bdf475ffe29050d0148176 WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504 WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345 - WordPressAuthenticator: eae458ed9d8252ad972f6078e5b04faed0948bf5 - WordPressKit: a882aab63b1fb8cc4366c368910ded797a73ae5f + WordPressAuthenticator: 5110c62de1b1b1eb1f2a43fd2599f7f6c7a6659d + WordPressKit: 476ac76ac7ba610a694c55729cc4f0191bb820dc WordPressShared: e5a479220643f46dc4d7726ef8dd45f18bf0c53b WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac WPMediaPicker: 5a74a91e11c1047e942a65de0193f93432fc2c6d @@ -880,6 +880,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: cf16960c63b027f1dd7a6987c9bd742337122e66 +PODFILE CHECKSUM: 414e767e2d770a8f141d427b2d743a5bbe610fc1 COCOAPODS: 1.11.2 diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 99916bd8df19..9a1a819a2ff9 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,3 +1,7 @@ +21.1 +----- + + 21.0 ----- * [*] Fixed an issue where the cached notifications are retained after logging out of WordPress.com account [#19360] diff --git a/WordPress/Classes/ViewRelated/Stats/Insights/ViewsVisitors/ViewsVisitorsLineChartCell.swift b/WordPress/Classes/ViewRelated/Stats/Insights/ViewsVisitors/ViewsVisitorsLineChartCell.swift index 6cbbc037b815..0769cc600175 100644 --- a/WordPress/Classes/ViewRelated/Stats/Insights/ViewsVisitors/ViewsVisitorsLineChartCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Insights/ViewsVisitors/ViewsVisitorsLineChartCell.swift @@ -54,14 +54,38 @@ struct StatsSegmentedControlData { } var differenceLabel: String { - let stringFormatValue = differencePercent != 0 ? "%@%@ (%@%%)" : "%@%@" - let stringFormat = NSLocalizedString(stringFormatValue, comment: "Difference label for Insights Overview stat, indicating change from previous period. Ex: +99.9K(5%)") - return String.localizedStringWithFormat( - stringFormat, - difference < 0 ? "" : "+", - difference.abbreviatedString(), - differencePercent.abbreviatedString() - ) + // We want to show something like "+10.2K (+5%)" if we have a percentage difference and "1.2K" if we don't. + // + // Negative cases automatically appear with a negative sign "-10.2K (-5%)" by using `abbreviatedString()`. + // `abbreviatedString()` also handles formatting big numbers, i.e. 10,200 will become 10.2K. + let formatter = NumberFormatter() + formatter.locale = .current + let plusSign = difference <= 0 ? "" : "\(formatter.plusSign ?? "")" + + if differencePercent != 0 { + let stringFormat = NSLocalizedString( + "insights.visitorsLineChartCell.differenceLabelWithPercentage", + value: "%1$@%2$@ (%3$@%%)", + comment: "Text for the Insights Overview stat difference label. Shows the change from the previous period, including the percentage value. E.g.: +12.3K (5%). %1$@ is the placeholder for the change sign ('-', '+', or none). %2$@ is the placeholder for the change numerical value. %3$@ is the placeholder for the change percentage value, excluding the % sign." + ) + return String.localizedStringWithFormat( + stringFormat, + plusSign, + difference.abbreviatedString(), + differencePercent.abbreviatedString() + ) + } else { + let stringFormat = NSLocalizedString( + "insights.visitorsLineChartCell.differenceLabelWithoutPercentage", + value: "%1$@%2$@", + comment: "Text for the Insights Overview stat difference label. Shows the change from the previous period. E.g.: +12.3K. %1$@ is the placeholder for the change sign ('-', '+', or none). %2$@ is the placeholder for the change numerical value." + ) + return String.localizedStringWithFormat( + stringFormat, + plusSign, + difference.abbreviatedString() + ) + } } var differenceTextColor: UIColor { diff --git a/WordPress/Jetpack/Resources/release_notes.txt b/WordPress/Jetpack/Resources/release_notes.txt index ca8dbb1e2331..881237caeb9c 100644 --- a/WordPress/Jetpack/Resources/release_notes.txt +++ b/WordPress/Jetpack/Resources/release_notes.txt @@ -1,7 +1,12 @@ -You can now cancel a WordPress.com login while you’re already logged in to a self-hosted site—no more getting stuck on the login screen if you change your mind. - -The Jetpack app can run weekly roundups in the background while you’re using other apps. Up, up, and away. - -On iPad displays, the “Turn on notifications” button no longer sits overtop the instructions for turning on push notifications. The “No result” side menu text now fits on screen, too. - -Once upon a time, we fixed an issue where deleting one image in a Story Post draft would prevent the next image in the story from loading. And everyone lived happily ever after. +* [*] Fixed an issue where the cached notifications are retained after logging out of WordPress.com account [#19360] +* [**] Added a share extension. Now users can share content to Jetpack through iOS's share sheet. This was previously only available on the WordPress app. [#19383] +* [*] Update launch screen. [#19341] +* [*] Add ability to set custom app icon for Jetpack app. [#19378] +* [**] Added a "Save as Draft" extension. Now users can save content to Jetpack through iOS's share sheet. This was previously only available on the WordPress app. [#19414] +* [**] Enables Rich Notifications for the Jetpack app. Now we display more details on most of the push notifications. This was previously only available on the WordPress app. [#19415] +* [*] Reader: Comment Details have been redesigned. [#19387] +* [*] [internal] A refactor in weekly roundup notification scheduler. [#19422] +* [*] [internal] A low level database refactor around fetching cards in the Reader tab. [#19427] +* [*] Stories: Fixed an issue where the keyboard would overlap with the publish dialog in landscape. [#19350] +* [*] [internal] A refactor in fetch Reader posts and their comments. [#19458] +* [*] Fixed an issue where the navigation bar becomes invisible when swiping back to Login Prologue screen. [#19461] diff --git a/WordPress/Resources/en.lproj/Localizable.strings b/WordPress/Resources/en.lproj/Localizable.strings index 6444316a74b6..4fe4f3f5070f 100644 --- a/WordPress/Resources/en.lproj/Localizable.strings +++ b/WordPress/Resources/en.lproj/Localizable.strings @@ -130,8 +130,7 @@ /* Let's the user know that a third party sharing service was reconnected. The %@ is a placeholder for the service name. */ "%@ was reconnected." = "%@ was reconnected."; -/* Difference label for Insights Overview stat, indicating change from previous period. Ex: +99.9K(5%) - Difference label for Period Overview stat, indicating change from previous period. Ex: +99.9K (5%) */ +/* Difference label for Period Overview stat, indicating change from previous period. Ex: +99.9K (5%) */ "%@%@ (%@%%)" = "%1$@%2$@ (%3$@%%)"; /* Accessibility label for a post in the post list. The parameters are the title, and date respectively. For example, \"Let it Go, 1 hour ago.\" */ @@ -1798,9 +1797,6 @@ /* A label title. */ "Comments per page" = "Comments per page"; -/* Insights 'Comments Total' header */ -"Comments Total" = "Comments Total"; - /* Setting: WordPress.com Community */ "Community" = "Community"; @@ -3404,9 +3400,6 @@ Label for number of followers. */ "Followers" = "Followers"; -/* Insights 'Followers Total' header */ -"Followers Total" = "Followers Total"; - /* Accessibility label for following buttons. Title of the Following Reader tab User is following the blog. @@ -3991,6 +3984,12 @@ /* Title displayed on the feature introduction view that announces the updated Stats Insight screen. */ "Insights update" = "Insights update"; +/* Text for the Insights Overview stat difference label. Shows the change from the previous period. E.g.: +12.3K. %1$@ is the placeholder for the change sign ('-', '+', or none). %2$@ is the placeholder for the change numerical value. */ +"insights.visitorsLineChartCell.differenceLabelWithoutPercentage" = "%1$@%2$@"; + +/* Text for the Insights Overview stat difference label. Shows the change from the previous period, including the percentage value. E.g.: +12.3K (5%). %1$@ is the placeholder for the change sign ('-', '+', or none). %2$@ is the placeholder for the change numerical value. %3$@ is the placeholder for the change percentage value, excluding the % sign. */ +"insights.visitorsLineChartCell.differenceLabelWithPercentage" = "%1$@%2$@ (%3$@%%)"; + /* Button label to install a plugin Confirmation button displayd in alert displayed when user installs their first plugin. */ "Install" = "Install"; @@ -4172,7 +4171,8 @@ /* Message to show when Publicize connection synchronization failed */ "Jetpack Social connection synchronization failed" = "Jetpack Social connection synchronization failed"; -/* Section title for Publicize services in Sharing screen */ +/* Insights 'Jetpack Social Connections' header + Section title for Publicize services in Sharing screen */ "Jetpack Social Connections" = "Jetpack Social Connections"; /* Message to show when Publicize service synchronization failed */ @@ -4217,9 +4217,6 @@ /* Post a photo prompt for the jetpack prologue */ "jetpack.prologue.prompt.postPhoto" = "Post a photo"; -/* Read an article prompt for the jetpack prologue */ -"jetpack.prologue.prompt.readArticle" = "Read an article"; - /* Respond to comments prompt for the jetpack prologue */ "jetpack.prologue.prompt.respondComments" = "Respond to comments"; @@ -4229,8 +4226,8 @@ /* Search for plugins prompt for the jetpack prologue */ "jetpack.prologue.prompt.searchPlugins" = "Search for plugins"; -/* Search for posts or sites prompt for the jetpack prologue */ -"jetpack.prologue.prompt.searchPosts" = "Search for posts or sites"; +/* Update a plugin prompt for the jetpack prologue */ +"jetpack.prologue.prompt.updatePlugin" = "Update a plugin"; /* Watch your stats prompt for the jetpack prologue */ "jetpack.prologue.prompt.watchStats" = "Watch your stats"; @@ -4397,9 +4394,6 @@ /* VoiceOver accessibility hint, informing the user the button can be used to like a comment */ "Likes the Comment." = "Likes the Comment."; -/* Insights 'Likes Total' header */ -"Likes Total" = "Likes Total"; - /* Message to show when a request for a WP.com API endpoint is throttled */ "Limit reached. You can try again in 1 minute. Trying again before that will only increase the time you have to wait before the ban is lifted. If you think this is in error, contact support." = "Limit reached. You can try again in 1 minute. Trying again before that will only increase the time you have to wait before the ban is lifted. If you think this is in error, contact support."; @@ -4907,6 +4901,7 @@ /* Label for a button that moves a page to the trash folder Label for a option that moves a post to the trash folder + Title for button on the comment details page that moves the comment to trash when tapped. Trash option in the trash confirmation alert. Trash option in the trash page confirmation alert. Trashes the comment */ @@ -6175,9 +6170,6 @@ Text for privacy settings: Public */ "Public" = "Public"; -/* Insights 'Publicize' header */ -"Publicize" = "Publicize"; - /* Button shown when the author is asked for publishing confirmation. Button title. Publishes a post. Label for the publish (verb) button. Tapping publishes a draft post. @@ -7075,6 +7067,9 @@ Verb. Title of a button. Pressing lets the user share a post to others. */ "Share" = "Share"; +/* Accessibility label for button to share a comment from a notification */ +"Share comment" = "Share comment"; + /* Informational text for Collect Information setting */ "Share information with our analytics tool about your use of services while logged in to your WordPress.com account." = "Share information with our analytics tool about your use of services while logged in to your WordPress.com account."; @@ -7539,6 +7534,9 @@ /* The status of the post. Should be the same as in core WP. */ "Status" = "Status"; +/* Section title for the moderation section of the comment details screen. */ +"STATUS" = "STATUS"; + /* Title of the first alert preparing users to grant permission for us to send them push notifications. */ "Stay in the loop" = "Stay in the loop"; @@ -8401,13 +8399,18 @@ /* Label for total followers */ "Total" = "Total"; -/* 'This Year' label for total number of comments. */ +/* 'This Year' label for total number of comments. + Insights 'Total Comments' header */ "Total Comments" = "Total Comments"; /* Label displaying total number of Email followers. %@ is the total. */ "Total Email Followers: %@" = "Total Email Followers: %@"; -/* 'This Year' label for total number of likes. */ +/* Insights 'Total Followers' header */ +"Total Followers" = "Total Followers"; + +/* 'This Year' label for total number of likes. + Insights 'Total Likes' header */ "Total Likes" = "Total Likes"; /* 'This Year' label for the total number of posts. */ diff --git a/WordPress/Resources/release_notes.txt b/WordPress/Resources/release_notes.txt index 0fa50087e2eb..b0fd054d66a0 100644 --- a/WordPress/Resources/release_notes.txt +++ b/WordPress/Resources/release_notes.txt @@ -1,7 +1,8 @@ -You can now cancel a WordPress.com login while you’re already logged in to a self-hosted site—no more getting stuck on the login screen if you change your mind. - -We also squashed several bugs in this latest update. - -- Once upon a time, we fixed an issue where deleting one image in a Story Post draft would prevent the next image in the story from loading. And everyone lived happily ever after. -- On iPad displays, the “Turn on notifications” button no longer sits overtop the instructions for turning on push notifications. The “No result” side menu text now fits on screen, too. -- Content above the Powered by Jetpack banner now stays visible and responsive while you’re scrolling. Up, up, and away. +* [*] Fixed an issue where the cached notifications are retained after logging out of WordPress.com account [#19360] +* [*] Update launch screen. [#19341] +* [*] Reader: Comment Details have been redesigned. [#19387] +* [*] [internal] A refactor in weekly roundup notification scheduler. [#19422] +* [*] [internal] A low level database refactor around fetching cards in the Reader tab. [#19427] +* [*] Stories: Fixed an issue where the keyboard would overlap with the publish dialog in landscape. [#19350] +* [*] [internal] A refactor in fetch Reader posts and their comments. [#19458] +* [*] Fixed an issue where the navigation bar becomes invisible when swiping back to Login Prologue screen. [#19461] diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index ee70af56433c..bd60643f13aa 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -748,6 +748,7 @@ 3FEC241525D73E8B007AFE63 /* ConfettiView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FEC241425D73E8B007AFE63 /* ConfettiView.swift */; }; 3FF1A853242D5FCB00373F5D /* WPTabBarController+ReaderTabNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FF1A852242D5FCB00373F5D /* WPTabBarController+ReaderTabNavigation.swift */; }; 3FFA5ED22876152E00830E28 /* JetpackButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFA5ED12876152E00830E28 /* JetpackButton.swift */; }; + 3FFE3C0828FE00D10021BB96 /* StatsSegmentedControlDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFE3C0728FE00D10021BB96 /* StatsSegmentedControlDataTests.swift */; }; 400199AB222590E100EB0906 /* AllTimeStatsRecordValueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 400199AA222590E100EB0906 /* AllTimeStatsRecordValueTests.swift */; }; 400199AD22259FF300EB0906 /* AnnualAndMostPopularTimeStatsRecordValueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 400199AC22259FF300EB0906 /* AnnualAndMostPopularTimeStatsRecordValueTests.swift */; }; 400A2C772217A8A0000A8A59 /* VisitsSummaryStatsRecordValue+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 400A2C752217A8A0000A8A59 /* VisitsSummaryStatsRecordValue+CoreDataClass.swift */; }; @@ -6091,6 +6092,7 @@ 3FEC241425D73E8B007AFE63 /* ConfettiView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfettiView.swift; sourceTree = ""; }; 3FF1A852242D5FCB00373F5D /* WPTabBarController+ReaderTabNavigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WPTabBarController+ReaderTabNavigation.swift"; sourceTree = ""; }; 3FFA5ED12876152E00830E28 /* JetpackButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackButton.swift; sourceTree = ""; }; + 3FFE3C0728FE00D10021BB96 /* StatsSegmentedControlDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsSegmentedControlDataTests.swift; sourceTree = ""; }; 400199AA222590E100EB0906 /* AllTimeStatsRecordValueTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllTimeStatsRecordValueTests.swift; sourceTree = ""; }; 400199AC22259FF300EB0906 /* AnnualAndMostPopularTimeStatsRecordValueTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnualAndMostPopularTimeStatsRecordValueTests.swift; sourceTree = ""; }; 400A2C752217A8A0000A8A59 /* VisitsSummaryStatsRecordValue+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VisitsSummaryStatsRecordValue+CoreDataClass.swift"; sourceTree = ""; }; @@ -8489,7 +8491,6 @@ F465980528E66A5A00D5F49A /* white-on-blue-icon-app-60@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "white-on-blue-icon-app-60@3x.png"; sourceTree = ""; }; F465980628E66A5A00D5F49A /* white-on-blue-icon-app-60@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "white-on-blue-icon-app-60@2x.png"; sourceTree = ""; }; F465980728E66A5B00D5F49A /* white-on-blue-icon-app-83.5@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "white-on-blue-icon-app-83.5@2x.png"; sourceTree = ""; }; - F47DB4A8EC2E6844E213A3FA /* Pods_WordPressShareExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WordPressShareExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F4BECD1A288EE5220078391A /* SuggestionsViewModelType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SuggestionsViewModelType.swift; sourceTree = ""; }; F4D9AF4E288AD2E300803D40 /* SuggestionViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionViewModelTests.swift; sourceTree = ""; }; F4D9AF50288AE23500803D40 /* SuggestionTableViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionTableViewTests.swift; sourceTree = ""; }; @@ -10958,9 +10959,12 @@ 40F50B7F221310D400CBBB73 /* FollowersStatsRecordValueTests.swift */, 40E7FEC72211EEC00032834E /* LastPostStatsRecordValueTests.swift */, 40EE948122132F5800CD264F /* PublicizeConectionStatsRecordValueTests.swift */, + 938466B82683CA0E00A538DC /* ReferrerDetailsViewModelTests.swift */, 400A2C922217B463000A8A59 /* ReferrerStatsRecordValueTests.swift */, 40C403ED2215CE9500E8C894 /* SearchResultsStatsRecordValueTests.swift */, + 3FDDFE9527C8178C00606933 /* SiteStatsInformationTests.swift */, 40E7FEC42211DF790032834E /* StatsRecordTests.swift */, + 3FFE3C0728FE00D10021BB96 /* StatsSegmentedControlDataTests.swift */, 40F50B81221310F000CBBB73 /* StatsTestCase.swift */, 931215E0267DE1C0008C3B69 /* StatsTotalRowDataTests.swift */, 4054F4632214F94D00D261AB /* StreakStatsRecordValueTests.swift */, @@ -10970,8 +10974,6 @@ 40C403F72215D88100E8C894 /* TopViewedStatsTests.swift */, 400A2C942217B68D000A8A59 /* TopViewedVideoStatsRecordValueTests.swift */, 400A2C962217B883000A8A59 /* VisitsSummaryStatsRecordValueTests.swift */, - 938466B82683CA0E00A538DC /* ReferrerDetailsViewModelTests.swift */, - 3FDDFE9527C8178C00606933 /* SiteStatsInformationTests.swift */, ); name = Stats; sourceTree = ""; @@ -12507,7 +12509,6 @@ 8584FDB4192437160019C02E /* Utility */ = { isa = PBXGroup; children = ( - 175721152754D31F00DE38BC /* AppIcon.swift */, 8B85AED8259230C500ADBEC9 /* AB Testing */, FA25FB242609B98E0005E08F /* App Configuration */, F181EDE326B2AC3100C61241 /* BackgroundTasks */, @@ -18418,7 +18419,6 @@ 17039226282E6D2F00F602E9 /* ViewsVisitorsLineChartCell.xib in Resources */, FABB28472603067C00C8785C /* Launch Screen.storyboard in Resources */, F465978F28E65F8A00D5F49A /* celadon-on-white-icon-app-60@2x.png in Resources */, - FEC3B81A26C2915A00A395C7 /* SingleButtonTableViewCell.xib in Resources */, FABB203F2602FC2C00C8785C /* ReaderRecommendedSiteCardCell.xib in Resources */, FE23EB4A26E7C91F005A1698 /* richCommentTemplate.html in Resources */, FABB20402602FC2C00C8785C /* Nunito-Bold.ttf in Resources */, @@ -22207,6 +22207,7 @@ C738CB0F28626466001BE107 /* QRLoginScanningCoordinatorTests.swift in Sources */, 8B6214E627B1B446001DF7B6 /* BlogDashboardServiceTests.swift in Sources */, C856749A243F4292001A995E /* TenorMockDataHelper.swift in Sources */, + 3FFE3C0828FE00D10021BB96 /* StatsSegmentedControlDataTests.swift in Sources */, D81C2F5820F86CEA002AE1F1 /* NetworkStatus.swift in Sources */, E1C545801C6C79BB001CEB0E /* MediaSettingsTests.swift in Sources */, C3439B5F27FE3A3C0058DA55 /* SiteCreationWizardLauncherTests.swift in Sources */, diff --git a/WordPress/WordPressTest/StatsSegmentedControlDataTests.swift b/WordPress/WordPressTest/StatsSegmentedControlDataTests.swift new file mode 100644 index 000000000000..f0914ec1f0e5 --- /dev/null +++ b/WordPress/WordPressTest/StatsSegmentedControlDataTests.swift @@ -0,0 +1,48 @@ +import Nimble +import XCTest +@testable import WordPress + +class StatsSegmentedControlDataTests: XCTestCase { + + func testDifferenceLabel() { + expect(StatsSegmentedControlData.fixture(difference: -12_345, differencePercent: -1).differenceLabel) + == "-12.3K (-1%)" + expect(StatsSegmentedControlData.fixture(difference: -12_345, differencePercent: 0).differenceLabel) + == "-12.3K" + expect(StatsSegmentedControlData.fixture(difference: -12_345, differencePercent: 1).differenceLabel) + == "-12.3K (1%)" + expect(StatsSegmentedControlData.fixture(difference: 0, differencePercent: -1).differenceLabel) + == "0 (-1%)" + expect(StatsSegmentedControlData.fixture(difference: 0, differencePercent: 0).differenceLabel) + == "0" + expect(StatsSegmentedControlData.fixture(difference: 0, differencePercent: 1).differenceLabel) + == "0 (1%)" + expect(StatsSegmentedControlData.fixture(difference: 12_345, differencePercent: -1).differenceLabel) + == "+12.3K (-1%)" + expect(StatsSegmentedControlData.fixture(difference: 12_345, differencePercent: 0).differenceLabel) + == "+12.3K" + expect(StatsSegmentedControlData.fixture(difference: 12_345, differencePercent: 1).differenceLabel) + == "+12.3K (1%)" + } +} + +extension StatsSegmentedControlData { + + static func fixture( + segmentTitle: String = "title", + segmentData: Int = 0, + segmentPrevData: Int = 1, + difference: Int = 2, + differenceText: String = "text", + differencePercent: Int = 3 + ) -> StatsSegmentedControlData { + StatsSegmentedControlData( + segmentTitle: segmentTitle, + segmentData: segmentData, + segmentPrevData: segmentPrevData, + difference: difference, + differenceText: differenceText, + differencePercent: differencePercent + ) + } +} diff --git a/config/Version.internal.xcconfig b/config/Version.internal.xcconfig index 8af91ef31928..ab24b0327380 100644 --- a/config/Version.internal.xcconfig +++ b/config/Version.internal.xcconfig @@ -1,4 +1,4 @@ -VERSION_SHORT=20.9 +VERSION_SHORT=21.0 // Internal long version example: VERSION_LONG=9.9.0.20180423 -VERSION_LONG=20.9.0.20221014 +VERSION_LONG=21.0.0.20221017 diff --git a/config/Version.public.xcconfig b/config/Version.public.xcconfig index 9c6135db0ba0..219e10b6aa93 100644 --- a/config/Version.public.xcconfig +++ b/config/Version.public.xcconfig @@ -1,4 +1,4 @@ -VERSION_SHORT=20.9 +VERSION_SHORT=21.0 // Public long version example: VERSION_LONG=9.9.0.0 -VERSION_LONG=20.9.0.2 +VERSION_LONG=21.0.0.0