Skip to content

Commit

Permalink
Merge branch 'main' into afarcasanu/fxios_10655_23315_common_name_und…
Browse files Browse the repository at this point in the history
…erlined

# Conflicts:
#	firefox-ios/Client/Frontend/TrackingProtection/CertificatesHelpers/CertificatesCell.swift
  • Loading branch information
dicarobinho committed Jan 17, 2025
2 parents 5437361 + a87d7b1 commit 45792ef
Show file tree
Hide file tree
Showing 25 changed files with 273 additions and 37 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/firefox-ios-autofill-playwrite-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ jobs:
- name: Send Slack notification if tests fail
if: '${{ !cancelled() && !github.event.pull_request.head.repo.fork }}'
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-autofill-test.json"
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
18 changes: 10 additions & 8 deletions .github/workflows/firefox-ios-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
workflow_dispatch: {}
env:
browser: firefox-ios
xcode_version: 16.1
ios_version: 18.1
xcode_version: 16.2
ios_version: 18.2
ios_simulator_default: iPhone 16
xcodebuild_scheme: Fennec
xcodebuild_target: Client
Expand Down Expand Up @@ -184,12 +184,13 @@ jobs:
retention-days: 90
- name: Report to Slack
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: ${{ env.browser }}/slack.json
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
pass_fail: ${{ steps.passfail.outcome == 'success' && ':white_check_mark:' || ':x:' }}
xcodebuild_test_plan: Smoketests
Expand Down Expand Up @@ -267,12 +268,13 @@ jobs:
retention-days: 90
- name: Report to Slack
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: ${{ env.browser }}/slack.json
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
xcodebuild_test_plan: FullFunctionalTestPlan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: GitHub <[email protected]>
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: ${{ env.pr_title }}
commit-message: "Refactor [v${{ env.next_version }}] Update effective_tld_names file ${{ env.current_date }}"
title: "Refactor [v${{ env.next_version }}] Update effective_tld_names file ${{ env.current_date }}"
branch: ${{ env.branch_name }}
body: ${{ env.pr_body }}
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ jobs:
- name: Send Slack to notifiy if github action fails
if: '!cancelled()'
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
env:
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-autofill.json"
payload-templated: true
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
call-firefox-ios-autofill-playwrite-tests:
uses: ./.github/workflows/firefox-ios-autofill-playwrite-tests.yml
secrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ jobs:
- name: Send Slack to notifiy if github action fails
if: '!cancelled()'
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
env:
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-remote-settings-fetch.json"
payload-file-path: "./test-fixtures/ci/slack-notification-payload-remote-settings-fetch.json"
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
10 changes: 10 additions & 0 deletions BrowserKit/Sources/ComponentLibrary/Buttons/LinkButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ open class LinkButton: UIButton, ThemeApplicable {
configuration = updatedConfiguration
}

public func applyUnderline(underlinedText: String) {
let attributedString = NSAttributedString(
string: underlinedText,
attributes: [
.underlineStyle: NSUnderlineStyle.single.rawValue
]
)
setAttributedTitle(attributedString, for: .normal)
}

// MARK: ThemeApplicable

public func applyTheme(theme: Theme) {
Expand Down
8 changes: 8 additions & 0 deletions firefox-ios/Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
0A76936B2C82018700103A6D /* TrackingProtectionBlockedTrackersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76936A2C82018700103A6D /* TrackingProtectionBlockedTrackersView.swift */; };
0A93C8AA2C87070300BEA143 /* TrackingProtectionConnectionStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A93C8A92C87070300BEA143 /* TrackingProtectionConnectionStatusView.swift */; };
0A93C8AC2C870E7100BEA143 /* TrackingProtectionToggleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A93C8AB2C870E7100BEA143 /* TrackingProtectionToggleView.swift */; };
0ABCD45B2D355260005D704A /* TermsOfServiceTelemetry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABCD45A2D355255005D704A /* TermsOfServiceTelemetry.swift */; };
0ABCD45D2D356015005D704A /* TermsOfServiceTelemetryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABCD45C2D356006005D704A /* TermsOfServiceTelemetryTests.swift */; };
0AC659272BF35854005C614A /* FxAWebViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC659262BF35854005C614A /* FxAWebViewModelTests.swift */; };
0AC659292BF493CE005C614A /* MockFxAWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC659282BF493CE005C614A /* MockFxAWebViewModel.swift */; };
0AD3EEAC2C2485A7001044E5 /* ThemedCenteredTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AD3EEAB2C2485A7001044E5 /* ThemedCenteredTableViewCell.swift */; };
Expand Down Expand Up @@ -2332,6 +2334,8 @@
0A7D41DB98DDB127A2B8C544 /* ms */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ms; path = ms.lproj/Menu.strings; sourceTree = "<group>"; };
0A93C8A92C87070300BEA143 /* TrackingProtectionConnectionStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackingProtectionConnectionStatusView.swift; sourceTree = "<group>"; };
0A93C8AB2C870E7100BEA143 /* TrackingProtectionToggleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackingProtectionToggleView.swift; sourceTree = "<group>"; };
0ABCD45A2D355255005D704A /* TermsOfServiceTelemetry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsOfServiceTelemetry.swift; sourceTree = "<group>"; };
0ABCD45C2D356006005D704A /* TermsOfServiceTelemetryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsOfServiceTelemetryTests.swift; sourceTree = "<group>"; };
0AC659262BF35854005C614A /* FxAWebViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FxAWebViewModelTests.swift; sourceTree = "<group>"; };
0AC659282BF493CE005C614A /* MockFxAWebViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockFxAWebViewModel.swift; sourceTree = "<group>"; };
0AD3EEAB2C2485A7001044E5 /* ThemedCenteredTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemedCenteredTableViewCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -12116,6 +12120,7 @@
8AC225632B6D3F9600CDA7FD /* Telemetry */ = {
isa = PBXGroup;
children = (
0ABCD45C2D356006005D704A /* TermsOfServiceTelemetryTests.swift */,
8AC225642B6D3FA400CDA7FD /* HomepageTelemetryTests.swift */,
E1B9A2C32CADA78300F6A0E9 /* ToolbarTelemetryTests.swift */,
0A686B3B2CDB70DC0090E146 /* MainMenuTelemetryTests.swift */,
Expand Down Expand Up @@ -13108,6 +13113,7 @@
435D660423D794B90046EFA2 /* UpdateViewModel.swift */,
74B420C82A1D0D7A00370E53 /* OnboardingInstructionsPopupInfoModel.swift */,
C8CD80DB2A1E8C970097C3AE /* OnboardingTelemetryUtility.swift */,
0ABCD45A2D355255005D704A /* TermsOfServiceTelemetry.swift */,
81020C932BB5B026007B8481 /* OnboardingMultipleChoiceButtonViewModel.swift */,
);
path = Models;
Expand Down Expand Up @@ -16803,6 +16809,7 @@
E174963A2992B42C0096900A /* CreditCardSectionHeader.swift in Sources */,
8A3EF7F42A2FCF5700796E3A /* ExportBrowserDataSetting.swift in Sources */,
8CC6170B2C358BAC001C7688 /* ActionToast.swift in Sources */,
0ABCD45B2D355260005D704A /* TermsOfServiceTelemetry.swift in Sources */,
2128E27B292E624400FB91BE /* SendToDeviceActivity.swift in Sources */,
E63ED7D81BFCD9990097D08E /* LoginDetailTableViewCell.swift in Sources */,
C855728229AE7F1700AF32B0 /* SurveySurfaceManager.swift in Sources */,
Expand Down Expand Up @@ -17253,6 +17260,7 @@
213B67A827CE721E000542F5 /* StartAtHomeHelperTests.swift in Sources */,
8A13FA892AD82BC8007527AB /* AppSendTabDelegateTests.swift in Sources */,
8A7653C228A2E57D00924ABF /* PocketDataAdaptorTests.swift in Sources */,
0ABCD45D2D356015005D704A /* TermsOfServiceTelemetryTests.swift in Sources */,
C8CD80D42A1E268C0097C3AE /* MockGleanPlumbEvaluationUtility.swift in Sources */,
E1AEC176286E0CF500062E29 /* JumpBackInViewModelTests.swift in Sources */,
8A7AE4472BAC78230072DAEC /* MockLibraryNavigationHandler.swift in Sources */,
Expand Down
6 changes: 6 additions & 0 deletions firefox-ios/Client/Application/AccessibilityIdentifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ struct AccessibilityIdentifiers {
static let closeButton = "TrackingProtectionDetails.CloseButton"
static let backButton = "TrackingProtectionDetails.BackButton"
static let titleLabel = "TrackingProtectionDetails.TitleLabel"
static let certificatesTitleLabel = "TrackingProtectionDetails.CertificatesTitleLabel"
static let tableView = "TrackingProtectionDetails.TableView"
static let tableViewHeader = "TrackingProtectionDetails.TableViewHeader"
static let sectionLabel = "TrackingProtectionDetails.SectionLabel"
static let allSectionItems = "TrackingProtectionDetails.AllSectionItems"
static let itemLabel = "TrackingProtectionDetails.ItemLabel"
}

struct BlockedTrackers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ class LaunchCoordinator: BaseCoordinator,
// MARK: - Terms of Service
private func presentTermsOfService(with manager: TermsOfServiceManager,
isFullScreen: Bool) {
TermsOfServiceTelemetry().termsOfServiceScreenDisplayed()
let viewController = TermsOfServiceViewController(profile: profile, windowUUID: windowUUID)
viewController.didFinishFlow = { [weak self] in
guard let self = self else { return }
manager.setAccepted()
TermsOfServiceTelemetry().termsOfServiceAcceptButtonTapped()

let sendTechnicalData = profile.prefs.boolForKey(AppConstants.prefSendUsageData) ?? true
manager.shouldSendTechnicalData(value: sendTechnicalData)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/

import Foundation
import Glean

struct TermsOfServiceTelemetry {
func termsOfServiceScreenDisplayed() {
GleanMetrics.Onboarding.termsOfServiceCard.record()
}

func technicalInteractionDataSwitched(to value: Bool) {
let extra = GleanMetrics.Onboarding.ToggleTechnicalInteractionDataExtra(changedTo: value)
GleanMetrics.Onboarding.toggleTechnicalInteractionData.record(extra)
}

func automaticCrashReportsSwitched(to value: Bool) {
let extra = GleanMetrics.Onboarding.ToggleAutomaticCrashReportsExtra(changedTo: value)
GleanMetrics.Onboarding.toggleAutomaticCrashReports.record(extra)
}

func termsOfServiceLinkTapped() {
GleanMetrics.Onboarding.termsOfServiceLinkClicked.record()
}

func termsOfServicePrivacyNoticeLinkTapped() {
GleanMetrics.Onboarding.termsOfServicePrivacyNoticeLinkClicked.record()
}

func termsOfServiceManageLinkTapped() {
GleanMetrics.Onboarding.termsOfServiceManageLinkClicked.record()
}

func termsOfServiceAcceptButtonTapped() {
GleanMetrics.Onboarding.termsOfServiceAccepted.record()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ final class PrivacyPreferencesViewController: UIViewController,
private func setupCallbacks() {
crashReportsSwitch.switchCallback = { [weak self] value in
self?.profile.prefs.setBool(value, forKey: AppConstants.prefSendCrashReports)
TermsOfServiceTelemetry().automaticCrashReportsSwitched(to: value)
}

technicalDataSwitch.switchCallback = { [weak self] value in
self?.profile.prefs.setBool(value, forKey: AppConstants.prefSendUsageData)
TermsOfServiceTelemetry().technicalInteractionDataSwitched(to: value)
}

crashReportsSwitch.learnMoreCallBack = { [weak self] in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,19 @@ class TermsOfServiceViewController: UIViewController, Themeable {
// MARK: - Button actions
@objc
private func presentTermsOfService(_ gesture: UIGestureRecognizer) {
TermsOfServiceTelemetry().termsOfServiceLinkTapped()
presentLink(with: URL(string: Links.termsOfService))
}

@objc
private func presentPrivacyNotice(_ gesture: UIGestureRecognizer) {
TermsOfServiceTelemetry().termsOfServicePrivacyNoticeLinkTapped()
presentLink(with: URL(string: Links.privacyNotice))
}

@objc
private func presentManagePreferences(_ gesture: UIGestureRecognizer) {
TermsOfServiceTelemetry().termsOfServiceManageLinkTapped()
let managePreferencesVC = PrivacyPreferencesViewController(profile: profile, windowUUID: windowUUID)
if UIDevice.current.userInterfaceIdiom != .phone {
managePreferencesVC.modalPresentationStyle = .formSheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ final class CertificatesCell: UITableViewCell, ReusableCell, ThemeApplicable {
}
}

// MARK: Accessibility
func setupAccessibilityIdentifiers() {
typealias A11y = AccessibilityIdentifiers.EnhancedTrackingProtection.DetailsScreen
sectionLabel.accessibilityIdentifier = A11y.sectionLabel
allSectionItemsStackView.accessibilityIdentifier = A11y.allSectionItems
}

func applyTheme(theme: Theme) {
backgroundColor = theme.colors.layer5
sectionLabel.textColor = theme.colors.textPrimary
Expand All @@ -92,6 +99,7 @@ final class CertificatesCell: UITableViewCell, ReusableCell, ThemeApplicable {
itemLabel.textAlignment = isTitle ? .right : .left
itemLabel.numberOfLines = 0
itemLabel.lineBreakMode = .byWordWrapping
itemLabel.accessibilityIdentifier = AccessibilityIdentifiers.EnhancedTrackingProtection.DetailsScreen.itemLabel
if isUnderlined, !isTitle {
let attributedString = NSAttributedString(
string: title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,10 @@ class CertificatesHeaderView: UITableViewHeaderFooterView, ReusableCell {

headerStackView.backgroundColor = theme.colors.layer5
}

// MARK: Accessibility
func setupAccessibilityIdentifiers() {
typealias A11y = AccessibilityIdentifiers.EnhancedTrackingProtection.DetailsScreen
headerStackView.accessibilityIdentifier = A11y.tableViewHeader
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ class CertificatesViewController: UIViewController,
}
}
headerView.configure(withItems: items, theme: currentTheme())
headerView.setupAccessibilityIdentifiers()
return headerView
}

Expand All @@ -222,6 +223,7 @@ class CertificatesViewController: UIViewController,
}

let certificate = model.certificates[model.selectedCertificateIndex]
cell.setupAccessibilityIdentifiers()

switch CertificatesItemType(rawValue: indexPath.row) {
case .subjectName:
Expand Down Expand Up @@ -265,13 +267,16 @@ class CertificatesViewController: UIViewController,

// MARK: Accessibility
private func setupAccessibilityIdentifiers() {
typealias A11y = AccessibilityIdentifiers.EnhancedTrackingProtection.DetailsScreen
headerView.setupAccessibility(
closeButtonA11yLabel: .Menu.EnhancedTrackingProtection.AccessibilityLabels.CloseButton,
closeButtonA11yId: AccessibilityIdentifiers.EnhancedTrackingProtection.DetailsScreen.closeButton,
titleA11yId: AccessibilityIdentifiers.EnhancedTrackingProtection.DetailsScreen.titleLabel,
closeButtonA11yId: A11y.closeButton,
titleA11yId: A11y.titleLabel,
backButtonA11yLabel: .Menu.EnhancedTrackingProtection.AccessibilityLabels.BackButton,
backButtonA11yId: AccessibilityIdentifiers.EnhancedTrackingProtection.DetailsScreen.backButton
backButtonA11yId: A11y.backButton
)
titleLabel.accessibilityIdentifier = A11y.certificatesTitleLabel
certificatesTableView.accessibilityIdentifier = A11y.tableView
}

// MARK: View Transitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class TrackingProtectionDetailsViewController: UIViewController, Themeable {
font: FXFontStyles.Regular.footnote.scaledFont()
)
viewCertificatesButton.configure(viewModel: certificatesButtonViewModel)
viewCertificatesButton.applyUnderline(underlinedText: model.viewCertificatesButtonTitle)
baseView.addArrangedSubview(viewCertificatesButton)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ class TrackingProtectionViewController: UIViewController,
font: FXFontStyles.Regular.footnote.scaledFont()
)
settingsLinkButton.configure(viewModel: settingsButtonViewModel)
settingsLinkButton.applyUnderline(underlinedText: model.settingsButtonTitle)
}

private func setupProtectionSettingsView() {
Expand Down
Loading

0 comments on commit 45792ef

Please sign in to comment.