Skip to content

Commit

Permalink
* fix(tsconfig): remove deprecated config and unnecessary (#1610)
Browse files Browse the repository at this point in the history
* fix(common): resolve template type checking

* fix(geo): resolve template type checking

* fix(context): resolve template type checking

* fix(integration): resolve template type checking

* fix(demo): resolve template type checking
BREAKING CHANGE ToolboxColor is now a type
  • Loading branch information
alecarn authored Jan 30, 2024
1 parent 8dd825c commit 9f89d89
Show file tree
Hide file tree
Showing 53 changed files with 157 additions and 133 deletions.
10 changes: 7 additions & 3 deletions packages/common/src/lib/action/actionbar/actionbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { MatListModule } from '@angular/material/list';
import { MatMenuModule } from '@angular/material/menu';
import {
MatMenuModule,
MenuPositionX,
MenuPositionY
} from '@angular/material/menu';
import { MatTooltipModule } from '@angular/material/tooltip';

import { Media, MediaService } from '@igo2/core';
Expand Down Expand Up @@ -161,12 +165,12 @@ export class ActionbarComponent implements OnDestroy, OnChanges {
/**
* Overlay X position
*/
@Input() xPosition = 'before';
@Input() xPosition: MenuPositionX = 'before';

/**
* Overlay Y position
*/
@Input() yPosition = 'above';
@Input() yPosition: MenuPositionY = 'above';

/**
* Class to add to the actionbar overlay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import { getEntityTitle } from '../shared/entity.utils';
import { EntityStore } from '../shared/store';
import { EntityStoreWatcher } from '../shared/watcher';

export interface EntitySelectorChange<T = any> {
selected: boolean;
value: T;
}
@Component({
selector: 'igo-entity-selector',
templateUrl: './entity-selector.component.html',
Expand Down Expand Up @@ -105,10 +109,7 @@ export class EntitySelectorComponent implements OnInit, OnDestroy {
/**
* Event emitted when the selection changes
*/
@Output() selectedChange = new EventEmitter<{
selected: boolean;
value: object | object[];
}>();
@Output() selectedChange = new EventEmitter<EntitySelectorChange>();

constructor(private cdRef: ChangeDetectorRef) {}

Expand Down
7 changes: 7 additions & 0 deletions packages/common/src/lib/entity/shared/entity.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,18 @@ export interface EntityTableColumn {
) => {
[key: string]: boolean;
};
step?: number;
icon?: string;
onBlur?: (event: Event) => void;
onChange?: (event: Event) => void;
onClick?: (event: Event) => void;
onFocus?: (event: Event) => void;
}

export interface SelectOption {
id: number;
value: string;
disabled?: boolean;
}

export interface EntityTableButton {
Expand Down
6 changes: 1 addition & 5 deletions packages/common/src/lib/tool/shared/toolbox.enums.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
export enum ToolboxColor {
White = 'white',
Grey = 'grey',
Primary = 'primary'
}
export type ToolboxColor = 'white' | 'grey' | 'primary';
6 changes: 3 additions & 3 deletions packages/common/src/lib/tool/toolbox/toolbox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,22 @@ export class ToolboxComponent implements OnInit, OnDestroy {
/**
* Color of Toolbox
*/
@Input() color: ToolboxColor = ToolboxColor.White;
@Input() color: ToolboxColor = 'white';

/**
* @ignore
*/
@HostBinding('class.color-grey')
get classColorGrey() {
return this.color === ToolboxColor.Grey;
return this.color === 'grey';
}

/**
* @ignore
*/
@HostBinding('class.color-primary')
get classColorPrimary() {
return this.color === ToolboxColor.Primary;
return this.color === 'primary';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import {
} from '@angular/core';

import { getEntityTitle } from '../../entity';
import { EntitySelectorComponent } from '../../entity/entity-selector/entity-selector.component';
import {
EntitySelectorChange,
EntitySelectorComponent
} from '../../entity/entity-selector/entity-selector.component';
import { WorkspaceStore } from '../shared/store';
import { Workspace } from '../shared/workspace';

Expand Down Expand Up @@ -54,7 +57,7 @@ export class WorkspaceSelectorComponent {
* @internal
* @param event The selection change event
*/
onSelectedChange(event: { value: Workspace }) {
onSelectedChange(event: EntitySelectorChange<Workspace>) {
const workspace = event.value;
this.store.activateWorkspace(workspace);
this.selectedChange.emit({ selected: true, value: workspace });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
type="file"
[style.display]="'none'"
(click)="fileInput.value = null"
(change)="importFiles($event.target.files)"
(change)="importFiles($any($event.target).files)"
/>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@
[ngForOf]="$any(contexts$ | async) | keyvalue"
>
<igo-collapsible
*ngIf="groupContexts.value.length && auth.authenticated"
[title]="titleMapping[groupContexts.key] | translate"
[collapsed]="collapsed[titleMapping[groupContexts.key]]"
(toggle)="collapsed[titleMapping[groupContexts.key]] = $event"
*ngIf="$any(groupContexts).value.length && auth.authenticated"
[title]="titleMapping[$any(groupContexts).key] | translate"
[collapsed]="$any(collapsed[titleMapping[$any(groupContexts).key]])"
(toggle)="collapsed[titleMapping[$any(groupContexts).key]] = $any($event)"
>
<ng-template ngFor let-context [ngForOf]="groupContexts.value">
<ng-template ngFor let-context [ngForOf]="$any(groupContexts).value">
<igo-context-item
igoListItem
color="accent"
Expand All @@ -178,12 +178,10 @@
</ng-template>
</igo-collapsible>

<ng-template
*ngIf="groupContexts.value.length && !auth.authenticated"
ngFor
let-context
[ngForOf]="groupContexts.value"
>
<ng-container
*ngIf="$any(groupContexts).value.length && !auth.authenticated"
></ng-container>
<ng-template ngFor let-context [ngForOf]="$any(groupContexts).value">
<igo-context-item
igoListItem
color="accent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<ng-container *ngIf="isLayer(item)">
<igo-catalog-browser-layer
igoListItem
[layer]="item"
[layer]="$any(item)"
[resolution]="resolution"
[map]="map"
[catalogAllowLegend]="catalogAllowLegend"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
>
</mat-icon>
</button>
<igo-metadata-button [layer]="layer"></igo-metadata-button>
<igo-metadata-button [layer]="$any(layer)"></igo-metadata-button>

<button
(mouseenter)="onMouseEvent($event)"
Expand All @@ -46,7 +46,7 @@
[igoMatBadgeIcon]="getBadgeIcon()"
igoMatBadgeColor="rgba(0,0,0,0.87)"
igoMatBadgeBackgroundColor="none"
igoMatBadgeInverseColor="true"
[igoMatBadgeInverseColor]="true"
[matBadgeHidden]="
((inRange$ | async) && (isVisible$ | async) === true) ||
((inRange$ | async) && !added) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ng-container *ngIf="isLayer(item)">
<igo-catalog-browser-layer
igoListItem
[layer]="item"
[layer]="$any(item)"
[map]="map"
[resolution]="resolution$ | async"
[catalogAllowLegend]="catalogAllowLegend"
Expand Down
6 changes: 4 additions & 2 deletions packages/geo/src/lib/draw/draw/draw-popup.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ <h2 mat-dialog-title>
class="mat-typography"
[value]="option.value"
[disabled]="optionAvailable(option.value)"
(change)="onLabelTypeChange($event.source.value, $event.checked)"
(change)="
onLabelTypeChange($any($event.source.value), $event.checked)
"
[checked]="option.checked"
>
{{ getProperLengthLabel(option.value) }}
Expand Down Expand Up @@ -153,7 +155,7 @@ <h2 mat-dialog-title>
#input
matInput
(select)="(true)"
(input)="getLabelLength($event.target.value)"
(input)="getLabelLength($any($event.target).value)"
placeholder="{{ 'igo.geo.draw.dialogTitle' | translate }}"
value="{{ currentLabel }}"
cdkFocusInitial
Expand Down
11 changes: 6 additions & 5 deletions packages/geo/src/lib/draw/draw/draw-popup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ export class DrawPopupComponent {
: (this.labelFlag = undefined);
checked
? (this.labelFlag = labelType)
: (this.labelFlag = this.arrayBuiltInType.find((type) => type.checked)
?.value);
: (this.labelFlag = this.arrayBuiltInType.find(
(type) => type.checked
)?.value);
} else {
this.labelFlag = labelType;
}
Expand Down Expand Up @@ -410,19 +411,19 @@ export class DrawPopupComponent {
}
}

get allLengthUnits(): string[] {
get allLengthUnits(): MeasureLengthUnit[] {
return Object.values(MeasureLengthUnit);
}

getLengthUnitEnum(lengthUnit: MeasureLengthUnit) {
return MeasureLengthUnitAbbreviation[lengthUnit];
}

get allAreaUnits(): string[] {
get allAreaUnits(): MeasureAreaUnit[] {
return Object.values(MeasureAreaUnit);
}

get allCoordinatesUnits(): string[] {
get allCoordinatesUnits(): CoordinatesUnit[] {
return Object.values(CoordinatesUnit);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class FeatureDetailsComponent implements OnInit, OnDestroy {
return text;
}

filterFeatureProperties(feature) {
filterFeatureProperties(feature): { [key: string]: any } {
const allowedFieldsAndAlias = feature.meta ? feature.meta.alias : undefined;
const properties = {};
let offlineButtonState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ListItemDirective } from '@igo2/common';
import { TranslateModule } from '@ngx-translate/core';

import { Layer } from '../../layer/shared/layers/layer';
import { IgoMap } from '../../map/shared/map';
import { MapBase } from '../../map';
import { OgcFilterableItemComponent } from '../ogc-filterable-item/ogc-filterable-item.component';
import {
IgoOgcSelector,
Expand Down Expand Up @@ -168,7 +168,7 @@ export class OgcFilterButtonComponent implements OnInit {
}
private _layer;

@Input() map: IgoMap;
@Input() map: MapBase;

@Input() color: string = 'primary';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
? (selectedField$ | async).alias
: ('igo.geo.sourceFields.selectField' | translate)
"
(input)="updateFieldsList($event.target.value)"
(input)="updateFieldsList($any($event.target).value)"
/>
<mat-autocomplete
#autoCompleteField="matAutocomplete"
Expand Down Expand Up @@ -181,7 +181,7 @@
? currentFilter.expression || ''
: currentFilter.pattern || ''
"
(input)="updateValuesList($event.target.value)"
(input)="updateValuesList($any($event.target).value)"
/>
<mat-autocomplete
#autoCompleteValues="matAutocomplete"
Expand Down Expand Up @@ -243,7 +243,7 @@
tooltip-position="above"
matTooltipShowDelay="500"
[matTooltip]="currentFilter.igoSNRC ? currentFilter.igoSNRC : ''"
(input)="changeSNRC($event.target.value)"
(input)="changeSNRC($any($event.target).value)"
/>
<button
*ngIf="currentFilter.igoSNRC"
Expand Down Expand Up @@ -305,7 +305,7 @@
? currentFilter.lowerBoundary
: currentFilter.begin
"
(input)="updateValuesList($event.target.value, 1)"
(input)="updateValuesList($any($event.target).value, 1)"
/>
<mat-autocomplete
#autoDualValueOperator1="matAutocomplete"
Expand Down Expand Up @@ -357,7 +357,7 @@
? currentFilter.upperBoundary
: currentFilter.end
"
(input)="updateValuesList($event.target.value, 2)"
(input)="updateValuesList($any($event.target).value, 2)"
/>
<mat-autocomplete
#autoDualValueOperator2="matAutocomplete"
Expand Down Expand Up @@ -391,8 +391,8 @@

<igo-ogc-filter-time
*ngIf="isTemporalOperator()"
[(datasource)]="datasource"
[(currentFilter)]="currentFilter"
[datasource]="datasource"
[currentFilter]="currentFilter"
(changeProperty)="changeProperty($event.value, $event.pos)"
>
</igo-ogc-filter-time>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
OgcFilterableDataSource,
OgcFiltersOptions
} from '../../filter/shared/ogc-filter.interface';
import { IgoMap } from '../../map/shared/map';
import { MapBase } from '../../map';
import { WktService } from '../../wkt/shared/wkt.service';
import { OgcFilterTimeComponent } from '../ogc-filter-time/ogc-filter-time.component';

Expand Down Expand Up @@ -76,7 +76,7 @@ export class OgcFilterFormComponent implements OnInit {

@Input() datasource: OgcFilterableDataSource;

@Input() map: IgoMap;
@Input() map: MapBase;

@Input() currentFilter: any;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ <h3 *ngIf="!currentFilter.title">
</h3>
<h3 *ngIf="currentFilter.title">{{ currentFilter.title }}</h3>
<igo-ogc-filter-time
[(datasource)]="datasource"
[(currentFilter)]="currentFilter"
[datasource]="datasource"
[currentFilter]="currentFilter"
(changeProperty)="changeProperty($event.value, $event.pos)"
>
</igo-ogc-filter-time>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
OgcSelectorBundle,
SelectorGroup
} from '../../filter/shared/ogc-filter.interface';
import { IgoMap } from '../../map/shared/map';
import { MapBase } from '../../map';
import { OgcFilterTimeComponent } from '../ogc-filter-time/ogc-filter-time.component';
import { OgcFilterOperator } from '../shared/ogc-filter.enum';
import { OGCFilterService } from '../shared/ogc-filter.service';
Expand Down Expand Up @@ -81,7 +81,7 @@ export class OgcFilterSelectionComponent implements OnInit {

@Input() datasource: OgcFilterableDataSource;

@Input() map: IgoMap;
@Input() map: MapBase;

@Input() checkboxesIndex = 5;
@Input() radioButtonsIndex = 5;
Expand Down
Loading

0 comments on commit 9f89d89

Please sign in to comment.