Skip to content

Commit 190d5fa

Browse files
committed
feat: remove CIRA disabled warning
1 parent 16a256b commit 190d5fa

17 files changed

Lines changed: 45 additions & 111 deletions

src/app/profiles/profile-detail/profile-detail.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@
330330
[value]="connectionMode.cira"
331331
[disabled]="ciraConfigurations().length === 0">
332332
{{ 'profileDetail.ciraCloud.value' | translate }}
333-
<span>{{ 'profileDetail.ciraDisabledOption.value' | translate }}</span>
334333
@if (ciraConfigurations().length === 0) {
335334
<span>{{ 'profileDetail.noCiraConfigs.value' | translate }}</span>
336335
}

src/app/profiles/profile-detail/profile-detail.component.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,26 @@ describe('ProfileDetailComponent', () => {
187187
component.setConnectionMode(profile)
188188
expect(component.profileForm.controls.connectionMode.value).toBe('CIRA')
189189
})
190+
it('should not set connectionMode to CIRA when CIRA is disabled and availability is resolved', () => {
191+
component.profileForm.controls.ciraConfigName.setValue('config1')
192+
component.ciraEnabled.set(false)
193+
;(component as any).ciraAvailabilityResolved.set(true)
194+
195+
const profile: Profile = { ciraConfigName: 'config1' } as any
196+
component.setConnectionMode(profile)
197+
198+
expect(component.profileForm.controls.connectionMode.value).toBe('DIRECT')
199+
expect(component.profileForm.controls.ciraConfigName.value).toBeNull()
200+
})
201+
it('should keep CIRA connectionMode before enterprise feature availability resolves', () => {
202+
component.ciraEnabled.set(false)
203+
;(component as any).ciraAvailabilityResolved.set(false)
204+
205+
const profile: Profile = { ciraConfigName: 'config1' } as any
206+
component.setConnectionMode(profile)
207+
208+
expect(component.profileForm.controls.connectionMode.value).toBe('CIRA')
209+
})
190210
it('should set connectionMode to DIRECT when tlsMode is 0 and no CIRA config', () => {
191211
const profile: Profile = { tlsMode: 0, ciraConfigName: null } as any
192212
component.setConnectionMode(profile)

src/app/profiles/profile-detail/profile-detail.component.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ export class ProfileDetailComponent implements OnInit {
147147
// (fetched on init). Start from cloudMode so enterprise hides CIRA until the
148148
// API responds, avoiding a flash when the server reports CIRA disabled.
149149
public readonly ciraEnabled = signal(this.cloudMode)
150+
// Enterprise starts with ciraEnabled=false before server features return; track
151+
// when availability is actually known to avoid coercing a saved CIRA profile too early.
152+
private readonly ciraAvailabilityResolved = signal(this.cloudMode)
150153
public readonly isLoading = signal(false)
151154
public readonly errorMessages = signal<string[]>([])
152155

@@ -217,17 +220,35 @@ export class ProfileDetailComponent implements OnInit {
217220
this.serverFeaturesService.getFeatures().subscribe({
218221
next: (features) => {
219222
this.ciraEnabled.set(features.ciraEnabled)
223+
this.ciraAvailabilityResolved.set(true)
224+
if (!features.ciraEnabled) {
225+
this.coerceConnectionModeIfCiraUnavailable()
226+
}
220227
if (features.ciraEnabled) this.getCiraConfigs()
221228
},
222229
// Fail open: if the features call fails, assume CIRA is enabled.
223230
error: () => {
224231
this.ciraEnabled.set(true)
232+
this.ciraAvailabilityResolved.set(true)
225233
this.getCiraConfigs()
226234
}
227235
})
228236
}
229237
}
230238

239+
private coerceConnectionModeIfCiraUnavailable(): void {
240+
if (this.profileForm.controls.connectionMode.value !== this.connectionMode.cira) {
241+
return
242+
}
243+
244+
// Keep existing TLS profiles on TLS; otherwise fall back to DIRECT.
245+
const fallbackMode =
246+
this.profileForm.controls.tlsMode.value != null && this.profileForm.controls.tlsMode.value > 0
247+
? this.connectionMode.tls
248+
: this.connectionMode.direct
249+
this.profileForm.controls.connectionMode.setValue(fallbackMode)
250+
}
251+
231252
private setupFormSubscriptions(): void {
232253
this.profileForm.controls.activation.valueChanges.subscribe((value) => {
233254
if (value) this.activationChange(value)
@@ -262,9 +283,11 @@ export class ProfileDetailComponent implements OnInit {
262283
}
263284

264285
setConnectionMode(data: Profile): void {
286+
const canUseCira = this.ciraEnabled() || !this.ciraAvailabilityResolved()
287+
265288
if (data.tlsMode != null && data.tlsMode > 0) {
266289
this.profileForm.controls.connectionMode.setValue(this.connectionMode.tls)
267-
} else if (data.ciraConfigName != null) {
290+
} else if (data.ciraConfigName != null && canUseCira) {
268291
this.profileForm.controls.connectionMode.setValue(this.connectionMode.cira)
269292
} else {
270293
this.profileForm.controls.connectionMode.setValue(this.connectionMode.direct)

src/app/profiles/profiles.component.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ <h3 class="flex justify-center">{{ 'profiles.noData.value' | translate }}</h3>
2424
<mat-header-cell *matHeaderCellDef style="flex: 1 1 0">
2525
{{ 'profiles.table.name.value' | translate }}
2626
</mat-header-cell>
27-
<mat-cell *matCellDef="let element" style="flex: 1 1 0">
28-
{{ element.profileName }}
29-
@if (!ciraEnabled() && element.ciraConfigName) {
30-
<mat-icon
31-
color="warn"
32-
[matTooltip]="'profileDetail.ciraDisabledWarning.value' | translate"
33-
style="font-size: 18px; height: 18px; width: 18px; vertical-align: middle; margin-left: 4px"
34-
>warning</mat-icon
35-
>
36-
}
37-
</mat-cell>
27+
<mat-cell *matCellDef="let element" style="flex: 1 1 0">{{ element.profileName }}</mat-cell>
3828
</ng-container>
3929
<!-- network config Column -->
4030
<ng-container matColumnDef="networkConfig">

src/app/profiles/profiles.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { MatProgressBar } from '@angular/material/progress-bar'
3333
import { MatIcon } from '@angular/material/icon'
3434
import { MatButton, MatIconButton } from '@angular/material/button'
3535
import { MatToolbar } from '@angular/material/toolbar'
36-
import { MatTooltip } from '@angular/material/tooltip'
3736
import { environment } from '../../environments/environment'
3837
import { KeyDisplayDialogComponent } from './key-display-dialog/key-display-dialog.component'
3938
import { TranslatePipe, TranslateService } from '@ngx-translate/core'
@@ -63,7 +62,6 @@ import { ServerFeaturesService } from '../server-features.service'
6362
MatRowDef,
6463
MatRow,
6564
MatPaginator,
66-
MatTooltip,
6765
ToolkitPipe,
6866
TranslatePipe
6967
]

src/assets/i18n/ar.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,14 +2145,6 @@
21452145
"description": "تسمية حقل تكوين CIRA",
21462146
"value": "تكوين CIRA"
21472147
},
2148-
"profileDetail.ciraDisabledOption": {
2149-
"description": "Inline note on the CIRA radio when CIRA is disabled on the server",
2150-
"value": "(CIRA معطّل على هذا الخادم)"
2151-
},
2152-
"profileDetail.ciraDisabledWarning": {
2153-
"description": "Warning shown when editing a profile that uses CIRA while CIRA is disabled on the server",
2154-
"value": "CIRA معطّل على هذا الخادم. يستخدم هذا الملف الشخصي CIRA لاتصال الإدارة الخاص به ولن يعمل حتى تتم إعادة تمكين CIRA."
2155-
},
21562148
"profileDetail.connectionConfiguration": {
21572149
"description": "تسمية قسم تكوين الاتصال",
21582150
"value": "تكوين الاتصال المُوفر"

src/assets/i18n/de.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,14 +2145,6 @@
21452145
"description": "Bezeichnung für das CIRA-Konfigurationsfeld",
21462146
"value": "CIRA-Konfiguration"
21472147
},
2148-
"profileDetail.ciraDisabledOption": {
2149-
"description": "Inline note on the CIRA radio when CIRA is disabled on the server",
2150-
"value": "(CIRA ist auf diesem Server deaktiviert)"
2151-
},
2152-
"profileDetail.ciraDisabledWarning": {
2153-
"description": "Warning shown when editing a profile that uses CIRA while CIRA is disabled on the server",
2154-
"value": "CIRA ist auf diesem Server deaktiviert. Dieses Profil verwendet CIRA für seine Verwaltungsverbindung und funktioniert erst, wenn CIRA wieder aktiviert wird."
2155-
},
21562148
"profileDetail.connectionConfiguration": {
21572149
"description": "Bezeichnung für den Abschnitt zur Verbindungskonfiguration",
21582150
"value": "Konfiguration der bereitgestellten Verbindung"

src/assets/i18n/en.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2615,14 +2615,6 @@
26152615
"description": "Label for CIRA configuration field",
26162616
"value": "CIRA Configuration"
26172617
},
2618-
"profileDetail.ciraDisabledOption": {
2619-
"description": "Inline note on the CIRA radio when CIRA is disabled on the server",
2620-
"value": "(CIRA is disabled on this server)"
2621-
},
2622-
"profileDetail.ciraDisabledWarning": {
2623-
"description": "Warning shown when editing a profile that uses CIRA while CIRA is disabled on the server",
2624-
"value": "CIRA is disabled on this server. This profile uses CIRA for its management connection and won't work until CIRA is re-enabled."
2625-
},
26262618
"profileDetail.connectionConfiguration": {
26272619
"description": "Label for connection configuration section",
26282620
"value": "Provisioned Connection Configuration"

src/assets/i18n/es.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,14 +2145,6 @@
21452145
"description": "Etiqueta para el campo de configuración CIRA.",
21462146
"value": "Configuración de CIRA"
21472147
},
2148-
"profileDetail.ciraDisabledOption": {
2149-
"description": "Inline note on the CIRA radio when CIRA is disabled on the server",
2150-
"value": "(CIRA está deshabilitado en este servidor)"
2151-
},
2152-
"profileDetail.ciraDisabledWarning": {
2153-
"description": "Warning shown when editing a profile that uses CIRA while CIRA is disabled on the server",
2154-
"value": "CIRA está deshabilitado en este servidor. Este perfil usa CIRA para su conexión de administración y no funcionará hasta que se vuelva a habilitar CIRA."
2155-
},
21562148
"profileDetail.connectionConfiguration": {
21572149
"description": "Etiqueta para la sección de configuración de la conexión.",
21582150
"value": "Configuración de la conexión aprovisionada"

src/assets/i18n/fi.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,14 +2145,6 @@
21452145
"description": "CIRA-määrityskentän nimi",
21462146
"value": "CIRA-konfiguraatio"
21472147
},
2148-
"profileDetail.ciraDisabledOption": {
2149-
"description": "Inline note on the CIRA radio when CIRA is disabled on the server",
2150-
"value": "(CIRA on poistettu käytöstä tällä palvelimella)"
2151-
},
2152-
"profileDetail.ciraDisabledWarning": {
2153-
"description": "Warning shown when editing a profile that uses CIRA while CIRA is disabled on the server",
2154-
"value": "CIRA on poistettu käytöstä tällä palvelimella. Tämä profiili käyttää CIRAa hallintayhteyteensä eikä toimi, ennen kuin CIRA otetaan uudelleen käyttöön."
2155-
},
21562148
"profileDetail.connectionConfiguration": {
21572149
"description": "Yhteysasetusten osion nimike",
21582150
"value": "Provisioitu yhteyden konfigurointi"

0 commit comments

Comments
 (0)