Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alecarn committed Aug 23, 2024
1 parent 9b8a070 commit 0ada522
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 62 deletions.
9 changes: 4 additions & 5 deletions e2e/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/angular';

import './commands';

// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
mount: typeof mount
mount: typeof mount;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export class ExpansionPanelHeaderComponent {
return this.expanded;
}

constructor() {}

handleClose(): void {
this.expandedChange.emit(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ExpansionPanelComponent {
}
private _expanded: boolean;

@Input() maximized: Boolean = false;
@Input() maximized = false;

@Input()
get backdropShown(): boolean {
Expand All @@ -59,8 +59,6 @@ export class ExpansionPanelComponent {
return this.expanded && this.maximized;
}

constructor() {}

onBackdropClick() {
this.expanded = false;
this.backdropShown = false;
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/portal/map-overlay/map-overlay.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class MapOverlayComponent implements AfterViewInit, OnDestroy {
this.handleContextChange(context);
this.context = context;
});
this.media$$ = this.mediaService.media$.subscribe((media) =>
this.media$$ = this.mediaService.media$.subscribe(() =>
this.handleContextChange(this.context)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/portal/map-overlay/map-overlay.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface MapOverlay {
* Media device to display the mapOverlay
* Desktop is the default value.
*/
media: Array<Media>;
media: Media[];
/**
* Css class to define position of the element
*/
Expand Down
33 changes: 14 additions & 19 deletions src/app/pages/portal/portal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,15 @@ import { WelcomeWindowService } from './welcome-window/welcome-window.service';
})
export class PortalComponent implements OnInit, OnDestroy {
public appConfig: EnvironmentOptions;
public toastPanelOffsetX$: BehaviorSubject<string> = new BehaviorSubject(
undefined
);
public sidenavOpened$: BehaviorSubject<boolean> = new BehaviorSubject(false);
public toastPanelOffsetX$ = new BehaviorSubject<string>(undefined);
public sidenavOpened$ = new BehaviorSubject<boolean>(false);
public minSearchTermLength = 2;
public hasGeolocateButton = true;
public showMenuButton = true;
public showSearchBar = true;
public workspaceNotAvailableMessage: string = 'workspace.disabled.resolution';
public workspaceNotAvailableMessage = 'workspace.disabled.resolution';
public workspacePaginator: MatPaginator;
public workspaceEntitySortChange$: BehaviorSubject<boolean> =
new BehaviorSubject(false);
public workspaceEntitySortChange$ = new BehaviorSubject<boolean>(false);
public workspaceSwitchDisabled = false;
public paginatorOptions: EntityTablePaginatorOptions = {
pageSize: 50, // Number of items to display on a page.
Expand Down Expand Up @@ -260,9 +257,7 @@ export class PortalComponent implements OnInit, OnDestroy {
public toastPanelForExpansionOpened = true;
private activeWidget$$: Subscription;
public showToastPanelForExpansionToggle = false;
public selectedWorkspace$: BehaviorSubject<Workspace> = new BehaviorSubject(
undefined
);
public selectedWorkspace$ = new BehaviorSubject<Workspace>(undefined);
private routeParams: Params;
public toastPanelHtmlDisplay = false;

Expand Down Expand Up @@ -460,7 +455,7 @@ export class PortalComponent implements OnInit, OnDestroy {
this.readLanguageParam(params);
});

this.authService.authenticate$.subscribe((authenticated) => {
this.authService.authenticate$.subscribe(() => {
this.contextLoaded = false;
});

Expand Down Expand Up @@ -537,7 +532,7 @@ export class PortalComponent implements OnInit, OnDestroy {
});

this.workspaceMaximize$$.push(
this.workspaceState.workspaceMaximize$.subscribe((workspaceMaximize) => {
this.workspaceState.workspaceMaximize$.subscribe(() => {
this.updateMapBrowserClass();
})
);
Expand Down Expand Up @@ -596,7 +591,7 @@ export class PortalComponent implements OnInit, OnDestroy {
this.mediaService.orientation$
])
.pipe(debounceTime(50))
.subscribe((sidenavMediaAndOrientation: [boolean, string, string]) => {
.subscribe(() => {
this.computeToastPanelOffsetX();
});

Expand Down Expand Up @@ -667,7 +662,7 @@ export class PortalComponent implements OnInit, OnDestroy {
}

addFeature(workspace: EditionWorkspace) {
let feature = {
const feature = {
type: 'Feature',
properties: {}
};
Expand All @@ -677,7 +672,7 @@ export class PortalComponent implements OnInit, OnDestroy {
}

createFeatureProperties(layer: ImageLayer | VectorLayer) {
let properties = {};
const properties = {};
layer.options.sourceOptions.sourceFields.forEach((field) => {
if (!field.primary && field.visible) {
properties[field.name] = '';
Expand Down Expand Up @@ -1575,7 +1570,7 @@ export class PortalComponent implements OnInit, OnDestroy {
name: string,
type: 'wms' | 'wmts' | 'arcgisrest' | 'imagearcgisrest' | 'tilearcgisrest',
version: string,
visibility: boolean = true,
visibility = true,
zIndex: number
) {
if (!this.contextLoaded) {
Expand Down Expand Up @@ -1687,7 +1682,7 @@ export class PortalComponent implements OnInit, OnDestroy {
this.dialogWindow.open(WelcomeWindowComponent, welcomWindowConfig)
);

this.matDialogRef$.value.afterClosed().subscribe((result) => {
this.matDialogRef$.value.afterClosed().subscribe(() => {
this.welcomeWindowService.afterClosedWelcomeWindow();
this.matDialogRef$.next(undefined);
});
Expand Down Expand Up @@ -1744,7 +1739,7 @@ export class PortalComponent implements OnInit, OnDestroy {
}

zoomToSelectedFeatureWks() {
let format = new olFormatGeoJSON();
const format = new olFormatGeoJSON();
const featuresSelected = this.workspaceState.workspaceSelection.map(
(rec) => rec.entity as Feature
);
Expand All @@ -1753,7 +1748,7 @@ export class PortalComponent implements OnInit, OnDestroy {
}
const olFeaturesSelected = [];
for (const feat of featuresSelected) {
let localOlFeature = format.readFeature(feat, {
const localOlFeature = format.readFeature(feat, {
dataProjection: feat.projection,
featureProjection: this.map.projection
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,4 @@ export class ToastPanelForExpansionComponent {
get displayStyle() {
return this.withHeader || this.opened ? 'visible' : 'hidden';
}

constructor() {}
}
38 changes: 14 additions & 24 deletions src/app/pages/portal/toast-panel/toast-panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class ToastPanelComponent implements OnInit, OnDestroy {
}
set store(value: EntityStore<SearchResult<Feature>>) {
this._store = value;
this.store.entities$.subscribe((_entities) => {
this.store.entities$.subscribe(() => {
this.unselectResult();
});
}
Expand All @@ -140,7 +140,7 @@ export class ToastPanelComponent implements OnInit, OnDestroy {
}
private _opened = true;

@Input() hasFeatureEmphasisOnSelection: Boolean = false;
@Input() hasFeatureEmphasisOnSelection = false;

get zoomAuto(): boolean {
return this._zoomAuto;
Expand Down Expand Up @@ -170,15 +170,10 @@ export class ToastPanelComponent implements OnInit, OnDestroy {
}
private _fullExtent = false;

public potententialLayerToAdd$: BehaviorSubject<any> = new BehaviorSubject(
undefined
);
public potententialLayerisAdded$: BehaviorSubject<boolean> =
new BehaviorSubject(false);
public potententialLayerToAdd$ = new BehaviorSubject<any>(undefined);
public potententialLayerisAdded$ = new BehaviorSubject<boolean>(false);

public fullExtent$: BehaviorSubject<boolean> = new BehaviorSubject(
this.fullExtent
);
public fullExtent$ = new BehaviorSubject<boolean>(this.fullExtent);
public isHtmlDisplay = false;
public iconResizeWindows = '';

Expand All @@ -197,12 +192,13 @@ export class ToastPanelComponent implements OnInit, OnDestroy {
private format = new olFormatGeoJSON();

private resultOrResolution$$: Subscription;
private focusedResult$: BehaviorSubject<SearchResult<Feature>> =
new BehaviorSubject(undefined);
private focusedResult$ = new BehaviorSubject<SearchResult<Feature>>(
undefined
);
private abstractFocusedOrSelectedResult: Feature;

public withZoomButton = true;
zoomAuto$: BehaviorSubject<boolean> = new BehaviorSubject(false);
zoomAuto$ = new BehaviorSubject<boolean>(false);

@Output() openedChange = new EventEmitter<boolean>();

Expand Down Expand Up @@ -283,21 +279,15 @@ export class ToastPanelComponent implements OnInit, OnDestroy {
// return this.opened && this.fullExtent;
// }

@HostListener('document:keydown.escape', ['$event']) onEscapeHandler(
event: KeyboardEvent
) {
@HostListener('document:keydown.escape', ['$event']) onEscapeHandler() {
this.clear();
}

@HostListener('document:keydown.backspace', ['$event']) onBackHandler(
event: KeyboardEvent
) {
@HostListener('document:keydown.backspace', ['$event']) onBackHandler() {
this.unselectResult();
}

@HostListener('document:keydown.z', ['$event']) onZoomHandler(
event: KeyboardEvent
) {
@HostListener('document:keydown.z', ['$event']) onZoomHandler() {
if (this.isResultSelected$.getValue() === true) {
const localOlFeature = this.format.readFeature(
this.resultSelected$.getValue().data,
Expand Down Expand Up @@ -858,15 +848,15 @@ export class ToastPanelComponent implements OnInit, OnDestroy {
}

private computeSourceOptionsFromProperties(
properties: {},
properties: unknown,
geoService: ExtendedGeoServiceDefinition
) {
const keys = Object.keys(properties);
const propertiesForLayerName = keys.filter((p) =>
geoService.propertiesForLayerName.includes(p)
);
// providing the the first matching regex;
let layerName = properties[propertiesForLayerName[0]];
const layerName = properties[propertiesForLayerName[0]];
const url = properties[geoService.propertyForUrl];
let appliedLayerName = layerName;
let arcgisLayerName = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { getAppVersion } from 'src/app/app.utils';

import { WelcomeWindowService } from './welcome-window.service';

('@igo2/core');

@Component({
selector: 'app-welcome-window',
templateUrl: './welcome-window.component.html',
Expand All @@ -47,7 +45,7 @@ export class WelcomeWindowComponent implements OnInit, OnDestroy {
showAgain = false;
public discoverTitleInLocale$: Observable<string>;
private title$$: Subscription;
public html$: BehaviorSubject<string> = new BehaviorSubject(undefined);
public html$ = new BehaviorSubject<string>(undefined);

constructor(
public dialog: MatDialog,
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/pwa.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { skip, tap } from 'rxjs/operators';
providedIn: 'root'
})
export class PwaService {
private confirmOpened: boolean = false;
private confirmOpened = false;
constructor(
private updates: SwUpdate,
private languageService: LanguageService,
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { AppComponent } from './app/app.component';
import { PortalModule } from './app/pages';
import { environment } from './environments/environment';

const DEFAULT_THEME: string = 'blue-theme';
const DEFAULT_THEME = 'blue-theme';

const TOOLTIP_OPTIONS: MatTooltipDefaultOptions = {
showDelay: 500,
Expand Down

0 comments on commit 0ada522

Please sign in to comment.