From 167eb8a8873b13ead9a06809b2e36ba90cca69d8 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Wed, 11 May 2022 14:23:23 -0700 Subject: [PATCH 01/24] IOS-408 Upgrade to building on Monterey --- .github/workflows/archive-and-upload.yml | 6 ++++-- .github/workflows/non-drm-build.yml | 2 +- .github/workflows/unit-testing.yml | 2 +- scripts/xcode-settings.sh | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/archive-and-upload.yml b/.github/workflows/archive-and-upload.yml index 2650cde8a..088c3b117 100644 --- a/.github/workflows/archive-and-upload.yml +++ b/.github/workflows/archive-and-upload.yml @@ -7,7 +7,7 @@ on: - feature/** jobs: version-check: - runs-on: macOS-11 + runs-on: macOS-12 env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: @@ -19,6 +19,8 @@ jobs: run: uname -a - name: Check Carthage version run: command -v carthage && carthage version + - name: Check Python version + run: command -v python && python --version - name: Checkout main repo uses: actions/checkout@v2.3.4 with: @@ -40,7 +42,7 @@ jobs: simplye_changed: ${{ steps.detectapp.outputs.simplye_changed }} openebooks_changed: ${{ steps.detectapp.outputs.openebooks_changed }} upload-arc: - runs-on: macOS-11 + runs-on: macOS-12 needs: version-check if: needs.version-check.outputs.simplye_changed == '1' || needs.version-check.outputs.openebooks_changed == '1' env: diff --git a/.github/workflows/non-drm-build.yml b/.github/workflows/non-drm-build.yml index e23ea6356..d2476a291 100644 --- a/.github/workflows/non-drm-build.yml +++ b/.github/workflows/non-drm-build.yml @@ -3,7 +3,7 @@ on: pull_request: jobs: build: - runs-on: macOS-11 + runs-on: macOS-12 steps: - name: Check available Xcodes run: ls -la /Applications diff --git a/.github/workflows/unit-testing.yml b/.github/workflows/unit-testing.yml index 2f6fb46ff..d17197ad2 100644 --- a/.github/workflows/unit-testing.yml +++ b/.github/workflows/unit-testing.yml @@ -3,7 +3,7 @@ on: pull_request: jobs: build-and-test: - runs-on: macOS-11 + runs-on: macOS-12 if: github.event.pull_request.head.repo.full_name == github.repository env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} diff --git a/scripts/xcode-settings.sh b/scripts/xcode-settings.sh index be034793a..84d9568f1 100755 --- a/scripts/xcode-settings.sh +++ b/scripts/xcode-settings.sh @@ -64,4 +64,3 @@ PAYLOAD_DIR_NAME="$ARCHIVE_NAME-payload" PAYLOAD_PATH="$ARCHIVE_DIR/$PAYLOAD_DIR_NAME" DSYMS_PATH="$PAYLOAD_PATH" UPLOAD_FILENAME="${ARCHIVE_NAME}.zip" -UPLOAD_FILENAME_URLENCODED=$(python -c "import urllib; print urllib.quote('''$UPLOAD_FILENAME''')") From 2cfc2cb121926a474c7a3a0a68888fe72f8226c9 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Wed, 11 May 2022 16:15:19 -0700 Subject: [PATCH 02/24] IOS-408 Upgrade to Xcode 13.3.1 --- .github/workflows/archive-and-upload.yml | 4 +--- .github/workflows/non-drm-build.yml | 2 +- .github/workflows/unit-testing.yml | 2 +- CardCreator-iOS | 2 +- NYPLAEToolkit | 2 +- NYPLAudiobookToolkit | 2 +- RDServices.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/RDServices.xcscheme | 2 +- Simplified.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Open eBooks.xcscheme | 2 +- .../xcshareddata/xcschemes/SimplyE-R2dev.xcscheme | 2 +- .../xcshareddata/xcschemes/SimplyE-noDRM.xcscheme | 2 +- Simplified.xcodeproj/xcshareddata/xcschemes/SimplyE.xcscheme | 2 +- adept-ios | 2 +- readium-sdk | 2 +- tenprintcover-ios | 2 +- 16 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/archive-and-upload.yml b/.github/workflows/archive-and-upload.yml index 088c3b117..07fb69957 100644 --- a/.github/workflows/archive-and-upload.yml +++ b/.github/workflows/archive-and-upload.yml @@ -19,8 +19,6 @@ jobs: run: uname -a - name: Check Carthage version run: command -v carthage && carthage version - - name: Check Python version - run: command -v python && python --version - name: Checkout main repo uses: actions/checkout@v2.3.4 with: @@ -48,7 +46,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: - - name: Force Xcode 13.1 + - name: Force Xcode 13.3.1 run: sudo xcode-select -switch /Applications/Xcode_13.1.app - name: Install Firebase Tools run: npm install -g firebase-tools diff --git a/.github/workflows/non-drm-build.yml b/.github/workflows/non-drm-build.yml index d2476a291..fa9e9d9cb 100644 --- a/.github/workflows/non-drm-build.yml +++ b/.github/workflows/non-drm-build.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Check available Xcodes run: ls -la /Applications - - name: Force Xcode 13.1 + - name: Force Xcode 13.3.1 run: sudo xcode-select -switch /Applications/Xcode_13.1.app - name: Checkout main repo uses: actions/checkout@v2 diff --git a/.github/workflows/unit-testing.yml b/.github/workflows/unit-testing.yml index d17197ad2..5aef7fccd 100644 --- a/.github/workflows/unit-testing.yml +++ b/.github/workflows/unit-testing.yml @@ -8,7 +8,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: - - name: Force Xcode 13.1 + - name: Force Xcode 13.3.1 run: sudo xcode-select -switch /Applications/Xcode_13.1.app - name: Print System Info run: uname -a diff --git a/CardCreator-iOS b/CardCreator-iOS index fdedf62f3..b7de71ea0 160000 --- a/CardCreator-iOS +++ b/CardCreator-iOS @@ -1 +1 @@ -Subproject commit fdedf62f3aa115afbab79761a173c9cf22d86e04 +Subproject commit b7de71ea0482683ab08a5040278088ad36311783 diff --git a/NYPLAEToolkit b/NYPLAEToolkit index fd4d745c8..c0d2c8fcd 160000 --- a/NYPLAEToolkit +++ b/NYPLAEToolkit @@ -1 +1 @@ -Subproject commit fd4d745c84d562ffa17ddb79fc4abb5fd828b15c +Subproject commit c0d2c8fcdf43ba77ff38cc1753815a4d4e0af466 diff --git a/NYPLAudiobookToolkit b/NYPLAudiobookToolkit index 89503bb99..5f12e7553 160000 --- a/NYPLAudiobookToolkit +++ b/NYPLAudiobookToolkit @@ -1 +1 @@ -Subproject commit 89503bb99844756ec60b72a90f60c77b966ce93e +Subproject commit 5f12e7553737ba5dbc6cce352dfa0ec1b0ef1047 diff --git a/RDServices.xcodeproj/project.pbxproj b/RDServices.xcodeproj/project.pbxproj index 7a2a0e29c..5451bde97 100644 --- a/RDServices.xcodeproj/project.pbxproj +++ b/RDServices.xcodeproj/project.pbxproj @@ -389,7 +389,7 @@ 118A0E201992B3FD00792DDE /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1310; + LastUpgradeCheck = 1330; ORGANIZATIONNAME = Readium; }; buildConfigurationList = 118A0E231992B3FD00792DDE /* Build configuration list for PBXProject "RDServices" */; diff --git a/RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme b/RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme index 4cc184d4e..ae5f258f6 100644 --- a/RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme +++ b/RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme @@ -1,6 +1,6 @@ Date: Fri, 13 May 2022 08:26:49 -0700 Subject: [PATCH 03/24] Bump SimplyE version to 3.8.7 --- Simplified.xcodeproj/project.pbxproj | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index 2ffe77b20..e6da98639 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5522,7 +5522,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 0; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5542,7 +5542,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.8.6; + MARKETING_VERSION = 3.8.7; PRODUCT_BUNDLE_IDENTIFIER = org.nypl.labs.SimplyE; PRODUCT_MODULE_NAME = SimplyE; PRODUCT_NAME = "SimplyE-R2dev"; @@ -5573,7 +5573,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 0; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5592,7 +5592,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.8.6; + MARKETING_VERSION = 3.8.7; PRODUCT_BUNDLE_IDENTIFIER = org.nypl.labs.SimplyE; PRODUCT_MODULE_NAME = SimplyE; PRODUCT_NAME = "SimplyE-R2dev"; @@ -5623,7 +5623,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 0; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5640,7 +5640,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.8.6; + MARKETING_VERSION = 3.8.7; PRODUCT_BUNDLE_IDENTIFIER = org.nypl.labs.SimplyE; PRODUCT_MODULE_NAME = SimplyE; PROVISIONING_PROFILE = "2e185b6c-271e-4b02-a05e-860b8c3831f6"; @@ -5671,7 +5671,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 0; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5687,7 +5687,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.8.6; + MARKETING_VERSION = 3.8.7; PRODUCT_BUNDLE_IDENTIFIER = org.nypl.labs.SimplyE; PRODUCT_MODULE_NAME = SimplyE; PROVISIONING_PROFILE = "b3d9154d-70e1-48d6-a0c5-869431277a5c"; @@ -5941,7 +5941,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 0; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5962,7 +5962,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.8.6; + MARKETING_VERSION = 3.8.7; PRODUCT_BUNDLE_IDENTIFIER = org.nypl.labs.SimplyE; PROVISIONING_PROFILE = "2e185b6c-271e-4b02-a05e-860b8c3831f6"; PROVISIONING_PROFILE_SPECIFIER = "SimplyE Development"; @@ -5992,7 +5992,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 0; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -6012,7 +6012,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.8.6; + MARKETING_VERSION = 3.8.7; PRODUCT_BUNDLE_IDENTIFIER = org.nypl.labs.SimplyE; PROVISIONING_PROFILE = "b3d9154d-70e1-48d6-a0c5-869431277a5c"; PROVISIONING_PROFILE_SPECIFIER = "SimplyE Distribution"; From 2c26b43d2d9a87bfe475fae56227c34baaea7db9 Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Wed, 18 May 2022 12:07:47 -0700 Subject: [PATCH 04/24] Update dependencies git ref for NYPLUtilities changes --- Axis-iOS | 2 +- CardCreator-iOS | 2 +- NYPLAEToolkit | 2 +- NYPLAudiobookToolkit | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 2 +- audiobook-ios-overdrive | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Axis-iOS b/Axis-iOS index f9908a405..09a694135 160000 --- a/Axis-iOS +++ b/Axis-iOS @@ -1 +1 @@ -Subproject commit f9908a4057ad1c0ffa2ec6a18aeafe05a5608db6 +Subproject commit 09a694135bc40e006fc80328ecf7cab8eda3329d diff --git a/CardCreator-iOS b/CardCreator-iOS index b7de71ea0..58fe3a2bd 160000 --- a/CardCreator-iOS +++ b/CardCreator-iOS @@ -1 +1 @@ -Subproject commit b7de71ea0482683ab08a5040278088ad36311783 +Subproject commit 58fe3a2bdf494dd86e9aa371febe611c531aaeb0 diff --git a/NYPLAEToolkit b/NYPLAEToolkit index c0d2c8fcd..4fad0c51b 160000 --- a/NYPLAEToolkit +++ b/NYPLAEToolkit @@ -1 +1 @@ -Subproject commit c0d2c8fcdf43ba77ff38cc1753815a4d4e0af466 +Subproject commit 4fad0c51bd420d69fef02a6152d6399123a1b889 diff --git a/NYPLAudiobookToolkit b/NYPLAudiobookToolkit index 5f12e7553..b2203e7ab 160000 --- a/NYPLAudiobookToolkit +++ b/NYPLAudiobookToolkit @@ -1 +1 @@ -Subproject commit 5f12e7553737ba5dbc6cce352dfa0ec1b0ef1047 +Subproject commit b2203e7abf189e3cc83e438608524ecb2224ca99 diff --git a/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 08160191e..e840f4edf 100644 --- a/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/NYPL-Simplified/iOS-Utilities", "state": { "branch": "main", - "revision": "358380251b3f08b4414160e7e6863d14f4249294", + "revision": "92ba3eae4339d03a22e682faee6edc749a089933", "version": null } }, diff --git a/audiobook-ios-overdrive b/audiobook-ios-overdrive index 141bdad53..1b07a072c 160000 --- a/audiobook-ios-overdrive +++ b/audiobook-ios-overdrive @@ -1 +1 @@ -Subproject commit 141bdad53c85aa197f945645fb240a0a3ba5e543 +Subproject commit 1b07a072c4b5d25075df68f792288cff9a945d89 From 8eeae171ebd29b5bdaa5dc903cf2f27663752f6f Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Fri, 27 May 2022 12:01:07 -0700 Subject: [PATCH 05/24] OE-510 Change app structure at sign-out --- Simplified.xcodeproj/project.pbxproj | 14 +++++++++++++ .../NYPLAppDelegate+OE.swift | 6 ++++-- .../SimplyE-Bridging-Header.h | 1 + ...ttingsAccountDetailViewController+OE.swift | 15 +++++++++++++ ...ttingsAccountDetailViewController+SE.swift | 16 ++++++++++++++ ...ettingsAccountDetailViewController+Swift.h | 21 +++++++++++++++++++ .../NYPLSettingsAccountDetailViewController.m | 6 ------ .../NYPLAccountSignInViewController.m | 3 +++ .../NYPLSignInBusinessLogic+SignOut.swift | 20 ++++++++---------- .../OETutorialChoiceViewController.swift | 1 + 10 files changed, 84 insertions(+), 19 deletions(-) create mode 100644 Simplified/Settings/NYPLSettingsAccountDetailViewController+OE.swift create mode 100644 Simplified/Settings/NYPLSettingsAccountDetailViewController+SE.swift create mode 100644 Simplified/Settings/NYPLSettingsAccountDetailViewController+Swift.h diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index e6da98639..b25ca7355 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -980,6 +980,10 @@ 73DE897E260BEA13003D9135 /* NYPLRequestExecuting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73DE8979260BEA13003D9135 /* NYPLRequestExecuting.swift */; }; 73DEB54E2486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73DEB5462486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift */; }; 73DEB54F2486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73DEB5462486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift */; }; + 73E1676E283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */; }; + 73E1676F283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */; }; + 73E16770283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */; }; + 73E16777283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E16776283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift */; }; 73E64E6A252BB82600276953 /* NYPLWelcomeEULAViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E64E65252BB82600276953 /* NYPLWelcomeEULAViewController.swift */; }; 73E64E6C252BB89A00276953 /* eula.html in Resources */ = {isa = PBXBuildFile; fileRef = 73E64E6B252BB89A00276953 /* eula.html */; }; 73EB0A6525821DF4006BC997 /* NYPLLibraryDescriptionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0826CD2E24AA2801000F4030 /* NYPLLibraryDescriptionCell.swift */; }; @@ -2096,6 +2100,9 @@ 73DE53302525A386003E2C56 /* NYPLLibraryAccountURLsProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLLibraryAccountURLsProvider.swift; sourceTree = ""; }; 73DE8979260BEA13003D9135 /* NYPLRequestExecuting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLRequestExecuting.swift; sourceTree = ""; }; 73DEB5462486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NYPLBookmarkR2Location.swift; sourceTree = ""; }; + 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLSettingsAccountDetailViewController+SE.swift"; sourceTree = ""; }; + 73E16776283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLSettingsAccountDetailViewController+OE.swift"; sourceTree = ""; }; + 73E16778283FD6C100B088DD /* NYPLSettingsAccountDetailViewController+Swift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NYPLSettingsAccountDetailViewController+Swift.h"; sourceTree = ""; }; 73E64E65252BB82600276953 /* NYPLWelcomeEULAViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NYPLWelcomeEULAViewController.swift; sourceTree = ""; }; 73E64E6B252BB89A00276953 /* eula.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = eula.html; sourceTree = ""; }; 73EB0B7525821DF4006BC997 /* SimplyE-noDRM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SimplyE-noDRM.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -2661,7 +2668,10 @@ 730FC04F25127FA2004D7C2D /* NYPLSettings+OE.swift */, 7347312825142FE200BE3D2C /* NYPLSettings+SE.swift */, E6202A001DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.h */, + 73E16778283FD6C100B088DD /* NYPLSettingsAccountDetailViewController+Swift.h */, E6202A011DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.m */, + 73E16776283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift */, + 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */, E6B1F4FA1DD20EA900D73CA1 /* NYPLSettingsAccountsListVC.swift */, D787E8431FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift */, 841B55411B740F2700FAC1AF /* NYPLSettingsEULAViewController.h */, @@ -4492,6 +4502,7 @@ 73AB364A27F3D7AA0067BAAC /* NYPLOAuthTokenRefresher.swift in Sources */, 739E60CC244A0D8600D00301 /* NYPLOPDSAcquisition.m in Sources */, 7354A437255C9CAC00B64E25 /* NYPLSignInBusinessLogic+SignOut.swift in Sources */, + 73E1676F283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */, 739E60CD244A0D8600D00301 /* NSURLRequest+NYPLURLRequestAdditions.m in Sources */, 739E60CE244A0D8600D00301 /* NYPLRootTabBarController.m in Sources */, 739E60CF244A0D8600D00301 /* ExtendedNavBarView.swift in Sources */, @@ -4736,6 +4747,7 @@ 73EB0AF725821DF4006BC997 /* NYPLOPDSAcquisition.m in Sources */, 73EB0AF825821DF4006BC997 /* NSURLRequest+NYPLURLRequestAdditions.m in Sources */, 7350A79A27178D400042FF3A /* NYPLMyBooksNotifier.swift in Sources */, + 73E16770283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */, 73EB0AF925821DF4006BC997 /* NYPLRootTabBarController.m in Sources */, 73EB0AFA25821DF4006BC997 /* ExtendedNavBarView.swift in Sources */, 73EB0AFB25821DF4006BC997 /* OPDS2Link.swift in Sources */, @@ -4945,6 +4957,7 @@ 73FCA30725005BA4001B0C5D /* ProblemReportEmail.swift in Sources */, 73FCA30825005BA4001B0C5D /* NYPLBookCellDelegate.m in Sources */, 73FCA30925005BA4001B0C5D /* NYPLBookDetailNormalView.m in Sources */, + 73E16777283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift in Sources */, 7380E706254B407D004613B1 /* NYPLR1R2UserSettings.swift in Sources */, 73FCA30B25005BA4001B0C5D /* NYPLCatalogUngroupedFeedViewController.m in Sources */, 73085E3A25030D80008F6244 /* OEMigrations.swift in Sources */, @@ -5245,6 +5258,7 @@ 73AB364927F3D7AA0067BAAC /* NYPLOAuthTokenRefresher.swift in Sources */, 739ECB2425101CCE00691A70 /* NSNotification+NYPL.swift in Sources */, 734B789125659611006FB8AD /* URLResponse+NYPLAuthentication.swift in Sources */, + 73E1676E283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */, 118A0B1B19915BDF00792DDE /* NYPLCatalogSearchViewController.m in Sources */, 737DCB8C245CCF2300A8F297 /* NYPLReaderBookmarksBusinessLogic.swift in Sources */, 735FED262427494900144C97 /* NYPLNetworkResponder.swift in Sources */, diff --git a/Simplified/AppInfrastructure/NYPLAppDelegate+OE.swift b/Simplified/AppInfrastructure/NYPLAppDelegate+OE.swift index 4c34bcd1a..cf8a7730d 100644 --- a/Simplified/AppInfrastructure/NYPLAppDelegate+OE.swift +++ b/Simplified/AppInfrastructure/NYPLAppDelegate+OE.swift @@ -11,7 +11,9 @@ import Foundation extension NYPLAppDelegate { @objc func setUpRootVC() { if NYPLSettings.shared.userHasAcceptedEULA { - if NYPLSettings.shared.userHasSeenWelcomeScreen { + if NYPLSettings.shared.userHasSeenWelcomeScreen, + NYPLUserAccount.sharedAccount().isSignedIn() + { window.rootViewController = NYPLRootTabBarController.shared() } else { window.rootViewController = OETutorialViewController() @@ -35,7 +37,7 @@ extension NYPLAppDelegate { } @objc func completeBecomingActive() { - if !NYPLUserAccount.sharedAccount().hasCredentials() + if !NYPLUserAccount.sharedAccount().isSignedIn() && NYPLSettings.shared.userHasSeenWelcomeScreen && !isSigningIn { diff --git a/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h b/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h index db64a288c..2e54868a6 100644 --- a/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h +++ b/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h @@ -39,6 +39,7 @@ #import "NYPLRootTabBarController.h" #import "NYPLSAMLHelper.h" #import "NYPLSettingsAccountDetailViewController.h" +#import "NYPLSettingsAccountDetailViewController+Swift.h" #import "NYPLXML.h" #import "UIFont+NYPLSystemFontOverride.h" #import "UIView+NYPLViewAdditions.h" diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController+OE.swift b/Simplified/Settings/NYPLSettingsAccountDetailViewController+OE.swift new file mode 100644 index 000000000..af17ae962 --- /dev/null +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController+OE.swift @@ -0,0 +1,15 @@ +// +// NYPLSettingsAccountDetailViewController+OE.swift +// Open eBooks +// +// Created by Ettore Pasquini on 5/26/22. +// Copyright © 2022 NYPL. All rights reserved. +// + +import UIKit + +extension NYPLSettingsAccountDetailViewController { + @objc func businessLogicDidFinishDeauthorizing(_ businessLogic: NYPLSignInBusinessLogic) { + (UIApplication.shared.delegate as? NYPLAppDelegate)?.setUpRootVC() + } +} diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController+SE.swift b/Simplified/Settings/NYPLSettingsAccountDetailViewController+SE.swift new file mode 100644 index 000000000..f99bc4f29 --- /dev/null +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController+SE.swift @@ -0,0 +1,16 @@ +// +// NYPLSettingsAccountDetailViewController+SE.swift +// Simplified +// +// Created by Ettore Pasquini on 5/26/22. +// Copyright © 2022 NYPL. All rights reserved. +// + +import Foundation + +extension NYPLSettingsAccountDetailViewController { + @objc func businessLogicDidFinishDeauthorizing(_ businessLogic: NYPLSignInBusinessLogic) { + removeActivityTitle() + setupTableData() + } +} diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController+Swift.h b/Simplified/Settings/NYPLSettingsAccountDetailViewController+Swift.h new file mode 100644 index 000000000..a857c5ff6 --- /dev/null +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController+Swift.h @@ -0,0 +1,21 @@ +// +// NYPLSettingsAccountDetailViewController+Swift.h +// Simplified +// +// Created by Ettore Pasquini on 5/26/22. +// Copyright © 2022 NYPL. All rights reserved. +// + +#import "NYPLSettingsAccountDetailViewController.h" + +/* + Class extension containing private methods for Swift extensions. + + Do not use in other contexts. + */ +@interface NYPLSettingsAccountDetailViewController () + +- (void)removeActivityTitle; +- (void)setupTableData; + +@end diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index bc2f99bf3..2cde08fea 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -1607,10 +1607,4 @@ - (void)businessLogicWillSignOut:(NYPLSignInBusinessLogic *)businessLogic #endif } -- (void)businessLogicDidFinishDeauthorizing:(NYPLSignInBusinessLogic *)businessLogic -{ - [self removeActivityTitle]; - [self setupTableData]; -} - @end diff --git a/Simplified/SignInLogic/NYPLAccountSignInViewController.m b/Simplified/SignInLogic/NYPLAccountSignInViewController.m index 7b47cc6d5..952786c18 100644 --- a/Simplified/SignInLogic/NYPLAccountSignInViewController.m +++ b/Simplified/SignInLogic/NYPLAccountSignInViewController.m @@ -1005,14 +1005,17 @@ - (void) businessLogic:(NYPLSignInBusinessLogic *)logic didEncounterSignOutError:(NSError *)error withHTTPStatusCode:(NSInteger)statusCode { + // nothing to do since the sign-in modal is never used to sign-out } - (void)businessLogicWillSignOut:(NYPLSignInBusinessLogic *)businessLogic { + // nothing to do since the sign-in modal is never used to sign-out } - (void)businessLogicDidFinishDeauthorizing:(NYPLSignInBusinessLogic *)businessLogic { + // nothing to do since the sign-in modal is never used to sign-out } @end diff --git a/Simplified/SignInLogic/NYPLSignInBusinessLogic+SignOut.swift b/Simplified/SignInLogic/NYPLSignInBusinessLogic+SignOut.swift index 5beaff053..f59c2e248 100644 --- a/Simplified/SignInLogic/NYPLSignInBusinessLogic+SignOut.swift +++ b/Simplified/SignInLogic/NYPLSignInBusinessLogic+SignOut.swift @@ -124,18 +124,7 @@ extension NYPLSignInBusinessLogic { didEncounterSignOutError: errorWithProblemDoc, withHTTPStatusCode: statusCode) } - #endif - - private func completeLogOutProcess() { - bookDownloadsRemover.reset(libraryAccountID) - bookRegistry.reset(libraryAccountID) - userAccount.removeAll() - networker.resetLibrarySpecificInfo() - selectedIDP = nil - uiDelegate?.businessLogicDidFinishDeauthorizing(self) - } - #if FEATURE_DRM_CONNECTOR private func deauthorizeDevice() { guard let licensor = userAccount.licensor else { Log.warn(#file, "No Licensor available to deauthorize device. Will remove user credentials anyway.") @@ -186,4 +175,13 @@ extension NYPLSignInBusinessLogic { } } #endif + + private func completeLogOutProcess() { + bookDownloadsRemover.reset(libraryAccountID) + bookRegistry.reset(libraryAccountID) + userAccount.removeAll() + networker.resetLibrarySpecificInfo() + selectedIDP = nil + uiDelegate?.businessLogicDidFinishDeauthorizing(self) + } } diff --git a/Simplified/WelcomeScreen/OETutorialChoiceViewController.swift b/Simplified/WelcomeScreen/OETutorialChoiceViewController.swift index e35f42d67..5fd8db88c 100644 --- a/Simplified/WelcomeScreen/OETutorialChoiceViewController.swift +++ b/Simplified/WelcomeScreen/OETutorialChoiceViewController.swift @@ -92,6 +92,7 @@ class OETutorialChoiceViewController : UIViewController { Log.error("", "Could not load app window") return } + Log.info(#function, "Installing main root VC") appWindow?.rootViewController = NYPLRootTabBarController.shared() } From a73b1146f6b4452ccec94801f994c4f5c25afb10 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Tue, 31 May 2022 15:13:31 -0700 Subject: [PATCH 06/24] OE-510 Revert moving delegate method to swift extension to fix warning --- Simplified.xcodeproj/project.pbxproj | 14 ------------- .../Accounts/Library/AccountsManager.swift | 2 +- .../SimplyE-Bridging-Header.h | 1 - ...ttingsAccountDetailViewController+OE.swift | 15 ------------- ...ttingsAccountDetailViewController+SE.swift | 16 -------------- ...ettingsAccountDetailViewController+Swift.h | 21 ------------------- .../NYPLSettingsAccountDetailViewController.m | 10 +++++++++ 7 files changed, 11 insertions(+), 68 deletions(-) delete mode 100644 Simplified/Settings/NYPLSettingsAccountDetailViewController+OE.swift delete mode 100644 Simplified/Settings/NYPLSettingsAccountDetailViewController+SE.swift delete mode 100644 Simplified/Settings/NYPLSettingsAccountDetailViewController+Swift.h diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index b25ca7355..e6da98639 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -980,10 +980,6 @@ 73DE897E260BEA13003D9135 /* NYPLRequestExecuting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73DE8979260BEA13003D9135 /* NYPLRequestExecuting.swift */; }; 73DEB54E2486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73DEB5462486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift */; }; 73DEB54F2486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73DEB5462486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift */; }; - 73E1676E283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */; }; - 73E1676F283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */; }; - 73E16770283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */; }; - 73E16777283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E16776283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift */; }; 73E64E6A252BB82600276953 /* NYPLWelcomeEULAViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E64E65252BB82600276953 /* NYPLWelcomeEULAViewController.swift */; }; 73E64E6C252BB89A00276953 /* eula.html in Resources */ = {isa = PBXBuildFile; fileRef = 73E64E6B252BB89A00276953 /* eula.html */; }; 73EB0A6525821DF4006BC997 /* NYPLLibraryDescriptionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0826CD2E24AA2801000F4030 /* NYPLLibraryDescriptionCell.swift */; }; @@ -2100,9 +2096,6 @@ 73DE53302525A386003E2C56 /* NYPLLibraryAccountURLsProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLLibraryAccountURLsProvider.swift; sourceTree = ""; }; 73DE8979260BEA13003D9135 /* NYPLRequestExecuting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLRequestExecuting.swift; sourceTree = ""; }; 73DEB5462486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NYPLBookmarkR2Location.swift; sourceTree = ""; }; - 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLSettingsAccountDetailViewController+SE.swift"; sourceTree = ""; }; - 73E16776283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLSettingsAccountDetailViewController+OE.swift"; sourceTree = ""; }; - 73E16778283FD6C100B088DD /* NYPLSettingsAccountDetailViewController+Swift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NYPLSettingsAccountDetailViewController+Swift.h"; sourceTree = ""; }; 73E64E65252BB82600276953 /* NYPLWelcomeEULAViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NYPLWelcomeEULAViewController.swift; sourceTree = ""; }; 73E64E6B252BB89A00276953 /* eula.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = eula.html; sourceTree = ""; }; 73EB0B7525821DF4006BC997 /* SimplyE-noDRM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SimplyE-noDRM.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -2668,10 +2661,7 @@ 730FC04F25127FA2004D7C2D /* NYPLSettings+OE.swift */, 7347312825142FE200BE3D2C /* NYPLSettings+SE.swift */, E6202A001DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.h */, - 73E16778283FD6C100B088DD /* NYPLSettingsAccountDetailViewController+Swift.h */, E6202A011DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.m */, - 73E16776283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift */, - 73E1676D283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift */, E6B1F4FA1DD20EA900D73CA1 /* NYPLSettingsAccountsListVC.swift */, D787E8431FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift */, 841B55411B740F2700FAC1AF /* NYPLSettingsEULAViewController.h */, @@ -4502,7 +4492,6 @@ 73AB364A27F3D7AA0067BAAC /* NYPLOAuthTokenRefresher.swift in Sources */, 739E60CC244A0D8600D00301 /* NYPLOPDSAcquisition.m in Sources */, 7354A437255C9CAC00B64E25 /* NYPLSignInBusinessLogic+SignOut.swift in Sources */, - 73E1676F283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */, 739E60CD244A0D8600D00301 /* NSURLRequest+NYPLURLRequestAdditions.m in Sources */, 739E60CE244A0D8600D00301 /* NYPLRootTabBarController.m in Sources */, 739E60CF244A0D8600D00301 /* ExtendedNavBarView.swift in Sources */, @@ -4747,7 +4736,6 @@ 73EB0AF725821DF4006BC997 /* NYPLOPDSAcquisition.m in Sources */, 73EB0AF825821DF4006BC997 /* NSURLRequest+NYPLURLRequestAdditions.m in Sources */, 7350A79A27178D400042FF3A /* NYPLMyBooksNotifier.swift in Sources */, - 73E16770283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */, 73EB0AF925821DF4006BC997 /* NYPLRootTabBarController.m in Sources */, 73EB0AFA25821DF4006BC997 /* ExtendedNavBarView.swift in Sources */, 73EB0AFB25821DF4006BC997 /* OPDS2Link.swift in Sources */, @@ -4957,7 +4945,6 @@ 73FCA30725005BA4001B0C5D /* ProblemReportEmail.swift in Sources */, 73FCA30825005BA4001B0C5D /* NYPLBookCellDelegate.m in Sources */, 73FCA30925005BA4001B0C5D /* NYPLBookDetailNormalView.m in Sources */, - 73E16777283FD58000B088DD /* NYPLSettingsAccountDetailViewController+OE.swift in Sources */, 7380E706254B407D004613B1 /* NYPLR1R2UserSettings.swift in Sources */, 73FCA30B25005BA4001B0C5D /* NYPLCatalogUngroupedFeedViewController.m in Sources */, 73085E3A25030D80008F6244 /* OEMigrations.swift in Sources */, @@ -5258,7 +5245,6 @@ 73AB364927F3D7AA0067BAAC /* NYPLOAuthTokenRefresher.swift in Sources */, 739ECB2425101CCE00691A70 /* NSNotification+NYPL.swift in Sources */, 734B789125659611006FB8AD /* URLResponse+NYPLAuthentication.swift in Sources */, - 73E1676E283FD4D300B088DD /* NYPLSettingsAccountDetailViewController+SE.swift in Sources */, 118A0B1B19915BDF00792DDE /* NYPLCatalogSearchViewController.m in Sources */, 737DCB8C245CCF2300A8F297 /* NYPLReaderBookmarksBusinessLogic.swift in Sources */, 735FED262427494900144C97 /* NYPLNetworkResponder.swift in Sources */, diff --git a/Simplified/Accounts/Library/AccountsManager.swift b/Simplified/Accounts/Library/AccountsManager.swift index 731eb3747..fa1032168 100644 --- a/Simplified/Accounts/Library/AccountsManager.swift +++ b/Simplified/Accounts/Library/AccountsManager.swift @@ -20,7 +20,7 @@ let currentAccountIdentifierKey = "NYPLCurrentAccountIdentifier" static let NYPLAccountUUIDs = [ "urn:uuid:065c0c11-0d0f-42a3-82e4-277b18786949", //NYPL proper "urn:uuid:edef2358-9f6a-4ce6-b64f-9b351ec68ac4", //Brooklyn - "urn:uuid:56906f26-2c9a-4ae9-bd02-552557720b99" //Simplified Instant Classics + "urn:uuid:56906f26-2c9a-4ae9-bd02-552557720b99" //Books for All ] let NYPLAccountUUID = AccountsManager.NYPLAccountUUIDs[0] diff --git a/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h b/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h index 2e54868a6..db64a288c 100644 --- a/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h +++ b/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h @@ -39,7 +39,6 @@ #import "NYPLRootTabBarController.h" #import "NYPLSAMLHelper.h" #import "NYPLSettingsAccountDetailViewController.h" -#import "NYPLSettingsAccountDetailViewController+Swift.h" #import "NYPLXML.h" #import "UIFont+NYPLSystemFontOverride.h" #import "UIView+NYPLViewAdditions.h" diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController+OE.swift b/Simplified/Settings/NYPLSettingsAccountDetailViewController+OE.swift deleted file mode 100644 index af17ae962..000000000 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController+OE.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// NYPLSettingsAccountDetailViewController+OE.swift -// Open eBooks -// -// Created by Ettore Pasquini on 5/26/22. -// Copyright © 2022 NYPL. All rights reserved. -// - -import UIKit - -extension NYPLSettingsAccountDetailViewController { - @objc func businessLogicDidFinishDeauthorizing(_ businessLogic: NYPLSignInBusinessLogic) { - (UIApplication.shared.delegate as? NYPLAppDelegate)?.setUpRootVC() - } -} diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController+SE.swift b/Simplified/Settings/NYPLSettingsAccountDetailViewController+SE.swift deleted file mode 100644 index f99bc4f29..000000000 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController+SE.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// NYPLSettingsAccountDetailViewController+SE.swift -// Simplified -// -// Created by Ettore Pasquini on 5/26/22. -// Copyright © 2022 NYPL. All rights reserved. -// - -import Foundation - -extension NYPLSettingsAccountDetailViewController { - @objc func businessLogicDidFinishDeauthorizing(_ businessLogic: NYPLSignInBusinessLogic) { - removeActivityTitle() - setupTableData() - } -} diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController+Swift.h b/Simplified/Settings/NYPLSettingsAccountDetailViewController+Swift.h deleted file mode 100644 index a857c5ff6..000000000 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController+Swift.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// NYPLSettingsAccountDetailViewController+Swift.h -// Simplified -// -// Created by Ettore Pasquini on 5/26/22. -// Copyright © 2022 NYPL. All rights reserved. -// - -#import "NYPLSettingsAccountDetailViewController.h" - -/* - Class extension containing private methods for Swift extensions. - - Do not use in other contexts. - */ -@interface NYPLSettingsAccountDetailViewController () - -- (void)removeActivityTitle; -- (void)setupTableData; - -@end diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index 2cde08fea..1037764b2 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -1607,4 +1607,14 @@ - (void)businessLogicWillSignOut:(NYPLSignInBusinessLogic *)businessLogic #endif } +- (void)businessLogicDidFinishDeauthorizing:(NYPLSignInBusinessLogic *)businessLogic +{ +#if OPENEBOOKS + [((NYPLAppDelegate*)UIApplication.sharedApplication.delegate) setUpRootVC]; +#else + [self removeActivityTitle]; + [self setupTableData]; +#endif +} + @end From 1d596dcb996037c363a1b8321750166303be4e3f Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Wed, 1 Jun 2022 09:38:41 -0700 Subject: [PATCH 07/24] OE-540 Re/Set Crashlytics UserID using current user's barcode Note that OAuth Client Credentials "hides" the current barcode if you try to read it from a NYPLCredential object: we have to use the `barcode` getter explicitly instead --- .../Accounts/User/NYPLUserAccount.swift | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/Simplified/Accounts/User/NYPLUserAccount.swift b/Simplified/Accounts/User/NYPLUserAccount.swift index 2d2631331..c3aba830f 100644 --- a/Simplified/Accounts/User/NYPLUserAccount.swift +++ b/Simplified/Accounts/User/NYPLUserAccount.swift @@ -164,18 +164,12 @@ private enum StorageKey: String { _credentials.write(newValue) - // make sure to set the barcode related to the current account (aka library) - // not the one we just signed in to, because we could have signed in into - // library A, but still browsing the catalog of library B. - if case let .barcodeAndPin(barcode: userBarcode, pin: _) = newValue { - NYPLErrorLogger.setUserID(userBarcode) - } + setCrashReportingUserID(barcode) notifyAccountDidChange() } } - /// At all times, this returns the current user account. /// /// - Important: Do not attempt to manually create an instance of @@ -189,7 +183,16 @@ private enum StorageKey: String { // document has been loaded. return sharedAccount(libraryUUID: AccountsManager.shared.currentAccountId) } - + + /// CHANGES the user account singleton to work as the user account for the + /// given library. + /// + /// This function is deprecated. + /// + /// - Important: This "getter" function has side effects. Avoid using it. + /// - Parameter libraryUUID: The UUID of the library. + /// - Returns: The shared NYPLUserAccount instance with its libraryUUID + /// changed to match the one provided in input. class func sharedAccount(libraryUUID: String?) -> NYPLUserAccount { shared.accountInfoLock.lock() defer { @@ -512,10 +515,20 @@ private enum StorageKey: String { _deviceID.write(id) notifyAccountDidChange() } - + + private func setCrashReportingUserID(_ userID: String?) { + // make sure to set the barcode related to the current account (aka library) + // not the one we just signed in to, because we could have signed in into + // library A, but still browsing the catalog of library B. + if libraryUUID == AccountsManager.shared.currentAccountId { + NYPLErrorLogger.setUserID(userID) + } + } + // MARK: - Remove func removeAll() { + setCrashReportingUserID(nil) keychainTransaction.perform { _adobeToken.write(nil) _patron.write(nil) From 236ba9bcfc9c4fe7a97cf6deff8a2150e5e0bd4d Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Fri, 3 Jun 2022 16:54:44 -0700 Subject: [PATCH 08/24] Rewrite NYPLConfiguration in swift --- Simplified.xcodeproj/project.pbxproj | 24 +++-- .../AppInfrastructure/NYPLAppDelegate.m | 1 - .../NYPLConfiguration+OE.swift | 4 +- .../AppInfrastructure/NYPLConfiguration.h | 39 -------- .../AppInfrastructure/NYPLConfiguration.m | 96 ------------------- .../AppInfrastructure/NYPLConfiguration.swift | 90 +++++++++++++++++ .../SimplyE-Bridging-Header.h | 1 - Simplified/Book/Models/NYPLBook.m | 1 - Simplified/Book/Models/NYPLBookRegistry.m | 1 - Simplified/Book/UI/NYPLBookButtonsView.m | 1 - Simplified/Book/UI/NYPLBookCell.m | 1 - .../UI/NYPLBookCellCollectionViewController.m | 1 - .../UI/NYPLBookDetailDownloadFailedView.m | 1 - .../Book/UI/NYPLBookDetailDownloadingView.m | 1 - Simplified/Book/UI/NYPLBookDetailNormalView.m | 1 - Simplified/Book/UI/NYPLBookDetailView.m | 2 - .../Book/UI/NYPLBookDownloadFailedCell.m | 1 - Simplified/Book/UI/NYPLBookDownloadingCell.m | 1 - Simplified/Book/UI/NYPLBookNormalCell.m | 1 - .../Catalog/NYPLCatalogFeedViewController.m | 1 - Simplified/Catalog/NYPLCatalogGroupedFeed.m | 1 - .../NYPLCatalogGroupedFeedViewController.m | 1 - Simplified/Catalog/NYPLCatalogLaneCell.m | 1 - .../Catalog/NYPLCatalogNavigationController.m | 1 - Simplified/Catalog/NYPLCatalogUngroupedFeed.m | 1 - .../NYPLCatalogUngroupedFeedViewController.m | 1 - Simplified/Holds/NYPLHoldsViewController.m | 1 - .../MyBooks/NYPLMyBooksViewController.m | 1 - Simplified/Network/NYPLRemoteViewController.m | 1 - .../Reader2/Bookmarks/NYPLAnnotations.swift | 2 +- .../BusinessLogic/NYPLR1R2UserSettings.swift | 4 +- .../NYPLReaderBookmarksBusinessLogic.swift | 2 +- .../BusinessLogic/NYPLReaderSettings.m | 2 - .../Reader2/UI/NYPLReaderPositionsVC.swift | 4 +- .../Reader2/UI/NYPLReaderSettingsView.swift | 18 ++-- .../NYPLSettingsAccountDetailViewController.m | 1 - .../Settings/NYPLSettingsEULAViewController.m | 1 - .../NYPLSettingsPrimaryTableViewController.m | 1 - .../NYPLAccountSignInViewController.m | 1 - .../UI/UIFont+NYPLSystemFontOverride.m | 2 +- 40 files changed, 119 insertions(+), 197 deletions(-) delete mode 100644 Simplified/AppInfrastructure/NYPLConfiguration.h delete mode 100644 Simplified/AppInfrastructure/NYPLConfiguration.m create mode 100644 Simplified/AppInfrastructure/NYPLConfiguration.swift diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index e6da98639..38711946e 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -76,7 +76,6 @@ 1164F106199AC236009BF8BF /* NYPLBookLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 1164F105199AC236009BF8BF /* NYPLBookLocation.m */; }; 116A5EAF194767B200491A21 /* NYPLMyBooksNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 116A5EAE194767B200491A21 /* NYPLMyBooksNavigationController.m */; }; 116A5EB3194767DC00491A21 /* NYPLMyBooksViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 116A5EB2194767DC00491A21 /* NYPLMyBooksViewController.m */; }; - 116A5EB91947B57500491A21 /* NYPLConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 116A5EB81947B57500491A21 /* NYPLConfiguration.m */; }; 1183F33B194B775900DC322F /* NYPLCatalogLaneCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1183F33A194B775900DC322F /* NYPLCatalogLaneCell.m */; }; 1183F341194F723D00DC322F /* NYPLCatalogLane.m in Sources */ = {isa = PBXBuildFile; fileRef = 1183F340194F723D00DC322F /* NYPLCatalogLane.m */; }; 1183F347194F744D00DC322F /* NYPLBook.m in Sources */ = {isa = PBXBuildFile; fileRef = 1183F346194F744D00DC322F /* NYPLBook.m */; }; @@ -636,6 +635,10 @@ 7392E4682788E7CB006F010E /* NYPLAudiobookToolkit in Frameworks */ = {isa = PBXBuildFile; productRef = 7392E4672788E7CB006F010E /* NYPLAudiobookToolkit */; }; 7392E46A2788E7CB006F010E /* NYPLCardCreator in Frameworks */ = {isa = PBXBuildFile; productRef = 7392E4692788E7CB006F010E /* NYPLCardCreator */; }; 7392E46C2788E7D8006F010E /* NYPLAxis in Frameworks */ = {isa = PBXBuildFile; productRef = 7392E46B2788E7D8006F010E /* NYPLAxis */; }; + 7398290E284AC94500382FE1 /* NYPLConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7398290D284AC94500382FE1 /* NYPLConfiguration.swift */; }; + 7398290F284AC94500382FE1 /* NYPLConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7398290D284AC94500382FE1 /* NYPLConfiguration.swift */; }; + 73982910284AC94500382FE1 /* NYPLConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7398290D284AC94500382FE1 /* NYPLConfiguration.swift */; }; + 73982911284AC94500382FE1 /* NYPLConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7398290D284AC94500382FE1 /* NYPLConfiguration.swift */; }; 739E6046244A0D8600D00301 /* NYPLCirculationAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = E66AE32F1DC0FCFC00124AE2 /* NYPLCirculationAnalytics.swift */; }; 739E6047244A0D8600D00301 /* NYPLBookState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 171966A824170819007BB87E /* NYPLBookState.swift */; }; 739E6049244A0D8600D00301 /* NYPLPlatformAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0345BFD61DBF002E00398B6F /* NYPLPlatformAPI.swift */; }; @@ -650,7 +653,6 @@ 739E6055244A0D8600D00301 /* NYPLUserSettingsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 734917D0242D77D800059AA5 /* NYPLUserSettingsVC.swift */; }; 739E6056244A0D8600D00301 /* NYPLJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 11369D47199527C200BB11F8 /* NYPLJSON.m */; }; 739E6057244A0D8600D00301 /* NYPLMainThreadChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7327A89223EE017300954748 /* NYPLMainThreadChecker.swift */; }; - 739E6058244A0D8600D00301 /* NYPLConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 116A5EB81947B57500491A21 /* NYPLConfiguration.m */; }; 739E6059244A0D8600D00301 /* NYPLAlertUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1B142922CC179F0006C964 /* NYPLAlertUtils.swift */; }; 739E605A244A0D8600D00301 /* OPDS2Publication.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51C1E0122861BBF003B49A5 /* OPDS2Publication.swift */; }; 739E605B244A0D8600D00301 /* String+MD5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD567AE22B95A30001F0C83 /* String+MD5.swift */; }; @@ -995,7 +997,6 @@ 73EB0A7225821DF4006BC997 /* NYPLAppDelegate+SE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 734731222514235900BE3D2C /* NYPLAppDelegate+SE.swift */; }; 73EB0A7325821DF4006BC997 /* NYPLJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 11369D47199527C200BB11F8 /* NYPLJSON.m */; }; 73EB0A7425821DF4006BC997 /* NYPLMainThreadChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7327A89223EE017300954748 /* NYPLMainThreadChecker.swift */; }; - 73EB0A7525821DF4006BC997 /* NYPLConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 116A5EB81947B57500491A21 /* NYPLConfiguration.m */; }; 73EB0A7625821DF4006BC997 /* NYPLAlertUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1B142922CC179F0006C964 /* NYPLAlertUtils.swift */; }; 73EB0A7725821DF4006BC997 /* OPDS2Publication.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51C1E0122861BBF003B49A5 /* OPDS2Publication.swift */; }; 73EB0A7825821DF4006BC997 /* String+MD5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD567AE22B95A30001F0C83 /* String+MD5.swift */; }; @@ -1239,7 +1240,6 @@ 73FCA2B625005BA4001B0C5D /* UILabel+NYPLAppearanceAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 081387561BC574DA003DEA6A /* UILabel+NYPLAppearanceAdditions.m */; }; 73FCA2B725005BA4001B0C5D /* NYPLJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 11369D47199527C200BB11F8 /* NYPLJSON.m */; }; 73FCA2B825005BA4001B0C5D /* NYPLMainThreadChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7327A89223EE017300954748 /* NYPLMainThreadChecker.swift */; }; - 73FCA2B925005BA4001B0C5D /* NYPLConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 116A5EB81947B57500491A21 /* NYPLConfiguration.m */; }; 73FCA2BA25005BA4001B0C5D /* NYPLAlertUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1B142922CC179F0006C964 /* NYPLAlertUtils.swift */; }; 73FCA2BB25005BA4001B0C5D /* OPDS2Publication.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51C1E0122861BBF003B49A5 /* OPDS2Publication.swift */; }; 73FCA2BC25005BA4001B0C5D /* String+MD5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD567AE22B95A30001F0C83 /* String+MD5.swift */; }; @@ -1726,8 +1726,6 @@ 116A5EAE194767B200491A21 /* NYPLMyBooksNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYPLMyBooksNavigationController.m; sourceTree = ""; }; 116A5EB1194767DC00491A21 /* NYPLMyBooksViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYPLMyBooksViewController.h; sourceTree = ""; }; 116A5EB2194767DC00491A21 /* NYPLMyBooksViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYPLMyBooksViewController.m; sourceTree = ""; }; - 116A5EB71947B57500491A21 /* NYPLConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYPLConfiguration.h; sourceTree = ""; }; - 116A5EB81947B57500491A21 /* NYPLConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYPLConfiguration.m; sourceTree = ""; }; 1183F339194B775900DC322F /* NYPLCatalogLaneCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYPLCatalogLaneCell.h; sourceTree = ""; }; 1183F33A194B775900DC322F /* NYPLCatalogLaneCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYPLCatalogLaneCell.m; sourceTree = ""; }; 1183F33F194F723D00DC322F /* NYPLCatalogLane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYPLCatalogLane.h; sourceTree = ""; }; @@ -2054,6 +2052,7 @@ 739062D125358CF900D0743D /* NYPLSignInBusinessLogicUIDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLSignInBusinessLogicUIDelegate.swift; sourceTree = ""; }; 7392E45D2788E685006F010E /* CardCreator-iOS */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "CardCreator-iOS"; sourceTree = ""; }; 7392E45E2788E6E9006F010E /* NYPLAudiobookToolkit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = NYPLAudiobookToolkit; sourceTree = ""; }; + 7398290D284AC94500382FE1 /* NYPLConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLConfiguration.swift; sourceTree = ""; }; 739E6157244A0F6D00D00301 /* R2Shared.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = R2Shared.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 739ECB2325101CCE00691A70 /* NSNotification+NYPL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSNotification+NYPL.swift"; sourceTree = ""; }; 739ECB282510207E00691A70 /* NYPLCatalogs+OE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLCatalogs+OE.swift"; sourceTree = ""; }; @@ -2751,8 +2750,8 @@ A93F9F9621CDACF700BD3B0C /* NYPLAppReviewPrompt.swift */, E6207B642118973800864143 /* NYPLAppTheme.swift */, E6F26E721DFF672F00C103CA /* NYPLBookContentMetadataFilesHelper.swift */, - 116A5EB71947B57500491A21 /* NYPLConfiguration.h */, - 116A5EB81947B57500491A21 /* NYPLConfiguration.m */, + 7398290D284AC94500382FE1 /* NYPLConfiguration.swift */, + 172F410926F3BAF70017476A /* NYPLConfiguration+Color.swift */, 738CB1FF2509A61E00891F31 /* NYPLConfiguration+OE.swift */, 738CB2052509A87700891F31 /* NYPLConfiguration+SE.swift */, 11548C091939136C009DBF2E /* NYPLRootTabBarController.h */, @@ -2762,7 +2761,6 @@ 730EDFFF251567820038DD9F /* NYPLLibraryNavigationController.h */, 730EE000251567820038DD9F /* NYPLLibraryNavigationController.m */, 52545184217A76FF00BBC1B4 /* NYPLUserNotifications.swift */, - 172F410926F3BAF70017476A /* NYPLConfiguration+Color.swift */, ); path = AppInfrastructure; sourceTree = ""; @@ -4312,6 +4310,7 @@ 739E6053244A0D8600D00301 /* NYPLBookRegistry.m in Sources */, 739E6054244A0D8600D00301 /* UILabel+NYPLAppearanceAdditions.m in Sources */, 73A172F427ADA6FA005E7BCF /* NYPLAxisDRMAuthorizer.swift in Sources */, + 7398290F284AC94500382FE1 /* NYPLConfiguration.swift in Sources */, 739E6055244A0D8600D00301 /* NYPLUserSettingsVC.swift in Sources */, 739E6056244A0D8600D00301 /* NYPLJSON.m in Sources */, 7327528D2578D68500A073E2 /* NYPLReauthenticator.swift in Sources */, @@ -4320,7 +4319,6 @@ 73B551082511748800D05B86 /* NYPLLoginCellTypes.swift in Sources */, 73F11E0D251941FD00FCD22B /* AudioBookVendorsHelper.swift in Sources */, 73A172FD27ADA6FA005E7BCF /* NYPLAxisContentProtection.swift in Sources */, - 739E6058244A0D8600D00301 /* NYPLConfiguration.m in Sources */, 7386C1F824525AFF004C78BD /* NYPLReaderTOCBusinessLogic.swift in Sources */, 172F410B26F3BAF70017476A /* NYPLConfiguration+Color.swift in Sources */, 739E6059244A0D8600D00301 /* NYPLAlertUtils.swift in Sources */, @@ -4570,6 +4568,7 @@ 73EB0A6925821DF4006BC997 /* NYPLPlatformAPI.swift in Sources */, 73EB0A6A25821DF4006BC997 /* NYPLAttributedString.m in Sources */, 73D8D27B25A68D4300DF5F69 /* NYPLRootTabBarController+R2.swift in Sources */, + 73982910284AC94500382FE1 /* NYPLConfiguration.swift in Sources */, 73EB0A6D25821DF4006BC997 /* NYPLBookContentTypeConverter.swift in Sources */, 73EB0A6E25821DF4006BC997 /* NYPLAgeCheck.swift in Sources */, 73EB0A6F25821DF4006BC997 /* Log.swift in Sources */, @@ -4579,7 +4578,6 @@ 73EB0A7325821DF4006BC997 /* NYPLJSON.m in Sources */, 73EB0A7425821DF4006BC997 /* NYPLMainThreadChecker.swift in Sources */, 2126FE3525C059700095C45C /* ReaderModule.swift in Sources */, - 73EB0A7525821DF4006BC997 /* NYPLConfiguration.m in Sources */, 73EB0A7625821DF4006BC997 /* NYPLAlertUtils.swift in Sources */, 73EB0A7725821DF4006BC997 /* OPDS2Publication.swift in Sources */, 73EB0A7825821DF4006BC997 /* String+MD5.swift in Sources */, @@ -4821,7 +4819,6 @@ 73FCA2B625005BA4001B0C5D /* UILabel+NYPLAppearanceAdditions.m in Sources */, 73FCA2B725005BA4001B0C5D /* NYPLJSON.m in Sources */, 73FCA2B825005BA4001B0C5D /* NYPLMainThreadChecker.swift in Sources */, - 73FCA2B925005BA4001B0C5D /* NYPLConfiguration.m in Sources */, 73225DED250B4B9100EF1877 /* NYPLRootTabBarController+OE.swift in Sources */, 734731262514236A00BE3D2C /* NYPLAppDelegate+OE.swift in Sources */, 597E272A268B537E00A3CD23 /* NYPLAxisDecompressionAdapter.swift in Sources */, @@ -4942,6 +4939,7 @@ 73FCA30525005BA4001B0C5D /* NYPLFacetView.m in Sources */, 73422119252FE4950053DA9E /* NYPLAccountSignInViewController+OESelectAuth.swift in Sources */, 1798538E255A4092009F94D9 /* NYPLBookLocation+Locator.swift in Sources */, + 73982911284AC94500382FE1 /* NYPLConfiguration.swift in Sources */, 73FCA30725005BA4001B0C5D /* ProblemReportEmail.swift in Sources */, 73FCA30825005BA4001B0C5D /* NYPLBookCellDelegate.m in Sources */, 73FCA30925005BA4001B0C5D /* NYPLBookDetailNormalView.m in Sources */, @@ -5065,13 +5063,13 @@ 11616E11196B0531003D60D9 /* NYPLBookRegistry.m in Sources */, 081387571BC574DA003DEA6A /* UILabel+NYPLAppearanceAdditions.m in Sources */, 73A172DE27ADA6F9005E7BCF /* NYPLAxisDRMAuthorizer.swift in Sources */, + 7398290E284AC94500382FE1 /* NYPLConfiguration.swift in Sources */, 734917D1242D77D800059AA5 /* NYPLUserSettingsVC.swift in Sources */, 21DDE31F25D2CEAF002CBCE3 /* AdobeDRMContainer.mm in Sources */, 734731232514235900BE3D2C /* NYPLAppDelegate+SE.swift in Sources */, 2146872D2559A64B007B401A /* LCPLibraryService.swift in Sources */, 11369D48199527C200BB11F8 /* NYPLJSON.m in Sources */, 7327A89323EE017300954748 /* NYPLMainThreadChecker.swift in Sources */, - 116A5EB91947B57500491A21 /* NYPLConfiguration.m in Sources */, 73A172E727ADA6F9005E7BCF /* NYPLAxisContentProtection.swift in Sources */, 5D1B142A22CC179F0006C964 /* NYPLAlertUtils.swift in Sources */, 7386C1F724525AFF004C78BD /* NYPLReaderTOCBusinessLogic.swift in Sources */, diff --git a/Simplified/AppInfrastructure/NYPLAppDelegate.m b/Simplified/AppInfrastructure/NYPLAppDelegate.m index 845e4b6f5..6019ead00 100644 --- a/Simplified/AppInfrastructure/NYPLAppDelegate.m +++ b/Simplified/AppInfrastructure/NYPLAppDelegate.m @@ -4,7 +4,6 @@ #import "SimplyE-Swift.h" -#import "NYPLConfiguration.h" #import "NYPLBookRegistry.h" #import "NYPLReachability.h" #import "NYPLReaderSettings.h" diff --git a/Simplified/AppInfrastructure/NYPLConfiguration+OE.swift b/Simplified/AppInfrastructure/NYPLConfiguration+OE.swift index 0dedef115..84b3aaf93 100644 --- a/Simplified/AppInfrastructure/NYPLConfiguration+OE.swift +++ b/Simplified/AppInfrastructure/NYPLConfiguration+OE.swift @@ -63,9 +63,9 @@ extension NYPLConfiguration { static func welcomeScreenFont() -> UIFont? { if UIDevice.current.userInterfaceIdiom == .phone { - return UIFont(name: NYPLConfiguration.systemFontFamilyName(), + return UIFont(name: NYPLConfiguration.systemFontFamilyName, size: 16.0) } - return UIFont(name: NYPLConfiguration.systemFontFamilyName(), size: 22.0) + return UIFont(name: NYPLConfiguration.systemFontFamilyName, size: 22.0) } } diff --git a/Simplified/AppInfrastructure/NYPLConfiguration.h b/Simplified/AppInfrastructure/NYPLConfiguration.h deleted file mode 100644 index 1e5e7484b..000000000 --- a/Simplified/AppInfrastructure/NYPLConfiguration.h +++ /dev/null @@ -1,39 +0,0 @@ -// This class does NOT provide configuration for the following files: -// credits.css - -@import UIKit; - -@interface NYPLConfiguration : NSObject - -+ (id)new NS_UNAVAILABLE; - -// This can be overriden by setting |customMainFeedURL| in NYPLSettings. -+ (NSURL *)mainFeedURL; - -+ (NSURL *)minimumVersionURL; - -+ (UIColor *)accentColor; - -+ (UIColor *)readerBackgroundColor; - -+ (UIColor *)readerBackgroundDarkColor; - -+ (UIColor *)readerBackgroundSepiaColor; - -+ (NSString *)systemFontName; - -+ (NSString *)systemFontFamilyName; - -+ (NSString *)boldSystemFontName; - -+ (UIColor *)backgroundMediaOverlayHighlightColor; - -+ (UIColor *)backgroundMediaOverlayHighlightDarkColor; - -+ (UIColor *)backgroundMediaOverlayHighlightSepiaColor; - -+ (CGFloat)defaultTOCRowHeight; - -+ (CGFloat)defaultBookmarkRowHeight; - -@end diff --git a/Simplified/AppInfrastructure/NYPLConfiguration.m b/Simplified/AppInfrastructure/NYPLConfiguration.m deleted file mode 100644 index 1dbbed5e9..000000000 --- a/Simplified/AppInfrastructure/NYPLConfiguration.m +++ /dev/null @@ -1,96 +0,0 @@ -#import "NYPLConfiguration.h" -#import "NYPLAppDelegate.h" - -#import "UILabel+NYPLAppearanceAdditions.h" -#import "UIButton+NYPLAppearanceAdditions.h" -#import "SimplyE-Swift.h" - -#if defined(FEATURE_DRM_CONNECTOR) -#import -#endif - -@implementation NYPLConfiguration - -+ (NSURL *)mainFeedURL -{ - NSURL *const customURL = [NYPLSettings sharedSettings].customMainFeedURL; - - if(customURL) return customURL; - - NSURL *const accountURL = [NYPLSettings sharedSettings].accountMainFeedURL; - return accountURL; -} - -+ (NSURL *)minimumVersionURL -{ - return [NSURL URLWithString:@"http://www.librarysimplified.org/simplye-client/minimum-version"]; -} - -+ (UIColor *)accentColor -{ - return [UIColor colorWithRed:0.0/255.0 green:144/255.0 blue:196/255.0 alpha:1.0]; -} - -+ (UIColor *)readerBackgroundColor -{ - return [UIColor colorWithWhite:250/255.0 alpha:1.0]; -} - -// OK to leave as static color because it's reader-only -+ (UIColor *)readerBackgroundDarkColor -{ - return [UIColor colorWithWhite:5/255.0 alpha:1.0]; -} - -// OK to leave as static color because it's reader-only -+ (UIColor *)readerBackgroundSepiaColor -{ - return [UIColor colorWithRed:250/255.0 green:244/255.0 blue:232/255.0 alpha:1.0]; -} - -// OK to leave as static color because it's reader-only -+ (UIColor *)backgroundMediaOverlayHighlightColor -{ - return [UIColor yellowColor]; -} - -// OK to leave as static color because it's reader-only -+ (UIColor *)backgroundMediaOverlayHighlightDarkColor -{ - return [UIColor orangeColor]; -} - -// OK to leave as static color because it's reader-only -+ (UIColor *)backgroundMediaOverlayHighlightSepiaColor -{ - return [UIColor yellowColor]; -} - -// Set for the whole app via UIView+NYPLFontAdditions. -+ (NSString *)systemFontName -{ - return @"AvenirNext-Medium"; -} - -// Set for the whole app via UIView+NYPLFontAdditions. -+ (NSString *)boldSystemFontName -{ - return @"AvenirNext-Bold"; -} - -+ (NSString *)systemFontFamilyName -{ - return @"Avenir Next"; -} - -+ (CGFloat)defaultTOCRowHeight -{ - return 56; -} - -+ (CGFloat)defaultBookmarkRowHeight -{ - return 100; -} - -@end diff --git a/Simplified/AppInfrastructure/NYPLConfiguration.swift b/Simplified/AppInfrastructure/NYPLConfiguration.swift new file mode 100644 index 000000000..4cb26abeb --- /dev/null +++ b/Simplified/AppInfrastructure/NYPLConfiguration.swift @@ -0,0 +1,90 @@ +// +// NYPLConfiguration.swift +// Simplified +// +// Created by Ettore Pasquini on 6/3/22. +// Copyright © 2022 NYPL. All rights reserved. +// + +import UIKit + +class NYPLConfiguration: NSObject { + private override init() { + super.init() + } + + // MARK: - Objects + + static var mainFeedURL: URL? { + if let customURL = NYPLSettings.shared.customMainFeedURL { + return customURL + } + + return NYPLSettings.shared.accountMainFeedURL + } + + // MARK: - Colors + + @objc static var accentColor: UIColor { + return UIColor(red: 0.0/255.0, green: 144/255.0, blue: 196/255.0, alpha:1.0) + } + + @objc static var readerBackgroundColor: UIColor { + return UIColor(white: 250/255.0, alpha:1.0) + } + + // OK to leave as static color because it's reader-only + @objc static var readerBackgroundDarkColor: UIColor { + return UIColor(white: 5/255.0, alpha:1.0) + } + + // OK to leave as static color because it's reader-only + @objc static var readerBackgroundSepiaColor: UIColor { + return UIColor(red: 250/255.0, green: 244/255.0, blue: 232/255.0, alpha: 1.0) + } + + // OK to leave as static color because it's reader-only + @objc static var backgroundMediaOverlayHighlightColor: UIColor { + return .yellow + } + + // OK to leave as static color because it's reader-only + @objc static var backgroundMediaOverlayHighlightDarkColor: UIColor { + return .orange + } + + // OK to leave as static color because it's reader-only + @objc static var backgroundMediaOverlayHighlightSepiaColor: UIColor { + return .yellow + } + + // MARK: - Fonts + + // Set for the whole app via UIView+NYPLFontAdditions. + @objc static var systemFontName: String { + return "AvenirNext-Medium" + } + + // Set for the whole app via UIView+NYPLFontAdditions. + static var boldSystemFontName: String { + return "AvenirNext-Bold" + } + + @objc static var systemFontFamilyName: String { + return "Avenir Next" + } + + //MARK: - Dimensions + + static var defaultTOCRowHeight: CGFloat { + return 56 + } + + static var defaultBookmarkRowHeight: CGFloat { + return 100 + } + + static var cornerRadius: CGFloat { + return 5 + } +} diff --git a/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h b/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h index db64a288c..fcb5b591f 100644 --- a/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h +++ b/Simplified/AppInfrastructure/SimplyE-Bridging-Header.h @@ -26,7 +26,6 @@ #import "NYPLCatalogFeedViewController.h" #import "NYPLCatalogNavigationController.h" #import "NYPLCatalogGroupedFeed.h" -#import "NYPLConfiguration.h" #import "NYPLFacetView.h" #import "NYPLHoldsNavigationController.h" #import "NYPLKeychain.h" diff --git a/Simplified/Book/Models/NYPLBook.m b/Simplified/Book/Models/NYPLBook.m index 3472664ba..811f82008 100644 --- a/Simplified/Book/Models/NYPLBook.m +++ b/Simplified/Book/Models/NYPLBook.m @@ -1,7 +1,6 @@ #import "NSDate+NYPLDateAdditions.h" #import "NYPLNull.h" #import "NYPLOPDS.h" -#import "NYPLConfiguration.h" #import "SimplyE-Swift.h" #import "NYPLBook.h" diff --git a/Simplified/Book/Models/NYPLBookRegistry.m b/Simplified/Book/Models/NYPLBookRegistry.m index 9921e6d92..99b7c79ab 100644 --- a/Simplified/Book/Models/NYPLBookRegistry.m +++ b/Simplified/Book/Models/NYPLBookRegistry.m @@ -3,7 +3,6 @@ #import "NYPLBook.h" #import "NYPLBookCoverRegistry.h" #import "NYPLBookRegistryRecord.h" -#import "NYPLConfiguration.h" #import "NYPLJSON.h" #import "NYPLOPDS.h" #import "NYPLMyBooksDownloadCenter.h" diff --git a/Simplified/Book/UI/NYPLBookButtonsView.m b/Simplified/Book/UI/NYPLBookButtonsView.m index 846a389fb..6d350d478 100644 --- a/Simplified/Book/UI/NYPLBookButtonsView.m +++ b/Simplified/Book/UI/NYPLBookButtonsView.m @@ -11,7 +11,6 @@ #import "NYPLBook.h" #import "NYPLBookRegistry.h" #import "NYPLBookButtonsView.h" -#import "NYPLConfiguration.h" #import "NYPLRootTabBarController.h" #import "NYPLOPDS.h" #import "SimplyE-Swift.h" diff --git a/Simplified/Book/UI/NYPLBookCell.m b/Simplified/Book/UI/NYPLBookCell.m index 44cde88ea..c380a0e54 100644 --- a/Simplified/Book/UI/NYPLBookCell.m +++ b/Simplified/Book/UI/NYPLBookCell.m @@ -4,7 +4,6 @@ #import "NYPLBookDownloadingCell.h" #import "NYPLBookNormalCell.h" #import "NYPLBookRegistry.h" -#import "NYPLConfiguration.h" #import "NYPLMyBooksDownloadCenter.h" #import "NYPLOPDS.h" #import "SimplyE-Swift.h" diff --git a/Simplified/Book/UI/NYPLBookCellCollectionViewController.m b/Simplified/Book/UI/NYPLBookCellCollectionViewController.m index 6db3adaa2..21676e7a1 100644 --- a/Simplified/Book/UI/NYPLBookCellCollectionViewController.m +++ b/Simplified/Book/UI/NYPLBookCellCollectionViewController.m @@ -2,7 +2,6 @@ #import "NYPLBookCell.h" #import "NYPLBookDownloadingCell.h" #import "NYPLBookRegistry.h" -#import "NYPLConfiguration.h" #import "NYPLMyBooksDownloadCenter.h" #import "UIView+NYPLViewAdditions.h" #import "NYPLBookCellCollectionViewController.h" diff --git a/Simplified/Book/UI/NYPLBookDetailDownloadFailedView.m b/Simplified/Book/UI/NYPLBookDetailDownloadFailedView.m index e53db799f..2838d83e6 100644 --- a/Simplified/Book/UI/NYPLBookDetailDownloadFailedView.m +++ b/Simplified/Book/UI/NYPLBookDetailDownloadFailedView.m @@ -1,7 +1,6 @@ @import PureLayout; #import "SimplyE-Swift.h" -#import "NYPLConfiguration.h" #import "NYPLLinearView.h" #import "UIView+NYPLViewAdditions.h" #import "UIFont+NYPLSystemFontOverride.h" diff --git a/Simplified/Book/UI/NYPLBookDetailDownloadingView.m b/Simplified/Book/UI/NYPLBookDetailDownloadingView.m index 3856a6f77..898e5e55b 100644 --- a/Simplified/Book/UI/NYPLBookDetailDownloadingView.m +++ b/Simplified/Book/UI/NYPLBookDetailDownloadingView.m @@ -1,7 +1,6 @@ @import PureLayout; #import "SimplyE-Swift.h" -#import "NYPLConfiguration.h" #import "NYPLMyBooksDownloadCenter.h" #import "UIView+NYPLViewAdditions.h" #import "NYPLLocalization.h" diff --git a/Simplified/Book/UI/NYPLBookDetailNormalView.m b/Simplified/Book/UI/NYPLBookDetailNormalView.m index 929d471ff..00882815f 100644 --- a/Simplified/Book/UI/NYPLBookDetailNormalView.m +++ b/Simplified/Book/UI/NYPLBookDetailNormalView.m @@ -2,7 +2,6 @@ #import "SimplyE-Swift.h" #import "NSDate+NYPLDateAdditions.h" -#import "NYPLConfiguration.h" #import "NYPLOPDS.h" #import "UIView+NYPLViewAdditions.h" #import "UIFont+NYPLSystemFontOverride.h" diff --git a/Simplified/Book/UI/NYPLBookDetailView.m b/Simplified/Book/UI/NYPLBookDetailView.m index ceacb8e6b..e5c77d0e4 100644 --- a/Simplified/Book/UI/NYPLBookDetailView.m +++ b/Simplified/Book/UI/NYPLBookDetailView.m @@ -11,9 +11,7 @@ #import "NYPLCatalogGroupedFeedViewController.h" #import "NYPLCatalogLaneCell.h" #import "NYPLCatalogUngroupedFeed.h" -#import "NYPLConfiguration.h" #import "NYPLBookDetailView.h" -#import "NYPLConfiguration.h" #import "NYPLRootTabBarController.h" #import "NYPLOPDSAcquisition.h" #import "NYPLOPDSFeed.h" diff --git a/Simplified/Book/UI/NYPLBookDownloadFailedCell.m b/Simplified/Book/UI/NYPLBookDownloadFailedCell.m index cb57a8534..316d5b4f6 100644 --- a/Simplified/Book/UI/NYPLBookDownloadFailedCell.m +++ b/Simplified/Book/UI/NYPLBookDownloadFailedCell.m @@ -1,6 +1,5 @@ #import "NYPLBook.h" #import "NYPLBookDownloadFailedCell.h" -#import "NYPLConfiguration.h" #import "UIView+NYPLViewAdditions.h" #import "SimplyE-Swift.h" diff --git a/Simplified/Book/UI/NYPLBookDownloadingCell.m b/Simplified/Book/UI/NYPLBookDownloadingCell.m index 10b16563d..0873753fb 100644 --- a/Simplified/Book/UI/NYPLBookDownloadingCell.m +++ b/Simplified/Book/UI/NYPLBookDownloadingCell.m @@ -1,5 +1,4 @@ #import "NYPLBook.h" -#import "NYPLConfiguration.h" #import "SimplyE-Swift.h" #import "UIView+NYPLViewAdditions.h" diff --git a/Simplified/Book/UI/NYPLBookNormalCell.m b/Simplified/Book/UI/NYPLBookNormalCell.m index 243e329f5..48fe672b4 100644 --- a/Simplified/Book/UI/NYPLBookNormalCell.m +++ b/Simplified/Book/UI/NYPLBookNormalCell.m @@ -2,7 +2,6 @@ #import "NYPLAttributedString.h" #import "NYPLBook.h" #import "NYPLBookRegistry.h" -#import "NYPLConfiguration.h" #import "NYPLBookButtonsView.h" #import "SimplyE-Swift.h" diff --git a/Simplified/Catalog/NYPLCatalogFeedViewController.m b/Simplified/Catalog/NYPLCatalogFeedViewController.m index 5934174a2..6f5e77a5c 100644 --- a/Simplified/Catalog/NYPLCatalogFeedViewController.m +++ b/Simplified/Catalog/NYPLCatalogFeedViewController.m @@ -2,7 +2,6 @@ #import "NYPLCatalogGroupedFeedViewController.h" #import "NYPLCatalogUngroupedFeed.h" #import "NYPLCatalogUngroupedFeedViewController.h" -#import "NYPLConfiguration.h" #import "NYPLOPDS.h" #import "NYPLXML.h" #import "SimplyE-Swift.h" diff --git a/Simplified/Catalog/NYPLCatalogGroupedFeed.m b/Simplified/Catalog/NYPLCatalogGroupedFeed.m index f73c75c60..9089d4b56 100644 --- a/Simplified/Catalog/NYPLCatalogGroupedFeed.m +++ b/Simplified/Catalog/NYPLCatalogGroupedFeed.m @@ -7,7 +7,6 @@ #import "NYPLOpenSearchDescription.h" #import "NYPLXML.h" -#import "NYPLConfiguration.h" #import "NYPLCatalogFacet.h" #import "SimplyE-Swift.h" diff --git a/Simplified/Catalog/NYPLCatalogGroupedFeedViewController.m b/Simplified/Catalog/NYPLCatalogGroupedFeedViewController.m index 3b91d3c2f..b91ff91c4 100644 --- a/Simplified/Catalog/NYPLCatalogGroupedFeedViewController.m +++ b/Simplified/Catalog/NYPLCatalogGroupedFeedViewController.m @@ -8,7 +8,6 @@ #import "NYPLCatalogLane.h" #import "NYPLCatalogLaneCell.h" #import "NYPLCatalogSearchViewController.h" -#import "NYPLConfiguration.h" #import "NYPLIndeterminateProgressView.h" #import "NYPLOpenSearchDescription.h" #import "NYPLXML.h" diff --git a/Simplified/Catalog/NYPLCatalogLaneCell.m b/Simplified/Catalog/NYPLCatalogLaneCell.m index 0c8ae3d00..fa4d82b6c 100644 --- a/Simplified/Catalog/NYPLCatalogLaneCell.m +++ b/Simplified/Catalog/NYPLCatalogLaneCell.m @@ -1,6 +1,5 @@ @import PureLayout; #import "NYPLBook.h" -#import "NYPLConfiguration.h" #import "SimplyE-Swift.h" #import "NYPLCatalogLaneCell.h" diff --git a/Simplified/Catalog/NYPLCatalogNavigationController.m b/Simplified/Catalog/NYPLCatalogNavigationController.m index d5a7c560e..cd25e1113 100644 --- a/Simplified/Catalog/NYPLCatalogNavigationController.m +++ b/Simplified/Catalog/NYPLCatalogNavigationController.m @@ -1,6 +1,5 @@ #import "SimplyE-Swift.h" #import "NYPLCatalogFeedViewController.h" -#import "NYPLConfiguration.h" #import "NYPLCatalogNavigationController.h" #import "NYPLAccountSignInViewController.h" #import "NYPLBookRegistry.h" diff --git a/Simplified/Catalog/NYPLCatalogUngroupedFeed.m b/Simplified/Catalog/NYPLCatalogUngroupedFeed.m index c705a88b4..02f180f93 100644 --- a/Simplified/Catalog/NYPLCatalogUngroupedFeed.m +++ b/Simplified/Catalog/NYPLCatalogUngroupedFeed.m @@ -5,7 +5,6 @@ #import "NYPLCatalogFacetGroup.h" #import "NYPLOPDS.h" #import "NYPLOpenSearchDescription.h" -#import "NYPLConfiguration.h" #import "SimplyE-Swift.h" #import "NYPLCatalogUngroupedFeed.h" diff --git a/Simplified/Catalog/NYPLCatalogUngroupedFeedViewController.m b/Simplified/Catalog/NYPLCatalogUngroupedFeedViewController.m index 46433954b..4c128ee6a 100644 --- a/Simplified/Catalog/NYPLCatalogUngroupedFeedViewController.m +++ b/Simplified/Catalog/NYPLCatalogUngroupedFeedViewController.m @@ -8,7 +8,6 @@ #import "NYPLCatalogFacetGroup.h" #import "NYPLCatalogFeedViewController.h" #import "NYPLCatalogSearchViewController.h" -#import "NYPLConfiguration.h" #import "NYPLFacetView.h" #import "NYPLOpenSearchDescription.h" #import "NYPLReloadView.h" diff --git a/Simplified/Holds/NYPLHoldsViewController.m b/Simplified/Holds/NYPLHoldsViewController.m index 332a4459c..a7c87cc98 100644 --- a/Simplified/Holds/NYPLHoldsViewController.m +++ b/Simplified/Holds/NYPLHoldsViewController.m @@ -5,7 +5,6 @@ #import "NYPLBookDetailViewController.h" #import "NYPLBookRegistry.h" #import "NYPLCatalogSearchViewController.h" -#import "NYPLConfiguration.h" #import "NYPLOpenSearchDescription.h" #import "NYPLOPDS.h" #import "UIView+NYPLViewAdditions.h" diff --git a/Simplified/MyBooks/NYPLMyBooksViewController.m b/Simplified/MyBooks/NYPLMyBooksViewController.m index be5ecc86a..53e193737 100644 --- a/Simplified/MyBooks/NYPLMyBooksViewController.m +++ b/Simplified/MyBooks/NYPLMyBooksViewController.m @@ -5,7 +5,6 @@ #import "NYPLBookDetailViewController.h" #import "NYPLBookRegistry.h" #import "NYPLCatalogSearchViewController.h" -#import "NYPLConfiguration.h" #import "NYPLFacetView.h" #import "NYPLOpenSearchDescription.h" #import "NYPLAccountSignInViewController.h" diff --git a/Simplified/Network/NYPLRemoteViewController.m b/Simplified/Network/NYPLRemoteViewController.m index da0873c10..b3fe4aef9 100644 --- a/Simplified/Network/NYPLRemoteViewController.m +++ b/Simplified/Network/NYPLRemoteViewController.m @@ -1,6 +1,5 @@ @import PureLayout; -#import "NYPLConfiguration.h" #import "NYPLReloadView.h" #import "NYPLRemoteViewController.h" diff --git a/Simplified/Reader2/Bookmarks/NYPLAnnotations.swift b/Simplified/Reader2/Bookmarks/NYPLAnnotations.swift index c2fd0bd70..556c52c7f 100644 --- a/Simplified/Reader2/Bookmarks/NYPLAnnotations.swift +++ b/Simplified/Reader2/Bookmarks/NYPLAnnotations.swift @@ -571,7 +571,7 @@ final class NYPLAnnotations: NSObject, NYPLAnnotationSyncing { } static var annotationsURL: URL? { - return NYPLConfiguration.mainFeedURL()?.appendingPathComponent("annotations/") + return NYPLConfiguration.mainFeedURL?.appendingPathComponent("annotations/") } class func makeSubmissionData(fromRepresentation dict: [String: Any]) -> Data? { diff --git a/Simplified/Reader2/BusinessLogic/NYPLR1R2UserSettings.swift b/Simplified/Reader2/BusinessLogic/NYPLR1R2UserSettings.swift index 2a85a0af7..5e1900dc5 100644 --- a/Simplified/Reader2/BusinessLogic/NYPLR1R2UserSettings.swift +++ b/Simplified/Reader2/BusinessLogic/NYPLR1R2UserSettings.swift @@ -42,10 +42,10 @@ class NYPLR1R2UserSettings: NSObject { switch appearance.toString() { case "readium-sepia-on": - backgroundColor = NYPLConfiguration.readerBackgroundSepiaColor() + backgroundColor = NYPLConfiguration.readerBackgroundSepiaColor textColor = UIColor.black case "readium-night-on": - backgroundColor = NYPLConfiguration.readerBackgroundDarkColor() + backgroundColor = NYPLConfiguration.readerBackgroundDarkColor textColor = UIColor.white default: backgroundColor = UIColor.white diff --git a/Simplified/Reader2/BusinessLogic/NYPLReaderBookmarksBusinessLogic.swift b/Simplified/Reader2/BusinessLogic/NYPLReaderBookmarksBusinessLogic.swift index ea293ec2e..f39c6d9ec 100644 --- a/Simplified/Reader2/BusinessLogic/NYPLReaderBookmarksBusinessLogic.swift +++ b/Simplified/Reader2/BusinessLogic/NYPLReaderBookmarksBusinessLogic.swift @@ -185,7 +185,7 @@ class NYPLReaderBookmarksBusinessLogic: NSObject { } func syncBookmarks(completion: @escaping (Bool, [NYPLReadiumBookmark]) -> ()) { - NYPLReachability.shared()?.reachability(for: NYPLConfiguration.mainFeedURL(), + NYPLReachability.shared()?.reachability(for: NYPLConfiguration.mainFeedURL, timeoutInternal: 8.0, handler: { (reachable) in guard reachable else { diff --git a/Simplified/Reader2/BusinessLogic/NYPLReaderSettings.m b/Simplified/Reader2/BusinessLogic/NYPLReaderSettings.m index 61923f18b..989b98635 100644 --- a/Simplified/Reader2/BusinessLogic/NYPLReaderSettings.m +++ b/Simplified/Reader2/BusinessLogic/NYPLReaderSettings.m @@ -1,7 +1,5 @@ -#import "NYPLConfiguration.h" #import "NYPLJSON.h" #import "UIColor+NYPLColorAdditions.h" - #import "NYPLReaderSettings.h" #import "SimplyE-Swift.h" diff --git a/Simplified/Reader2/UI/NYPLReaderPositionsVC.swift b/Simplified/Reader2/UI/NYPLReaderPositionsVC.swift index d21f999f0..094808df7 100644 --- a/Simplified/Reader2/UI/NYPLReaderPositionsVC.swift +++ b/Simplified/Reader2/UI/NYPLReaderPositionsVC.swift @@ -166,9 +166,9 @@ class NYPLReaderPositionsVC: UIViewController, UITableViewDataSource, UITableVie estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { switch currentTab { case .toc: - return NYPLConfiguration.defaultTOCRowHeight() + return NYPLConfiguration.defaultTOCRowHeight case .bookmarks: - return NYPLConfiguration.defaultBookmarkRowHeight() + return NYPLConfiguration.defaultBookmarkRowHeight } } diff --git a/Simplified/Reader2/UI/NYPLReaderSettingsView.swift b/Simplified/Reader2/UI/NYPLReaderSettingsView.swift index 58d142ce9..d38a6180d 100644 --- a/Simplified/Reader2/UI/NYPLReaderSettingsView.swift +++ b/Simplified/Reader2/UI/NYPLReaderSettingsView.swift @@ -156,21 +156,21 @@ class NYPLReaderSettingsView: UIView { blackOnSepiaButton.isEnabled = false blackOnWhiteButton.isEnabled = true whiteOnBlackButton.isEnabled = true - backgroundColor = NYPLConfiguration.readerBackgroundSepiaColor() + backgroundColor = NYPLConfiguration.readerBackgroundSepiaColor foregroundColor = .black break case .blackOnWhite: blackOnSepiaButton.isEnabled = true blackOnWhiteButton.isEnabled = false whiteOnBlackButton.isEnabled = true - backgroundColor = NYPLConfiguration.readerBackgroundColor() + backgroundColor = NYPLConfiguration.readerBackgroundColor foregroundColor = .black break case .whiteOnBlack: blackOnSepiaButton.isEnabled = true blackOnWhiteButton.isEnabled = true whiteOnBlackButton.isEnabled = false - backgroundColor = NYPLConfiguration.readerBackgroundDarkColor() + backgroundColor = NYPLConfiguration.readerBackgroundDarkColor foregroundColor = .white break } @@ -276,13 +276,13 @@ class NYPLReaderSettingsView: UIView { switch colorScheme { case .blackOnSepia: - selectedFontBottomBorder.backgroundColor = NYPLConfiguration.readerBackgroundSepiaColor() + selectedFontBottomBorder.backgroundColor = NYPLConfiguration.readerBackgroundSepiaColor break case .blackOnWhite: - selectedFontBottomBorder.backgroundColor = NYPLConfiguration.readerBackgroundColor() + selectedFontBottomBorder.backgroundColor = NYPLConfiguration.readerBackgroundColor break case .whiteOnBlack: - selectedFontBottomBorder.backgroundColor = NYPLConfiguration.readerBackgroundDarkColor() + selectedFontBottomBorder.backgroundColor = NYPLConfiguration.readerBackgroundDarkColor break } @@ -585,7 +585,7 @@ class NYPLReaderSettingsView: UIView { NSAttributedString.Key.foregroundColor: UIColor.black], disabledStateAttributes: [NSAttributedString.Key.underlineStyle: 1, NSAttributedString.Key.foregroundColor: NYPLConfiguration.mainColor()]) - button.backgroundColor = NYPLConfiguration.readerBackgroundSepiaColor() + button.backgroundColor = NYPLConfiguration.readerBackgroundSepiaColor button.accessibilityLabel = NSLocalizedString("BlackOnSepiaText", comment: "Accessible label for the color scheme") button.addTarget(self, action: #selector(didSelectBlackOnSepia), for: .touchUpInside) return button @@ -600,7 +600,7 @@ class NYPLReaderSettingsView: UIView { NSAttributedString.Key.foregroundColor: UIColor.black], disabledStateAttributes: [NSAttributedString.Key.underlineStyle: 1, NSAttributedString.Key.foregroundColor: NYPLConfiguration.mainColor()]) - button.backgroundColor = NYPLConfiguration.readerBackgroundColor() + button.backgroundColor = NYPLConfiguration.readerBackgroundColor button.accessibilityLabel = NSLocalizedString("BlackOnWhiteText", comment: "Accessible label for the color scheme") button.addTarget(self, action: #selector(didSelectBlackOnWhite), for: .touchUpInside) return button @@ -615,7 +615,7 @@ class NYPLReaderSettingsView: UIView { NSAttributedString.Key.foregroundColor: UIColor.white], disabledStateAttributes: [NSAttributedString.Key.underlineStyle: 1, NSAttributedString.Key.foregroundColor: UIColor.white]) - button.backgroundColor = NYPLConfiguration.readerBackgroundDarkColor() + button.backgroundColor = NYPLConfiguration.readerBackgroundDarkColor button.accessibilityLabel = NSLocalizedString("WhiteOnBlackText", comment: "Accessible label for the color scheme") button.addTarget(self, action: #selector(didSelectWhiteOnBlack), for: .touchUpInside) return button diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index 1037764b2..b6ff39aaf 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -5,7 +5,6 @@ #import "NYPLBookCoverRegistry.h" #import "NYPLBookRegistry.h" #import "NYPLCatalogNavigationController.h" -#import "NYPLConfiguration.h" #import "NYPLLinearView.h" #import "NYPLMyBooksDownloadCenter.h" #import "NYPLOPDS.h" diff --git a/Simplified/Settings/NYPLSettingsEULAViewController.m b/Simplified/Settings/NYPLSettingsEULAViewController.m index 210ce7fbc..632d77189 100644 --- a/Simplified/Settings/NYPLSettingsEULAViewController.m +++ b/Simplified/Settings/NYPLSettingsEULAViewController.m @@ -1,7 +1,6 @@ @import WebKit; #import "SimplyE-Swift.h" -#import "NYPLConfiguration.h" #import "NYPLSettingsEULAViewController.h" @interface NYPLSettingsEULAViewController () diff --git a/Simplified/Settings/NYPLSettingsPrimaryTableViewController.m b/Simplified/Settings/NYPLSettingsPrimaryTableViewController.m index aa0e77a66..5ed646a80 100644 --- a/Simplified/Settings/NYPLSettingsPrimaryTableViewController.m +++ b/Simplified/Settings/NYPLSettingsPrimaryTableViewController.m @@ -1,4 +1,3 @@ -#import "NYPLConfiguration.h" #import "SimplyE-Swift.h" #import "NYPLSettingsPrimaryTableViewController.h" diff --git a/Simplified/SignInLogic/NYPLAccountSignInViewController.m b/Simplified/SignInLogic/NYPLAccountSignInViewController.m index 952786c18..6b52865b5 100644 --- a/Simplified/SignInLogic/NYPLAccountSignInViewController.m +++ b/Simplified/SignInLogic/NYPLAccountSignInViewController.m @@ -7,7 +7,6 @@ #import "NYPLAppDelegate.h" #import "NYPLBookCoverRegistry.h" #import "NYPLBookRegistry.h" -#import "NYPLConfiguration.h" #import "NYPLLinearView.h" #import "NYPLOPDSFeed.h" #import "NYPLReachability.h" diff --git a/Simplified/Utilities/UI/UIFont+NYPLSystemFontOverride.m b/Simplified/Utilities/UI/UIFont+NYPLSystemFontOverride.m index e4d4f4625..72c6b6e50 100644 --- a/Simplified/Utilities/UI/UIFont+NYPLSystemFontOverride.m +++ b/Simplified/Utilities/UI/UIFont+NYPLSystemFontOverride.m @@ -1,5 +1,5 @@ -#import "NYPLConfiguration.h" #import "UIFont+NYPLSystemFontOverride.h" +#import "SimplyE-Swift.h" @implementation UIFont (NYPLSystemFontOverride) From 775d977a5cbcde4363f111dc6ee9daecf4042579 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Fri, 3 Jun 2022 17:01:50 -0700 Subject: [PATCH 09/24] Uniform corner radius --- Simplified/Reader2/UI/NYPLReaderTOCCell.swift | 2 +- Simplified/Views/NYPLRoundedButton.swift | 2 +- Simplified/WelcomeScreen/NYPLWelcomeScreenViewController.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Simplified/Reader2/UI/NYPLReaderTOCCell.swift b/Simplified/Reader2/UI/NYPLReaderTOCCell.swift index 3cc6656f2..af7ce24f9 100644 --- a/Simplified/Reader2/UI/NYPLReaderTOCCell.swift +++ b/Simplified/Reader2/UI/NYPLReaderTOCCell.swift @@ -31,7 +31,7 @@ import UIKit background?.layer.borderColor = NYPLConfiguration.mainColor().cgColor background?.layer.borderWidth = 1 - background?.layer.cornerRadius = 3 + background?.layer.cornerRadius = NYPLConfiguration.cornerRadius backgroundColor = .clear background.isHidden = !isForCurrentChapter diff --git a/Simplified/Views/NYPLRoundedButton.swift b/Simplified/Views/NYPLRoundedButton.swift index a23765a07..6493e375c 100644 --- a/Simplified/Views/NYPLRoundedButton.swift +++ b/Simplified/Views/NYPLRoundedButton.swift @@ -69,7 +69,7 @@ private let NYPLRoundedButtonPadding: CGFloat = 6.0 titleLabel?.font = UIFont.systemFont(ofSize: 14) layer.borderColor = tintColor.cgColor layer.borderWidth = 1 - layer.cornerRadius = 3 + layer.cornerRadius = NYPLConfiguration.cornerRadius label.textColor = self.tintColor label.font = UIFont.systemFont(ofSize: 9) diff --git a/Simplified/WelcomeScreen/NYPLWelcomeScreenViewController.swift b/Simplified/WelcomeScreen/NYPLWelcomeScreenViewController.swift index 267b8dae5..51407d0ae 100644 --- a/Simplified/WelcomeScreen/NYPLWelcomeScreenViewController.swift +++ b/Simplified/WelcomeScreen/NYPLWelcomeScreenViewController.swift @@ -133,7 +133,7 @@ import PureLayout button.setTitleColor(NYPLConfiguration.iconLogoBlueColor(), for: .normal) button.layer.borderColor = NYPLConfiguration.iconLogoGreenColor().cgColor button.layer.borderWidth = 2 - button.layer.cornerRadius = 6 + button.layer.cornerRadius = NYPLConfiguration.cornerRadius button.contentEdgeInsets = UIEdgeInsets.init(top: 8.0, left: 10.0, bottom: 8.0, right: 10.0) button.addTarget(self, action: buttonTargetSelector, for: .touchUpInside) From 623749ef6f5848710999dd619e66f7907dfefd4e Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Mon, 6 Jun 2022 09:36:59 -0700 Subject: [PATCH 10/24] OE-510 Bump OE version to 2.5.0 --- Simplified.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index 38711946e..cf4a54973 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5715,7 +5715,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 0; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -5731,7 +5731,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.4.0; + MARKETING_VERSION = 2.5.0; PRODUCT_BUNDLE_IDENTIFIER = org.nypl.labs.OpenEbooks; PRODUCT_MODULE_NAME = SimplyE; PROVISIONING_PROFILE = "2e185b6c-271e-4b02-a05e-860b8c3831f6"; @@ -5763,7 +5763,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 0; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -5779,7 +5779,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.4.0; + MARKETING_VERSION = 2.5.0; PRODUCT_BUNDLE_IDENTIFIER = org.nypl.labs.OpenEbooks; PRODUCT_MODULE_NAME = SimplyE; PROVISIONING_PROFILE = "b3d9154d-70e1-48d6-a0c5-869431277a5c"; From 25b3cfd554b2c2777879713f72348305e85f1a5b Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Mon, 6 Jun 2022 13:09:54 -0700 Subject: [PATCH 11/24] Implement delete server data view controller --- Simplified.xcodeproj/project.pbxproj | 12 ++ .../NYPLSettingsAccountDetailViewController.m | 115 +++++++++---- ...ttingsDeleteServerDataViewController.swift | 152 ++++++++++++++++++ ...tivityIndicatorMessageViewController.swift | 113 +++++++++++++ Simplified/en.lproj/Localizable.strings | 11 +- .../ArrowRight.imageset/ArrowRight.svg | 3 + .../ArrowRight.imageset/Contents.json | 21 +++ 7 files changed, 396 insertions(+), 31 deletions(-) create mode 100644 Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift create mode 100644 Simplified/Utilities/UI/NYPLActivityIndicatorMessageViewController.swift create mode 100644 SimplyE/Images.xcassets/ArrowRight.imageset/ArrowRight.svg create mode 100644 SimplyE/Images.xcassets/ArrowRight.imageset/Contents.json diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index cf4a54973..9107cd3cd 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -118,6 +118,10 @@ 172F410D26F3BAF70017476A /* NYPLConfiguration+Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = 172F410926F3BAF70017476A /* NYPLConfiguration+Color.swift */; }; 172F41A626FD0A8D0017476A /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 172F40F926F0A0170017476A /* Colors.xcassets */; }; 173F0823241AAA4E00A64658 /* NYPLBookStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 173F0822241AAA4E00A64658 /* NYPLBookStateTests.swift */; }; + 1747331C284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */; }; + 1747331D284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */; }; + 1747331E284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */; }; + 1747332C284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */; }; 17536B9E26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; 17536B9F26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; 17536BA026A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; @@ -1786,6 +1790,8 @@ 172F40F926F0A0170017476A /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = ""; }; 172F410926F3BAF70017476A /* NYPLConfiguration+Color.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLConfiguration+Color.swift"; sourceTree = ""; }; 173F0822241AAA4E00A64658 /* NYPLBookStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLBookStateTests.swift; sourceTree = ""; }; + 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLSettingsDeleteServerDataViewController.swift; sourceTree = ""; }; + 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLActivityIndicatorMessageViewController.swift; sourceTree = ""; }; 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLBookDetailView+Accessibility.swift"; sourceTree = ""; }; 175E480724EF36520066A6CF /* NYPLAnnouncementBusinessLogic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLAnnouncementBusinessLogic.swift; sourceTree = ""; }; 17631AEC25E488CD006079C4 /* NYPLAgeCheckViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLAgeCheckViewController.swift; sourceTree = ""; }; @@ -2675,6 +2681,7 @@ 111E75791A80165C00718AD7 /* NYPLSettingsSplitViewController.m */, 73085E252502EDF0008F6244 /* NYPLSettingsSplitViewController.swift */, 7353940B250854A90043C800 /* NYPLSettingsSplitViewController+OE.swift */, + 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */, ); path = Settings; sourceTree = ""; @@ -3195,6 +3202,7 @@ 081387561BC574DA003DEA6A /* UILabel+NYPLAppearanceAdditions.m */, 1107835C19816E3D0071AB1E /* UIView+NYPLViewAdditions.h */, 1107835D19816E3D0071AB1E /* UIView+NYPLViewAdditions.m */, + 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */, ); path = UI; sourceTree = ""; @@ -4331,6 +4339,7 @@ 73A172F627ADA6FA005E7BCF /* NYPLAxisXMLRepresentation.swift in Sources */, 5916E7D5262791B20021CD67 /* NYPLSignInBusinessLogic+Adept.swift in Sources */, 73A172FC27ADA6FA005E7BCF /* NYPLAxisProtectedAssetHandler.swift in Sources */, + 1747331D284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */, 73B5510D2511750A00D05B86 /* NYPLSamlIDPCell.swift in Sources */, 73A172FA27ADA6FA005E7BCF /* NYPLAxisErrorLogsAdapter.swift in Sources */, 739E605F244A0D8600D00301 /* NYPLXML.m in Sources */, @@ -4569,6 +4578,7 @@ 73EB0A6A25821DF4006BC997 /* NYPLAttributedString.m in Sources */, 73D8D27B25A68D4300DF5F69 /* NYPLRootTabBarController+R2.swift in Sources */, 73982910284AC94500382FE1 /* NYPLConfiguration.swift in Sources */, + 1747331E284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */, 73EB0A6D25821DF4006BC997 /* NYPLBookContentTypeConverter.swift in Sources */, 73EB0A6E25821DF4006BC997 /* NYPLAgeCheck.swift in Sources */, 73EB0A6F25821DF4006BC997 /* Log.swift in Sources */, @@ -5084,6 +5094,7 @@ 73A172E027ADA6F9005E7BCF /* NYPLAxisXMLRepresentation.swift in Sources */, 5916E7D4262791B20021CD67 /* NYPLSignInBusinessLogic+Adept.swift in Sources */, 73A172E627ADA6F9005E7BCF /* NYPLAxisProtectedAssetHandler.swift in Sources */, + 1747331C284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */, 111559ED19B8FA590003BE94 /* NYPLXML.m in Sources */, 73A172E427ADA6F9005E7BCF /* NYPLAxisErrorLogsAdapter.swift in Sources */, 731A5B1224621F2B00B5E663 /* NYPLSignInBusinessLogic.swift in Sources */, @@ -5253,6 +5264,7 @@ 73A229A2240F3BEB006B9EAD /* LibraryService.swift in Sources */, 730B7868249AB9D7008F28B3 /* Float+NYPLAdditions.swift in Sources */, AE77E9B832371587493FF281 /* NYPLOPDSEntry.m in Sources */, + 1747332C284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */, 733DEC92241090C7008C74BC /* NYPLRootTabBarController+R2.swift in Sources */, 7369A39C264AF9700029D8AB /* NYPLAdobeContentProtectionService.swift in Sources */, 113DB8A719C24E54004E1154 /* NYPLIndeterminateProgressView.m in Sources */, diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index b6ff39aaf..7bfe232ea 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -21,7 +21,7 @@ #endif typedef NS_ENUM(NSInteger, CellKind) { - CellKindAdvancedSettings, + CellKindDeleteServerData, CellKindAgeCheck, CellKindBarcodeImage, CellKindBarcode, @@ -36,7 +36,7 @@ typedef NS_ENUM(NSInteger, CellKind) { CellReportIssue }; -@interface NYPLSettingsAccountDetailViewController () +@interface NYPLSettingsAccountDetailViewController () // view state @property (nonatomic) BOOL loggingInAfterBarcodeScan; @@ -60,6 +60,7 @@ @interface NYPLSettingsAccountDetailViewController () NSMutableAttributedString { + let attributedString = NSMutableAttributedString(string: + """ + SimplyE does not create any accounts outside of your library card. The content that the SimplyE app saves is: + + * your library card information to log into your library + * your last known place in the book you’re reading or listening to + * and any bookmarks or highlights you’ve created for your current book + + Your account information is saved outside of your current device if you specifically permit us to save it. If you only want your bookmarks and reading location deleted, please go to Settings/Accounts/The New York Public Library. Set the “Sync Bookmarks” toggle to OFF, then come back to this page and tap “Delete Reading Data”. Then you can log out, and SimplyE will no longer save any of your information. + """ + ) + + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineSpacing = 1.25 + paragraphStyle.lineHeightMultiple = 1.25 + attributedString.addAttribute(NSAttributedString.Key.paragraphStyle, + value:paragraphStyle, + range:NSMakeRange(0, attributedString.length)) + + return attributedString + } +} diff --git a/Simplified/Utilities/UI/NYPLActivityIndicatorMessageViewController.swift b/Simplified/Utilities/UI/NYPLActivityIndicatorMessageViewController.swift new file mode 100644 index 000000000..f41b24969 --- /dev/null +++ b/Simplified/Utilities/UI/NYPLActivityIndicatorMessageViewController.swift @@ -0,0 +1,113 @@ +// +// NYPLActivityIndicatorMessageViewController.swift +// SimplyE +// +// Created by Ernest Fan on 2022-06-06. +// Copyright © 2022 NYPL. All rights reserved. +// + +import UIKit + +/// Display an activity indicator with a message in the center of the screen, +/// with a dimmed transparent background. +class NYPLActivityIndicatorMessageViewController: UIViewController { + private let spacing: CGFloat = 20.0 + + // MARK: - Life Cycle + + init(with message: String) { + super.init(nibName: nil, bundle: nil) + + self.textLabel.text = message + self.modalPresentationStyle = .overFullScreen + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupUI() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + activityIndicator.startAnimating() + } + + // MARK: - Setup + + func setupUI() { + // Transparent background + if #available(iOS 12.0, *), + UIScreen.main.traitCollection.userInterfaceStyle == .dark { + self.view.backgroundColor = UIColor(white: 0.2, alpha: 0.7) + } else { + self.view.backgroundColor = UIColor(white: 0, alpha: 0.7) + } + + // Background of the activity indicator and text + let backgroundView = UIView() + backgroundView.backgroundColor = NYPLConfiguration.primaryBackgroundColor + backgroundView.layer.cornerRadius = NYPLConfiguration.cornerRadius + backgroundView.clipsToBounds = true + + backgroundView.addSubview(activityIndicator) + activityIndicator.autoPinEdgesToSuperviewEdges(with: .init(top: spacing, + left: spacing, + bottom: spacing, + right: spacing), + excludingEdge: .trailing) + + backgroundView.addSubview(textLabel) + textLabel.autoPinEdgesToSuperviewEdges(with: .init(top: spacing, + left: spacing, + bottom: spacing, + right: spacing), + excludingEdge: .leading) + + textLabel.autoPinEdge(.leading, to: .trailing, of: activityIndicator, withOffset: spacing) + + /// The length of the message determines the view size when displaying the message, + /// a longer message needs a taller and wider size and a shorter message needs a smaller size + /// that hugs the content, without stretching all the way to the side of the screen. + /// Since `backgroundView.intrinsicContentSize` does not give the right size, + /// we use the calculated expanded size (within the limit of the screen size) and + /// the compressed size to find out the best size to fit the message. + let expandedSize = backgroundView.systemLayoutSizeFitting(.init(width: self.view.frame.width - spacing, + height: self.view.frame.height - spacing), + withHorizontalFittingPriority: .defaultHigh, + verticalFittingPriority: .defaultHigh) + + let compressedSize = backgroundView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) + backgroundView.frame.size = .init(width: min(compressedSize.width, expandedSize.width), + height: max(compressedSize.height, expandedSize.height)) + + view.addSubview(backgroundView) + backgroundView.autoCenterInSuperview() + } + + // MARK: - UI Components + + lazy var activityIndicator: UIActivityIndicatorView = { + if #available(iOS 12.0, *), + UIScreen.main.traitCollection.userInterfaceStyle == .dark { + return UIActivityIndicatorView(style: .white) + } else { + return UIActivityIndicatorView(style: .gray) + } + }() + + lazy var textLabel: UILabel = { + let label = UILabel(frame: .zero) + label.textAlignment = .center + label.textColor = NYPLConfiguration.primaryTextColor + label.font = UIFont.customBoldFont(forTextStyle: UIFont.TextStyle.body) + label.lineBreakMode = .byWordWrapping + label.numberOfLines = 0 + return label + }() +} diff --git a/Simplified/en.lproj/Localizable.strings b/Simplified/en.lproj/Localizable.strings index e6d92999c..e8db1f076 100644 --- a/Simplified/en.lproj/Localizable.strings +++ b/Simplified/en.lproj/Localizable.strings @@ -258,12 +258,15 @@ "Under 13" = "Under 13"; "13 or Older" = "13 or Older"; -// NYPLSettingsAdvancedViewController -"Advanced" = "Advanced"; -"Selecting \"Delete\" will remove all bookmarks from the server for %@." = "Selecting \"Delete\" will remove all bookmarks from the server for %@."; -"Delete Server Data" = "Delete Server Data"; +// Account / Data deletion +"Delete my SimplyE Data" = "Delete my SimplyE Data"; +"Delete Reading Data" = "Delete Reading Data"; "Please wait..." = "Please wait..."; "Delete all the bookmarks you have saved in the cloud." = "Delete all the bookmarks you have saved in the cloud."; +"You have successfully deleted your SimplyE data" = "You have successfully deleted your SimplyE data"; +"Unsubscribe from emails" = "Unsubscribe from emails"; +"Delete my library account" = "Delete my library account"; +"Delete Data Failed" = "Delete Data Failed"; // Open eBooks "Welcome to Open eBooks" = "Welcome to Open eBooks!"; diff --git a/SimplyE/Images.xcassets/ArrowRight.imageset/ArrowRight.svg b/SimplyE/Images.xcassets/ArrowRight.imageset/ArrowRight.svg new file mode 100644 index 000000000..9ed453229 --- /dev/null +++ b/SimplyE/Images.xcassets/ArrowRight.imageset/ArrowRight.svg @@ -0,0 +1,3 @@ + + + diff --git a/SimplyE/Images.xcassets/ArrowRight.imageset/Contents.json b/SimplyE/Images.xcassets/ArrowRight.imageset/Contents.json new file mode 100644 index 000000000..99aaedbef --- /dev/null +++ b/SimplyE/Images.xcassets/ArrowRight.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "ArrowRight.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} From c960e345e911170b02e4380b03ec86b48e81b965 Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Thu, 9 Jun 2022 18:57:04 -0700 Subject: [PATCH 12/24] Remove settings advanced view controller --- Simplified.xcodeproj/project.pbxproj | 10 -- .../NYPLSettingsAdvancedViewController.swift | 120 ------------------ 2 files changed, 130 deletions(-) delete mode 100644 Simplified/Settings/NYPLSettingsAdvancedViewController.swift diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index 9107cd3cd..49326ab1f 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -725,7 +725,6 @@ 739E60A7244A0D8600D00301 /* NYPLBookDetailNormalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 111197381987F4070014462F /* NYPLBookDetailNormalView.m */; }; 739E60A8244A0D8600D00301 /* NYPLSettingsPrimaryNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 111E757C1A801A6F00718AD7 /* NYPLSettingsPrimaryNavigationController.m */; }; 739E60A9244A0D8600D00301 /* NYPLCatalogUngroupedFeedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 11A16E68195B2BD3004147F4 /* NYPLCatalogUngroupedFeedViewController.m */; }; - 739E60AA244A0D8600D00301 /* NYPLSettingsAdvancedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D787E8431FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift */; }; 739E60AB244A0D8600D00301 /* NYPLMigrationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D60D3532297353C001080D0 /* NYPLMigrationManager.swift */; }; 739E60AC244A0D8600D00301 /* NYPLSettingsSplitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 111E75791A80165C00718AD7 /* NYPLSettingsSplitViewController.m */; }; 739E60AD244A0D8600D00301 /* Date+NYPLAdditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7384C801242BCC4800D5F960 /* Date+NYPLAdditions.swift */; }; @@ -1090,7 +1089,6 @@ 73EB0AD325821DF4006BC997 /* NYPLBookDetailNormalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 111197381987F4070014462F /* NYPLBookDetailNormalView.m */; }; 73EB0AD425821DF4006BC997 /* NYPLSettingsPrimaryNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 111E757C1A801A6F00718AD7 /* NYPLSettingsPrimaryNavigationController.m */; }; 73EB0AD525821DF4006BC997 /* NYPLCatalogUngroupedFeedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 11A16E68195B2BD3004147F4 /* NYPLCatalogUngroupedFeedViewController.m */; }; - 73EB0AD625821DF4006BC997 /* NYPLSettingsAdvancedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D787E8431FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift */; }; 73EB0AD725821DF4006BC997 /* NYPLMigrationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D60D3532297353C001080D0 /* NYPLMigrationManager.swift */; }; 73EB0AD825821DF4006BC997 /* NYPLSettingsSplitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 111E75791A80165C00718AD7 /* NYPLSettingsSplitViewController.m */; }; 73EB0AD925821DF4006BC997 /* Date+NYPLAdditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7384C801242BCC4800D5F960 /* Date+NYPLAdditions.swift */; }; @@ -1315,7 +1313,6 @@ 73FCA30825005BA4001B0C5D /* NYPLBookCellDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 111197271986B43B0014462F /* NYPLBookCellDelegate.m */; }; 73FCA30925005BA4001B0C5D /* NYPLBookDetailNormalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 111197381987F4070014462F /* NYPLBookDetailNormalView.m */; }; 73FCA30B25005BA4001B0C5D /* NYPLCatalogUngroupedFeedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 11A16E68195B2BD3004147F4 /* NYPLCatalogUngroupedFeedViewController.m */; }; - 73FCA30C25005BA4001B0C5D /* NYPLSettingsAdvancedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D787E8431FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift */; }; 73FCA30D25005BA4001B0C5D /* NYPLMigrationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D60D3532297353C001080D0 /* NYPLMigrationManager.swift */; }; 73FCA30F25005BA4001B0C5D /* Date+NYPLAdditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7384C801242BCC4800D5F960 /* Date+NYPLAdditions.swift */; }; 73FCA31025005BA4001B0C5D /* NYPLBasicAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086C45D524AE77CA00F5108E /* NYPLBasicAuth.swift */; }; @@ -1445,7 +1442,6 @@ B51C1E18229456E2003B49A5 /* gpl_authentication_document.json in Resources */ = {isa = PBXBuildFile; fileRef = B51C1E14229456E2003B49A5 /* gpl_authentication_document.json */; }; B51C1E19229456E2003B49A5 /* nypl_authentication_document.json in Resources */ = {isa = PBXBuildFile; fileRef = B51C1E15229456E2003B49A5 /* nypl_authentication_document.json */; }; B51C1E1A229456E2003B49A5 /* dpl_authentication_document.json in Resources */ = {isa = PBXBuildFile; fileRef = B51C1E16229456E2003B49A5 /* dpl_authentication_document.json */; }; - D787E8441FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D787E8431FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift */; }; E6202A021DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E6202A011DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.m */; }; E6207B652118973800864143 /* NYPLAppTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6207B642118973800864143 /* NYPLAppTheme.swift */; }; E627B554216D4A9700A7D1D5 /* NYPLBookContentType.m in Sources */ = {isa = PBXBuildFile; fileRef = E627B553216D4A9700A7D1D5 /* NYPLBookContentType.m */; }; @@ -2182,7 +2178,6 @@ B51C1E15229456E2003B49A5 /* nypl_authentication_document.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = nypl_authentication_document.json; sourceTree = ""; }; B51C1E16229456E2003B49A5 /* dpl_authentication_document.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = dpl_authentication_document.json; sourceTree = ""; }; CAE35BBA1B86289500BF9BC5 /* Simplified.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Simplified.xcconfig; path = ../Simplified.xcconfig; sourceTree = ""; }; - D787E8431FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLSettingsAdvancedViewController.swift; sourceTree = ""; }; E61D7F631F6AC78B0091C781 /* SimplyE.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SimplyE.entitlements; sourceTree = ""; }; E6202A001DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYPLSettingsAccountDetailViewController.h; sourceTree = ""; }; E6202A011DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYPLSettingsAccountDetailViewController.m; sourceTree = ""; }; @@ -2668,7 +2663,6 @@ E6202A001DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.h */, E6202A011DD4E6F300C99553 /* NYPLSettingsAccountDetailViewController.m */, E6B1F4FA1DD20EA900D73CA1 /* NYPLSettingsAccountsListVC.swift */, - D787E8431FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift */, 841B55411B740F2700FAC1AF /* NYPLSettingsEULAViewController.h */, 841B55421B740F2700FAC1AF /* NYPLSettingsEULAViewController.m */, 111E757B1A801A6F00718AD7 /* NYPLSettingsPrimaryNavigationController.h */, @@ -4442,7 +4436,6 @@ 7354A439255C9CC800B64E25 /* NYPLSignInBusinessLogic+BookmarkSyncing.swift in Sources */, 739E60A8244A0D8600D00301 /* NYPLSettingsPrimaryNavigationController.m in Sources */, 739E60A9244A0D8600D00301 /* NYPLCatalogUngroupedFeedViewController.m in Sources */, - 739E60AA244A0D8600D00301 /* NYPLSettingsAdvancedViewController.swift in Sources */, 739E60AB244A0D8600D00301 /* NYPLMigrationManager.swift in Sources */, 739E60AC244A0D8600D00301 /* NYPLSettingsSplitViewController.m in Sources */, 739E60AD244A0D8600D00301 /* Date+NYPLAdditions.swift in Sources */, @@ -4702,7 +4695,6 @@ 73EB0AD325821DF4006BC997 /* NYPLBookDetailNormalView.m in Sources */, 73EB0AD425821DF4006BC997 /* NYPLSettingsPrimaryNavigationController.m in Sources */, 73EB0AD525821DF4006BC997 /* NYPLCatalogUngroupedFeedViewController.m in Sources */, - 73EB0AD625821DF4006BC997 /* NYPLSettingsAdvancedViewController.swift in Sources */, 73EB0AD725821DF4006BC997 /* NYPLMigrationManager.swift in Sources */, 73EB0AD825821DF4006BC997 /* NYPLSettingsSplitViewController.m in Sources */, 73EB0AD925821DF4006BC997 /* Date+NYPLAdditions.swift in Sources */, @@ -4956,7 +4948,6 @@ 7380E706254B407D004613B1 /* NYPLR1R2UserSettings.swift in Sources */, 73FCA30B25005BA4001B0C5D /* NYPLCatalogUngroupedFeedViewController.m in Sources */, 73085E3A25030D80008F6244 /* OEMigrations.swift in Sources */, - 73FCA30C25005BA4001B0C5D /* NYPLSettingsAdvancedViewController.swift in Sources */, 73FCA30D25005BA4001B0C5D /* NYPLMigrationManager.swift in Sources */, 73FCA30F25005BA4001B0C5D /* Date+NYPLAdditions.swift in Sources */, 73FCA31025005BA4001B0C5D /* NYPLBasicAuth.swift in Sources */, @@ -5197,7 +5188,6 @@ 73DEB54E2486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift in Sources */, 111E757D1A801A6F00718AD7 /* NYPLSettingsPrimaryNavigationController.m in Sources */, 11A16E69195B2BD3004147F4 /* NYPLCatalogUngroupedFeedViewController.m in Sources */, - D787E8441FB6B0290016D9D5 /* NYPLSettingsAdvancedViewController.swift in Sources */, 5D60D3542297353C001080D0 /* NYPLMigrationManager.swift in Sources */, 111E757A1A80165C00718AD7 /* NYPLSettingsSplitViewController.m in Sources */, 7384C802242BCC4800D5F960 /* Date+NYPLAdditions.swift in Sources */, diff --git a/Simplified/Settings/NYPLSettingsAdvancedViewController.swift b/Simplified/Settings/NYPLSettingsAdvancedViewController.swift deleted file mode 100644 index 99ba39702..000000000 --- a/Simplified/Settings/NYPLSettingsAdvancedViewController.swift +++ /dev/null @@ -1,120 +0,0 @@ -import UIKit - -/// Advanced Menu in Settings -@objcMembers class NYPLSettingsAdvancedViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { - - var account: Account - - init(account id: String) { - self.account = AccountsManager.shared.account(id)! - super.init(nibName: nil, bundle: nil) - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func viewDidLoad() { - super.viewDidLoad() - - title = NSLocalizedString("Advanced", comment: "") - - let tableView = UITableView.init(frame: .zero, style: .grouped) - tableView.delegate = self - tableView.dataSource = self - tableView.backgroundColor = NYPLConfiguration.primaryBackgroundColor - self.view.addSubview(tableView) - tableView.autoPinEdgesToSuperviewEdges() - } - - // MARK: - UITableViewDelegate - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - if (indexPath.row == 0) { - - let cell = tableView.cellForRow(at: indexPath) - cell?.setSelected(false, animated: true) - - let message = String.localizedStringWithFormat(NSLocalizedString("Selecting \"Delete\" will remove all bookmarks from the server for %@.", comment: "Message warning alert for removing all bookmarks from the server"), account.name) - - let alert = UIAlertController.init(title: nil, message: message, preferredStyle: .alert) - - let deleteAction = UIAlertAction.init(title: NSLocalizedString("Delete", comment:""), style: .destructive, handler: { (action) in - self.disableSync() - }) - - let cancelAction = UIAlertAction.init(title: NSLocalizedString("Cancel", comment:""), style: .cancel, handler: { (action) in - Log.info(#file, "User cancelled bookmark server delete.") - }) - - alert.addAction(deleteAction) - alert.addAction(cancelAction) - - NYPLAlertUtils.presentFromViewControllerOrNil(alertController: alert, viewController: nil, animated: true, completion: nil) - } - } - - private func disableSync() { - //Disable UI while working - let alert = UIAlertController(title: nil, message: NSLocalizedString("Please wait...", comment:"Generic Wait message"), preferredStyle: .alert) - let loadingIndicator = UIActivityIndicatorView(frame: CGRect(x: 10, y: 5, width: 50, height: 50)) - loadingIndicator.hidesWhenStopped = true - loadingIndicator.style = UIActivityIndicatorView.Style.gray - loadingIndicator.startAnimating(); - - alert.view.addSubview(loadingIndicator) - present(alert, animated: true, completion: nil) - - NYPLAnnotations.updateServerSyncSetting(toEnabled: false) { success in - NYPLMainThreadRun.asyncIfNeeded { - self.dismiss(animated: true, completion: nil) - if success { - self.account.details?.syncPermissionGranted = false - NYPLSettings.shared.userHasSeenFirstTimeSyncMessage = false - self.navigationController?.popViewController(animated: true) - } - } - } - } - - // MARK: - UITableViewDataSource - - func numberOfSections(in tableView: UITableView) -> Int { - return 1 - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 1 - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - - let cell = UITableViewCell() - cell.textLabel?.text = NSLocalizedString("Delete Server Data", comment:"") - cell.textLabel?.font = UIFont.customFont(forTextStyle: .body) - cell.textLabel?.textColor = NYPLConfiguration.deleteActionColor - return cell - } - - func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { - return footerView - } - - // MARK: - UI Properties - - lazy var footerView: UIView = { - let view = UIView() - view.addSubview(deleteDescriptionLabel) - deleteDescriptionLabel.autoPinEdgesToSuperviewEdges(with: .init(top: 10, left: 15, bottom: 10, right: 15)) - return view - }() - - lazy var deleteDescriptionLabel: UILabel = { - let label = UILabel(frame: .zero) - label.text = NSLocalizedString("Delete all the bookmarks you have saved in the cloud.", comment:"") - label.textAlignment = .left - label.textColor = NYPLConfiguration.primaryTextColor - label.font = UIFont.systemFont(ofSize: 12) - return label - }() -} From 1bda9d573c355521f0644d0bd0ef027d189cc89f Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Fri, 10 Jun 2022 10:54:35 -0700 Subject: [PATCH 13/24] Refactor DeleteServerDataVC with tableview --- Simplified.xcodeproj/project.pbxproj | 8 ++ .../NYPLConfiguration+Color.swift | 9 ++ .../NYPLSettingsAccountDetailViewController.m | 14 +- ...ttingsDeleteServerDataViewController.swift | 120 ++++++++++-------- ...tivityIndicatorMessageViewController.swift | 12 +- 5 files changed, 101 insertions(+), 62 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index 49326ab1f..b05dc62e5 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -122,6 +122,10 @@ 1747331D284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */; }; 1747331E284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */; }; 1747332C284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */; }; + 174733552853B1110090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */; }; + 1747335A2853B1120090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */; }; + 1747335B2853B1120090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */; }; + 1747335C2853B1190090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */; }; 17536B9E26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; 17536B9F26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; 17536BA026A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; @@ -4359,6 +4363,7 @@ 739E6071244A0D8600D00301 /* BundledHTMLViewController.swift in Sources */, 739E6072244A0D8600D00301 /* NYPLBookDetailView.m in Sources */, 739E6073244A0D8600D00301 /* UIButton+NYPLAppearanceAdditions.m in Sources */, + 174733552853B1110090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */, 21DDE32925D2CEFC002CBCE3 /* AdobeDRMContentProtection.swift in Sources */, 739E6074244A0D8600D00301 /* NYPLBookCoverRegistry.m in Sources */, 21DDE31825D2CE9B002CBCE3 /* AdobeDRMLibraryService.swift in Sources */, @@ -4784,6 +4789,7 @@ 73D8D27D25A68D4300DF5F69 /* NYPLReaderTOCBusinessLogic.swift in Sources */, 73EB0B2225821DF4006BC997 /* NYPLSecrets.swift in Sources */, 73EB0B2325821DF4006BC997 /* NYPLBarcodeScanningViewController.m in Sources */, + 1747335A2853B1120090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */, 73C3CF5825C8EB6B00CA8166 /* NYPLUserAccount.swift in Sources */, 73EB0B2425821DF4006BC997 /* NYPLBookDetailDownloadFailedView.m in Sources */, 73EB0B2525821DF4006BC997 /* NYPLOPDSFeed.m in Sources */, @@ -4824,6 +4830,7 @@ 73225DED250B4B9100EF1877 /* NYPLRootTabBarController+OE.swift in Sources */, 734731262514236A00BE3D2C /* NYPLAppDelegate+OE.swift in Sources */, 597E272A268B537E00A3CD23 /* NYPLAxisDecompressionAdapter.swift in Sources */, + 1747335B2853B1120090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */, 73FCA2BA25005BA4001B0C5D /* NYPLAlertUtils.swift in Sources */, 73FCA2BB25005BA4001B0C5D /* OPDS2Publication.swift in Sources */, 73FCA2BC25005BA4001B0C5D /* String+MD5.swift in Sources */, @@ -4855,6 +4862,7 @@ 73A794A825477D8F00C59CC1 /* NYPLSignInBusinessLogic+UI.swift in Sources */, 7359DCB527E92462001C4254 /* NYPLSignInBusinessLogic+OAuthClientCredentials.swift in Sources */, 73FCA2C625005BA4001B0C5D /* NYPLReloadView.m in Sources */, + 1747335C2853B1190090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */, 73FCA2C725005BA4001B0C5D /* NYPLReachabilityManager.m in Sources */, 73FCA2C925005BA4001B0C5D /* NYPLCatalogGroupedFeedViewController.m in Sources */, 73FCA2CA25005BA4001B0C5D /* NYPLBackgroundExecutor.swift in Sources */, diff --git a/Simplified/AppInfrastructure/NYPLConfiguration+Color.swift b/Simplified/AppInfrastructure/NYPLConfiguration+Color.swift index a882815b2..22f008f44 100644 --- a/Simplified/AppInfrastructure/NYPLConfiguration+Color.swift +++ b/Simplified/AppInfrastructure/NYPLConfiguration+Color.swift @@ -116,4 +116,13 @@ private enum ColorAsset: String { return .black } + + static var transparentBackgroundColor: UIColor { + if #available(iOS 12.0, *), + UIScreen.main.traitCollection.userInterfaceStyle == .dark { + return UIColor(white: 0.2, alpha: 0.7) + } else { + return UIColor(white: 0, alpha: 0.7) + } + } } diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index 7bfe232ea..aff47e8c7 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -473,6 +473,9 @@ - (void)setupTableData NSMutableArray *section2DeleteServerData = [[NSMutableArray alloc] init]; if ([self.businessLogic shouldShowSyncButton]) { [section1Sync addObject:@(CellKindSyncButton)]; + } + + if ([self.businessLogic isSignedIn]) { [section2DeleteServerData addObject:@(CellKindDeleteServerData)]; } @@ -1066,7 +1069,12 @@ - (UITableViewCell *)tableView:(__attribute__((unused)) UITableView *)tableView initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; cell.textLabel.font = [UIFont customFontForTextStyle:UIFontTextStyleBody]; +#ifdef SIMPLYE cell.textLabel.text = NSLocalizedString(@"Delete my SimplyE Data", nil); +#else + cell.textLabel.text = NSLocalizedString(@"Delete my OpenEBooks Data", nil); +#endif + cell.textLabel.textColor = NYPLConfiguration.deleteActionColor; UIImageView *imageView = [self rightArrowImageView]; @@ -1149,7 +1157,7 @@ - (CGFloat)tableView:(__unused UITableView *)tableView heightForFooterInSection: { if ((section == sSection0AccountInfo && [self.businessLogic shouldShowEULALink]) || (section == sSection1Sync && [self.businessLogic shouldShowSyncButton]) || - (section == sSection2DeleteServerData && [self.businessLogic shouldShowSyncButton])) { + (section == sSection2DeleteServerData && [self.businessLogic isSignedIn])) { return UITableViewAutomaticDimension; } return 0; @@ -1165,7 +1173,7 @@ - (CGFloat)tableView:(__unused UITableView *)tableView estimatedHeightForFooterI { if ((section == sSection0AccountInfo && [self.businessLogic shouldShowEULALink]) || (section == sSection1Sync && [self.businessLogic shouldShowSyncButton]) || - (section == sSection2DeleteServerData && [self.businessLogic shouldShowSyncButton])) { + (section == sSection2DeleteServerData && [self.businessLogic isSignedIn])) { return 44; } return 0; @@ -1227,7 +1235,7 @@ - (UIView *)tableView:(UITableView *)__unused tableView viewForFooterInSection:( // something's wrong, it gets called every refresh cycle when scrolling if ((section == sSection0AccountInfo && [self.businessLogic shouldShowEULALink]) || (section == sSection1Sync && [self.businessLogic shouldShowSyncButton]) || - (section == sSection2DeleteServerData && [self.businessLogic shouldShowSyncButton])) { + (section == sSection2DeleteServerData && [self.businessLogic isSignedIn])) { if (section == sSection0AccountInfo && self.accountInfoFooterView) { return self.accountInfoFooterView; diff --git a/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift b/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift index 6bdd41a84..9ab35cf8a 100644 --- a/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift +++ b/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift @@ -12,7 +12,9 @@ import UIKit func didDeleteServerData() } -@objc class NYPLSettingsDeleteServerDataViewController: UIViewController { +@objc class NYPLSettingsDeleteServerDataViewController: UITableViewController { + private let tableViewFooterViewHeight: CGFloat = 15.0 + @objc weak var delegate: NYPLServerDataDeleting? @objc init(delegate: NYPLServerDataDeleting) { @@ -32,12 +34,55 @@ import UIKit setupUI() } + // MARK: - TableViewSourceDelegate + + override func numberOfSections(in tableView: UITableView) -> Int { + return 2 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 1 + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = UITableViewCell(frame: .zero) + cell.backgroundColor = NYPLConfiguration.primaryBackgroundColor + if indexPath.section == 0 { + // Data Deletion Description + cell.textLabel?.attributedText = dataDeletionDescription() + cell.textLabel?.numberOfLines = 0 + } else { + // Delete Button + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.alignment = .center + let attributedString = NSMutableAttributedString(string: NSLocalizedString("Delete Reading Data", + comment: "Button title for delete reading data"), + attributes: [.underlineStyle: NSUnderlineStyle.single.rawValue, + .foregroundColor: NYPLConfiguration.actionColor, + .paragraphStyle: paragraphStyle, + .font: UIFont.systemFont(ofSize: 14)]) + deleteDataButton.setAttributedTitle(attributedString, for: .normal) + cell.contentView.addSubview(deleteDataButton) + deleteDataButton.autoPinEdge(toSuperviewEdge: .top, withInset: 0) + deleteDataButton.autoPinEdge(toSuperviewEdge: .bottom, withInset: 0) + deleteDataButton.autoCenterInSuperview() + } + return cell + } + + override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { + return tableViewFooterViewHeight + } + + override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { + return footerView + } // MARK: - Action - @objc func deleteData() { + @objc private func deleteData() { let message = NSLocalizedString("Please wait...", comment: "Loading view message") - let vc = NYPLActivityIndicatorMessageViewController(with: message) + let vc = NYPLActivityIndicatorMessageViewController(message: message) present(vc, animated: false) NYPLAnnotations.updateServerSyncSetting(toEnabled: false) { [weak self] success in NYPLMainThreadRun.asyncIfNeeded { @@ -58,11 +103,11 @@ import UIKit } } - @objc func dismissVC() { + @objc private func dismissVC() { self.navigationController?.dismiss(animated: true, completion: nil) } - func showAlert() { + private func showAlert() { let title = NSLocalizedString("Delete Data Failed", comment: "Title for deletion failure alert") let message = NSLocalizedString("CheckConnection", @@ -76,8 +121,8 @@ import UIKit // MARK: - Setup - func setupNavBar() { - self.title = NSLocalizedString("Delete my SimplyE Data", + private func setupNavBar() { + self.title = NSLocalizedString("Delete Library Card", comment: "Title for navigation bar") let backButton = UIBarButtonItem(title: NSLocalizedString("Cancel", @@ -89,63 +134,38 @@ import UIKit self.navigationItem.leftBarButtonItem = backButton } - func setupUI() { + private func setupUI() { self.view.backgroundColor = NYPLConfiguration.primaryBackgroundColor - deleteDataButton.autoSetDimension(.height, toSize: 40) - let subviews = [deleteDescriptionLabel, deleteDataButton, UIView()] - let stackView = UIStackView(arrangedSubviews: subviews) - stackView.alignment = .fill - stackView.distribution = .fill - stackView.axis = .vertical - stackView.spacing = 20 - - view.addSubview(stackView) - stackView.autoPinEdgesToSuperviewSafeArea(with: .init(top: 20, left: 20, bottom: 20, right: 20)) + self.tableView.separatorStyle = .none + self.tableView.allowsSelection = false } - // MARK: - UI Properties + // MARK: - Helper - lazy var deleteDescriptionLabel: UILabel = { - let label = UILabel(frame: .zero) - label.attributedText = dataDeletionDescription() - label.textAlignment = .left - label.textColor = NYPLConfiguration.primaryTextColor - label.font = UIFont.systemFont(ofSize: 14) - label.numberOfLines = 0 - return label + lazy var footerView: UIView = { + let view = UIView() + view.backgroundColor = NYPLConfiguration.primaryBackgroundColor + return view }() lazy var deleteDataButton: UIButton = { - let button = UIButton(type: .system) - let attributedString = NSMutableAttributedString(string: NSLocalizedString("Delete Reading Data", - comment: "Button title for delete reading data"), - attributes: [.underlineStyle: NSUnderlineStyle.single.rawValue, - .foregroundColor: NYPLConfiguration.actionColor]) - button.setAttributedTitle(attributedString, for: .normal) - button.titleLabel?.textAlignment = .center + let button = UIButton() button.addTarget(self, action: #selector(deleteData), for: .touchUpInside) return button }() - func dataDeletionDescription() -> NSMutableAttributedString { - let attributedString = NSMutableAttributedString(string: - """ - SimplyE does not create any accounts outside of your library card. The content that the SimplyE app saves is: - - * your library card information to log into your library - * your last known place in the book you’re reading or listening to - * and any bookmarks or highlights you’ve created for your current book - - Your account information is saved outside of your current device if you specifically permit us to save it. If you only want your bookmarks and reading location deleted, please go to Settings/Accounts/The New York Public Library. Set the “Sync Bookmarks” toggle to OFF, then come back to this page and tap “Delete Reading Data”. Then you can log out, and SimplyE will no longer save any of your information. - """ - ) - + private func dataDeletionDescription() -> NSMutableAttributedString { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineSpacing = 1.25 paragraphStyle.lineHeightMultiple = 1.25 - attributedString.addAttribute(NSAttributedString.Key.paragraphStyle, - value:paragraphStyle, - range:NSMakeRange(0, attributedString.length)) + + let description = NSLocalizedString("DeleteServerDataDescription", + comment: "Description of the delete action") + let attributedString = NSMutableAttributedString(string:description, + attributes: [.font: UIFont.systemFont(ofSize: 14), + .foregroundColor: NYPLConfiguration.primaryTextColor, + .paragraphStyle: paragraphStyle] + ) return attributedString } diff --git a/Simplified/Utilities/UI/NYPLActivityIndicatorMessageViewController.swift b/Simplified/Utilities/UI/NYPLActivityIndicatorMessageViewController.swift index f41b24969..a63553278 100644 --- a/Simplified/Utilities/UI/NYPLActivityIndicatorMessageViewController.swift +++ b/Simplified/Utilities/UI/NYPLActivityIndicatorMessageViewController.swift @@ -15,7 +15,7 @@ class NYPLActivityIndicatorMessageViewController: UIViewController { // MARK: - Life Cycle - init(with message: String) { + init(message: String) { super.init(nibName: nil, bundle: nil) self.textLabel.text = message @@ -40,14 +40,8 @@ class NYPLActivityIndicatorMessageViewController: UIViewController { // MARK: - Setup - func setupUI() { - // Transparent background - if #available(iOS 12.0, *), - UIScreen.main.traitCollection.userInterfaceStyle == .dark { - self.view.backgroundColor = UIColor(white: 0.2, alpha: 0.7) - } else { - self.view.backgroundColor = UIColor(white: 0, alpha: 0.7) - } + private func setupUI() { + self.view.backgroundColor = NYPLConfiguration.transparentBackgroundColor // Background of the activity indicator and text let backgroundView = UIView() From c06c5fae6edb29102d13ad04102150d835650318 Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Mon, 13 Jun 2022 10:04:25 -0700 Subject: [PATCH 14/24] Update localized strings for Delete Account --- .../NYPLSettingsAccountDetailViewController.m | 2 +- Simplified/de.lproj/Localizable.strings | Bin 14994 -> 16498 bytes Simplified/en.lproj/Localizable.strings | 11 +++++++++- Simplified/es.lproj/Localizable.strings | Bin 14146 -> 15650 bytes Simplified/it.lproj/Localizable.strings | 20 ++++++++++++++---- 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index aff47e8c7..268580688 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -1072,7 +1072,7 @@ - (UITableViewCell *)tableView:(__attribute__((unused)) UITableView *)tableView #ifdef SIMPLYE cell.textLabel.text = NSLocalizedString(@"Delete my SimplyE Data", nil); #else - cell.textLabel.text = NSLocalizedString(@"Delete my OpenEBooks Data", nil); + cell.textLabel.text = NSLocalizedString(@"Delete my Open eBooks Data", nil); #endif cell.textLabel.textColor = NYPLConfiguration.deleteActionColor; diff --git a/Simplified/de.lproj/Localizable.strings b/Simplified/de.lproj/Localizable.strings index 3d217aa056d29d1ddf2653f0eef54baa18d25d68..927208a199a1b7e99db314c20c2d32ee24814703 100644 GIT binary patch delta 1446 zcmai!!EVz)5QYbdL+PDErB+%vqxN1dfB=aTg7m`CaT3QOiLJzGl#_Xe_A$8dY&-$~ zH=ETaX#rVYuXkr>{`u#hy<7kO@#NRt^_Nq-(i7~xjcum4(;Muqm3kUm+d?Z>+AZ`g z?9^T!SPo>pv|Ar{HupcDzUT*5+uT}t+}a2E8_Cz$R+=p|>+~&kZtPx(S7?3f-~G7Q zgQ3&OT0XFBY@%`N>r2gM+8N4Mp%)J&vtGuR`nj>GA0ibJ8T%MCn|kOt!|gHPLf~7i zuVhDhK&dreivp1l{te+7Xhs~lFHWBKglY6Q(^$D9z_9YSJRXK96dc~ZJA)gI!TBwe zF$vVZLSp<4<-L)uN9aZ2S%B^!Sdcz)bD%U@i6r74esIJN03!^FLo%sI$@yF>O9hE# z!p~HvD~%L|FNF(M#VpSPL>^Wix04-+%ta}{ONRI9 delta 8 Pcmey=z&NRN!z3#J6FLL; diff --git a/Simplified/en.lproj/Localizable.strings b/Simplified/en.lproj/Localizable.strings index e8db1f076..f7755c3ad 100644 --- a/Simplified/en.lproj/Localizable.strings +++ b/Simplified/en.lproj/Localizable.strings @@ -260,13 +260,22 @@ // Account / Data deletion "Delete my SimplyE Data" = "Delete my SimplyE Data"; +"Delete my Open eBooks Data" = "Delete my Open eBooks Data"; "Delete Reading Data" = "Delete Reading Data"; "Please wait..." = "Please wait..."; "Delete all the bookmarks you have saved in the cloud." = "Delete all the bookmarks you have saved in the cloud."; "You have successfully deleted your SimplyE data" = "You have successfully deleted your SimplyE data"; "Unsubscribe from emails" = "Unsubscribe from emails"; -"Delete my library account" = "Delete my library account"; +"E-Mail to cancel your library card" = "E-Mail to cancel your library card"; +"Delete Library Card" = "Delete Library Card"; "Delete Data Failed" = "Delete Data Failed"; +"DeleteServerDataDescription" = "SimplyE does not create any accounts outside of your library card. The content that the SimplyE app saves is: + +• your library card information to log into your library +• your last known place in the book you’re reading or listening to +• and any bookmarks or highlights you’ve created for your current book + +Your account information is saved outside of your current device if you specifically permit us to save it. If you only want your bookmarks and reading location deleted, please go to back to the prior screen. Set the “Sync Bookmarks” toggle to OFF, then come back to this page and tap “Delete Reading Data”. Then you can log out, and SimplyE will no longer save any of your information."; // Open eBooks "Welcome to Open eBooks" = "Welcome to Open eBooks!"; diff --git a/Simplified/es.lproj/Localizable.strings b/Simplified/es.lproj/Localizable.strings index a0cdfa1bea70b551acbdfa5da53ac873f007f000..1a951fbe30fba5a128f0a183e198cff324faf106 100644 GIT binary patch delta 1491 zcmai!L5|Zv5JhW&gqRy3%}5PvG_yp41!4q9tPq3^OUE&ZMPi%SGf~+104(PQoPaZM zGXASh(@ACkS#GzxtAG8f`qjUhAK!jnK7D^;7kYxdvdWfv2fe{wTB)bCD{HiJq1{5? z!cOe*f#pQjYrFPwXLIxY-lK71wXLiZ;?`aZZzinDdd(Wm27ODNs~i=7h1R$J-S>+< z90r}Ng@I*jpEYiMeXZG2J5ym5dO;|ejWRyh&qrJMAwnUL%EzGD!d=H1u*ZZ8k?*wL z%Z~7%Qfqvs6etPd-xNmJ%=}0rzODXN?yz-qh(!g3zDqnI)DL%;)yU_WgotqaA?vHn8o+9S5 z;_rV7JNAwauN9B-tkdMLjTCzI2Nukhb0*XVcth7qmuAD|JdeRtRgX{L~0Vvvy z7#q(y=d(~!GII7~WkzBEs7Is?ZA`uhL-Sv2aDeI2oUYiP$$X3wEhPs4{au3lV%S$IwWw-q{;H(2F=wr>j?P za~H8OR=N}Cxf>O~Zfc;;17ix~H$29N#J% hr3pR6YcL+A?@&e-W$vuw%Z^^WeVv@^Qhu&h_zi&>5zhbs delta 7 OcmZ2fbtrFxlQ{qno&$CO diff --git a/Simplified/it.lproj/Localizable.strings b/Simplified/it.lproj/Localizable.strings index e3a1d3268..37f8b07a9 100644 --- a/Simplified/it.lproj/Localizable.strings +++ b/Simplified/it.lproj/Localizable.strings @@ -257,12 +257,24 @@ "Under 13" = "Meno di 13"; "13 or Older" = "13 o di più"; -// NYPLSettingsAdvancedViewController -"Advanced" = "Impostazioni avanzate"; -"Selecting \"Delete\" will remove all bookmarks from the server for %@." = "Selezionando \"Rimuovi\" cancellerai tutti i tuoi segnalibri dal server per %@."; -"Delete Server Data" = "Rimuovi dati dal server"; +// Account / Data deletion +"Delete my SimplyE Data" = "Rimuovi i miei dati di SimplyE"; +"Delete my Open eBooks Data" = "Rimuovi i miei dati di Open eBooks"; +"Delete Reading Data" = "Rimozione dati"; "Please wait..." = "Attendere, prego..."; "Delete all the bookmarks you have saved in the cloud." = "Tutti i segnalibri salvati sul server saranno rimossi."; +"You have successfully deleted your SimplyE data" = "I tuoi dati di SimplyE sono stati rimossi"; +"Unsubscribe from emails" = "Rimuovimi dalle email"; +"E-Mail to cancel your library card" = "Manda una mail per cancellare la tua tessera"; +"Delete Library Card" = "Cancella la mia tessera"; +"Delete Data Failed" = "Si è verificato un problema nella cancellazione dei dati"; +"DeleteServerDataDescription" = "SimplyE non crea nessun account a parte la tessera della biblioteca. I dati che SimplyE salva sono: + +• le informazioni della tua tessera che ti consentono di accedere alla biblioteca +• l'ultimo punto raggiunto nei libri che stai leggendo o ascoltando +• i segnalibri che hai creato nei libri che stai leggendo + +Le informazioni del tuo account sono salvate esternamente al tuo iPhone / iPad solo col tuo consenso. Se vuoi che siano cancellati solamente i tuoi segnalibri o i punti di lettura, vai alla pagina dello schermo precedente e imposta \"Sincronizza i segnalibri\" su \"spento\". Poi torna su questa pagina e seleziona \"Rimozione dati\". A questo punto puoi disconnetterti, e SimplyE non salverà più nessun dato."; // Open eBooks "Welcome to Open eBooks" = "Benvenuti a Open eBooks!"; From 762441f23a2261a0ced4b4f7ecbc7f9a9660976c Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Tue, 14 Jun 2022 12:57:27 -0700 Subject: [PATCH 15/24] Implement UI for DeleteLibraryCard --- Simplified.xcodeproj/project.pbxproj | 8 + .../NYPLSettingsAccountDetailViewController.m | 105 ++++++--- ...tingsDeleteLibraryCardViewController.swift | 205 ++++++++++++++++++ Simplified/de.lproj/Localizable.strings | Bin 16498 -> 17354 bytes Simplified/en.lproj/Localizable.strings | 4 + Simplified/es.lproj/Localizable.strings | Bin 15650 -> 16506 bytes Simplified/it.lproj/Localizable.strings | 4 + 7 files changed, 294 insertions(+), 32 deletions(-) create mode 100644 Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index b05dc62e5..e69aad570 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -126,6 +126,9 @@ 1747335A2853B1120090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */; }; 1747335B2853B1120090B1F3 /* NYPLActivityIndicatorMessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */; }; 1747335C2853B1190090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */; }; + 174733662857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 174733652857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift */; }; + 174733672857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 174733652857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift */; }; + 174733682857A6960090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 174733652857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift */; }; 17536B9E26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; 17536B9F26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; 17536BA026A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */; }; @@ -1792,6 +1795,7 @@ 173F0822241AAA4E00A64658 /* NYPLBookStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLBookStateTests.swift; sourceTree = ""; }; 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLSettingsDeleteServerDataViewController.swift; sourceTree = ""; }; 1747332B284ECC980090B1F3 /* NYPLActivityIndicatorMessageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLActivityIndicatorMessageViewController.swift; sourceTree = ""; }; + 174733652857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLSettingsDeleteLibraryCardViewController.swift; sourceTree = ""; }; 17536B9D26A8CDF00089C40F /* NYPLBookDetailView+Accessibility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLBookDetailView+Accessibility.swift"; sourceTree = ""; }; 175E480724EF36520066A6CF /* NYPLAnnouncementBusinessLogic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLAnnouncementBusinessLogic.swift; sourceTree = ""; }; 17631AEC25E488CD006079C4 /* NYPLAgeCheckViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLAgeCheckViewController.swift; sourceTree = ""; }; @@ -2680,6 +2684,7 @@ 73085E252502EDF0008F6244 /* NYPLSettingsSplitViewController.swift */, 7353940B250854A90043C800 /* NYPLSettingsSplitViewController+OE.swift */, 1747331B284AA4100090B1F3 /* NYPLSettingsDeleteServerDataViewController.swift */, + 174733652857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift */, ); path = Settings; sourceTree = ""; @@ -4401,6 +4406,7 @@ 73A172EF27ADA6FA005E7BCF /* NYPLAxisNetworkExecutor.swift in Sources */, 73B550FC2511729E00D05B86 /* NYPLBookContentTypeConverter.swift in Sources */, 73F11E10251945E500FCD22B /* NYPLPresentationUtils.swift in Sources */, + 174733672857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift in Sources */, 739E608D244A0D8600D00301 /* NYPLReadiumBookmark.swift in Sources */, 73B5DFDD26052A1800225C12 /* NYPLBookButtonsState.m in Sources */, 73DEB54F2486FDFC00B5FF0A /* NYPLBookmarkR2Location.swift in Sources */, @@ -4613,6 +4619,7 @@ 73EB0A8A25821DF4006BC997 /* NYPLReturnPromptHelper.swift in Sources */, 73EB0A8B25821DF4006BC997 /* NYPLReaderBookmarkCell.swift in Sources */, 73EB0A8C25821DF4006BC997 /* NYPLOpenSearchDescription.m in Sources */, + 174733682857A6960090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift in Sources */, 73EB0A8E25821DF4006BC997 /* NYPLSignInBusinessLogic+UI.swift in Sources */, 73D8D27825A68D3B00DF5F69 /* NYPLUserSettingsVC.swift in Sources */, 73EB0A9025821DF4006BC997 /* OPDS2CatalogsFeed.swift in Sources */, @@ -5157,6 +5164,7 @@ 11E0208D197F05D9009DEA93 /* UIFont+NYPLSystemFontOverride.m in Sources */, 03690E291EB2B44300F75D5F /* NYPLReadiumBookmark.swift in Sources */, E683953B217663B100371072 /* NYPLFacetViewDefaultDataSource.swift in Sources */, + 174733662857A6950090B1F3 /* NYPLSettingsDeleteLibraryCardViewController.swift in Sources */, 73B5DFDC26052A1800225C12 /* NYPLBookButtonsState.m in Sources */, E6207B652118973800864143 /* NYPLAppTheme.swift in Sources */, 11A14DF41A1BF94F00D6C510 /* UIColor+NYPLColorAdditions.m in Sources */, diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index 268580688..30329548a 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -33,7 +33,14 @@ typedef NS_ENUM(NSInteger, CellKind) { CellKindAbout, CellKindPrivacyPolicy, CellKindContentLicense, - CellReportIssue + CellReportIssue, + CellKindDeleteLibraryAccount +}; + +typedef NS_ENUM(NSInteger, AccountDetailSection) { + AccountInfoSection, + SyncSection, + DeleteServerDataSection }; @interface NYPLSettingsAccountDetailViewController () @@ -72,11 +79,6 @@ @interface NYPLSettingsAccountDetailViewController () Int { + return 3 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 1 + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = UITableViewCell(frame: .zero) + cell.backgroundColor = NYPLConfiguration.primaryBackgroundColor + if indexPath.section == 0 { + // Library Card Deletion Description + cell.textLabel?.attributedText = libraryCardDeletionDescription() + cell.textLabel?.numberOfLines = 0 + } else if indexPath.section == 1 { + // Email Button + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.alignment = .center + + let attributedString = NSMutableAttributedString(string: NSLocalizedString("E-Mail to cancel your library card", + comment: "Button title for compose email"), + attributes: [.underlineStyle: NSUnderlineStyle.single.rawValue, + .foregroundColor: NYPLConfiguration.actionColor, + .paragraphStyle: paragraphStyle, + .font: UIFont.systemFont(ofSize: 14)]) + emailButton.setAttributedTitle(attributedString, for: .normal) + cell.contentView.addSubview(emailButton) + emailButton.autoPinEdge(toSuperviewEdge: .top, withInset: 0) + emailButton.autoPinEdge(toSuperviewEdge: .bottom, withInset: 0) + emailButton.autoCenterInSuperview() + } else { + // Show support email address + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.alignment = .center + paragraphStyle.lineSpacing = 1.25 + paragraphStyle.lineHeightMultiple = 1.25 + let string = NSLocalizedString("If the above link does not work, please email us at", + comment: "Message to show support email address") + "\n\(self.supportEmail)" + let attributedString = NSMutableAttributedString(string: string, + attributes: [.paragraphStyle: paragraphStyle, + .font: UIFont.systemFont(ofSize: 12)]) + cell.textLabel?.attributedText = attributedString + cell.textLabel?.numberOfLines = 0 + } + return cell + } + + override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { + return tableViewFooterViewHeight + } + + override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { + return footerView + } + // MARK: - Action + + @objc private func presentEmailComposer() { + guard MFMailComposeViewController.canSendMail() else { + let url = URL(string: "mailto:\(supportEmail)")! + UIApplication.shared.open(url) + return + } + + let body = "\n\n---\nBarcode: \(barcode)" + let mailComposeViewController = MFMailComposeViewController.init() + mailComposeViewController.mailComposeDelegate = self + mailComposeViewController.setSubject(NYPLLocalizationNotNeeded("Delete Library Card")) + mailComposeViewController.setToRecipients([supportEmail]) + mailComposeViewController.setMessageBody(body, isHTML: false) + present(mailComposeViewController, animated: true, completion: nil) + } + + @objc private func dismissVC() { + self.navigationController?.dismiss(animated: true, completion: nil) + } + + // MARK: - Setup + + private func setupNavBar() { + self.title = NSLocalizedString("Delete Library Card", + comment: "Title for navigation bar") + + let backButton = UIBarButtonItem(title: NSLocalizedString("Cancel", + comment: "Button title for dismissing view controller"), + style: .plain, + target: self, + action: #selector(dismissVC)) + + self.navigationItem.leftBarButtonItem = backButton + } + + private func setupUI() { + self.tableView.backgroundColor = NYPLConfiguration.primaryBackgroundColor + self.tableView.separatorStyle = .none + self.tableView.allowsSelection = false + } + + // MARK: - Helper + + lazy var footerView: UIView = { + let view = UIView() + view.backgroundColor = NYPLConfiguration.primaryBackgroundColor + return view + }() + + lazy var emailButton: UIButton = { + let button = UIButton() + button.addTarget(self, action: #selector(presentEmailComposer), for: .touchUpInside) + return button + }() + + private func libraryCardDeletionDescription() -> NSMutableAttributedString { + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineSpacing = 1.25 + paragraphStyle.lineHeightMultiple = 1.25 + + let description = NSLocalizedString("DeleteLibraryCardDescription", + comment: "Description of the delete action") + let attributedString = NSMutableAttributedString(string:description, + attributes: [.font: UIFont.systemFont(ofSize: 14), + .foregroundColor: NYPLConfiguration.primaryTextColor, + .paragraphStyle: paragraphStyle] + ) + + return attributedString + } +} + +extension NYPLSettingsDeleteLibraryCardViewController: MFMailComposeViewControllerDelegate { + func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) { + controller.dismiss(animated: true, completion: nil) + + switch result { + case .failed: + if let error = error { + let alert = NYPLAlertUtils.alert(title: "Error", error: error as NSError) + NYPLAlertUtils.presentFromViewControllerOrNil(alertController: alert, + viewController: self, + animated: true, + completion: nil) + } + case .sent: + // TODO: Check wordings with Risa + let alert = UIAlertController( + title: NSLocalizedString("Thank You", comment: "Alert title"), + message: NSLocalizedString("Your email has been sent.", comment: "Alert message"), + preferredStyle: .alert) + alert.addAction( + UIAlertAction( + title: NSLocalizedString("OK", comment: ""), + style: .default, + handler: { _ in + self.dismissVC() + })) + NYPLAlertUtils.presentFromViewControllerOrNil(alertController: alert, + viewController: self, + animated: true, + completion: nil) + case .cancelled: + fallthrough + case .saved: + fallthrough + @unknown default: + break + } + } +} diff --git a/Simplified/de.lproj/Localizable.strings b/Simplified/de.lproj/Localizable.strings index 927208a199a1b7e99db314c20c2d32ee24814703..ff0c9ebcfb286a8575161d3f7a0d272fced99608 100644 GIT binary patch delta 717 zcmZ9KKS~2(5XC28A%dV-h}f(FD7tgI|I*)>_R$rm??Ayw==z}DWt!gF{W zPvGy(x=9Gj_h;vOGjHb2{JuASJ{sRe=dfw_mRio5Sz3PXpO#;H(bI#ySY%5JHs@Se zY-8RdR$xyy9&1#=Ew&z?e1yKn60EZ4mX~*(lXBcXdYpipVGp1bOMkJWXEw0RrdSu8 z_;4%WdL?4!w{7kW|9%;_FK@)0dv1NNW58Zm%MSQ9)j6Js%W`;oc0K~5s>CKo&?Fbm8P% P;;zA{YHL~3+O+r&|L=*x delta 9 QcmX@r&iJW;aYK;<02amsC;$Ke diff --git a/Simplified/en.lproj/Localizable.strings b/Simplified/en.lproj/Localizable.strings index f7755c3ad..3c48a5ba8 100644 --- a/Simplified/en.lproj/Localizable.strings +++ b/Simplified/en.lproj/Localizable.strings @@ -267,6 +267,7 @@ "You have successfully deleted your SimplyE data" = "You have successfully deleted your SimplyE data"; "Unsubscribe from emails" = "Unsubscribe from emails"; "E-Mail to cancel your library card" = "E-Mail to cancel your library card"; +"If the above link does not work, please email us at" = "If the above link does not work, please email us at"; "Delete Library Card" = "Delete Library Card"; "Delete Data Failed" = "Delete Data Failed"; "DeleteServerDataDescription" = "SimplyE does not create any accounts outside of your library card. The content that the SimplyE app saves is: @@ -276,6 +277,9 @@ • and any bookmarks or highlights you’ve created for your current book Your account information is saved outside of your current device if you specifically permit us to save it. If you only want your bookmarks and reading location deleted, please go to back to the prior screen. Set the “Sync Bookmarks” toggle to OFF, then come back to this page and tap “Delete Reading Data”. Then you can log out, and SimplyE will no longer save any of your information."; +"DeleteLibraryCardDescription" = "If you want to delete your account, or all of your library patron data, this will require deleting your library card altogether. + +Deleting your account means that you will no longer have access to ebooks, audiobooks, databases and other digital resources. You also can no longer use your card at your local branches. If you wish to proceed, in order to protect your privacy, please email us."; // Open eBooks "Welcome to Open eBooks" = "Welcome to Open eBooks!"; diff --git a/Simplified/es.lproj/Localizable.strings b/Simplified/es.lproj/Localizable.strings index 1a951fbe30fba5a128f0a183e198cff324faf106..5969e73f7cdffc2630aeb92e7ea36b21447ccc1c 100644 GIT binary patch delta 722 zcmZ9Ky-EX75QRsuP(d)Hun=SoSSbMuAzE{jEJ(WHSpkVV_!T z&%8&>z?!T*R;YqgY+Z(Ygg(a-tg`2pmp|=#dE7d<8-g2S51sw|ctW$P; zI2Gi2A!6pI&D%bz|6E?ApsWYL{@Xx;F*a0!ZOA(YcVGo{H^@>|&J*M<< z?sErA&;nuQ*aY@~lfFfu5$A|Eg^QTF<*Y~pUO^|Gaz%TAE+qmDsD|{*cBiB2k%;nE&u=k delta 8 Pcmey>z__StgOV)(69EIK diff --git a/Simplified/it.lproj/Localizable.strings b/Simplified/it.lproj/Localizable.strings index 37f8b07a9..547f7f16c 100644 --- a/Simplified/it.lproj/Localizable.strings +++ b/Simplified/it.lproj/Localizable.strings @@ -266,6 +266,7 @@ "You have successfully deleted your SimplyE data" = "I tuoi dati di SimplyE sono stati rimossi"; "Unsubscribe from emails" = "Rimuovimi dalle email"; "E-Mail to cancel your library card" = "Manda una mail per cancellare la tua tessera"; +"If the above link does not work, please email us at" = "Se il link soprastante non funziona, manda una mail a"; "Delete Library Card" = "Cancella la mia tessera"; "Delete Data Failed" = "Si è verificato un problema nella cancellazione dei dati"; "DeleteServerDataDescription" = "SimplyE non crea nessun account a parte la tessera della biblioteca. I dati che SimplyE salva sono: @@ -275,6 +276,9 @@ • i segnalibri che hai creato nei libri che stai leggendo Le informazioni del tuo account sono salvate esternamente al tuo iPhone / iPad solo col tuo consenso. Se vuoi che siano cancellati solamente i tuoi segnalibri o i punti di lettura, vai alla pagina dello schermo precedente e imposta \"Sincronizza i segnalibri\" su \"spento\". Poi torna su questa pagina e seleziona \"Rimozione dati\". A questo punto puoi disconnetterti, e SimplyE non salverà più nessun dato."; +"DeleteLibraryCardDescription" = "Cancellare il tuo account o tutti i tuoi dati personali richiede la cancellazione della tua tessera della biblioteca. + +Ciò significa che non avrai più accesso agli ebooks, audiobooks, database e altre risorse digitali. Non potrai più usare la tua tessera neanche alle succursali locali. Se vuoi procedere, per proteggere la tua privacy contattaci via email."; // Open eBooks "Welcome to Open eBooks" = "Benvenuti a Open eBooks!"; From 51471886e782cfe89b8f8ba5672052b4f94a17ab Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Thu, 16 Jun 2022 12:55:19 -0700 Subject: [PATCH 16/24] Use UIFont preferredFont instead of system font in Delete Account --- .../NYPLSettingsAccountDetailViewController.m | 1 - ...YPLSettingsDeleteLibraryCardViewController.swift | 13 ++++++++----- ...NYPLSettingsDeleteServerDataViewController.swift | 10 ++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index 30329548a..08b9a64f2 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -500,7 +500,6 @@ - (void)setupTableData [self.tableData addObject:@[@(CellReportIssue)]]; if ([self.businessLogic isSignedIn] && [self.selectedAccount.details supportsCardCreator]) { - /// Delete library account is only shown when patron is signed in and library supported card creation [section4DeleteAccount addObject:@(CellKindDeleteLibraryAccount)]; } } diff --git a/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift b/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift index d95a241ff..81e33c7c7 100644 --- a/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift +++ b/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift @@ -55,12 +55,13 @@ import MessageUI let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .center + let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) let attributedString = NSMutableAttributedString(string: NSLocalizedString("E-Mail to cancel your library card", comment: "Button title for compose email"), attributes: [.underlineStyle: NSUnderlineStyle.single.rawValue, .foregroundColor: NYPLConfiguration.actionColor, .paragraphStyle: paragraphStyle, - .font: UIFont.systemFont(ofSize: 14)]) + .font: font as Any]) emailButton.setAttributedTitle(attributedString, for: .normal) cell.contentView.addSubview(emailButton) emailButton.autoPinEdge(toSuperviewEdge: .top, withInset: 0) @@ -74,9 +75,10 @@ import MessageUI paragraphStyle.lineHeightMultiple = 1.25 let string = NSLocalizedString("If the above link does not work, please email us at", comment: "Message to show support email address") + "\n\(self.supportEmail)" + let font = UIFont.customFont(forTextStyle: .footnote) let attributedString = NSMutableAttributedString(string: string, attributes: [.paragraphStyle: paragraphStyle, - .font: UIFont.systemFont(ofSize: 12)]) + .font: font as Any]) cell.textLabel?.attributedText = attributedString cell.textLabel?.numberOfLines = 0 } @@ -149,13 +151,14 @@ import MessageUI private func libraryCardDeletionDescription() -> NSMutableAttributedString { let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineSpacing = 1.25 - paragraphStyle.lineHeightMultiple = 1.25 + paragraphStyle.lineSpacing = 1.1 + paragraphStyle.lineHeightMultiple = 1.1 let description = NSLocalizedString("DeleteLibraryCardDescription", comment: "Description of the delete action") + let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) let attributedString = NSMutableAttributedString(string:description, - attributes: [.font: UIFont.systemFont(ofSize: 14), + attributes: [.font: font as Any, .foregroundColor: NYPLConfiguration.primaryTextColor, .paragraphStyle: paragraphStyle] ) diff --git a/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift b/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift index 9ab35cf8a..2ec69a747 100644 --- a/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift +++ b/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift @@ -55,12 +55,13 @@ import UIKit // Delete Button let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .center + let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) let attributedString = NSMutableAttributedString(string: NSLocalizedString("Delete Reading Data", comment: "Button title for delete reading data"), attributes: [.underlineStyle: NSUnderlineStyle.single.rawValue, .foregroundColor: NYPLConfiguration.actionColor, .paragraphStyle: paragraphStyle, - .font: UIFont.systemFont(ofSize: 14)]) + .font: font as Any]) deleteDataButton.setAttributedTitle(attributedString, for: .normal) cell.contentView.addSubview(deleteDataButton) deleteDataButton.autoPinEdge(toSuperviewEdge: .top, withInset: 0) @@ -156,13 +157,14 @@ import UIKit private func dataDeletionDescription() -> NSMutableAttributedString { let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineSpacing = 1.25 - paragraphStyle.lineHeightMultiple = 1.25 + paragraphStyle.lineSpacing = 1.1 + paragraphStyle.lineHeightMultiple = 1.1 let description = NSLocalizedString("DeleteServerDataDescription", comment: "Description of the delete action") + let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) let attributedString = NSMutableAttributedString(string:description, - attributes: [.font: UIFont.systemFont(ofSize: 14), + attributes: [.font: font as Any, .foregroundColor: NYPLConfiguration.primaryTextColor, .paragraphStyle: paragraphStyle] ) From 1b1f4ec2f9d4b817478041dd0040109fec0898c3 Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Thu, 16 Jun 2022 12:57:17 -0700 Subject: [PATCH 17/24] Bump build number --- Simplified.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index e69aad570..aa0ad9d7e 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5538,7 +5538,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5589,7 +5589,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5639,7 +5639,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5687,7 +5687,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5957,7 +5957,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6008,7 +6008,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; From cfa12784120f261821532004127dc914dab3d802 Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Thu, 16 Jun 2022 16:43:15 -0700 Subject: [PATCH 18/24] Fix DeleteAccount UI logic and strings, bump build number --- Simplified.xcodeproj/project.pbxproj | 12 ++++++------ .../NYPLSettingsAccountDetailViewController.m | 14 ++++++++++---- ...ttingsDeleteServerDataViewController.swift | 14 ++++++++++++-- Simplified/de.lproj/Localizable.strings | Bin 17354 -> 18868 bytes Simplified/en.lproj/Localizable.strings | 9 ++++++++- Simplified/es.lproj/Localizable.strings | Bin 16506 -> 18020 bytes Simplified/it.lproj/Localizable.strings | 9 ++++++++- 7 files changed, 44 insertions(+), 14 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index aa0ad9d7e..221211eb4 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5538,7 +5538,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5589,7 +5589,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5639,7 +5639,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5687,7 +5687,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5957,7 +5957,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6008,7 +6008,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index 08b9a64f2..920ad313e 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -492,13 +492,19 @@ - (void)setupTableData [self.tableData addObject:@[@(CellKindJuvenile)]]; } + if (self.selectedAccount.supportEmail != nil) { + [self.tableData addObject:@[@(CellReportIssue)]]; + } + [self.tableData addObject:section3About]; + #ifdef SIMPLYE NSMutableArray *section4DeleteAccount = [[NSMutableArray alloc] init]; - // TODO: iOS-412 Unsubscribe from email - if (self.selectedAccount.supportEmail != nil) { - [self.tableData addObject:@[@(CellReportIssue)]]; - if ([self.businessLogic isSignedIn] + + if ([self.businessLogic isSignedIn]) { + // TODO: iOS-412 Unsubscribe from email + + if (self.selectedAccount.supportEmail != nil && [self.selectedAccount.details supportsCardCreator]) { [section4DeleteAccount addObject:@(CellKindDeleteLibraryAccount)]; } diff --git a/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift b/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift index 2ec69a747..b87b1b2d2 100644 --- a/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift +++ b/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift @@ -123,8 +123,13 @@ import UIKit // MARK: - Setup private func setupNavBar() { - self.title = NSLocalizedString("Delete Library Card", + #if SIMPLYE + self.title = NSLocalizedString("Delete my SimplyE Data", comment: "Title for navigation bar") + #else + self.title = NSLocalizedString("Delete my Open eBooks Data", + comment: "Title for navigation bar") + #endif let backButton = UIBarButtonItem(title: NSLocalizedString("Cancel", comment: "Button title for dismissing view controller"), @@ -160,8 +165,13 @@ import UIKit paragraphStyle.lineSpacing = 1.1 paragraphStyle.lineHeightMultiple = 1.1 - let description = NSLocalizedString("DeleteServerDataDescription", + #if SIMPLYE + let description = NSLocalizedString("DeleteServerDataDescriptionSimplyE", + comment: "Description of the delete action") + #else + let description = NSLocalizedString("DeleteServerDataDescriptionOpeneBooks", comment: "Description of the delete action") + #endif let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) let attributedString = NSMutableAttributedString(string:description, attributes: [.font: font as Any, diff --git a/Simplified/de.lproj/Localizable.strings b/Simplified/de.lproj/Localizable.strings index ff0c9ebcfb286a8575161d3f7a0d272fced99608..05032b19f2ab7a304132aaff68b7d283266de0ea 100644 GIT binary patch delta 142 zcmX@r&bVbV<<)5Wyk|!Cx(0=%w{NN lP-0MEumxfz2AHe@vixL0>&2p2Wi}tQc4omLCFrn|82~)yA`$=q delta 19 bcmdlonekLRno8ST|?6c`*Y3R|yBO diff --git a/Simplified/en.lproj/Localizable.strings b/Simplified/en.lproj/Localizable.strings index 3c48a5ba8..29bf2a616 100644 --- a/Simplified/en.lproj/Localizable.strings +++ b/Simplified/en.lproj/Localizable.strings @@ -270,13 +270,20 @@ "If the above link does not work, please email us at" = "If the above link does not work, please email us at"; "Delete Library Card" = "Delete Library Card"; "Delete Data Failed" = "Delete Data Failed"; -"DeleteServerDataDescription" = "SimplyE does not create any accounts outside of your library card. The content that the SimplyE app saves is: +"DeleteServerDataDescriptionSimplyE" = "SimplyE does not create any accounts outside of your library card. The content that the SimplyE app saves is: • your library card information to log into your library • your last known place in the book you’re reading or listening to • and any bookmarks or highlights you’ve created for your current book Your account information is saved outside of your current device if you specifically permit us to save it. If you only want your bookmarks and reading location deleted, please go to back to the prior screen. Set the “Sync Bookmarks” toggle to OFF, then come back to this page and tap “Delete Reading Data”. Then you can log out, and SimplyE will no longer save any of your information."; +"DeleteServerDataDescriptionOpeneBooks" = "Open eBooks does not create any accounts outside of your library card. The content that the Open eBooks app saves is: + +• your library card information to log into your library +• your last known place in the book you’re reading or listening to +• and any bookmarks or highlights you’ve created for your current book + +Your account information is saved outside of your current device if you specifically permit us to save it. If you only want your bookmarks and reading location deleted, please go to back to the prior screen. Set the “Sync Bookmarks” toggle to OFF, then come back to this page and tap “Delete Reading Data”. Then you can log out, and Open eBooks will no longer save any of your information."; "DeleteLibraryCardDescription" = "If you want to delete your account, or all of your library patron data, this will require deleting your library card altogether. Deleting your account means that you will no longer have access to ebooks, audiobooks, databases and other digital resources. You also can no longer use your card at your local branches. If you wish to proceed, in order to protect your privacy, please email us."; diff --git a/Simplified/es.lproj/Localizable.strings b/Simplified/es.lproj/Localizable.strings index 5969e73f7cdffc2630aeb92e7ea36b21447ccc1c..f8eee8ee1110809860118e1a1c667c46cc0e766f 100644 GIT binary patch delta 124 zcmey>!1$zxalka7Z1r*~tt5cq$;I delta 23 fcmaFT!}zO#al Date: Tue, 21 Jun 2022 16:10:59 -0700 Subject: [PATCH 19/24] Update localized strings --- .../Settings/NYPLSettingsDeleteLibraryCardViewController.swift | 1 - Simplified/en.lproj/Localizable.strings | 2 ++ Simplified/it.lproj/Localizable.strings | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift b/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift index 81e33c7c7..79610ce63 100644 --- a/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift +++ b/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift @@ -181,7 +181,6 @@ extension NYPLSettingsDeleteLibraryCardViewController: MFMailComposeViewControll completion: nil) } case .sent: - // TODO: Check wordings with Risa let alert = UIAlertController( title: NSLocalizedString("Thank You", comment: "Alert title"), message: NSLocalizedString("Your email has been sent.", comment: "Alert message"), diff --git a/Simplified/en.lproj/Localizable.strings b/Simplified/en.lproj/Localizable.strings index 29bf2a616..ae9246af5 100644 --- a/Simplified/en.lproj/Localizable.strings +++ b/Simplified/en.lproj/Localizable.strings @@ -270,6 +270,8 @@ "If the above link does not work, please email us at" = "If the above link does not work, please email us at"; "Delete Library Card" = "Delete Library Card"; "Delete Data Failed" = "Delete Data Failed"; +"Thank You" = "Thank You"; +"Your email has been sent." = "Your email has been sent."; "DeleteServerDataDescriptionSimplyE" = "SimplyE does not create any accounts outside of your library card. The content that the SimplyE app saves is: • your library card information to log into your library diff --git a/Simplified/it.lproj/Localizable.strings b/Simplified/it.lproj/Localizable.strings index a9fc2f652..a45c44d8a 100644 --- a/Simplified/it.lproj/Localizable.strings +++ b/Simplified/it.lproj/Localizable.strings @@ -269,6 +269,8 @@ "If the above link does not work, please email us at" = "Se il link soprastante non funziona, manda una mail a"; "Delete Library Card" = "Cancella la mia tessera"; "Delete Data Failed" = "Si è verificato un problema nella cancellazione dei dati"; +"Thank You" = "Grazie"; +"Your email has been sent." = "La tua mail è stata inviata."; "DeleteServerDataDescriptionSimplyE" = "SimplyE non crea nessun account a parte la tessera della biblioteca. I dati che SimplyE salva sono: • le informazioni della tua tessera che ti consentono di accedere alla biblioteca From 3e937c412daea397ec750a51a056239ccf2de72b Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Tue, 21 Jun 2022 16:11:37 -0700 Subject: [PATCH 20/24] Bump build number --- Simplified.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index 221211eb4..2649e42cd 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5538,7 +5538,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5589,7 +5589,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5639,7 +5639,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5687,7 +5687,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5957,7 +5957,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6008,7 +6008,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; From c9e5cbcc71588ac8ad56029a05b7c4a6b2966e74 Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Mon, 27 Jun 2022 11:03:22 -0700 Subject: [PATCH 21/24] Update font and related string for Delete Account --- .../NYPLSettingsAccountDetailViewController.m | 3 ++- ...tingsDeleteLibraryCardViewController.swift | 21 +++++++++---------- ...ttingsDeleteServerDataViewController.swift | 11 +++------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index 920ad313e..5df0cef75 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -760,7 +760,8 @@ - (void)tableView:(__attribute__((unused)) UITableView *)tableView && self.selectedUserAccount.barcode.length != 0) { NYPLSettingsDeleteLibraryCardViewController *vc = [[NYPLSettingsDeleteLibraryCardViewController alloc] initWithEmail:self.selectedAccount.supportEmail - barcode:self.selectedUserAccount.barcode]; + barcode:self.selectedUserAccount.barcode + libraryName:self.selectedAccount.name]; UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:vc]; [self presentViewController:navVC animated:YES completion:nil]; } diff --git a/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift b/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift index 79610ce63..e8f55990e 100644 --- a/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift +++ b/Simplified/Settings/NYPLSettingsDeleteLibraryCardViewController.swift @@ -14,10 +14,12 @@ import MessageUI private var supportEmail: String private var barcode: String + private var libraryName: String - @objc init(email: String, barcode: String) { + @objc init(email: String, barcode: String, libraryName: String) { self.supportEmail = email self.barcode = barcode + self.libraryName = libraryName super.init(nibName: nil, bundle: nil) } @@ -55,7 +57,7 @@ import MessageUI let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .center - let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) + let font = UIFont.customFont(forTextStyle: .body) let attributedString = NSMutableAttributedString(string: NSLocalizedString("E-Mail to cancel your library card", comment: "Button title for compose email"), attributes: [.underlineStyle: NSUnderlineStyle.single.rawValue, @@ -101,12 +103,14 @@ import MessageUI return } - let body = "\n\n---\nBarcode: \(barcode)" + let body = """ +I am writing to have my library card, barcode \(barcode), deleted from your system. I understand this means I lose access to all digital and branch services tied to my library card that are offered by \(libraryName). +""" let mailComposeViewController = MFMailComposeViewController.init() mailComposeViewController.mailComposeDelegate = self mailComposeViewController.setSubject(NYPLLocalizationNotNeeded("Delete Library Card")) mailComposeViewController.setToRecipients([supportEmail]) - mailComposeViewController.setMessageBody(body, isHTML: false) + mailComposeViewController.setMessageBody(NYPLLocalizationNotNeeded(body), isHTML: false) present(mailComposeViewController, animated: true, completion: nil) } @@ -150,17 +154,12 @@ import MessageUI }() private func libraryCardDeletionDescription() -> NSMutableAttributedString { - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineSpacing = 1.1 - paragraphStyle.lineHeightMultiple = 1.1 - let description = NSLocalizedString("DeleteLibraryCardDescription", comment: "Description of the delete action") - let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) + let font = UIFont.customFont(forTextStyle: .body) let attributedString = NSMutableAttributedString(string:description, attributes: [.font: font as Any, - .foregroundColor: NYPLConfiguration.primaryTextColor, - .paragraphStyle: paragraphStyle] + .foregroundColor: NYPLConfiguration.primaryTextColor] ) return attributedString diff --git a/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift b/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift index b87b1b2d2..f742f4565 100644 --- a/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift +++ b/Simplified/Settings/NYPLSettingsDeleteServerDataViewController.swift @@ -55,7 +55,7 @@ import UIKit // Delete Button let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .center - let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) + let font = UIFont.customFont(forTextStyle: .body) let attributedString = NSMutableAttributedString(string: NSLocalizedString("Delete Reading Data", comment: "Button title for delete reading data"), attributes: [.underlineStyle: NSUnderlineStyle.single.rawValue, @@ -161,10 +161,6 @@ import UIKit }() private func dataDeletionDescription() -> NSMutableAttributedString { - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineSpacing = 1.1 - paragraphStyle.lineHeightMultiple = 1.1 - #if SIMPLYE let description = NSLocalizedString("DeleteServerDataDescriptionSimplyE", comment: "Description of the delete action") @@ -172,11 +168,10 @@ import UIKit let description = NSLocalizedString("DeleteServerDataDescriptionOpeneBooks", comment: "Description of the delete action") #endif - let font = UIFont.customFont(forTextStyle: .body, multiplier: 0.9) + let font = UIFont.customFont(forTextStyle: .body) let attributedString = NSMutableAttributedString(string:description, attributes: [.font: font as Any, - .foregroundColor: NYPLConfiguration.primaryTextColor, - .paragraphStyle: paragraphStyle] + .foregroundColor: NYPLConfiguration.primaryTextColor] ) return attributedString From e8b0cc0948f0a1c61f25f97642a1c8b45c20d5bd Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Mon, 27 Jun 2022 11:05:22 -0700 Subject: [PATCH 22/24] Bump build number --- Simplified.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index 2649e42cd..f61c36f6e 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5538,7 +5538,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5589,7 +5589,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5639,7 +5639,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5687,7 +5687,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5957,7 +5957,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6008,7 +6008,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; From 5be1740d4b62558acc314a430f7bdb5deea6b88c Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Wed, 29 Jun 2022 11:53:25 -0700 Subject: [PATCH 23/24] Use authIdentifier for Delete Account email --- Simplified.xcodeproj/project.pbxproj | 12 ++++++------ .../NYPLSettingsAccountDetailViewController.m | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index f61c36f6e..f3e9111d9 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5538,7 +5538,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5589,7 +5589,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5639,7 +5639,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5687,7 +5687,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5957,7 +5957,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6008,7 +6008,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index 5df0cef75..198f4428b 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -757,10 +757,10 @@ - (void)tableView:(__attribute__((unused)) UITableView *)tableView case CellKindDeleteLibraryAccount: { #ifdef SIMPLYE if (self.selectedAccount.supportEmail.length != 0 - && self.selectedUserAccount.barcode.length != 0) { + && self.selectedUserAccount.authorizationIdentifier.length != 0) { NYPLSettingsDeleteLibraryCardViewController *vc = [[NYPLSettingsDeleteLibraryCardViewController alloc] initWithEmail:self.selectedAccount.supportEmail - barcode:self.selectedUserAccount.barcode + barcode:self.selectedUserAccount.authorizationIdentifier libraryName:self.selectedAccount.name]; UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:vc]; [self presentViewController:navVC animated:YES completion:nil]; From 7ddb7a78a7351475b7624b53e5fb96e342ab3cd4 Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Thu, 30 Jun 2022 14:27:18 -0700 Subject: [PATCH 24/24] Bump build number --- Simplified.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index f3e9111d9..dfbb617e0 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5538,7 +5538,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5589,7 +5589,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5639,7 +5639,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5687,7 +5687,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5957,7 +5957,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6008,7 +6008,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES;