Skip to content

Commit

Permalink
Merge pull request #2236 from CruGlobal/develop
Browse files Browse the repository at this point in the history
Merge develop into master for new QA release
  • Loading branch information
levieggertcru authored Jul 30, 2024
2 parents 29bd213 + b110806 commit 84a37e2
Show file tree
Hide file tree
Showing 114 changed files with 2,105 additions and 748 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ updates:
assignees:
- frett
- levieggertcru
- package-ecosystem: swift
directory: "/"
schedule:
interval: daily
reviewers:
- frett
- levieggertcru
assignees:
- frett
- levieggertcru
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.957.0)
aws-sdk-core (3.201.2)
aws-partitions (1.958.0)
aws-sdk-core (3.201.3)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
Expand All @@ -36,7 +36,7 @@ GEM
aws-sdk-core (~> 3, >= 3.201.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.8.0)
aws-sigv4 (1.9.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
Expand Down Expand Up @@ -117,15 +117,15 @@ GEM
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.3.1)
fastlane (2.221.1)
fastlane (2.222.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down
182 changes: 161 additions & 21 deletions godtools.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions godtools.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "748c7837511d0e6a507737353af268484e1745e2",
"version" : "1.2024011601.1"
"revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27",
"version" : "1.2024011602.0"
}
},
{
Expand All @@ -33,8 +33,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/AppsFlyerSDK/AppsFlyerFramework-Strict",
"state" : {
"revision" : "622bb3a6d31f88e128ee2816c11f490d072473a7",
"version" : "6.14.5"
"revision" : "629e2e9873ec3f990b8be9500062b077cef730b9",
"version" : "6.14.6"
}
},
{
Expand Down Expand Up @@ -267,8 +267,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "d57a5aecf24a25b32ec4a74be2f5d0a995a47c4b",
"version" : "1.27.0"
"revision" : "e17d61f26df0f0e06f58f6977ba05a097a720106",
"version" : "1.27.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ class AppDataLayerDependencies {
return sharedUserDefaultsCache
}

func getStringWithLocaleCount() -> StringWithLocaleCountInterface {
return StringWithLocaleCount()
}

func getToolDownloader() -> ToolDownloader {
return ToolDownloader(
resourcesRepository: getResourcesRepository(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,23 @@ class AppLanguagesApi {
let allAppLanguages: [AppLanguageCodable] = [
AppLanguageCodable(languageCode: "am", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "ar", languageDirection: .rightToLeft, languageScriptCode: nil),
AppLanguageCodable(languageCode: "bn", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "de", languageDirection: .rightToLeft, languageScriptCode: nil),
AppLanguageCodable(languageCode: "en", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "es", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "pt", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "fr", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "id", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "zh", languageDirection: .leftToRight, languageScriptCode: "Hans"),
AppLanguageCodable(languageCode: "zh", languageDirection: .leftToRight, languageScriptCode: "Hant"),
AppLanguageCodable(languageCode: "hi", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "id", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "ja", languageDirection: .rightToLeft, languageScriptCode: nil),
AppLanguageCodable(languageCode: "ko", languageDirection: .rightToLeft, languageScriptCode: nil),
AppLanguageCodable(languageCode: "lv", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "pt", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "ru", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "sw", languageDirection: .rightToLeft, languageScriptCode: nil),
AppLanguageCodable(languageCode: "ur", languageDirection: .rightToLeft, languageScriptCode: nil),
AppLanguageCodable(languageCode: "vi", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "lv", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "bn", languageDirection: .leftToRight, languageScriptCode: nil),
AppLanguageCodable(languageCode: "ur", languageDirection: .rightToLeft, languageScriptCode: nil)
AppLanguageCodable(languageCode: "zh", languageDirection: .leftToRight, languageScriptCode: "Hans"),
AppLanguageCodable(languageCode: "zh", languageDirection: .leftToRight, languageScriptCode: "Hant")
]

return Just(allAppLanguages).setFailureType(to: Error.self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class GetToolsRepository: GetToolsRepositoryInterface {
self.getTranslatedToolLanguageAvailability = getTranslatedToolLanguageAvailability
}

func getToolsPublisher(translatedInAppLanguage: AppLanguageDomainModel, languageForAvailabilityText: LanguageDomainModel?, filterToolsByCategory: CategoryFilterDomainModel?, filterToolsByLanguage: LanguageFilterDomainModel?) -> AnyPublisher<[ToolListItemDomainModel], Never> {
func getToolsPublisher(translatedInAppLanguage: AppLanguageDomainModel, languageIdForAvailabilityText: String?, filterToolsByCategory: ToolFilterCategoryDomainModel?, filterToolsByLanguage: ToolFilterLanguageDomainModel?) -> AnyPublisher<[ToolListItemDomainModel], Never> {

let languageForAvailabilityTextModel: LanguageModel?

if let languageForAvailabilityTextId = languageForAvailabilityText?.id {
if let languageForAvailabilityTextId = languageIdForAvailabilityText {
languageForAvailabilityTextModel = languagesRepository.getLanguage(id: languageForAvailabilityTextId)
} else {
languageForAvailabilityTextModel = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ import Combine

protocol GetToolsRepositoryInterface {

func getToolsPublisher(translatedInAppLanguage: AppLanguageDomainModel, languageForAvailabilityText: LanguageDomainModel?, filterToolsByCategory: CategoryFilterDomainModel?, filterToolsByLanguage: LanguageFilterDomainModel?) -> AnyPublisher<[ToolListItemDomainModel], Never>
func getToolsPublisher(translatedInAppLanguage: AppLanguageDomainModel, languageIdForAvailabilityText: String?, filterToolsByCategory: ToolFilterCategoryDomainModel?, filterToolsByLanguage: ToolFilterLanguageDomainModel?) -> AnyPublisher<[ToolListItemDomainModel], Never>
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class ViewToolsUseCase {
self.getToolsRepository = getToolsRepository
}

func viewPublisher(translatedInAppLanguage: AppLanguageDomainModel, languageForAvailabilityText: LanguageDomainModel?, filterToolsByCategory: CategoryFilterDomainModel?, filterToolsByLanguage: LanguageFilterDomainModel?) -> AnyPublisher<ViewToolsDomainModel, Never> {
func viewPublisher(translatedInAppLanguage: AppLanguageDomainModel, languageIdForAvailabilityText: String?, filterToolsByCategory: ToolFilterCategoryDomainModel?, filterToolsByLanguage: ToolFilterLanguageDomainModel?) -> AnyPublisher<ViewToolsDomainModel, Never> {

return Publishers.CombineLatest(
getInterfaceStringsRepository.getStringsPublisher(translateInLanguage: translatedInAppLanguage),
getToolsRepository.getToolsPublisher(
translatedInAppLanguage: translatedInAppLanguage,
languageForAvailabilityText: languageForAvailabilityText,
languageIdForAvailabilityText: languageIdForAvailabilityText,
filterToolsByCategory: filterToolsByCategory,
filterToolsByLanguage: filterToolsByLanguage
)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class ToolsViewModel: ObservableObject {
private weak var flowDelegate: FlowDelegate?

@Published private var appLanguage: AppLanguageDomainModel = LanguageCodeDomainModel.english.rawValue
@Published private var toolFilterCategorySelection: CategoryFilterDomainModel = .anyCategory(text: "", toolsAvailableText: "")
@Published private var toolFilterLanguageSelection: LanguageFilterDomainModel = .anyLanguage(text: "", toolsAvailableText: "")
@Published private var toolFilterCategorySelection: ToolFilterCategoryDomainModel = ToolFilterAnyCategoryDomainModel(text: "", toolsAvailableText: "")
@Published private var toolFilterLanguageSelection: ToolFilterLanguageDomainModel = ToolFilterAnyLanguageDomainModel(text: "", toolsAvailableText: "")

@Published var favoritingToolBannerMessage: String = ""
@Published var showsFavoritingToolBanner: Bool = false
Expand Down Expand Up @@ -79,13 +79,13 @@ class ToolsViewModel: ObservableObject {
Publishers.CombineLatest(
viewToolsUseCase.viewPublisher(
translatedInAppLanguage: appLanguage,
languageForAvailabilityText: toolFilterLanguage.language,
languageIdForAvailabilityText: toolFilterLanguage.languageDataModelId,
filterToolsByCategory: toolFilterCategory,
filterToolsByLanguage: toolFilterLanguage
),
getSpotlightToolsUseCase.getSpotlightToolsPublisher(
translatedInAppLanguage: appLanguage,
languageForAvailabilityText: toolFilterLanguage.language
languageIdForAvailabilityText: toolFilterLanguage.languageDataModelId
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ class GetLessonFilterLanguagesRepository: GetLessonFilterLanguagesRepositoryInte
private let languagesRepository: LanguagesRepository
private let getTranslatedLanguageName: GetTranslatedLanguageName
private let localizationServices: LocalizationServicesInterface
private let stringWithLocaleCount: StringWithLocaleCountInterface

init(resourcesRepository: ResourcesRepository, languagesRepository: LanguagesRepository, getTranslatedLanguageName: GetTranslatedLanguageName, localizationServices: LocalizationServicesInterface) {
init(resourcesRepository: ResourcesRepository, languagesRepository: LanguagesRepository, getTranslatedLanguageName: GetTranslatedLanguageName, localizationServices: LocalizationServicesInterface, stringWithLocaleCount: StringWithLocaleCountInterface) {
self.resourcesRepository = resourcesRepository
self.languagesRepository = languagesRepository
self.getTranslatedLanguageName = getTranslatedLanguageName
self.localizationServices = localizationServices
self.stringWithLocaleCount = stringWithLocaleCount
}

func getLessonFilterLanguagesPublisher(translatedInAppLanguage: AppLanguageDomainModel) -> AnyPublisher<[LessonLanguageFilterDomainModel], Never> {
func getLessonFilterLanguagesPublisher(translatedInAppLanguage: AppLanguageDomainModel) -> AnyPublisher<[LessonFilterLanguageDomainModel], Never> {

return resourcesRepository.getResourcesChangedPublisher()
.flatMap { _ in
Expand All @@ -38,7 +40,7 @@ class GetLessonFilterLanguagesRepository: GetLessonFilterLanguagesRepositoryInte
.eraseToAnyPublisher()
}

func getLessonLanguageFilterFromLanguageCode(languageCode: String?, translatedInAppLanguage: AppLanguageDomainModel) -> LessonLanguageFilterDomainModel? {
func getLessonLanguageFilterFromLanguageCode(languageCode: String?, translatedInAppLanguage: AppLanguageDomainModel) -> LessonFilterLanguageDomainModel? {

guard let languageCode = languageCode,
let language = languagesRepository.getLanguage(code: languageCode)
Expand All @@ -49,7 +51,7 @@ class GetLessonFilterLanguagesRepository: GetLessonFilterLanguagesRepositoryInte
return createLessonLanguageFilterDomainModel(with: language, translatedInAppLanguage: translatedInAppLanguage)
}

func getLessonLanguageFilterFromLanguageId(languageId: String?, translatedInAppLanguage: AppLanguageDomainModel) -> LessonLanguageFilterDomainModel? {
func getLessonLanguageFilterFromLanguageId(languageId: String?, translatedInAppLanguage: AppLanguageDomainModel) -> LessonFilterLanguageDomainModel? {

guard let languageId = languageId,
let language = languagesRepository.getLanguage(id: languageId)
Expand All @@ -63,9 +65,9 @@ class GetLessonFilterLanguagesRepository: GetLessonFilterLanguagesRepositoryInte

extension GetLessonFilterLanguagesRepository {

private func createLessonLanguageFilterDomainModelList(from languageIds: [String], translatedInAppLanguage: AppLanguageDomainModel) -> [LessonLanguageFilterDomainModel] {
private func createLessonLanguageFilterDomainModelList(from languageIds: [String], translatedInAppLanguage: AppLanguageDomainModel) -> [LessonFilterLanguageDomainModel] {

let languages: [LessonLanguageFilterDomainModel] = languagesRepository.getLanguages(ids: languageIds)
let languages: [LessonFilterLanguageDomainModel] = languagesRepository.getLanguages(ids: languageIds)
.compactMap { languageModel in

let lessonsAvailableCount: Int = resourcesRepository.getAllLessonsCount(filterByLanguageId: languageModel.id)
Expand All @@ -84,7 +86,7 @@ extension GetLessonFilterLanguagesRepository {
return languages
}

private func createLessonLanguageFilterDomainModel(with languageModel: LanguageModel, translatedInAppLanguage: AppLanguageDomainModel) -> LessonLanguageFilterDomainModel? {
private func createLessonLanguageFilterDomainModel(with languageModel: LanguageModel, translatedInAppLanguage: AppLanguageDomainModel) -> LessonFilterLanguageDomainModel? {

let lessonsAvailableCount: Int = resourcesRepository.getAllLessonsCount(filterByLanguageId: languageModel.id)

Expand All @@ -93,7 +95,7 @@ extension GetLessonFilterLanguagesRepository {

let lessonsAvailableText: String = getLessonsAvailableText(lessonsAvailableCount: lessonsAvailableCount, translatedInAppLanguage: translatedInAppLanguage)

return LessonLanguageFilterDomainModel(
return LessonFilterLanguageDomainModel(
languageId: languageModel.id,
languageName: languageName,
translatedName: translatedLanguageName,
Expand All @@ -108,8 +110,6 @@ extension GetLessonFilterLanguagesRepository {
key: LessonFilterStringKeys.lessonsAvailableText.rawValue
)

let localizedString = String(format: formatString, locale: Locale(identifier: translatedInAppLanguage), lessonsAvailableCount)

return localizedString
return stringWithLocaleCount.getString(format: formatString, locale: Locale(identifier: translatedInAppLanguage), count: lessonsAvailableCount)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GetUserLessonFiltersRepository: GetUserLessonFiltersRepositoryInterface {
self.getLessonFilterLanguagesRepository = getLessonFilterLanguagesRepository
}

func getUserLessonLanguageFilterPublisher(translatedInAppLanguage: AppLanguageDomainModel) -> AnyPublisher<LessonLanguageFilterDomainModel?, Never> {
func getUserLessonLanguageFilterPublisher(translatedInAppLanguage: AppLanguageDomainModel) -> AnyPublisher<LessonFilterLanguageDomainModel?, Never> {

return userLessonFiltersRepository.getUserLessonLanguageFilterChangedPublisher()
.map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SearchLessonFilterLanguagesRepository: SearchLessonFilterLanguagesReposito
self.stringSearcher = stringSearcher
}

func getSearchResultsPublisher(for searchText: String, in lessonFilterLanguages: [LessonLanguageFilterDomainModel]) -> AnyPublisher<[LessonLanguageFilterDomainModel], Never> {
func getSearchResultsPublisher(for searchText: String, in lessonFilterLanguages: [LessonFilterLanguageDomainModel]) -> AnyPublisher<[LessonFilterLanguageDomainModel], Never> {

let searchResults = stringSearcher.search(for: searchText, in: lessonFilterLanguages)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class StoreUserLessonFiltersRepository: StoreUserLessonFiltersRepositoryInterfac
self.userLessonFiltersRepository = userLessonFiltersRepository
}

func storeUserLanguageFilterPublisher(_ languageFilter: LessonLanguageFilterDomainModel) -> AnyPublisher<Void, Never> {
func storeUserLanguageFilterPublisher(_ languageFilter: LessonFilterLanguageDomainModel) -> AnyPublisher<Void, Never> {

userLessonFiltersRepository.storeUserLessonLanguageFilter(with: languageFilter.languageId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class LessonFilterDataLayerDependencies {
resourcesRepository: coreDataLayer.getResourcesRepository(),
languagesRepository: coreDataLayer.getLanguagesRepository(),
getTranslatedLanguageName: coreDataLayer.getTranslatedLanguageName(),
localizationServices: coreDataLayer.getLocalizationServices()
localizationServices: coreDataLayer.getLocalizationServices(),
stringWithLocaleCount: coreDataLayer.getStringWithLocaleCount()
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// LessonLanguageFilterDomainModel.swift
// LessonFilterLanguageDomainModel.swift
// godtools
//
// Created by Rachael Skeath on 7/1/24.
Expand All @@ -8,21 +8,21 @@

import Foundation

struct LessonLanguageFilterDomainModel {
struct LessonFilterLanguageDomainModel {
let languageId: String
let languageName: String
let translatedName: String
let lessonsAvailableText: String
}

extension LessonLanguageFilterDomainModel: StringSearchable {
extension LessonFilterLanguageDomainModel: StringSearchable {

var searchableStrings: [String] {
return [languageName, translatedName]
}
}

extension LessonLanguageFilterDomainModel: Identifiable {
extension LessonFilterLanguageDomainModel: Identifiable {

var id: String {
return languageId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ import Foundation

struct UserLessonFiltersDomainModel {

let languageFilter: LessonLanguageFilterDomainModel?
let languageFilter: LessonFilterLanguageDomainModel?
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ import Foundation
struct ViewLessonFilterLanguagesDomainModel {

let interfaceStrings: LessonFilterLanguagesInterfaceStringsDomainModel
let languageFilters: [LessonLanguageFilterDomainModel]
let languageFilters: [LessonFilterLanguageDomainModel]
}
Loading

0 comments on commit 84a37e2

Please sign in to comment.