Skip to content

Commit

Permalink
Merge pull request #181 from ndsev/release/2025.1.0
Browse files Browse the repository at this point in the history
Release 2025.1.0
  • Loading branch information
Waguramu authored Jan 24, 2025
2 parents 75574a8 + 2e57c7e commit 02bcec0
Show file tree
Hide file tree
Showing 32 changed files with 1,090 additions and 786 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
Expand All @@ -30,7 +30,7 @@ jobs:
$GITHUB_WORKSPACE/ci/10_linux_build.bash
- name: Release artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v4
with:
name: erdblick
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install build dependencies
run: sudo apt-get install ninja-build
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ message("Building for ${CMAKE_SYSTEM_NAME}.")
if (NOT TARGET mapget)
FetchContent_Declare(mapget
GIT_REPOSITORY "https://github.com/Klebert-Engineering/mapget"
GIT_TAG "v2024.5.0"
GIT_TAG "v2025.1.0"
GIT_SHALLOW ON)
FetchContent_MakeAvailable(mapget)
endif()
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.5.0
2025.1.0
14 changes: 12 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@
"input": ".",
"output": "/bundle/"
}
]
],
"buildOptimizer": true,
"optimization": {
"scripts": true,
"styles": true,
"fonts": true
},
"vendorChunk": false,
"extractLicenses": false,
"sourceMap": false,
"namedChunks": false
},
"development": {
"buildOptimizer": false,
Expand All @@ -120,7 +130,7 @@
"namedChunks": true
}
},
"defaultConfiguration": "development"
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-builders/custom-webpack:dev-server",
Expand Down
6 changes: 3 additions & 3 deletions build-ui.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ npm install

echo "Building Angular distribution files."
npm run lint
if [[ -z "$NG_DEVELOP" ]]; then
npm run build -- -c production
if [[ -n "$NG_DEVELOP" ]]; then
npm run build -- -c development
else
npm run build --watch
npm run build
fi

exit 0
18 changes: 16 additions & 2 deletions erdblick_app/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import {filter} from "rxjs";
<pref-components></pref-components>
<coordinates-panel></coordinates-panel>
<stats-dialog></stats-dialog>
<legal-dialog></legal-dialog>
<div *ngIf="copyright.length" id="copyright-info" (click)="openLegalInfo()">
{{ copyright }}
</div>
<div id="info">
{{ title }} {{ version }}
</div>
Expand All @@ -36,19 +40,25 @@ export class AppComponent {

title: string = "erdblick";
version: string = "";
copyright: string = "";

constructor(private httpClient: HttpClient,
private router: Router,
private activatedRoute: ActivatedRoute,
public mapService: MapService,
public styleService: StyleService,
public jumpToTargetService: JumpTargetService,
public parametersService: ParametersService) {
this.httpClient.get('./bundle/VERSION', {responseType: 'text'}).subscribe(
data => {
this.version = data.toString();
});
this.init();
this.mapService.legalInformationUpdated.subscribe(_ => {
this.copyright = "";
let firstSet: Set<string> | undefined = this.mapService.legalInformationPerMap.values().next().value;
if (firstSet !== undefined && firstSet.size) {
this.copyright = '© '.concat(firstSet.values().next().value as string).slice(0, 14).concat('…');
}
});
}

init() {
Expand Down Expand Up @@ -83,4 +93,8 @@ export class AppComponent {
replaceUrl: replaceUrl
});
}

openLegalInfo() {
this.parametersService.legalInfoDialogVisible = true;
}
}
4 changes: 3 additions & 1 deletion erdblick_app/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import {StatsDialogComponent} from "./stats.component";
import {SourceDataLayerSelectionDialogComponent} from "./sourcedataselection.dialog.component";
import {ContextMenuModule} from "primeng/contextmenu";
import {RightClickMenuService} from "./rightclickmenu.service";
import {LegalInfoDialogComponent} from "./legalinfo.component";

export function initializeServices(styleService: StyleService, mapService: MapService, coordService: CoordinatesService) {
return async () => {
Expand Down Expand Up @@ -152,7 +153,8 @@ export function typeValidationMessage({ schemaType }: any) {
HighlightSearch,
TreeTableFilterPatchDirective,
StatsDialogComponent,
SourceDataLayerSelectionDialogComponent
SourceDataLayerSelectionDialogComponent,
LegalInfoDialogComponent
],
bootstrap: [
AppComponent
Expand Down
18 changes: 13 additions & 5 deletions erdblick_app/app/coordinates.panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {CesiumMath} from "./cesium";
import {ClipboardService} from "./clipboard.service";
import {coreLib} from "./wasm";
import {InspectionService} from "./inspection.service";
import {KeyValue} from "@angular/common";

interface PanelOption {
name: string,
Expand Down Expand Up @@ -37,15 +38,15 @@ interface PanelOption {
<span *ngFor="let component of coords.value" class="coord-span">{{ component }}</span>
</div>
</ng-container>
<ng-container *ngFor="let tileId of mapgetTileIds | keyvalue">
<ng-container *ngFor="let tileId of mapgetTileIds | keyvalue: compareLevels">
<div *ngIf="isSelectedOption(tileId.key)" class="coordinates-entry">
<span class="name-span"
(click)="clipboardService.copyToClipboard(tileId.value.toString())">{{ tileId.key }}
:</span>
<span class="coord-span">{{ tileId.value }}</span>
</div>
</ng-container>
<ng-container *ngFor="let tileId of auxiliaryTileIds | keyvalue">
<ng-container *ngFor="let tileId of auxiliaryTileIds | keyvalue: compareLevels">
<div *ngIf="isSelectedOption(tileId.key)" class="coordinates-entry">
<span class="name-span"
(click)="clipboardService.copyToClipboard(tileId.value.toString())">{{ tileId.key }}
Expand Down Expand Up @@ -102,7 +103,7 @@ export class CoordinatesPanelComponent {
public clipboardService: ClipboardService,
public inspectionService: InspectionService,
public parametersService: ParametersService) {
for (let level = 0; level < 15; level++) {
for (let level = 0; level <= 15; level++) {
this.displayOptions.push({name: `Mapget TileId (level ${level})`});
}
this.parametersService.parameters.subscribe(parameters => {
Expand Down Expand Up @@ -159,12 +160,12 @@ export class CoordinatesPanelComponent {
}
}
}
for (let level = 0; level < 15; level++) {
for (let level = 0; level <= 15; level++) {
this.mapgetTileIds.set(`Mapget TileId (level ${level})`,
coreLib.getTileIdFromPosition(this.longitude, this.latitude, level));
}
if (this.coordinatesService.auxiliaryTileIdsFun) {
for (let level = 0; level < 15; level++) {
for (let level = 0; level <= 15; level++) {
const levelData: Map<string, bigint> =
this.coordinatesService.auxiliaryTileIdsFun(this.longitude, this.latitude, level).reduce(
(map: Map<string, bigint>, [key, value]: [string, bigint]) => {
Expand Down Expand Up @@ -227,4 +228,11 @@ export class CoordinatesPanelComponent {
return array;
}, new Array<string>()));
}

compareLevels(a: KeyValue<string, bigint> , b: KeyValue<string, bigint>): number {
const aLevel = parseInt(a.key.match(/\d+/)?.[0] ?? '0', 10);
const bLevel = parseInt(b.key.match(/\d+/)?.[0] ?? '0', 10);

return aLevel - bLevel;
}
}
2 changes: 1 addition & 1 deletion erdblick_app/app/coordinates.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class CoordinatesService {
}

initialize() {
this.httpClient.get("/config.json", {responseType: 'json'}).subscribe({
this.httpClient.get("config.json", {responseType: 'json'}).subscribe({
next: (data: any) => {
try {
if (data && data["extensionModules"] && data["extensionModules"]["jumpTargets"]) {
Expand Down
4 changes: 2 additions & 2 deletions erdblick_app/app/datasources.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class DataSourcesService {

postConfig(config: string) {
this.loading = true;
this.http.post("/config", config, { observe: 'response', responseType: 'text' }).subscribe({
this.http.post("config", config, { observe: 'response', responseType: 'text' }).subscribe({
next: (data: any) => {
this.messageService.showSuccess(data.body);
setTimeout(() => {
Expand All @@ -38,7 +38,7 @@ export class DataSourcesService {
this.readOnly = true;
this.errorMessage = "";
this.loading = true;
this.http.get("/config").subscribe({
this.http.get("config").subscribe({
next: (data: any) => {
if (!data) {
this.errorMessage = "Unknown error: DataSources configuration data is missing!";
Expand Down
15 changes: 7 additions & 8 deletions erdblick_app/app/feature.panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@ export class FeaturePanelComponent implements OnInit, AfterViewInit, OnDestroy
}
}

onValueHover(event: any, rowData: any) {
event.stopPropagation();
private highlightHoveredEntry(rowData: any) {
if (rowData["type"] == this.InspectionValueType.FEATUREID.value) {
this.jumpService.highlightByJumpTargetFilter(
rowData["mapId"],
Expand All @@ -413,6 +412,11 @@ export class FeaturePanelComponent implements OnInit, AfterViewInit, OnDestroy
}
}

onValueHover(event: any, rowData: any) {
event.stopPropagation();
this.highlightHoveredEntry(rowData);
}

onValueHoverExit(event: any, rowData: any) {
event.stopPropagation();
if (rowData["type"] == this.InspectionValueType.FEATUREID.value) {
Expand All @@ -422,12 +426,7 @@ export class FeaturePanelComponent implements OnInit, AfterViewInit, OnDestroy

onKeyHover(event: any, rowData: any) {
event.stopPropagation();
if (rowData["hoverId"]) {
this.mapService.highlightFeatures([{
mapTileKey: this.inspectionService.selectedFeatures[rowData["featureIndex"]].featureTile.mapTileKey,
featureId: rowData["hoverId"]
}], false, coreLib.HighlightMode.HOVER_HIGHLIGHT).then();
}
this.highlightHoveredEntry(rowData);
}

onKeyHoverExit(event: any, rowData: any) {
Expand Down
2 changes: 2 additions & 0 deletions erdblick_app/app/features.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class FeatureTile {
mapName: string;
layerName: string;
tileId: bigint;
legalInfo: string;
numFeatures: number;
private parser: TileLayerParser;
preventCulling: boolean;
Expand All @@ -39,6 +40,7 @@ export class FeatureTile {
this.mapName = mapTileMetadata.mapName;
this.layerName = mapTileMetadata.layerName;
this.tileId = mapTileMetadata.tileId;
this.legalInfo = mapTileMetadata.legalInfo;
this.numFeatures = mapTileMetadata.numFeatures;
this.stats.set(FeatureTile.statTileSize, [tileFeatureLayerBlob.length/1024]);
for (let [k, v] of Object.entries(mapTileMetadata.scalarFields)) {
Expand Down
2 changes: 1 addition & 1 deletion erdblick_app/app/inspection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class InspectionService {
});

let layer: TileSourceDataLayer | undefined;
let fetch = new Fetch("/tiles")
let fetch = new Fetch("tiles")
.withChunkProcessing()
.withMethod("POST")
.withBody(newRequestBody)
Expand Down
4 changes: 2 additions & 2 deletions erdblick_app/app/jump.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class JumpTargetService {
private inspectionService: InspectionService,
private menuService: RightClickMenuService,
private searchService: FeatureSearchService) {
this.httpClient.get("/config.json", {responseType: 'json'}).subscribe({
this.httpClient.get("config.json", {responseType: 'json'}).subscribe({
next: (data: any) => {
try {
if (data && data["extensionModules"] && data["extensionModules"]["jumpTargets"]) {
Expand Down Expand Up @@ -327,7 +327,7 @@ export class JumpTargetService {
mapId: mapId,
featureId: action.idParts.map((kv) => [kv.key, kv.value]).flat()
}]};
let response = await fetch("/locate", {
let response = await fetch("locate", {
body: JSON.stringify(resolveMe),
method: "POST"
}).catch((err)=>console.error(`Error during /locate call: ${err}`));
Expand Down
74 changes: 74 additions & 0 deletions erdblick_app/app/legalinfo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { Component } from "@angular/core";
import { MapService } from "./map.service";
import { ParametersService } from "./parameters.service";

@Component({
selector: 'legal-dialog',
template: `
<p-dialog header="Copyright and Legal Information" [(visible)]="parametersService.legalInfoDialogVisible" [modal]="false"
[style]="{'min-height': '10em', 'min-width': '40em'}">
<div class="dialog-content">
<table class="stats-table">
<thead>
<tr>
<th>Map Name</th>
<th>Legal Information</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let info of aggregatedLegalInfo">
<td>{{ info.mapName }}</td>
<td>{{ info.entry }}</td>
</tr>
</tbody>
</table>
<button pButton type="button" label="Close" icon="pi pi-cross" (click)="close()"></button>
</div>
</p-dialog>
`,
styles: [
`
.dialog-content {
display: flex;
flex-direction: column;
gap: 1em;
}
.stats-table {
width: 100%;
border-collapse: collapse;
}
.stats-table th, .stats-table td {
border: 1px solid #ccc;
padding: 0.5em;
text-align: left;
}
.stats-table th {
background-color: #f9f9f9;
font-weight: bold;
}
`
]
})
export class LegalInfoDialogComponent {
public aggregatedLegalInfo: { mapName: string, entry: string }[] = [];

constructor(private mapService: MapService,
public parametersService: ParametersService) {
this.mapService.legalInformationUpdated.subscribe(_ => {
this.aggregatedLegalInfo = [];
this.mapService.legalInformationPerMap.forEach((entries, mapName) => {
if (entries.size) {
this.aggregatedLegalInfo.push({
mapName: mapName,
entry: Array.from(entries).join('\n\n')
})
}
});
});
}

close() {
this.parametersService.legalInfoDialogVisible = false;
}
}

Loading

0 comments on commit 02bcec0

Please sign in to comment.