Skip to content

Commit bb49d02

Browse files
committed
Merge branch 'trunk' into task/WOOMOB-1640-post-app-listings-meta
2 parents ea8867b + ac8c5c6 commit bb49d02

File tree

17 files changed

+199
-168
lines changed

17 files changed

+199
-168
lines changed

Gemfile.lock

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ GEM
55
base64
66
nkf
77
rexml
8-
activesupport (8.0.3)
8+
activesupport (8.1.1)
99
base64
10-
benchmark (>= 0.3)
1110
bigdecimal
1211
concurrent-ruby (~> 1.0, >= 1.3.1)
1312
connection_pool (>= 2.2.5)
1413
drb
1514
i18n (>= 1.6, < 2)
15+
json
1616
logger (>= 1.4.2)
1717
minitest (>= 5.1)
1818
securerandom (>= 0.3)
@@ -21,31 +21,30 @@ GEM
2121
addressable (2.8.7)
2222
public_suffix (>= 2.0.2, < 7.0)
2323
artifactory (3.0.17)
24-
ast (2.4.2)
24+
ast (2.4.3)
2525
atomos (0.1.3)
2626
aws-eventstream (1.4.0)
27-
aws-partitions (1.1169.0)
28-
aws-sdk-core (3.233.0)
27+
aws-partitions (1.1181.0)
28+
aws-sdk-core (3.237.0)
2929
aws-eventstream (~> 1, >= 1.3.0)
3030
aws-partitions (~> 1, >= 1.992.0)
3131
aws-sigv4 (~> 1.9)
3232
base64
3333
bigdecimal
3434
jmespath (~> 1, >= 1.6.1)
3535
logger
36-
aws-sdk-kms (1.113.0)
37-
aws-sdk-core (~> 3, >= 3.231.0)
36+
aws-sdk-kms (1.117.0)
37+
aws-sdk-core (~> 3, >= 3.234.0)
3838
aws-sigv4 (~> 1.5)
39-
aws-sdk-s3 (1.199.1)
40-
aws-sdk-core (~> 3, >= 3.231.0)
39+
aws-sdk-s3 (1.203.1)
40+
aws-sdk-core (~> 3, >= 3.234.0)
4141
aws-sdk-kms (~> 1)
4242
aws-sigv4 (~> 1.5)
4343
aws-sigv4 (1.12.1)
4444
aws-eventstream (~> 1, >= 1.0.2)
4545
babosa (1.0.4)
4646
base64 (0.3.0)
47-
benchmark (0.4.1)
48-
bigdecimal (3.3.0)
47+
bigdecimal (3.3.1)
4948
buildkit (1.6.1)
5049
sawyer (>= 0.6)
5150
chroma (0.2.0)
@@ -62,21 +61,21 @@ GEM
6261
connection_pool (2.5.4)
6362
cork (0.3.0)
6463
colored2 (~> 3.1)
65-
danger (9.5.1)
64+
danger (9.5.3)
6665
base64 (~> 0.2)
6766
claide (~> 1.0)
6867
claide-plugins (>= 0.9.2)
69-
colored2 (~> 3.1)
68+
colored2 (>= 3.1, < 5)
7069
cork (~> 0.1)
7170
faraday (>= 0.9.0, < 3.0)
7271
faraday-http-cache (~> 2.0)
73-
git (~> 1.13)
74-
kramdown (~> 2.3)
72+
git (>= 1.13, < 3.0)
73+
kramdown (>= 2.5.1, < 3.0)
7574
kramdown-parser-gfm (~> 1.0)
7675
octokit (>= 4.0)
7776
pstore (~> 0.1)
78-
terminal-table (>= 1, < 4)
79-
danger-dangermattic (1.2.1)
77+
terminal-table (>= 1, < 5)
78+
danger-dangermattic (1.2.4)
8079
danger (~> 9.4)
8180
danger-plugin-api (~> 1.0)
8281
danger-rubocop (~> 0.13)
@@ -168,12 +167,12 @@ GEM
168167
xcodeproj (>= 1.13.0, < 2.0.0)
169168
xcpretty (~> 0.4.1)
170169
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
171-
fastlane-plugin-firebase_app_distribution (0.10.0)
170+
fastlane-plugin-firebase_app_distribution (0.10.1)
172171
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
173172
google-apis-firebaseappdistribution_v1alpha (~> 0.2.0)
174-
fastlane-plugin-sentry (1.25.1)
173+
fastlane-plugin-sentry (1.35.0)
175174
os (~> 1.1, >= 1.1.4)
176-
fastlane-plugin-wpmreleasetoolkit (13.5.1)
175+
fastlane-plugin-wpmreleasetoolkit (13.7.0)
177176
activesupport (>= 6.1.7.1)
178177
buildkit (~> 1.5)
179178
chroma (= 0.2.0)
@@ -245,19 +244,20 @@ GEM
245244
concurrent-ruby (~> 1.0)
246245
java-properties (0.3.0)
247246
jmespath (1.6.2)
248-
json (2.15.1)
247+
json (2.16.0)
249248
jwt (2.10.2)
250249
base64
251250
kramdown (2.5.1)
252251
rexml (>= 3.3.9)
253252
kramdown-parser-gfm (1.1.0)
254253
kramdown (~> 2.0)
255-
language_server-protocol (3.17.0.3)
254+
language_server-protocol (3.17.0.5)
255+
lint_roller (1.1.0)
256256
logger (1.7.0)
257257
mini_magick (4.13.2)
258258
mini_mime (1.1.5)
259259
mini_portile2 (2.8.9)
260-
minitest (5.26.0)
260+
minitest (5.26.1)
261261
multi_json (1.17.0)
262262
multipart-post (2.4.1)
263263
mutex_m (0.3.0)
@@ -273,25 +273,26 @@ GEM
273273
sawyer (~> 0.9)
274274
open4 (1.3.4)
275275
options (2.3.2)
276-
optparse (0.6.0)
276+
optparse (0.8.0)
277277
os (1.1.4)
278278
parallel (1.27.0)
279-
parser (3.3.6.0)
279+
parser (3.3.10.0)
280280
ast (~> 2.4.1)
281281
racc
282282
plist (3.7.2)
283+
prism (1.6.0)
283284
progress_bar (1.3.4)
284285
highline (>= 1.6)
285286
options (~> 2.3.0)
286-
pstore (0.1.3)
287+
pstore (0.2.0)
287288
public_suffix (6.0.2)
288289
racc (1.8.1)
289290
rainbow (3.1.1)
290291
rake (12.3.3)
291292
rake-compiler (1.3.0)
292293
rake
293294
rchardet (1.10.0)
294-
regexp_parser (2.9.2)
295+
regexp_parser (2.11.3)
295296
representable (3.2.0)
296297
declarative (< 0.1.0)
297298
trailblazer-option (>= 0.1.1, < 0.2.0)
@@ -300,24 +301,27 @@ GEM
300301
rexml (3.4.4)
301302
rmagick (4.3.0)
302303
rouge (3.28.0)
303-
rubocop (1.68.0)
304+
rubocop (1.81.7)
304305
json (~> 2.3)
305-
language_server-protocol (>= 3.17.0)
306+
language_server-protocol (~> 3.17.0.2)
307+
lint_roller (~> 1.1.0)
306308
parallel (~> 1.10)
307309
parser (>= 3.3.0.2)
308310
rainbow (>= 2.2.2, < 4.0)
309-
regexp_parser (>= 2.4, < 3.0)
310-
rubocop-ast (>= 1.32.2, < 2.0)
311+
regexp_parser (>= 2.9.3, < 3.0)
312+
rubocop-ast (>= 1.47.1, < 2.0)
311313
ruby-progressbar (~> 1.7)
312-
unicode-display_width (>= 2.4.0, < 3.0)
313-
rubocop-ast (1.36.1)
314-
parser (>= 3.3.1.0)
315-
rubocop-rake (0.6.0)
316-
rubocop (~> 1.0)
314+
unicode-display_width (>= 2.4.0, < 4.0)
315+
rubocop-ast (1.48.0)
316+
parser (>= 3.3.7.2)
317+
prism (~> 1.4)
318+
rubocop-rake (0.7.1)
319+
lint_roller (~> 1.1)
320+
rubocop (>= 1.72.1)
317321
ruby-progressbar (1.13.0)
318322
ruby2_keywords (0.0.5)
319323
rubyzip (2.4.1)
320-
sawyer (0.9.2)
324+
sawyer (0.9.3)
321325
addressable (>= 2.3.5)
322326
faraday (>= 0.17.3, < 3)
323327
securerandom (0.4.1)
@@ -343,7 +347,7 @@ GEM
343347
concurrent-ruby (~> 1.0)
344348
uber (0.1.0)
345349
unicode-display_width (2.6.0)
346-
uri (1.0.4)
350+
uri (1.1.1)
347351
word_wrap (1.0.0)
348352
xcode-install (2.8.1)
349353
claide (>= 0.9.1)

Modules/Sources/Networking/Model/Bookings/Booking.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,12 @@ public enum BookingAttendanceStatus: String, CaseIterable, Codable {
239239
case noShow = "no-show"
240240
case unknown
241241
}
242+
243+
/// Represents the payment status for a booking.
244+
/// To be decoded from booking response once available.
245+
public enum BookingPaymentStatus: String, CaseIterable, Codable {
246+
case paid
247+
case unpaid
248+
case refunded
249+
case unknown
250+
}

Modules/Sources/Networking/Remote/BookingsRemote.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@ public struct BookingFilters {
3838
public let resourceIDs: [Int64]
3939
public let startDateBefore: String?
4040
public let startDateAfter: String?
41-
public let bookingStatuses: [String]
4241
public let attendanceStatuses: [String]
42+
public let paymentStatuses: [String]
4343

4444
public init(
4545
productIDs: [Int64] = [],
4646
customerIDs: [Int64] = [],
4747
resourceIDs: [Int64] = [],
4848
startDateBefore: String? = nil,
4949
startDateAfter: String? = nil,
50-
bookingStatuses: [String] = [],
51-
attendanceStatuses: [String] = []
50+
attendanceStatuses: [String] = [],
51+
paymentStatuses: [String] = []
5252
) {
5353
self.productIDs = productIDs
5454
self.customerIDs = customerIDs
5555
self.resourceIDs = resourceIDs
5656
self.startDateBefore = startDateBefore
5757
self.startDateAfter = startDateAfter
58-
self.bookingStatuses = bookingStatuses
5958
self.attendanceStatuses = attendanceStatuses
59+
self.paymentStatuses = paymentStatuses
6060
}
6161
}
6262

@@ -110,13 +110,13 @@ public final class BookingsRemote: Remote, BookingsRemoteProtocol {
110110
parameters[ParameterKey.startDateAfter] = startDateAfter
111111
}
112112

113-
if filters.bookingStatuses.isNotEmpty {
114-
parameters[ParameterKey.bookingStatus] = filters.bookingStatuses
115-
}
116-
117113
if filters.attendanceStatuses.isNotEmpty {
118114
parameters[ParameterKey.attendanceStatus] = filters.attendanceStatuses
119115
}
116+
117+
if filters.paymentStatuses.isNotEmpty {
118+
parameters[ParameterKey.paymentStatus] = filters.paymentStatuses
119+
}
120120
}
121121

122122
if let searchQuery = searchQuery, !searchQuery.isEmpty {
@@ -256,8 +256,8 @@ public extension BookingsRemote {
256256
static let product: String = "product"
257257
static let customer: String = "customer"
258258
static let resource: String = "resource"
259-
static let bookingStatus: String = "booking_status"
260259
static let attendanceStatus = "attendance_status"
260+
static let paymentStatus = "booking_status" // to be updated later when payment filtering is supported
261261
static let status: String = "status"
262262
}
263263
}

Modules/Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
import Foundation
22

3-
/// Helper Enum that specifies all of the available Gravatar Image Ratings
4-
/// TODO: Convert into a pure Swift String Enum. It's done this way to maintain ObjC Compatibility
5-
///
6-
@available(*, deprecated, message: "Use `Rating` from the Gravatar iOS SDK. See: https://github.com/Automattic/Gravatar-SDK-iOS.")
7-
@objc
8-
public enum GravatarRatings: Int {
9-
case g
10-
case pg
11-
case r
12-
case x
13-
case `default`
14-
15-
func stringValue() -> String {
16-
switch self {
17-
case .default:
18-
fallthrough
19-
case .g:
20-
return "g"
21-
case .pg:
22-
return "pg"
23-
case .r:
24-
return "r"
25-
case .x:
26-
return "x"
27-
}
28-
}
29-
}
30-
313
/// Helper Enum that specifies some of the options for default images
324
/// To see all available options, visit : https://en.gravatar.com/site/implement/images/
335
///
@@ -84,14 +56,14 @@ public struct Gravatar {
8456
public static func gravatarUrl(for email: String,
8557
defaultImage: GravatarDefaultImage? = nil,
8658
size: Int? = nil,
87-
rating: GravatarRatings = .default) -> URL? {
59+
rating: Rating = .general) -> URL? {
8860
let hash = gravatarHash(of: email)
8961
let targetURL = String(format: "%@/%@?d=%@&s=%d&r=%@",
9062
Defaults.baseURL,
9163
hash,
9264
defaultImage?.rawValue ?? GravatarDefaultImage.fileNotFound.rawValue,
9365
size ?? Defaults.imageSize,
94-
rating.stringValue())
66+
rating.rawValue)
9567
return URL(string: targetURL)
9668
}
9769

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Foundation
2+
3+
/// Sources:
4+
/// - https://github.com/Automattic/Gravatar-SDK-iOS/blob/trunk/Sources/Gravatar/Options/Rating.swift
5+
/// Gravatar allows users to self-rate their images so that they can indicate if an image is appropriate for a certain audience. By default, only `general`
6+
/// rated
7+
/// images are displayed unless you indicate that you would like to see higher ratings.
8+
///
9+
/// If the requested email hash does not have an image meeting the requested rating level, then the default avatar is returned (See: ``DefaultAvatarOption``)
10+
public enum Rating: String, Sendable, CaseIterable {
11+
/// Suitable for display on all websites with any audience type.
12+
case general = "g"
13+
/// May contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violence.
14+
case parentalGuidance = "pg"
15+
/// May contain such things as harsh profanity, intense violence, nudity, or hard drug use.
16+
case restricted = "r"
17+
/// May contain sexual imagery or extremely disturbing violence.
18+
case x
19+
}

0 commit comments

Comments
 (0)