mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
Merge pull request #41721 from aaryanporwal/telemetry-ident-fix
mgr/dashboard: telemetry activate: show ident fields when checked Reviewed-by: aaryanporwal <NOT@FOUND> Reviewed-by: Alfonso Martínez <almartin@redhat.com> Reviewed-by: Avan Thakkar <athakkar@redhat.com> Reviewed-by: Nizamudeen A <nia@redhat.com> Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
This commit is contained in:
commit
26df5df247
@ -126,12 +126,14 @@
|
|||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
class="custom-control-input"
|
class="custom-control-input"
|
||||||
id="channel_ident"
|
id="channel_ident"
|
||||||
formControlName="channel_ident">
|
formControlName="channel_ident"
|
||||||
|
(click)="toggleIdent()">
|
||||||
<label class="custom-control-label"
|
<label class="custom-control-label"
|
||||||
for="channel_ident"></label>
|
for="channel_ident"></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ng-container *ngIf="showContactInfo">
|
||||||
<legend>
|
<legend>
|
||||||
<ng-container i18n>Contact Information</ng-container>
|
<ng-container i18n>Contact Information</ng-container>
|
||||||
<cd-helper i18n>Submitting any contact information is completely optional and disabled by default.</cd-helper>
|
<cd-helper i18n>Submitting any contact information is completely optional and disabled by default.</cd-helper>
|
||||||
@ -161,6 +163,7 @@
|
|||||||
i18n-placeholder>
|
i18n-placeholder>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
<legend i18n>Advanced Settings</legend>
|
<legend i18n>Advanced Settings</legend>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="cd-col-form-label"
|
<label class="cd-col-form-label"
|
||||||
|
@ -80,6 +80,29 @@ describe('TelemetryComponent', () => {
|
|||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should show/hide ident fields on checking/unchecking', () => {
|
||||||
|
const getContactField = () =>
|
||||||
|
fixture.debugElement.nativeElement.querySelector('input[id=contact]');
|
||||||
|
const getDescriptionField = () =>
|
||||||
|
fixture.debugElement.nativeElement.querySelector('input[id=description]');
|
||||||
|
|
||||||
|
// Initially hidden.
|
||||||
|
expect(getContactField()).toBeFalsy();
|
||||||
|
expect(getDescriptionField()).toBeFalsy();
|
||||||
|
|
||||||
|
// Show fields.
|
||||||
|
component.toggleIdent();
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(getContactField()).toBeTruthy();
|
||||||
|
expect(getDescriptionField()).toBeTruthy();
|
||||||
|
|
||||||
|
// Hide fields.
|
||||||
|
component.toggleIdent();
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(getContactField()).toBeFalsy();
|
||||||
|
expect(getDescriptionField()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
it('should set module enability to true correctly', () => {
|
it('should set module enability to true correctly', () => {
|
||||||
expect(component.moduleEnabled).toBeTruthy();
|
expect(component.moduleEnabled).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
@ -42,6 +42,7 @@ export class TelemetryComponent extends CdForm implements OnInit {
|
|||||||
sendToUrl = '';
|
sendToUrl = '';
|
||||||
sendToDeviceUrl = '';
|
sendToDeviceUrl = '';
|
||||||
step = 1;
|
step = 1;
|
||||||
|
showContactInfo = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public actionLabels: ActionLabelsI18n,
|
public actionLabels: ActionLabelsI18n,
|
||||||
@ -137,6 +138,10 @@ export class TelemetryComponent extends CdForm implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleIdent() {
|
||||||
|
this.showContactInfo = !this.showContactInfo;
|
||||||
|
}
|
||||||
|
|
||||||
updateConfig() {
|
updateConfig() {
|
||||||
const config = {};
|
const config = {};
|
||||||
_.forEach(Object.values(this.options), (option) => {
|
_.forEach(Object.values(this.options), (option) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user