Skip to content

Commit db7a208

Browse files
[DSC-1872] Replaced 'ui-switch' in AccessControlFormContainerComponent
1 parent 20dd0e4 commit db7a208

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

src/app/shared/access-control-form-container/access-control-form-container.component.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
<h4 class="mb-0 mr-4">
1616
{{ 'access-control-item-header-toggle' | translate }}
1717
</h4>
18-
<ui-switch
19-
[(ngModel)]="state.item.toggleStatus"
20-
(ngModelChange)="handleStatusChange('item', $event)">
21-
</ui-switch>
18+
<ds-switch
19+
[options]="switchOptions"
20+
[(selectedValue)] = "state.item.toggleStatus"
21+
(selectedValueChange) = "handleStatusChange('item', $event)">
22+
</ds-switch>
2223
</div>
2324

2425
<div class="row mt-3">
@@ -68,10 +69,11 @@ <h5 class="mt-3">{{'access-control-access-conditions' | translate}}</h5>
6869
<h4 class="mb-0 mr-4">
6970
{{'access-control-bitstream-header-toggle' | translate}}
7071
</h4>
71-
<ui-switch
72-
[(ngModel)]="state.bitstream.toggleStatus"
73-
(ngModelChange)="handleStatusChange('bitstream', $event)">
74-
</ui-switch>
72+
<ds-switch
73+
[options]="switchOptions"
74+
[(selectedValue)] = "state.bitstream.toggleStatus"
75+
(selectedValueChange) = "handleStatusChange('bitstream', $event)">
76+
</ds-switch>
7577
</div>
7678

7779
<div *ngIf="showLimitToSpecificBitstreams" class="row mt-3">

src/app/shared/access-control-form-container/access-control-form-container.component.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ import { BulkAccessConfigDataService } from '../../core/config/bulk-access-confi
1616
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
1717
import { BulkAccessConditionOptions } from '../../core/config/models/bulk-access-condition-options.model';
1818
import { AlertType } from '../alert/alert-type';
19-
import {
20-
createAccessControlInitialFormState
21-
} from './access-control-form-container-intial-state';
19+
import { createAccessControlInitialFormState } from './access-control-form-container-intial-state';
20+
import { SwitchColor, SwitchOption } from '../switch/switch.component';
2221

2322
@Component({
2423
selector: 'ds-access-control-form-container',
@@ -55,6 +54,14 @@ export class AccessControlFormContainerComponent<T extends DSpaceObject> impleme
5554

5655
readonly AlertType = AlertType;
5756

57+
/**
58+
* The custom options for the 'ds-switch' component
59+
*/
60+
switchOptions: SwitchOption[] = [
61+
{ value: true, backgroundColor: SwitchColor.Success },
62+
{ value: false },
63+
];
64+
5865
constructor(
5966
private bulkAccessConfigService: BulkAccessConfigDataService,
6067
private bulkAccessControlService: BulkAccessControlService,

0 commit comments

Comments
 (0)