Skip to content

Commit

Permalink
Merge pull request #184 from IBM/development
Browse files Browse the repository at this point in the history
Version 3.0.2 Build 107 to Prod
  • Loading branch information
jvalentik authored Sep 5, 2023
2 parents 33a46a2 + 7193af7 commit a5cfd86
Show file tree
Hide file tree
Showing 13 changed files with 1,067 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Python version (for python projects only)
sonar.python.version=3
# Project Version to be used as Code Definition
sonar.projectVersion=3.0.0.104
sonar.projectVersion=3.0.2.107
# Folders excluded from the scan
sonar.exclusions=**/Notification Agent Core Tests/**,**/Notification Agent Alert Tests/**,**/Notification Agent Banner Tests/**,**/Notification Agent Popup Tests/**,**/Notification Agent Onboarding Tests/**,**/Notification Agent Popup UI Tests/**,**/Notification Agent Onboarding UI Tests/**,**/Notification Agent Core/Controllers/HelpBuilder.swift**
431 changes: 431 additions & 0 deletions ATTRIBUTIONS.md

Large diffs are not rendered by default.

431 changes: 431 additions & 0 deletions Notification Agent Core/Resources/ATTRIBUTIONS.md

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions Notification Agent Onboarding/Views/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ struct OnboardingView: View {
currentPage
.accessibilityElement(children: .contain)
Spacer()
Rectangle()
.frame(height: 0.5)
.foregroundColor(Color(.darkGray))
Divider()
HStack {
HStack {
if let infoSection = viewModel.currentPage.infoSection {
Expand Down Expand Up @@ -87,6 +85,7 @@ struct OnboardingView: View {
}
.padding()
}
.frame(maxWidth: 832, maxHeight: 600)
}

var currentPage: some View {
Expand All @@ -95,7 +94,7 @@ struct OnboardingView: View {
outp: $viewModel.pageOutputs,
primaryButtonState: $viewModel.primaryButtonState,
secondaryButtonState: $viewModel.secondaryButtonState))
.padding()
.padding([.trailing, .leading, .top], 8)
}
}

Expand Down
10 changes: 6 additions & 4 deletions Notification Agent Onboarding/Views/OnboardingViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class OnboardingViewModel: NSObject, ObservableObject {
if let page = onboardingData.pages[safe: currentIndex] {
primaryButtonState = .enabled
secondaryButtonState = .enabled
primaryButtonLabel = page.primaryButtonLabel ?? (isLastPage ? "onboarding_page_close_button".localized : "onboarding_page_continue_button".localized)
primaryButtonLabel = page.primaryButtonLabel ?? (isLastPage ? "onboarding_page_close_button".localized : "onboarding_page_continue_button".localized)
secondaryButtonLabel = page.secondaryButtonLabel ?? "onboarding_page_back_button".localized
currentPage = page
guard currentIndex < outputsStore.count && currentIndex < inputsStore.count else { return }
Expand Down Expand Up @@ -86,7 +86,7 @@ class OnboardingViewModel: NSObject, ObservableObject {
self.currentPage = firstPage
self.isLastPage = onboardingData.pages.count == 1
self.hideBackButton = true
self.primaryButtonLabel = firstPage.primaryButtonLabel ?? "onboarding_page_continue_button".localized
self.primaryButtonLabel = firstPage.primaryButtonLabel ?? (onboardingData.pages.count == 1 ? "onboarding_page_close_button".localized : "onboarding_page_continue_button".localized)
self.secondaryButtonLabel = firstPage.secondaryButtonLabel ?? "onboarding_page_back_button".localized
let tempMatrixArray: [[[String]]] = onboardingData.pages.map { page in
guard page.isValidPage() else {
Expand All @@ -111,7 +111,7 @@ class OnboardingViewModel: NSObject, ObservableObject {
self.setTimeout(timeout)
}
NotificationCenter.default.addObserver(self, selector: #selector(repositionWindow), name: NSApplication.didChangeScreenParametersNotification, object: nil)
if let progressBarPayload = onboardingData.progressBarPayload {
if let progressBarPayload = onboardingData.progressBarPayload, onboardingData.pages.count > 1 {
var payload: String = "/percent 0 /user_interaction_enabled true"
if progressBarPayload.lowercased() == "automatic" {
automaticProgressBar = true
Expand Down Expand Up @@ -141,12 +141,14 @@ class OnboardingViewModel: NSObject, ObservableObject {
resetTimers()
switch type {
case .main:
writeStoreOnDevice()
if currentIndex >= (onboardingData.pages.count - 1) {
outputsStore[currentIndex] = self.pageOutputs
writeStoreOnDevice()
Utils.applicationExit(withReason: .userFinishedOnboarding)
} else {
currentIndex += 1
}
writeStoreOnDevice()
updateProgressBarIfNeeded()
case .secondary:
guard currentIndex > 0 else { return }
Expand Down
9 changes: 4 additions & 5 deletions Notification Agent Onboarding/Views/PageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct PageView: View {
Text(title)
.font(.bold(.title)())
.multilineTextAlignment(.center)
.padding(.top, 6)
.padding(.top, 12)
.padding(.bottom, 4)
.accessibilityAddTraits(.isHeader)
.accessibilityIdentifier("onboarding_title")
Expand All @@ -62,7 +62,6 @@ struct PageView: View {
if let subtitle = viewModel.page.subtitle {
Text(AttributedString(markdownText(subtitle).attributedString()))
.multilineTextAlignment(.center)
.font(.title3)
.accessibilityAddTraits(.isHeader)
.accessibilityIdentifier("onboarding_subtitle")
}
Expand All @@ -76,7 +75,7 @@ struct PageView: View {
if let subtitle = viewModel.page.subtitle {
Text(subtitle)
.multilineTextAlignment(.center)
.font(.title3)
.font(.title2)
.accessibilityAddTraits(.isHeader)
.accessibilityIdentifier("onboarding_subtitle")
}
Expand All @@ -90,9 +89,9 @@ struct PageView: View {
}

if !viewModel.accessoryViewsMatrix.isEmpty {
VStack {
VStack(alignment: .center) {
ForEach(viewModel.accessoryViewsMatrix, id: \.hashValue) { row in
HStack {
HStack(alignment: .top) {
ForEach(row, id: \.hashValue) { accessoryView in
accessoryView
}
Expand Down
Loading

0 comments on commit a5cfd86

Please sign in to comment.