From cc0c925b8146d259ee252c1ada74a8e91200ec10 Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Sun, 15 Jan 2023 23:28:02 +0100 Subject: [PATCH] "working" --- .../TiledFeatureSource/OsmFeatureSource.ts | 2 +- Logic/Tags/TagUtils.ts | 17 +- Logic/Web/MangroveReviews.ts | 104 +- index.html | 2 +- package-lock.json | 22049 ++++------------ package.json | 9 +- scripts/ScriptUtils.ts | 61 +- scripts/automoveTranslations.ts | 4 +- scripts/extractBikeRental.ts | 2 +- scripts/fetchLanguages.ts | 2 +- scripts/filter.ts | 2 +- scripts/fixImagesInTagRenderings.ts | 2 +- scripts/fixSchemas.ts | 6 +- scripts/generateCache.ts | 2 +- scripts/generateImageAnalysis.ts | 2 +- scripts/generateLayerOverview.ts | 10 +- scripts/generateLicenseInfo.ts | 4 +- scripts/generateTaginfoProjectFiles.ts | 2 +- scripts/generateTranslations.ts | 2 +- scripts/makeConvex.ts | 2 +- scripts/perProperty.ts | 2 +- .../postal_code_tools/createRoutablePoint.ts | 6 +- .../postal_code_tools/prepPostalCodesHulls.ts | 4 +- test/scripts/GenerateCache.spec.ts | 2 +- theme.html | 2 +- tsconfig.json | 27 +- vite.config.js | 5 + 27 files changed, 4743 insertions(+), 17591 deletions(-) create mode 100644 vite.config.js diff --git a/Logic/FeatureSource/TiledFeatureSource/OsmFeatureSource.ts b/Logic/FeatureSource/TiledFeatureSource/OsmFeatureSource.ts index 949bb80f9..284da7685 100644 --- a/Logic/FeatureSource/TiledFeatureSource/OsmFeatureSource.ts +++ b/Logic/FeatureSource/TiledFeatureSource/OsmFeatureSource.ts @@ -147,7 +147,7 @@ export default class OsmFeatureSource { this.rawDataHandlers.forEach((handler) => handler(osmJson, Tiles.tile_index(z, x, y)) ) - const geojson = >OsmToGeoJson.default( + const geojson = >OsmToGeoJson( osmJson, // @ts-ignore { diff --git a/Logic/Tags/TagUtils.ts b/Logic/Tags/TagUtils.ts index ce5dafcd6..9805b3a85 100644 --- a/Logic/Tags/TagUtils.ts +++ b/Logic/Tags/TagUtils.ts @@ -7,7 +7,7 @@ import { RegexTag } from "./RegexTag" import SubstitutingTag from "./SubstitutingTag" import { Or } from "./Or" import { TagConfigJson } from "../../Models/ThemeConfig/Json/TagConfigJson" -import { isRegExp } from "util" +// import { isRegExp } from "util" import * as key_counts from "../../assets/key_totals.json" type Tags = Record @@ -94,13 +94,14 @@ export class TagUtils { if (allowRegex && tagsFilter instanceof RegexTag) { const key = tagsFilter.key - if (isRegExp(key)) { - console.error( - "Invalid type to flatten the multiAnswer: key is a regex too", - tagsFilter - ) - throw "Invalid type to FlattenMultiAnswer" - } + // TODO: Fixme + // if (isRegExp(key)) { + // console.error( + // "Invalid type to flatten the multiAnswer: key is a regex too", + // tagsFilter + // ) + // throw "Invalid type to FlattenMultiAnswer" + // } const keystr = key if (keyValues[keystr] === undefined) { keyValues[keystr] = [] diff --git a/Logic/Web/MangroveReviews.ts b/Logic/Web/MangroveReviews.ts index f0f66d86a..9f6679315 100644 --- a/Logic/Web/MangroveReviews.ts +++ b/Logic/Web/MangroveReviews.ts @@ -1,4 +1,4 @@ -import * as mangrove from "mangrove-reviews" +// import * as mangrove from "mangrove-reviews" import { UIEventSource } from "../UIEventSource" import { Review } from "./Review" import { Utils } from "../../Utils" @@ -15,13 +15,13 @@ export class MangroveIdentity { if (str === "") { return } - mangrove.jwkToKeypair(JSON.parse(str)).then((keypair) => { - self.keypair = keypair - mangrove.publicToPem(keypair.publicKey).then((pem) => { - console.log("Identity loaded") - self.kid.setData(pem) - }) - }) + // mangrove.jwkToKeypair(JSON.parse(str)).then((keypair) => { + // self.keypair = keypair + // mangrove.publicToPem(keypair.publicKey).then((pem) => { + // console.log("Identity loaded") + // self.kid.setData(pem) + // }) + // }) }) try { if (!Utils.runningFromConsole && (mangroveIdentity.data ?? "") === "") { @@ -42,12 +42,12 @@ export class MangroveIdentity { throw "Identity already defined - not creating a new one" } const self = this - mangrove.generateKeypair().then((keypair) => { - self.keypair = keypair - mangrove.keypairToJwk(keypair).then((jwk) => { - self._mangroveIdentity.setData(JSON.stringify(jwk)) - }) - }) + // mangrove.generateKeypair().then((keypair) => { + // self.keypair = keypair + // mangrove.keypairToJwk(keypair).then((jwk) => { + // self._mangroveIdentity.setData(JSON.stringify(jwk)) + // }) + // }) } } @@ -127,39 +127,39 @@ export default class MangroveReviews { this._lastUpdate = new Date() const self = this - mangrove - .getReviews({ sub: this.GetSubjectUri() }) - .then((data) => { - const reviews = [] - const reviewsByUser = [] - for (const review of data.reviews) { - const r = review.payload + // mangrove + // .getReviews({ sub: this.GetSubjectUri() }) + // .then((data) => { + // const reviews = [] + // const reviewsByUser = [] + // for (const review of data.reviews) { + // const r = review.payload - console.log( - "PublicKey is ", - self._mangroveIdentity.kid.data, - "reviews.kid is", - review.kid - ) - const byUser = self._mangroveIdentity.kid.map( - (data) => data === review.signature - ) - const rev: Review = { - made_by_user: byUser, - date: new Date(r.iat * 1000), - comment: r.opinion, - author: r.metadata.nickname, - affiliated: r.metadata.is_affiliated, - rating: r.rating, // percentage points - } + // console.log( + // "PublicKey is ", + // self._mangroveIdentity.kid.data, + // "reviews.kid is", + // review.kid + // ) + // const byUser = self._mangroveIdentity.kid.map( + // (data) => data === review.signature + // ) + // const rev: Review = { + // made_by_user: byUser, + // date: new Date(r.iat * 1000), + // comment: r.opinion, + // author: r.metadata.nickname, + // affiliated: r.metadata.is_affiliated, + // rating: r.rating, // percentage points + // } - ;(rev.made_by_user ? reviewsByUser : reviews).push(rev) - } - self._reviews.setData(reviewsByUser.concat(reviews)) - }) - .catch((e) => { - console.error("Could not download review for ", e) - }) + // ;(rev.made_by_user ? reviewsByUser : reviews).push(rev) + // } + // self._reviews.setData(reviewsByUser.concat(reviews)) + // }) + // .catch((e) => { + // console.error("Could not download review for ", e) + // }) return this._reviews } @@ -192,13 +192,13 @@ export default class MangroveReviews { this._reviews.ping() } } else { - mangrove.signAndSubmitReview(this._mangroveIdentity.keypair, payload).then(() => { - if (callback) { - callback() - } - this._reviews.data.push(r) - this._reviews.ping() - }) + // mangrove.signAndSubmitReview(this._mangroveIdentity.keypair, payload).then(() => { + // if (callback) { + // callback() + // } + // this._reviews.data.push(r) + // this._reviews.ping() + // }) } } } diff --git a/index.html b/index.html index 7a79a59e8..66053168a 100644 --- a/index.html +++ b/index.html @@ -72,7 +72,7 @@ - + +