Skip to content

Commit 296ae8f

Browse files
authored
Configuration imports (#483)
1 parent 3005be5 commit 296ae8f

12 files changed

+59
-273
lines changed

src/app/_constants/actions.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const ACTIONS_CASE_FOLLOW_UP = {
1919
export const ACTIONS_FACILITY = {
2020
BASIC_EXPORT: 'FACILITY_EXPORT_BASIC',
2121
DETAILED_EXPORT: 'FACILITY_EXPORT_DETAILED',
22+
IMPORT: 'IMPORT',
2223
};
2324

2425
export const ACTIONS_SAMPLE = {
@@ -150,3 +151,11 @@ export const ACTIONS_PERSONS = {
150151
export const ACTIONS_TRAVEL_ENTRIES = {
151152
IMPORT: 'IMPORT',
152153
};
154+
155+
export const ACTIONS_ENTRY_POINTS = {
156+
IMPORT: 'IMPORT',
157+
};
158+
159+
export const ACTIONS_POPULATION = {
160+
IMPORT: 'IMPORT',
161+
};

src/app/configuration/configuration.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import { EntryPointsComponent } from './entry-points/entry-points.component';
3535
import { EntryPointsFiltersComponent } from './entry-points/entry-points-filters/entry-points-filters.component';
3636
import { EntryPointsListComponent } from './entry-points/entry-points-list/entry-points-list.component';
3737
import { EntryPointsAddEditComponent } from './entry-points/entry-points-add-edit/entry-points-add-edit.component';
38-
import { PopulationImportComponent } from './population/population-import/population-import.component';
3938
import { SubcontinentAddEditComponent } from './subcontinents/subcontinent-add-edit/subcontinent-add-edit.component';
4039
import { SubcontinentListComponent } from './subcontinents/subcontinent-list/subcontinent-list.component';
4140
import { SubcontinentFiltersComponent } from './subcontinents/subcontinent-filters/subcontinent-filters.component';
@@ -85,7 +84,6 @@ import { OutbreaksEditComponent } from './outbreaks/outbreaks-edit/outbreaks-edi
8584
EntryPointsFiltersComponent,
8685
EntryPointsListComponent,
8786
EntryPointsAddEditComponent,
88-
PopulationImportComponent,
8987
SubcontinentAddEditComponent,
9088
SubcontinentFiltersComponent,
9189
SubcontinentListComponent,

src/app/configuration/entry-points/entry-points-list/entry-points-list.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<button class="add-btn" mat-flat-button color="primary" (click)="openAddEntryPointModal()">
1919
{{ 'actionAddNewEntryPoint.short' | translate }}
2020
</button>
21+
<button class="import-btn" mat-stroked-button color="primary" (click)="openImportModal()">
22+
{{ 'captions.actionImport' | translate }}
23+
</button>
2124
<button mat-stroked-button color="primary" (click)="export()" class="export-btn">
2225
{{ 'captions.export' | translate }}
2326
</button>

src/app/configuration/entry-points/entry-points-list/entry-points-list.component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
margin-left: auto;
44
}
55

6-
.export-btn {
6+
.export-btn,
7+
.import-btn {
78
margin-left: 1rem;
89
}

src/app/configuration/entry-points/entry-points-list/entry-points-list.component.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { TranslateService } from '@ngx-translate/core';
44
import { Subscription } from 'rxjs';
55
import { AddEditBaseModalComponent } from '../../../shared/modals/add-edit-base-modal/add-edit-base-modal.component';
66
import {
7+
ACTIONS_ENTRY_POINTS,
78
ADD_MODAL_MAX_WIDTH,
9+
ADD_MODAL_WIDE,
810
API_ROUTE_ENTRY_POINTS,
911
CONFIGURATION_ENTRY_POINT_FILTERS_FORM_ID,
1012
EXPORT_TYPES,
@@ -20,6 +22,7 @@ import { defaultColumnDefs } from './entry-points-table-data';
2022
import { TableComponent } from '../../../shared/table/table.component';
2123
import { NotificationService } from '../../../_services/notification.service';
2224
import { ExportService } from '../../../_services/api/export.service';
25+
import { ImportModalComponent } from '../../../shared/modals/import-modal/import-modal.component';
2326

2427
@Component({
2528
selector: 'app-entry-points-list',
@@ -92,6 +95,18 @@ export class EntryPointsListComponent implements OnDestroy {
9295
this.exportService.executeExport(EXPORT_TYPES.BASIC, API_ROUTE_ENTRY_POINTS.EXPORT);
9396
}
9497

98+
openImportModal(): void {
99+
this.dialog.open(ImportModalComponent, {
100+
width: ADD_MODAL_WIDE,
101+
data: {
102+
title: 'strings.headingImportPointsOfEntry',
103+
type: ACTIONS_ENTRY_POINTS.IMPORT,
104+
service: this.entryPointService,
105+
selectOveride: true,
106+
},
107+
});
108+
}
109+
95110
ngOnDestroy(): void {
96111
this.subscription.forEach((subscription) => subscription.unsubscribe());
97112
}

src/app/configuration/facilities/facility-list/facility-list.component.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@
1818
<button class="add-btn" mat-flat-button color="primary" (click)="openAddFacilityModal()">
1919
{{ 'actionAddNewFacility' | translate }}
2020
</button>
21-
<button mat-stroked-button color="primary" class="import-btn">
21+
<button class="import-btn" mat-stroked-button color="primary" (click)="openImportModal()">
2222
{{ 'captions.actionImport' | translate }}
2323
</button>
2424
<app-dropdown-menu buttonText="{{ 'captions.export' | translate }}" class="export-dropdown">
25-
<app-action-menu
26-
[config]="actionsMore"
27-
(action)="onActionSelected($event)"
28-
></app-action-menu>
25+
<app-action-menu [config]="actionsMore" (action)="onActionSelected($event)"></app-action-menu>
2926
</app-dropdown-menu>
3027
</div>
3128
</app-table>

src/app/configuration/facilities/facility-list/facility-list.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AddEditBaseModalComponent } from '../../../shared/modals/add-edit-base-
1212
import {
1313
ACTIONS_FACILITY,
1414
ADD_MODAL_MAX_WIDTH,
15+
ADD_MODAL_WIDE,
1516
API_ROUTE_FACILITIES,
1617
CONFIGURATION_FACILITY_FILTERS_FORM_ID,
1718
EXPORT_TYPES,
@@ -21,6 +22,7 @@ import { FacilityAddEditComponent } from '../facility-add-edit/facility-add-edit
2122
import { TableComponent } from '../../../shared/table/table.component';
2223
import { NotificationService } from '../../../_services/notification.service';
2324
import { ExportService } from '../../../_services/api/export.service';
25+
import { ImportModalComponent } from '../../../shared/modals/import-modal/import-modal.component';
2426

2527
@Component({
2628
selector: 'app-facility-list',
@@ -108,6 +110,18 @@ export class FacilityListComponent implements OnDestroy {
108110
}
109111
}
110112

113+
openImportModal(): void {
114+
this.dialog.open(ImportModalComponent, {
115+
width: ADD_MODAL_WIDE,
116+
data: {
117+
title: 'strings.headingImportFacilities',
118+
type: ACTIONS_FACILITY.IMPORT,
119+
service: this.facilityService,
120+
selectOveride: true,
121+
},
122+
});
123+
}
124+
111125
ngOnDestroy(): void {
112126
this.subscription.forEach((subscription) => subscription.unsubscribe());
113127
}

src/app/configuration/population/population-import/population-import.component.html

Lines changed: 0 additions & 138 deletions
This file was deleted.

src/app/configuration/population/population-import/population-import.component.scss

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/app/configuration/population/population-import/population-import.component.spec.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)