Skip to content

Commit e8b972e

Browse files
[DSC-1872] Replaced 'ui-switch' in SystemWideAlertFormComponent
1 parent db7a208 commit e8b972e

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

src/app/system-wide-alert/alert-form/system-wide-alert-form.component.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ <h2 id="header">{{'system-wide-alert.form.header' | translate}}</h2>
44
<div class="form-group">
55
<div class="row mb-2">
66
<div class="col">
7-
<ui-switch [checkedLabel]="'system-wide-alert.form.label.active' | translate"
8-
[uncheckedLabel]="'system-wide-alert.form.label.inactive' | translate"
9-
[checked]="formActive.value"
10-
(change)="setActive($event)"></ui-switch>
7+
<ds-switch
8+
[options]="switchOptions"
9+
[selectedValue]="formActive.value"
10+
(selectedValueChange)="setActive($event)">
11+
</ds-switch>
1112
</div>
1213
</div>
1314
<div class="row">
@@ -29,9 +30,14 @@ <h2 id="header">{{'system-wide-alert.form.header' | translate}}</h2>
2930
</div>
3031
<div class="row">
3132
<div class="col mb-2 d-flex align-items-end">
32-
<ui-switch size="small"
33-
[checked]="counterEnabled$ |async"
34-
(change)="setCounterEnabled($event)"></ui-switch>
33+
<label class="custom-control custom-switch">
34+
<input type="checkbox"
35+
class="custom-control-input"
36+
id="customSwitchBitstream"
37+
[checked]="counterEnabled$ | async"
38+
(change)="setCounterEnabled($event.target.checked)">
39+
<span class="custom-control-label"></span>
40+
</label>
3541
<span class="ml-2">{{ 'system-wide-alert.form.label.countdownTo.enable' | translate }}</span>
3642
</div>
3743
</div>

src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
1414
import { Router } from '@angular/router';
1515
import { RequestService } from '../../core/data/request.service';
1616
import { TranslateService } from '@ngx-translate/core';
17+
import { SwitchColor, SwitchOption } from '../../shared/switch/switch.component';
1718

1819

1920
/**
@@ -76,6 +77,13 @@ export class SystemWideAlertFormComponent implements OnInit {
7677
*/
7778
previewDays: number;
7879

80+
/**
81+
* The custom options for the 'ds-switch' component
82+
*/
83+
switchOptions: SwitchOption[] = [
84+
{ value: true, labelColor: SwitchColor.Success, backgroundColor: SwitchColor.Success ,label: 'system-wide-alert.form.label.active' },
85+
{ value: false, label: 'system-wide-alert.form.label.inactive' },
86+
];
7987

8088
constructor(
8189
protected systemWideAlertDataService: SystemWideAlertDataService,

0 commit comments

Comments
 (0)