-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
adf30bc
commit e4e2ec7
Showing
13 changed files
with
361 additions
and
7 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
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
27 changes: 27 additions & 0 deletions
27
BVSwift/BVConversations/Display/Fields/BVRelevancySortOrder.swift
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// | ||
// BVRelavancySortOrder.swift | ||
// BVSwift | ||
// | ||
// Copyright © 2022 Bazaarvoice. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
/// An enum that represents a sorting mechanism that allows for relevancy sort type by | ||
public enum BVRelencySortType: BVQuerySortOrder { | ||
case a2 | ||
|
||
public var description: String { | ||
return internalDescription | ||
} | ||
} | ||
|
||
extension BVRelencySortType: BVConversationsQueryValue { | ||
var internalDescription: String { | ||
switch self { | ||
case .a2: | ||
return BVConversationsConstants.BVConversationsSortOrder.orderTwo | ||
} | ||
} | ||
} | ||
|
43 changes: 43 additions & 0 deletions
43
BVSwift/BVConversations/Display/Fields/Types/BVCostomSort.swift
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// | ||
// BVCostomSort.swift | ||
// BVSwift | ||
// | ||
// Copyright © 2022 Bazaarvoice. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
/// An enum that represents the possible custom sorting comparators to filter on for | ||
/// the BVReviewQuery | ||
/// - Note: | ||
/// \ | ||
/// Used for conformance with the BVQuerySortable protocol. | ||
public enum BVCustomSort: BVQuerySort { | ||
|
||
case contentLocale | ||
|
||
public static var sortPrefix: String { | ||
return BVConversationsConstants.BVQuerySort.defaultField | ||
} | ||
|
||
public static var sortTypeSeparator: String { | ||
return BVConversationsConstants.BVQuerySort.typeSeparatorField | ||
} | ||
|
||
public static var sortValueSeparator: String { | ||
return BVConversationsConstants.BVQuerySort.valueSeparatorField | ||
} | ||
|
||
public var description: String { | ||
return internalDescription | ||
} | ||
} | ||
|
||
extension BVCustomSort: BVConversationsQueryValue { | ||
var internalDescription: String { | ||
switch self { | ||
case .contentLocale: | ||
return BVConversationsConstants.BVReviews.Keys.contentLocale | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
BVSwift/BVConversations/Display/Fields/Types/BVRelevancySort.swift
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// | ||
// BVRelavancySort.swift | ||
// BVSwift | ||
// | ||
// Copyright © 2022 Bazaarvoice. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// An enum that represents the possible relevancy sorting comparators to filter on for | ||
/// the BVReviewQuery | ||
/// - Note: | ||
/// \ | ||
/// Used for conformance with the BVQuerySortable protocol. | ||
public enum BVRelevancySort: BVQuerySort { | ||
|
||
case relevancy | ||
|
||
public static var sortPrefix: String { | ||
return BVConversationsConstants.BVQuerySort.defaultField | ||
} | ||
|
||
public static var sortTypeSeparator: String { | ||
return BVConversationsConstants.BVQuerySort.typeSeparatorField | ||
} | ||
|
||
public static var sortValueSeparator: String { | ||
return BVConversationsConstants.BVQuerySort.valueSeparatorField | ||
} | ||
|
||
public var description: String { | ||
return internalDescription | ||
} | ||
} | ||
|
||
extension BVRelevancySort: BVConversationsQueryValue { | ||
var internalDescription: String { | ||
switch self { | ||
case .relevancy: | ||
return BVConversationsConstants.BVReviews.Keys.relavancy | ||
} | ||
} | ||
} | ||
|
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
Oops, something went wrong.