Skip to content

Commit 3e2c6f1

Browse files
[DSC-1872] Replaced 'ui-switch' in BatchImportPageComponent
1 parent 49f5a58 commit 3e2c6f1

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/app/admin/admin-import-batch-page/batch-import-page.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ <h2 id="header">{{'admin.batch-import.page.header' | translate}}</h2>
2020
</small>
2121
</div>
2222

23-
<ui-switch color="#ebebeb"
24-
[checkedLabel]="'admin.metadata-import.page.toggle.upload' | translate"
25-
[uncheckedLabel]="'admin.metadata-import.page.toggle.url' | translate"
26-
[checked]="isUpload"
27-
(change)="toggleUpload()" ></ui-switch>
23+
<ds-switch
24+
[options]="switchOptions"
25+
[selectedValue]="isUpload ? 'upload' : 'url'"
26+
(selectedValueChange)="toggleUpload()">
27+
</ds-switch>
2828
<small class="form-text text-muted">
2929
{{'admin.batch-import.page.toggle.help' | translate}}
3030
</small>

src/app/admin/admin-import-batch-page/batch-import-page.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
1717
import { take } from 'rxjs/operators';
1818
import { DSpaceObject } from '../../core/shared/dspace-object.model';
1919
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
20+
import { SwitchColor, SwitchOption } from '../../shared/switch/switch.component';
2021

2122
@Component({
2223
selector: 'ds-batch-import-page',
@@ -48,6 +49,14 @@ export class BatchImportPageComponent {
4849
*/
4950
fileURL: string;
5051

52+
/**
53+
* The custom options for the 'ds-switch' component
54+
*/
55+
switchOptions: SwitchOption[] = [
56+
{ value: 'upload', icon: 'fa fa-upload', label: 'admin.metadata-import.page.toggle.upload', iconColor: SwitchColor.Primary },
57+
{ value: 'url', icon: 'fa fa-link', label: 'admin.metadata-import.page.toggle.url', iconColor: SwitchColor.Primary },
58+
];
59+
5160
public constructor(private location: Location,
5261
protected translate: TranslateService,
5362
protected notificationsService: NotificationsService,
@@ -154,4 +163,5 @@ export class BatchImportPageComponent {
154163
toggleUpload() {
155164
this.isUpload = !this.isUpload;
156165
}
166+
157167
}

0 commit comments

Comments
 (0)