Skip to content

Commit

Permalink
[MOB-3216] Update master (#111)
Browse files Browse the repository at this point in the history
* Update KarhooPaymentView and make it public (#62)

* Update KarhooPaymentView and make it public

* Add UIView extensions

* Add UIView extensions functions to the existing one

* [MOB-2976] Quote polling fix (#72)

* Merge develop, update pods

* no message

* handle quote polling

* Revert pods to point back to develop.

* no message

* no message

* no message

* MOB-2949 - Driver allocation delay alert (#73)

* Show alert on driver allocation delay

* Show Ride Details and not Rides List screen

* Add tests

* Remove extra . from text

* identifier added (#75)

Co-authored-by: Nurseda Balcioglu <nurseda.balcioglu@karhoo.com>

* CircleCI update (#74)

* Update with userLogin and config auth

* Move userLogin from Keys to ViewController

* Delete userLogin from Keys

* Move config settings setup to ViewController

* Use local userLogin

* Update with additional keys

* Update keys

* Set auth config

* Update keys

* Extract KarhooConfig

* Remove echo of KarhooConfig

* Re-add MockTripAllocationView

* Re-add MockTripAllocationView

* Re-add KarhooAddressSearchBarPresenterSpec

* Re-add CurrencyCodeConverterSpec

* Re-add MockAlertHandler

* Re-add MockQuoteSorter

* Re-add AdyenCardRegistrationFlowSpec

* Re-add MockQuoteSorter

* Re-add MockAddressBarView

* Re-add MockQuoteSorter again

* Re-add MockAddressMapView

* MockQuoteSorter again

* Re-add //

* Re-add MockQuoteSorter

* MockQuoteSorter for a change

* Add MockQuoteSorter

* Change import order

* Changed MockQuoteSorter encoding

* Add in Build Phase

* Move MockQuoteSorter into KarhooQuoteListPresenterSpec

* Move UnitTestSetup

* Revert to old MockQuoteSorter

* Add space

* Update to use env variable instead of echo

* Update fastlane version

* Update bundler

* Update tabbing

* Update bundler

* Use one line command

* Use --decode

* Add team id

* Point to circleci_fix branch

* Revert to point to develop

* CircleCI Fix (#76)

* Point to SDK fix branch

* Point to cart update branch

* Update to develop

* Update to use $(inherited)

* Clean up lanes

* Move test target out of main target

* Rename lane

* Fastlane scan

* Use FASTLANE_LANE_TEST

* Move target back

* Use bundle exec

* Move install step

* Update fastlane and search_path

* Delete output params

* Updated to remove params

* Add scan params

* Delete Client target from tests

* Updated the test target

* Ignore linting

* Add device back

* Move to Fastfile

* Update to search_paths

* Tweak xcov

* Use bundle exec command

* Add output

* Update fastlane

* Update output name

* Use workspace

* Comment out xcov for now

* Rename to skip flaky test

* Update Slack message text

* Mob 3171 remove unused strings (#77)

* Remove unused strings from UI SDK

* Add ErrorKarhoo to showAlert methods

* MOB-3143 - Contact button refactoring (#79)

* Very basic initial stab at using common StackButtons in Trip Screen.

* Cancel ride plugged in

* Changed show/hide button display constraints

* Delete redundant code

* Kind of working but needs tweaking to display properly

* Update dropdown button constraint

* Try spacing

* Fix stack button resizing

* More or less working but needs padding fix

* Remove spacing and change size of drop down button

* Delete unused voice

* Make var private

* Prefill passenger details for token exchange (#78)

* Prefill passenger details for token exchange

* use existing utility method PassengerInfo.shared.currentUserAsPassenger()

* MOB-3144 - Display cancellation fee on Trip and Ride Details screens (#80)

* Display cancellation fee popup

* Initial attempt at getting cancellation fee

* Refactor to put fee alert display logic in one place

* Dismiss overlay

* Put hide overlay in correct place

* Call cancelBookingConfirmed

* Move trip cancellation logic to CancelRideBehaviour

* Remove redundant delegate protocols

* Add to handle successful cancellation

* Use protocol and get test target compiling but tests still need fixing

* Added tests for booking fee retrieval

* Added tests for cancel ride behaviour

* Added tests for presenters handling cancellation success and remove redundant tests

* Delete redundant test

* Code review changes to remove redundant vars

* MOB-3144 - Add decimal formatting to currency display (#81)

* Add decimal formatting to currency display

* Update to point at develop

* Take user to Rides screen when OK is pressed on the cancel screen (#82)

* MOB-3193 - Cancellation SLA (#83)

* Take user to Rides screen when OK is pressed on the cancel screen

* Added free cancellation info

* Added tests for SLA free cancellation minutes

* Fix logic for cancellation info display

* Remove suffix url parameter from adyen (#84)

* Force Adyen 3ds (#85)

* Force 3DS on mobile by setting browserInfo

* Show Adyen error details

* Update podfile

* Add SupplyPartnerId to the AdyenPayments request (#86)

* Add SupplyPartnerId to the AdyenPayments request

* Code review feedback

* MOB-3190 - Align Trip & Ride buttons (#87)

* Updated ride/trip details buttons to align with Android

* Added asserts for click actions

* Mob 3205 update quote model use fleet (#88)

* Use Quote Fleet model

* Update podfile

* Handle 3DS callback in Client app (#89)

* When possible, show cancellable notification in the booking confirmation screens. (#91)

* When possible, show the notification that a ride is cancellable, in the booking confirmation screens.

* Remove duplicate cancelation message formatting.

* Feature/mob 3194 display cancellation sla in the booking request component (#92)

* Prepare cancellation info label for UI testing.

* Show free cancellation info in the ride list and details screens (#93)

* Do not cut off price information in the quote list (#95)

* On small devices

* Use nonce from response for Adyen booking (#96)

* Add free cancellation message when available before driver en route (#94)

* Refactor to use enum cancellation types. (#97)

* Task/mob 3184 add linting to iOS builds (#98)

* Fix all swiftlint violations & warnings.

* Add small swiftlint issue & add swiftlint CircleCI step

* Add swiftlint CircleCI job

* Fix small swiftlint issue

* Add more serious swiftlint issue

* Revert "Add more serious swiftlint issue"

This reverts commit 70eed30.

* Update SwiftLint pod & solve more swiftlint issues

* Include the folder to scan with SwiftLint

* fix and refactoring icon size (#100)

* fix and refactoring icon size

* removed empty lines

* Bump kramdown from 2.3.0 to 2.3.1 (#99)

Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/gettalong/kramdown/releases)
- [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page)
- [Commits](https://github.com/gettalong/kramdown/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Feature/mob 3237 show message when no fleet is available at a time (#101)

* Add message when quotes requests are completed with no quotes.

TODO: add unit tests (right now the KarhooQuoteListPresenterSpec are not running.

* Fix some unit tests

* Add padding to the message. Rename function.

* Complete the renaming of the function.

* Fix/mob 2842 coming back to the app after trip completion signs the user out (#103)

* Fix bug which hides the filtering, sorting controls in the quotes list.

* Fix bug which closes the booking view after the app goes into the background.

* Mob 3226 display cancellation time friendly (#102)

* added new TimeFormatter class, plurals localizable files and strings

* added stringsdict to podspec

* modified TimeFormatter and using it in different parts of the app

* added tests for TimeFormatter

* podfile

* shorter return

* [MOB-3181] Fix CircleCI XCov (#104)

* Update

* no message

* CircleCI run xcov

* [MOB-3185] Fix test (#106)

* Seems like this test doesn't fail anymore

* Found the issue

* changed price display rules (#105)

* changed price display rules

* new test and small fix

* [MOB-3216] Release 1.5.0 (#109)

* Bump versions

* no message

* Bump nokogiri from 1.10.10 to 1.11.3 (#107)

Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.10 to 1.11.3.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](sparklemotion/nokogiri@v1.10.10...v1.11.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Make Braintree versions more specific. (#108)

Right now, if trying to update, Braintree drop in will install version 9, which is not supported.

Co-authored-by: Mostafa Hadian <mostafa.hadian@karhoo.com>
Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com>
Co-authored-by: nurito-burrito <44758040+nurito-burrito@users.noreply.github.com>
Co-authored-by: Nurseda Balcioglu <nurseda.balcioglu@karhoo.com>
Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com>
Co-authored-by: cosminBadulescu <cosmin.badulescu@soft-to-you.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
8 people authored May 10, 2021
1 parent 583ac80 commit 4f99a58
Show file tree
Hide file tree
Showing 136 changed files with 2,895 additions and 1,446 deletions.
56 changes: 28 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,34 @@

version: 2.1
jobs:
### Swift lint job
swiftlint:
docker:
- image: dantoml/swiftlint:latest
steps:
- checkout
- run: swiftlint lint --reporter junit | tee swiftlintResults.xml
- store_artifacts:
path: swiftlintResults.xml
- store_test_results:
path: swiftlintResults.xml

### Build & test job
build-and-test:
macos:
xcode: 12.0.0
working_directory: /Users/distiller/project/KarhooUISDK.xcworkspace
environment:
FL_OUTPUT_DIR: output
FASTLANE_LANE: UISDK_unit_tests
FASTLANE_LANE_TEST: UISDK_unit_tests
shell: /bin/bash --login -eo pipefail
resource_class: xlarge
steps:
- checkout
- run:
name: Set Ruby Version
command: echo 'chruby ruby-2.7.2' >> ~/.bash_profile
command: |
echo 'chruby ruby-2.7.2' >> ~/.bash_profile
gem install bundler:2.2.7
- restore_cache:
name: Restore cache - Load installed gems from cache if possible -
keys:
Expand All @@ -38,36 +52,21 @@ jobs:
name: Fetch CocoaPods Specs
command: |
curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
- run:
name: Decode Keys.swift
command:
echo "$CLIENT_KEYS" | base64 --decode > Client/Keys.swift
- run:
name: Install CocoaPods
command: |
bundle check || bundle install
bundle exec pod install --repo-update --verbose
- run:
name: Create Keys.swift
command: |
echo "import KarhooSDK" > Client/Keys.swift
echo "import KarhooUISDK" >> Client/Keys.swift
echo "struct Keys {" >> Client/Keys.swift
echo "static let identifier = \"\"" >> Client/Keys.swift
echo "static let referer = \"\"" >> Client/Keys.swift
echo "static let organisationId = \"\"" >> Client/Keys.swift
echo "static let userServiceEmail = \"$ADYEN_TEST_USER\"" >> Client/Keys.swift
echo "static let userServicePassword = \"$USER_SERVICE_PASSWORD\"" >> Client/Keys.swift
echo "static func staging() -> KarhooEnvironment {" >> Client/Keys.swift
echo "return .custom(environment: KarhooEnvironmentDetails(host: \"$ADYEN_STG_HOST\", authHost: \"$ADYEN_STG_AUTHHOST\", guestHost: \"$ADYEN_STG_GUESTHOST\")) }}" >> Client/Keys.swift
echo "let guestSettings = GuestSettings(identifier: Keys.identifier, referer: Keys.referer, organisationId: Keys.organisationId)" >> Client/Keys.swift
echo "class KarhooConfig: KarhooUISDKConfiguration {" >> Client/Keys.swift
echo "func environment() -> KarhooEnvironment {" >> Client/Keys.swift
echo "return Keys.staging() }" >> Client/Keys.swift
echo "func authenticationMethod() -> AuthenticationMethod {" >> Client/Keys.swift
echo "return .karhooUser }}" >> Client/Keys.swift
- run:
name: fastlane
command: bundle exec fastlane UISDK_unit_tests
name: Run unit test
command: bundle exec fastlane $FASTLANE_LANE_TEST
- run:
name: Fastlane Xcov report
command: fastlane ios XcovReport
command: bundle exec fastlane ios XcovReport

# Collect XML test results data to show in the UI, and save the same XML
# files under test-results folder in the Artifacts tab
Expand All @@ -82,19 +81,20 @@ jobs:
xcode: 12.0.0
environment:
FL_OUTPUT_DIR: output
FASTLANE_LANE: adhoc
FASTLANE_LANE_TEST: UISDK_unit_tests
steps:
- checkout
- run: bundle install
- run:
name: Fastlane
command: bundle exec fastlane UISDK_unit_tests
command: bundle exec fastlane $FASTLANE_LANE_TEST
- store_artifacts:
path: output
path: $FL_OUTPUT_DIR

workflows:
build-test-adhoc:
jobs:
- swiftlint
- build-and-test
- adhoc:
filters:
Expand Down
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ disabled_rules:
trailing_whitespace:
ignores_empty_lines: true
ignores_comments: true
included:
- KarhooUISDK
excluded:
- Pods
line_length: 200
Expand Down
5 changes: 5 additions & 0 deletions Client/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import KarhooUISDK
import KarhooSDK
import Braintree
import Adyen

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -32,6 +33,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
if url.scheme?.localizedCaseInsensitiveCompare(urlScheme) == .orderedSame {
return BTAppSwitch.handleOpen(url, options: options)
}
let adyenThreeDSecureUtils = AdyenThreeDSecureUtils()
if url.scheme?.localizedCaseInsensitiveCompare(adyenThreeDSecureUtils.current3DSReturnUrlScheme) == .orderedSame {
return RedirectComponent.applicationDidOpen(from: url)
}
return false
}
}
10 changes: 10 additions & 0 deletions Client/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
<string>com.karhooUISDK.Client.Payments</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.karhooUISDK.Client.Adyen</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.karhooUISDK.Client.Adyen</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
Expand Down
23 changes: 23 additions & 0 deletions Client/KarhooConfig.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// KarhooConfig.swift
// Client
//
// Created by Jo Santamaria on 27/01/2021.
// Copyright © 2021 Flit Technologies Ltd. All rights reserved.
//

import KarhooSDK
import KarhooUISDK

final class KarhooConfig: KarhooUISDKConfiguration {

static var auth: AuthenticationMethod = .karhooUser

func environment() -> KarhooEnvironment {
return Keys.staging()
}

func authenticationMethod() -> AuthenticationMethod {
return KarhooConfig.auth
}
}
12 changes: 9 additions & 3 deletions Client/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class ViewController: UIViewController {
}

@objc func guestBookingTapped(sender: UIButton) {
let guestSettings = GuestSettings(identifier: Keys.braintreeGuestIdentifier,
referer: Keys.referer,
organisationId: Keys.braintreeGuestOrganisationId)
KarhooConfig.auth = .guest(settings: guestSettings)
showKarhoo()
}
Expand All @@ -78,15 +81,19 @@ class ViewController: UIViewController {
}

@objc func tokenExchangeBookingTapped(sender: UIButton) {
let tokenExchangeSettings = TokenExchangeSettings(clientId: Keys.braintreeTokenClientId, scope: Keys.braintreeTokenScope)
KarhooConfig.auth = .tokenExchange(settings: tokenExchangeSettings)
tokenLoginAndShowKarhoo()
}

private func usernamePasswordLoginAndShowKarhoo() {
KarhooConfig.auth = .karhooUser
let userService = Karhoo.getUserService()
userService.logout().execute(callback: { _ in})

userService.login(userLogin: Keys.userLogin).execute(callback: { result in
let userLogin = UserLogin(username: Keys.userServiceEmailBraintree,
password: Keys.userServicePasswordBraintree)
userService.login(userLogin: userLogin).execute(callback: { result in
print("login: \(result)")
if result.isSuccess() {
self.showKarhoo()
Expand All @@ -97,7 +104,7 @@ class ViewController: UIViewController {
private func tokenLoginAndShowKarhoo() {
let authService = Karhoo.getAuthService()

authService.login(token: Keys.authToken).execute { result in
authService.login(token: Keys.braintreeAuthToken).execute { result in
print("token login: \(result)")
if result.isSuccess() {
self.showKarhoo()
Expand All @@ -109,7 +116,6 @@ class ViewController: UIViewController {
booking = KarhooUI().screens().booking().buildBookingScreen(journeyInfo: nil,
passengerDetails: nil,
callback: { [weak self] result in
self?.logout()
switch result {
case .completed(let result):
switch result {
Expand Down
Loading

0 comments on commit 4f99a58

Please sign in to comment.