Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOBUG: Removing lodash and unused export service #511

Merged
merged 3 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,13 @@
"bootstrap": "~4.5.0",
"classlist.js": "~1.1.20150312",
"core-js": "^2.5.4",
"file-saver": "~2.0.2",
"hammerjs": "~2.0.8",
"intl": "~1.2.5",
"jquery": "~3.5.1",
"json2csv": "~4.5.3",
"keycloak-angular": "~5.1.0",
"leaflet": "~1.3.1",
"leaflet.markercluster": "~1.4.1",
"linkify-it": "~2.2.0",
"lodash.debounce": "4.0.8",
"lodash.differenceby": "4.8.0",
"lodash.flatmap": "4.5.0",
"lodash.flatten": "4.4.0",
"lodash.get": "4.4.2",
"moment": "~2.24.0",
"mygovbc-bootstrap-theme": "~0.4.1",
"ng-inline-svg": "~8.5.1",
Expand Down Expand Up @@ -113,11 +106,9 @@
"@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "~7.2.0",
"@types/arcgis-js-api": "~4.13.0",
"@types/file-saver": "~2.0.1",
"@types/geojson": "~7946.0.7",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/json2csv": "~4.5.0",
"@types/leaflet": "~1.4.4",
"@types/leaflet.markercluster": "~1.4.0",
"@types/linkify-it": "~2.1.0",
Expand Down
3 changes: 0 additions & 3 deletions angular/projects/global/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"@angular/platform-browser-dynamic": "^7.2.15",
"@angular/router": "^8.2.14",
"core-js": "^2.6.10",
"file-saver": "^2.0.2",
"json2csv": "^4.5.4",
"lodash.get": "^4.4.2",
"moment": "^2.24.0",
"ngx-pagination": "^3.3.1",
"zone.js": "^0.8.29",
Expand Down
4 changes: 1 addition & 3 deletions angular/projects/global/src/lib/global.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { AutoGrowTextAreaDirective } from './directives/auto-grow-textarea/auto-
import { DigitOnlyDirective } from './directives/digit-only/digit-only.directive';

// services
import { ExportService } from './services/export.service';
import { StoreService } from './services/store.service';
import { SearchService } from './services/search.service';
import { InjectComponentService } from './services/inject-component.service';
Expand Down Expand Up @@ -50,7 +49,6 @@ import { LoadingScreenService } from './services/loading-screen.service';
DigitOnlyDirective
],
providers: [
ExportService,
StoreService,
SearchService,
TableTemplateUtils,
Expand All @@ -69,4 +67,4 @@ import { LoadingScreenService } from './services/loading-screen.service';
DigitOnlyDirective
]
})
export class GlobalModule {}
export class GlobalModule { }
77 changes: 0 additions & 77 deletions angular/projects/global/src/lib/services/export.service.spec.ts

This file was deleted.

98 changes: 0 additions & 98 deletions angular/projects/global/src/lib/services/export.service.ts

This file was deleted.

1 change: 0 additions & 1 deletion angular/projects/global/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export * from './lib/directives/auto-grow-textarea/auto-grow-textarea.directive'
export * from './lib/directives/digit-only/digit-only.directive';

// services
export * from './lib/services/export.service';
export * from './lib/services/loading-screen.service';
export * from './lib/services/store.service';
export * from './lib/services/search.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import {
Component,
AfterViewInit,
OnChanges,
OnDestroy,
Input,
Output,
EventEmitter,
ElementRef,
SimpleChanges
} from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
// import { takeUntil, map } from 'rxjs/operators';
import 'leaflet';
import 'leaflet.markercluster';
import { differenceBy } from 'lodash.differenceby';
import 'async';
import 'topojson-client';
import 'jquery';
Expand Down Expand Up @@ -71,7 +68,7 @@ const markerIconLg = L.icon({
templateUrl: './app-map.component.html',
styleUrls: ['./app-map.component.scss']
})
export class AppMapComponent implements AfterViewInit, OnChanges, OnDestroy {
export class AppMapComponent implements AfterViewInit, OnDestroy {
@Input() isLoading: boolean; // from applications component
@Input() applications: Application[] = []; // from applications component
@Input() isMapVisible: Application[] = []; // from applications component
Expand Down Expand Up @@ -99,7 +96,7 @@ export class AppMapComponent implements AfterViewInit, OnChanges, OnDestroy {
private elementRef: ElementRef,
public urlService: UrlService
) {
this.urlService.onNavEnd$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {});
this.urlService.onNavEnd$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => { });
}

// for creating custom cluster icon
Expand Down Expand Up @@ -553,32 +550,6 @@ export class AppMapComponent implements AfterViewInit, OnChanges, OnDestroy {
});
}

// called when apps list changes
public ngOnChanges(changes: SimpleChanges) {
// update map only if it's visible
if (this.isMapVisible) {
if (changes.applications && !changes.applications.firstChange && changes.applications.currentValue) {
// console.log('map: got changed apps =', changes.applications);

const deletedApps = differenceBy(
changes.applications.previousValue as Application[],
changes.applications.currentValue as Application[],
'_id'
);
const addedApps = differenceBy(
changes.applications.currentValue as Application[],
changes.applications.previousValue as Application[],
'_id'
);
// console.log('deleted =', deletedApps);
// console.log('added =', addedApps);

// (re)draw the matching apps
this.drawMap(deletedApps, addedApps);
}
}
}

// when map becomes visible, draw all apps
// TODO: or just emit current bounds and cause a reload?
public onMapVisible() {
Expand Down