Skip to content

Commit

Permalink
update CustomerCenterSurveyOptionChosenEvent to accept path and url
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaro committed Dec 3, 2024
1 parent fb2ca8f commit 6ef3144
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ private extension FeedbackSurveyViewModel {
darkMode: darkMode,
isSandbox: isSandbox,
displayMode: displayMode,
pathID: feedbackSurveyData.path.id,
path: feedbackSurveyData.path.type,
url: feedbackSurveyData.path.url,
surveyOptionID: option.id,
surveyOptionTitleKey: option.title,
additionalContext: nil,
Expand Down
2 changes: 2 additions & 0 deletions Sources/CustomerCenter/CustomerCenterConfigData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,5 @@ extension CustomerCenterConfigData.Support {
}

}

extension CustomerCenterConfigData.HelpPath.PathType: Sendable, Codable {}
13 changes: 9 additions & 4 deletions Sources/CustomerCenter/Events/CustomerCenterEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ extension CustomerCenterSurveyOptionChosenEvent {
public var darkMode: Bool { base.darkMode }
public var isSandbox: Bool { base.isSandbox }
public var displayMode: CustomerCenterPresentationMode { base.displayMode }
public let pathID: String
public let path: CustomerCenterConfigData.HelpPath.PathType
public let url: URL?
public let surveyOptionID: String
public let surveyOptionTitleKey: String
public let additionalContext: String?
Expand All @@ -114,7 +115,8 @@ extension CustomerCenterSurveyOptionChosenEvent {
darkMode: Bool,
isSandbox: Bool,
displayMode: CustomerCenterPresentationMode,
pathID: String,
path: CustomerCenterConfigData.HelpPath.PathType,
url: URL?,
surveyOptionID: String,
surveyOptionTitleKey: String,
additionalContext: String? = nil,
Expand All @@ -126,7 +128,8 @@ extension CustomerCenterSurveyOptionChosenEvent {
isSandbox: isSandbox,
displayMode: displayMode
)
self.pathID = pathID
self.path = path
self.url = url
self.surveyOptionID = surveyOptionID
self.surveyOptionTitleKey = surveyOptionTitleKey
self.additionalContext = additionalContext
Expand Down Expand Up @@ -210,7 +213,8 @@ extension CustomerCenterSurveyOptionChosenEvent.Data: Equatable, Codable, Sendab
private enum CodingKeys: String, CodingKey {

case base
case pathID = "pathId"
case path
case url
case surveyOptionID = "surveyOptionId"
case surveyOptionTitleKey = "surveyOptionTitleKey"
case additionalContext = "additionalContext"
Expand All @@ -219,4 +223,5 @@ extension CustomerCenterSurveyOptionChosenEvent.Data: Equatable, Codable, Sendab
}

}

extension CustomerCenterSurveyOptionChosenEvent: Equatable, Codable, Sendable {}
15 changes: 10 additions & 5 deletions Sources/CustomerCenter/Events/EventsRequest+CustomerCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ extension EventsRequest {
var locale: String
var isSandbox: Bool
var displayMode: CustomerCenterPresentationMode
var pathID: String
var path: String
var url: String?
var surveyOptionID: String
var surveyOptionTitleKey: String
var additionalContext: String?
Expand All @@ -127,7 +128,8 @@ extension EventsRequest {
locale: String,
isSandbox: Bool,
displayMode: CustomerCenterPresentationMode,
pathID: String,
path: CustomerCenterConfigData.HelpPath.PathType,
url: URL?,
surveyOptionID: String,
surveyOptionTitleKey: String,
additionalContext: String?,
Expand All @@ -142,7 +144,8 @@ extension EventsRequest {
self.locale = locale
self.isSandbox = isSandbox
self.displayMode = displayMode
self.pathID = pathID
self.path = path.rawValue
self.url = url?.absoluteString
self.surveyOptionID = surveyOptionID
self.surveyOptionTitleKey = surveyOptionTitleKey
self.additionalContext = additionalContext
Expand Down Expand Up @@ -179,7 +182,8 @@ extension EventsRequest {
locale: data.localeIdentifier,
isSandbox: data.isSandbox,
displayMode: data.displayMode,
pathID: data.pathID,
path: data.path,
url: data.url,
surveyOptionID: data.surveyOptionID,
surveyOptionTitleKey: data.surveyOptionTitleKey,
additionalContext: data.additionalContext,
Expand Down Expand Up @@ -241,7 +245,8 @@ extension EventsRequest.CustomerCenterEventSurveyOptionChosen: Encodable {
case locale
case isSandbox = "isSandbox"
case displayMode = "displayMode"
case pathID = "pathId"
case path
case url
case surveyOptionID = "surveyOptionId"
case surveyOptionTitleKey = "surveyOptionTitleKey"
case additionalContext = "additionalContext"
Expand Down

0 comments on commit 6ef3144

Please sign in to comment.