@@ -28,17 +28,17 @@ struct TrayMenuView: View {
28
28
// Main content (Grid and Buttons)
29
29
VStack ( spacing: 20 ) { // Increased spacing between grid and buttons
30
30
LazyVGrid ( columns: columns, alignment: . leading) { // Add spacing between cards
31
- if !appState. preferences. hiddenCards. contains ( " Battery " ) {
31
+ if !appState. preferences. hiddenCards. contains ( Constants . Cards . battery ) {
32
32
CompactBatteryCard ( )
33
33
}
34
- if !appState. preferences. hiddenCards. contains ( " DeviceInformation " ) {
34
+ if !appState. preferences. hiddenCards. contains ( Constants . Cards . deviceInfo ) {
35
35
CompactDeviceCard ( )
36
36
}
37
- if !appState. preferences. hiddenCards. contains ( " Storage " ) {
37
+ if !appState. preferences. hiddenCards. contains ( Constants . Cards . storage ) {
38
38
CompactStorageCard ( )
39
39
}
40
40
if appState. preferences. mode == Constants . modes. munki || appState. preferences. mode == Constants . modes. intune {
41
- if !appState. preferences. hiddenCards. contains ( " ApplicationInstallProgress " ) {
41
+ if !appState. preferences. hiddenCards. contains ( Constants . Cards . appPatchProgress ) {
42
42
CompactPatchProgressCard ( )
43
43
}
44
44
}
@@ -99,11 +99,11 @@ struct TrayMenuView: View {
99
99
/// Counts visible cards in the grid
100
100
private func visibleCardsCount( ) -> Int {
101
101
var count = 0
102
- if !appState. preferences. hiddenCards. contains ( " Battery " ) { count += 1 }
103
- if !appState. preferences. hiddenCards. contains ( " DeviceInformation " ) { count += 1 }
104
- if !appState. preferences. hiddenCards. contains ( " Storage " ) { count += 1 }
102
+ if !appState. preferences. hiddenCards. contains ( Constants . Cards . battery ) { count += 1 }
103
+ if !appState. preferences. hiddenCards. contains ( Constants . Cards . deviceInfo ) { count += 1 }
104
+ if !appState. preferences. hiddenCards. contains ( Constants . Cards . storage ) { count += 1 }
105
105
if appState. preferences. mode == Constants . modes. munki || appState. preferences. mode == Constants . modes. intune {
106
- if !appState. preferences. hiddenCards. contains ( " ApplicationInstallProgress " ) {
106
+ if !appState. preferences. hiddenCards. contains ( Constants . Cards . appPatchProgress ) {
107
107
count += 1
108
108
}
109
109
}
@@ -117,12 +117,12 @@ struct TrayMenuView: View {
117
117
AppStateManager . shared. preferences. menuShowIdentity,
118
118
AppStateManager . shared. preferences. menuShowApps,
119
119
AppStateManager . shared. preferences. menuShowSelfService,
120
- viewModel. isButtonVisible ( " ChangePassword " ) ,
120
+ viewModel. isButtonVisible ( Constants . Actions . HideStrings . changePassword ) ,
121
121
appState. preferences. mode == Constants . modes. munki || appState. preferences. mode == Constants . modes. intune,
122
- viewModel. isButtonVisible ( " GetSupport " ) ,
123
- viewModel. isButtonVisible ( " GatherLogs " ) ,
124
- viewModel. isButtonVisible ( " SoftwareUpdates " ) ,
125
- viewModel. isButtonVisible ( " RestartIntuneAgent " )
122
+ viewModel. isButtonVisible ( Constants . Actions . HideStrings . getSupport ) ,
123
+ viewModel. isButtonVisible ( Constants . Actions . HideStrings . gatherLogs ) ,
124
+ viewModel. isButtonVisible ( Constants . Actions . HideStrings . softwareUpdate ) ,
125
+ viewModel. isButtonVisible ( Constants . Actions . HideStrings . restartIntuneAgent )
126
126
]
127
127
return buttons. filter { $0 } . count
128
128
}
@@ -140,20 +140,20 @@ struct ButtonSection: View {
140
140
appState. showWindowCallback ? ( )
141
141
}
142
142
} ) ,
143
- viewModel. isButtonVisible ( " ChangePassword " ) ? viewModel. createChangePasswordButton ( fontSize: 12 ) : nil ,
143
+ viewModel. isButtonVisible ( Constants . Actions. HideStrings. changePassword) ? viewModel. createChangePasswordButton ( fontSize: 12 ) : nil ,
144
+ viewModel. isButtonVisible ( Constants . Actions. HideStrings. getSupport) ? ScButton ( Constants . Actions. getSupport, fontSize: 12 ) { ActionHelpers . openSupportPage ( url: appState. preferences. supportPageURL) } : nil ,
144
145
( appState. preferences. mode == Constants . modes. munki || appState. preferences. mode == Constants . modes. intune)
145
- ? ( viewModel. isButtonVisible ( " OpenManagementApp " ) ? viewModel. createOpenManagementAppButton ( type: . default, fontSize: 12 ) : nil )
146
+ ? ( viewModel. isButtonVisible ( Constants . Actions . HideStrings . openManagementApp ) ? viewModel. createOpenManagementAppButton ( type: . default, fontSize: 12 ) : nil )
146
147
: nil ,
147
- viewModel. isButtonVisible ( " GetSupport " ) ? ScButton ( Constants . Actions. getSupport, fontSize: 12 ) { ActionHelpers . openSupportPage ( url: appState. preferences. supportPageURL) } : nil ,
148
- viewModel. isButtonVisible ( " GatherLogs " ) ? viewModel. createGatherLogsButton ( fontSize: 12 ) : nil ,
149
- viewModel. isButtonVisible ( " SoftwareUpdates " ) ? ScButton (
148
+ viewModel. isButtonVisible ( Constants . Actions. HideStrings. gatherLogs) ? viewModel. createGatherLogsButton ( fontSize: 12 ) : nil ,
149
+ viewModel. isButtonVisible ( Constants . Actions. HideStrings. softwareUpdate) ? ScButton (
150
150
Constants . Actions. softwareUpdate,
151
151
badgeNumber: appState. systemUpdateCache. updates. count,
152
152
helpText: appState. systemUpdateCache. updates. joined ( separator: " \n " ) ,
153
153
fontSize: 12 )
154
154
{ ActionHelpers . openSystemUpdates ( ) } : nil ,
155
155
( appState. preferences. mode == Constants . modes. munki || appState. preferences. mode == Constants . modes. intune)
156
- ? ( viewModel. isButtonVisible ( " RestartIntuneAgent " ) ? viewModel. createRestartIntuneAgentButton ( fontSize: 12 ) : nil )
156
+ ? ( viewModel. isButtonVisible ( Constants . Actions . HideStrings . restartIntuneAgent ) ? viewModel. createRestartIntuneAgentButton ( fontSize: 12 ) : nil )
157
157
: nil
158
158
] . compactMap { $0 } // Remove nil values
159
159
0 commit comments