Skip to content

Commit

Permalink
Merge branch 'develop' into issue/11035-replace-annoying-alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
shiki committed Mar 8, 2019
2 parents 11c929e + f1b3d95 commit b61284c
Show file tree
Hide file tree
Showing 56 changed files with 1,307 additions and 423 deletions.
18 changes: 7 additions & 11 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ daysUntilStale: 365 # 1 year

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: -1 # Close the issue almost immediately. See: https://github.com/probot/stale/issues/131
daysUntilClose: false

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
Expand All @@ -24,18 +24,14 @@ staleLabel: "[Status] Stale"

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
<p>This issue has been marked as stale and will be automatically closed.
This happened because:</p>
This issue has been marked as stale because:
<ul>
<li>It has been inactive for the past year.</li>
<li>It isn't in a project or a milestone.</li>
<li>It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`, or `good first issue`.</li>
</ul>
* It has been inactive for the past year.
* It isn't in a project or a milestone.
* It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`, or `good first issue`.
<p>However, discussion is still welcome! If the issue is still valid,
please leave a comment with a brief explanation so the issue can
be reopened.</p>
Please comment with an update if you believe this issue is still valid or if it can be closed.
This issue will also be reviewed for validity and priority (cc @designsimply).
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 2
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/wordpress-mobile/release-toolkit
revision: 1cfb99dcb2d7284165a6ee4fa149f1c9374db312
tag: 0.1.8
revision: a7f414b31dc383075d3489b3d9d4ec039529ef67
tag: 0.1.9
specs:
fastlane-plugin-wpmreleasetoolkit (0.1.8)
fastlane-plugin-wpmreleasetoolkit (0.1.9)
diffy
git
nokogiri
Expand Down
6 changes: 3 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def wordpress_ui
end

def wordpress_kit
pod 'WordPressKit', '~> 3.0.0-beta.1'
#pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => '0e2a035'
pod 'WordPressKit', '~> 3.0.0-beta.2'
#pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => 'issue/fix_tag_sync'
#pod 'WordPressKit', :path => '~/Developer/a8c/WordPressKit-iOS'
end

Expand Down Expand Up @@ -100,7 +100,7 @@ target 'WordPress' do
## React Native
## =====================
##
gutenberg :git => 'http://github.com/wordpress-mobile/gutenberg-mobile/', :tag => 'v1.0.1'
gutenberg :git => 'http://github.com/wordpress-mobile/gutenberg-mobile/', :commit => 'a7af71c0398d0a3901583ba26a91ecbed56bf2d2'

gutenberg_pod 'React'
gutenberg_pod 'yoga'
Expand Down
20 changes: 10 additions & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ PODS:
- WordPressKit (~> 3.0.0-beta.1)
- WordPressShared (~> 1.4)
- WordPressUI (~> 1.0)
- WordPressKit (3.0.0-beta.1):
- WordPressKit (3.0.0-beta.2):
- Alamofire (~> 4.7.3)
- CocoaLumberjack (= 3.4.2)
- NSObject-SafeExpectations (= 0.0.3)
Expand Down Expand Up @@ -228,7 +228,7 @@ DEPENDENCIES:
- Gifu (= 3.2.0)
- GiphyCoreSDK (~> 1.4.0)
- Gridicons (~> 0.16)
- Gutenberg (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, tag `v1.0.1`)
- Gutenberg (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, commit `a7af71c0398d0a3901583ba26a91ecbed56bf2d2`)
- HockeySDK (= 5.1.4)
- MGSwipeTableCell (= 1.6.8)
- MRProgress (= 0.8.3)
Expand All @@ -243,13 +243,13 @@ DEPENDENCIES:
- react-native-keyboard-aware-scroll-view (from `https://github.com/wordpress-mobile/react-native-keyboard-aware-scroll-view.git`, tag `gb-v0.8.6`)
- react-native-safe-area (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/master/react-native-gutenberg-bridge/third-party-podspecs/react-native-safe-area.podspec.json`)
- RNSVG (from `https://github.com/wordpress-mobile/react-native-svg.git`, tag `8.0.9-gb.0`)
- RNTAztecView (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, tag `v1.0.1`)
- RNTAztecView (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, commit `a7af71c0398d0a3901583ba26a91ecbed56bf2d2`)
- SimulatorStatusMagic
- Starscream (= 3.0.6)
- SVProgressHUD (= 2.2.5)
- WordPress-Editor-iOS (= 1.4.3)
- WordPressAuthenticator (~> 1.1.10-beta.1)
- WordPressKit (~> 3.0.0-beta.1)
- WordPressKit (~> 3.0.0-beta.2)
- WordPressShared (= 1.7.2-beta.1)
- WordPressUI (from `https://github.com/wordpress-mobile/WordPressUI-iOS.git`, tag `1.2.0`)
- WPMediaPicker (= 1.3.2)
Expand Down Expand Up @@ -304,8 +304,8 @@ EXTERNAL SOURCES:
Folly:
:podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/master/react-native-gutenberg-bridge/third-party-podspecs/Folly.podspec.json
Gutenberg:
:commit: a7af71c0398d0a3901583ba26a91ecbed56bf2d2
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
:tag: v1.0.1
React:
:podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/master/react-native-gutenberg-bridge/third-party-podspecs/React.podspec.json
react-native-keyboard-aware-scroll-view:
Expand All @@ -317,8 +317,8 @@ EXTERNAL SOURCES:
:git: https://github.com/wordpress-mobile/react-native-svg.git
:tag: 8.0.9-gb.0
RNTAztecView:
:commit: a7af71c0398d0a3901583ba26a91ecbed56bf2d2
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
:tag: v1.0.1
WordPressUI:
:git: https://github.com/wordpress-mobile/WordPressUI-iOS.git
:tag: 1.2.0
Expand All @@ -330,17 +330,17 @@ CHECKOUT OPTIONS:
:git: https://github.com/Automattic/Automattic-Tracks-iOS.git
:tag: 0.3.2
Gutenberg:
:commit: a7af71c0398d0a3901583ba26a91ecbed56bf2d2
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
:tag: v1.0.1
react-native-keyboard-aware-scroll-view:
:git: https://github.com/wordpress-mobile/react-native-keyboard-aware-scroll-view.git
:tag: gb-v0.8.6
RNSVG:
:git: https://github.com/wordpress-mobile/react-native-svg.git
:tag: 8.0.9-gb.0
RNTAztecView:
:commit: a7af71c0398d0a3901583ba26a91ecbed56bf2d2
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
:tag: v1.0.1
WordPressUI:
:git: https://github.com/wordpress-mobile/WordPressUI-iOS.git
:tag: 1.2.0
Expand Down Expand Up @@ -387,14 +387,14 @@ SPEC CHECKSUMS:
WordPress-Aztec-iOS: 0062ba96c3ea77186590c74b761427c461f89a06
WordPress-Editor-iOS: cfaa780c3ee64ea781fe6f52ca1561667a3f3707
WordPressAuthenticator: 80cda36379dfee8772ad1b2e9c7f4541ccba0500
WordPressKit: 843906cb26fb8a92dddefd9a324a821555bf2b94
WordPressKit: 819f7573ab38312138f78a0394cd2576404a7f98
WordPressShared: 02a2f4d490c44536b55fe59eeb2e72e95bd56697
WordPressUI: 44fe43a9c5c504dfd534286e39e1ce6ebcd69ff5
WPMediaPicker: e50edd8f30f5d87288840941ef3ff9cd11860937
wpxmlrpc: 6ba55c773cfa27083ae4a2173e69b19f46da98e2
yoga: f37b1edbd68be803f1dc4d57d40d8a5b277d8e2c
ZendeskSDK: 44ee00338dd718495f0364369420ae11b389c878

PODFILE CHECKSUM: 0f6a92fb3263053f913023dc505e34d25fc12e6c
PODFILE CHECKSUM: bf5ac6f453746919c96d6fef5cf917a405354b07

COCOAPODS: 1.5.3
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-----
* Redesigned Notices
* Changed offline error messages to be less disruptive.
* Resolved a defect in the new Site Creation flow where the site preview address bar could be edited.

11.9
------
Expand Down
1 change: 1 addition & 0 deletions Scripts/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import "./ScreenshotFastfile"
ios_bump_version_release()
new_version = ios_get_app_version()
ios_update_release_notes(new_version: new_version)
setbranchprotection(repository:GHHELPER_REPO, branch: "release/#{new_version}")
setfrozentag(repository:GHHELPER_REPO, milestone: new_version)

ios_localize_project()
Expand Down
2 changes: 1 addition & 1 deletion Scripts/fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-wpmreleasetoolkit', git: 'https://github.com/wordpress-mobile/release-toolkit', tag: '0.1.8'
gem 'fastlane-plugin-wpmreleasetoolkit', git: 'https://github.com/wordpress-mobile/release-toolkit', tag: '0.1.9'
2 changes: 1 addition & 1 deletion WordPress/Classes/Extensions/UIImageView+SiteIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extension UIImageView {
}

let request: URLRequest
if blog.isPrivate() {
if blog.isPrivate(), PrivateSiteURLProtocol.urlGoes(toWPComSite: siteIconURL) {
request = PrivateSiteURLProtocol.requestForPrivateSite(from: siteIconURL)
} else {
request = URLRequest(url: siteIconURL)
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Extensions/URL+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ extension URL {
return false
}

return host.contains("wordpress.com")
return host.hasSuffix(".wordpress.com")
}

var isWordPressDotComPost: Bool {
Expand Down
6 changes: 4 additions & 2 deletions WordPress/Classes/Services/PostService.m
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,10 @@ - (RemotePost *)remotePostWithPost:(AbstractPost *)post
}
if ([post isKindOfClass:[Post class]]) {
Post *postPost = (Post *)post;
remotePost.format = postPost.postFormat;
remotePost.tags = [postPost.tags componentsSeparatedByString:@","];
remotePost.format = postPost.postFormat;
remotePost.tags = [[postPost.tags componentsSeparatedByString:@","] wp_map:^id(NSString *obj) {
return [obj stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];
}];
remotePost.categories = [self remoteCategoriesForPost:postPost];
remotePost.metadata = [self remoteMetadataForPost:postPost];

Expand Down
75 changes: 75 additions & 0 deletions WordPress/Classes/Stores/StatsInsightsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ enum InsightAction: Action {
case receivedAllDotComFollowers(_ allDotComFollowers: StatsGroup?)
case receivedAllEmailFollowers(_ allDotComFollowers: StatsGroup?)
case refreshFollowers()

case receivedAllAuthorsComments()
case receivedAllPostsComments()
case refreshComments()
}

enum InsightQuery {
case insights
case allFollowers
case allComments
}

struct InsightStoreState {
Expand Down Expand Up @@ -70,6 +75,13 @@ struct InsightStoreState {

var allEmailFollowers: [StatsItem]?
var fetchingAllEmailFollowers = false

var allAuthorsComments: StatsCommentsInsight?
var fetchingAllAuthorsComments = false


var allPostsComments: StatsCommentsInsight?
var fetchingAllPostsComments = false
}

class StatsInsightsStore: QueryStore<InsightStoreState, InsightQuery> {
Expand Down Expand Up @@ -113,6 +125,12 @@ class StatsInsightsStore: QueryStore<InsightStoreState, InsightQuery> {
receivedAllEmailFollowers(allEmailFollowers)
case .refreshFollowers:
refreshFollowers()
case .receivedAllAuthorsComments:
receivedAllAuthorsComments()
case .receivedAllPostsComments:
receivedAllPostsComments()
case .refreshComments:
refreshComments()
}
}

Expand Down Expand Up @@ -143,6 +161,10 @@ private extension StatsInsightsStore {
if shouldFetchFollowers() {
fetchAllFollowers()
}
case .allComments:
if shouldFetchComments() {
fetchAllComments()
}
}
}
}
Expand Down Expand Up @@ -356,6 +378,15 @@ private extension StatsInsightsStore {
})
}

func fetchAllComments() {
state.fetchingAllAuthorsComments = true
state.fetchingAllPostsComments = true

// TODO: replace with api call when fetch all author and post comments is supported.
actionDispatcher.dispatch(InsightAction.receivedAllAuthorsComments())
actionDispatcher.dispatch(InsightAction.receivedAllPostsComments())
}

func receivedAllDotComFollowers(_ allDotComFollowers: StatsGroup?) {
transaction { state in
state.allDotComFollowers = allDotComFollowers?.items as? [StatsItem]
Expand All @@ -382,6 +413,36 @@ private extension StatsInsightsStore {
func shouldFetchFollowers() -> Bool {
return !isFetchingFollowers
}

func receivedAllAuthorsComments() {
transaction { state in
// TODO: replace with real allAuthorsComments when API supports it.
state.allAuthorsComments = state.topCommentsInsight
state.fetchingAllAuthorsComments = false
}
}

func receivedAllPostsComments() {
transaction { state in
// TODO: replace with real allPostsComments when API supports it.
state.allPostsComments = state.topCommentsInsight
state.fetchingAllPostsComments = false
}
}

func refreshComments() {
guard shouldFetchComments() else {
DDLogInfo("Stats Insights Comments refresh triggered while one was in progress.")
return
}

fetchAllComments()
}

func shouldFetchComments() -> Bool {
return !isFetchingComments
}

}

// MARK: - Public Accessors
Expand Down Expand Up @@ -491,6 +552,14 @@ extension StatsInsightsStore {
return state.allEmailFollowers
}

func getAllAuthorsComments() -> StatsCommentsInsight? {
return state.allAuthorsComments
}

func getAllPostsComments() -> StatsCommentsInsight? {
return state.allPostsComments
}

var isFetchingOverview: Bool {
return
state.fetchingLastPostInsight ||
Expand All @@ -511,4 +580,10 @@ extension StatsInsightsStore {
state.fetchingAllEmailFollowers
}

var isFetchingComments: Bool {
return
state.fetchingAllAuthorsComments ||
state.fetchingAllPostsComments
}

}
Loading

0 comments on commit b61284c

Please sign in to comment.