setup-your-mac / Setup-Your-Mac

Setup Your Mac aims to simplify initial device configuration by leveraging swiftDialog and Jamf Pro Policy Custom Events to allow end-users to self-complete Mac setup post-enrollment.
https://snelson.us/sym
MIT License
238 stars 52 forks source link

Display Dynamic Download Estimates at "Welcome" dialog sans Configurations #57

Closed rougegoat closed 1 year ago

rougegoat commented 1 year ago

Combine checkNetworkQualityConfigruation and checkNetworkQualityCatchAllConfiguration functionality to reduce duplicate code and standardize where the download estimate(s) appear

Essentially just moved the "If promptForConfiguration == true" check into checkNetworkQualityConfiguration so the behavior changes there without needing a second function to perform the same task.

Related to issue #56

dan-snelson commented 1 year ago

Thanks, @rougegoat.

The critical difference between the checkNetworkQualityConfigurations and checkNetworkQualityCatchAllConfiguration functions are which dialog gets updated.

When Configurations aren't used, I can't see forcing the user to wait on networkQuality to complete at the "Welcome" screen; IMHO, the informational results should be displayed on the main "SYM" dialog.

dan-snelson commented 1 year ago

Oh! What happens if the user completely disables the "Welcome" screen?

dan-snelson commented 1 year ago

@rougegoat:

Thanks for this PR; I just fixed another visual "glitch" in 1.10.1-b4 (for when welcomeDialog is false).

Will you please confirm my following observation?

  1. Set welcomeDialog="${6:-"false"}" and run your patch-7 and observe that the Dynamic Download Estimate is not displayed.
  2. Repeat with 1.10.1-b4 and observe that the Dynamic Download Estimate IS displayed.

Thanks for all your contributions.

rougegoat commented 1 year ago

Sorry for the delay. It just hit that busy time between the Spring and Summer semesters.

I can confirm what you were seeing. I think ultimately I was probably overthinking it. It should be fine to reject this PR and just change line 2843 to if [[ "${promptForConfiguration}" != "true" ]] && [[ "${configurationDownloadEstimation}" == "true" ]]; then to fix the bug while preserving the data in that box if the download estimate is disabled.

dan-snelson commented 1 year ago

Thanks, @rougegoat; closing as requested.

(I think I've got the other bug addressed; lines numbers have changed.)