From b3fab60970148e7e0ce27b913b87712d1aa1f558 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Tue, 18 Jun 2024 17:05:59 +0200 Subject: [PATCH] implement coordinates for community --- .../ContributionLink/ContributionLinkForm.vue | 2 +- .../Federation/CommunityVisualizeItem.vue | 46 +++++++--- admin/src/components/Federation/GMSApiKey.vue | 33 +++++++ admin/src/components/input/Coordinates.vue | 90 +++++++++++++++++++ admin/src/components/input/EditableGroup.vue | 61 +++++++++++++ admin/src/graphql/allCommunities.js | 1 + admin/src/graphql/updateHomeCommunity.js | 4 +- admin/src/locales/de.json | 13 ++- admin/src/locales/en.json | 13 ++- backend/package.json | 3 + backend/src/config/index.ts | 2 +- .../src/graphql/input/EditCommunityInput.ts | 7 ++ .../src/graphql/model/AdminCommunityView.ts | 5 ++ backend/src/graphql/model/Point.ts | 10 +++ .../src/graphql/resolver/CommunityResolver.ts | 7 +- backend/src/graphql/scalar/Point.ts | 16 ++-- backend/src/graphql/schema.ts | 3 + backend/src/graphql/validator/Point.ts | 29 ++++++ backend/yarn.lock | 12 ++- .../0085-add_community_location/Community.ts | 89 ++++++++++++++++++ database/entity/Community.ts | 2 +- .../migrations/0085-add_community_location.ts | 13 +++ dht-node/src/config/index.ts | 2 +- dht-node/yarn.lock | 16 +++- dlt-database/migrations/0004-fix_spelling.ts | 4 +- federation/src/config/index.ts | 2 +- 26 files changed, 452 insertions(+), 33 deletions(-) create mode 100644 admin/src/components/Federation/GMSApiKey.vue create mode 100644 admin/src/components/input/Coordinates.vue create mode 100644 admin/src/components/input/EditableGroup.vue create mode 100644 backend/src/graphql/model/Point.ts create mode 100644 backend/src/graphql/validator/Point.ts create mode 100644 database/entity/0085-add_community_location/Community.ts create mode 100644 database/migrations/0085-add_community_location.ts diff --git a/admin/src/components/ContributionLink/ContributionLinkForm.vue b/admin/src/components/ContributionLink/ContributionLinkForm.vue index 2afd8e1c5..f8e3d0f1f 100644 --- a/admin/src/components/ContributionLink/ContributionLinkForm.vue +++ b/admin/src/components/ContributionLink/ContributionLinkForm.vue @@ -113,7 +113,7 @@ {{ $t('contributionLink.clear') }} - {{ $t('contributionLink.close') }} + {{ $t('close') }} diff --git a/admin/src/components/Federation/CommunityVisualizeItem.vue b/admin/src/components/Federation/CommunityVisualizeItem.vue index 24e6b3712..edabc3a70 100644 --- a/admin/src/components/Federation/CommunityVisualizeItem.vue +++ b/admin/src/components/Federation/CommunityVisualizeItem.vue @@ -25,12 +25,24 @@ {{ $t('federation.publicKey') }} {{ item.publicKey }} - {{ $t('federation.gmsApiKey') }}  - + @save="handleUpdateHomeCommunity" + @reset="resetHomeCommunityEditable" + > + + + @@ -59,17 +71,21 @@ diff --git a/admin/src/components/Federation/GMSApiKey.vue b/admin/src/components/Federation/GMSApiKey.vue new file mode 100644 index 000000000..468bd7c28 --- /dev/null +++ b/admin/src/components/Federation/GMSApiKey.vue @@ -0,0 +1,33 @@ + + + diff --git a/admin/src/components/input/Coordinates.vue b/admin/src/components/input/Coordinates.vue new file mode 100644 index 000000000..dbbe4c7e5 --- /dev/null +++ b/admin/src/components/input/Coordinates.vue @@ -0,0 +1,90 @@ + + + diff --git a/admin/src/components/input/EditableGroup.vue b/admin/src/components/input/EditableGroup.vue new file mode 100644 index 000000000..9653430bc --- /dev/null +++ b/admin/src/components/input/EditableGroup.vue @@ -0,0 +1,61 @@ + + + diff --git a/admin/src/graphql/allCommunities.js b/admin/src/graphql/allCommunities.js index 6379086c7..c2ccdd15e 100644 --- a/admin/src/graphql/allCommunities.js +++ b/admin/src/graphql/allCommunities.js @@ -11,6 +11,7 @@ export const allCommunities = gql` name description gmsApiKey + location creationDate createdAt updatedAt diff --git a/admin/src/graphql/updateHomeCommunity.js b/admin/src/graphql/updateHomeCommunity.js index a43d6edd2..a33e7164c 100644 --- a/admin/src/graphql/updateHomeCommunity.js +++ b/admin/src/graphql/updateHomeCommunity.js @@ -1,8 +1,8 @@ import gql from 'graphql-tag' export const updateHomeCommunity = gql` - mutation ($uuid: String!, $gmsApiKey: String!) { - updateHomeCommunity(uuid: $uuid, gmsApiKey: $gmsApiKey) { + mutation ($uuid: String!, $gmsApiKey: String!, $location: Point!) { + updateHomeCommunity(uuid: $uuid, gmsApiKey: $gmsApiKey, location: $location) { id } } diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 9f808f70c..aa8f51983 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -1,14 +1,15 @@ { "GDD": "GDD", "all_emails": "Alle Nutzer", + "edit": "bearbeiten", "back": "zurück", "change_user_role": "Nutzerrolle ändern", "chat": "Chat", + "close": "Schließen", "contributionLink": { "amount": "Betrag", "changeSaved": "Änderungen gespeichert", "clear": "Löschen", - "close": "Schließen", "contributionLinks": "Beitragslinks", "create": "Anlegen", "cycle": "Zyklus", @@ -76,6 +77,7 @@ "apiVersion": "API Version", "authenticatedAt": "Verifiziert am:", "communityUuid": "Community UUID:", + "coordinates": "Koordinaten:", "createdAt": "Erstellt am", "gmsApiKey": "GMS API Key:", "toast_gmsApiKeyUpdated": "Der GMS Api Key wurde erfolgreich aktualisiert!", @@ -100,6 +102,13 @@ "form": { "cancel": "Abbrechen" }, + "geo-coordinates": { + "both-or-none": "Bitte beide oder keine eingeben!", + "label": "Geo-Koordinaten", + "latitude": { + "describe": "Teilt Koordinaten im Format 'Längengrad, Breitengrad' automatisch in separate Eingabefelder auf. Fügen sie hier einfach z.B. ihre Koordinaten von Google Maps, zum Beispiel: 49.28187664243721, 9.740672183943639, ein." + } + }, "help": { "help": "Hilfe", "transactionlist": { @@ -113,6 +122,8 @@ "hide_resubmission": "Wiedervorlage verbergen", "hide_resubmission_tooltip": "Verbirgt alle Schöpfungen für die ein Moderator ein Erinnerungsdatum festgelegt hat.", "lastname": "Nachname", + "latitude": "Breitengrad:", + "longitude": "Längengrad:", "math": { "equals": "=", "pipe": "|", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index b1f020921..258abe891 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -1,14 +1,15 @@ { "GDD": "GDD", "all_emails": "All users", + "edit": "edit", "back": "back", "change_user_role": "Change user role", "chat": "Chat", + "close": "Close", "contributionLink": { "amount": "Amount", "changeSaved": "Changes saved", "clear": "Clear", - "close": "Close", "contributionLinks": "Contribution Links", "create": "Create", "cycle": "Cycle", @@ -76,6 +77,7 @@ "apiVersion": "API Version", "authenticatedAt": "verified at:", "communityUuid": "Community UUID:", + "coordinates": "Coordinates:", "createdAt": "Created At ", "gmsApiKey": "GMS API Key:", "toast_gmsApiKeyUpdated": "The GMS Api Key has been successfully updated!", @@ -100,6 +102,13 @@ "form": { "cancel": "Cancel" }, + "geo-coordinates": { + "both-or-none": "Please enter both or none!", + "label": "geo-coordinates", + "latitude": { + "describe": "Automatically splits coordinates in the format 'longitude, latitude' into separate input fields. Simply enter your coordinates from Google Maps here, for example: 49.28187664243721, 9.740672183943639." + } + }, "help": { "help": "Help", "transactionlist": { @@ -113,6 +122,8 @@ "hide_resubmission": "Hide resubmission", "hide_resubmission_tooltip": "Hides all creations for which a moderator has set a reminder date.", "lastname": "Lastname", + "latitude": "Breitengrad:", + "longitude": "Längengrad:", "math": { "equals": "=", "pipe": "|", diff --git a/backend/package.json b/backend/package.json index 7fcd21000..7c6128a81 100644 --- a/backend/package.json +++ b/backend/package.json @@ -33,9 +33,11 @@ "email-templates": "^10.0.1", "express": "^4.17.1", "express-slow-down": "^2.0.1", + "geojson": "^0.5.0", "gradido-database": "file:../database", "graphql": "^15.5.1", "graphql-request": "5.0.0", + "graphql-type-json": "0.3.2", "helmet": "^5.1.1", "i18n": "^0.15.1", "jose": "^4.14.4", @@ -56,6 +58,7 @@ "@types/email-templates": "^10.0.1", "@types/express": "^4.17.12", "@types/faker": "^5.5.9", + "@types/geojson": "^7946.0.13", "@types/i18n": "^0.13.4", "@types/jest": "^27.0.2", "@types/lodash.clonedeep": "^4.5.6", diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 82308a52b..d75730c8e 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -12,7 +12,7 @@ Decimal.set({ }) const constants = { - DB_VERSION: '0084-introduce_humhub_registration', + DB_VERSION: '0085-add_community_location', DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0 LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info diff --git a/backend/src/graphql/input/EditCommunityInput.ts b/backend/src/graphql/input/EditCommunityInput.ts index 8c74f874b..b1bfc20fb 100644 --- a/backend/src/graphql/input/EditCommunityInput.ts +++ b/backend/src/graphql/input/EditCommunityInput.ts @@ -1,6 +1,9 @@ import { IsString, IsUUID } from 'class-validator' import { ArgsType, Field, InputType } from 'type-graphql' +import { Point } from '@/graphql/model/Point' +import { isValidPoint } from '@/graphql/validator/Point' + @ArgsType() @InputType() export class EditCommunityInput { @@ -11,4 +14,8 @@ export class EditCommunityInput { @Field(() => String) @IsString() gmsApiKey: string + + @Field(() => Point) + @isValidPoint() + location: Point } diff --git a/backend/src/graphql/model/AdminCommunityView.ts b/backend/src/graphql/model/AdminCommunityView.ts index 95af54bc5..c92a41b90 100644 --- a/backend/src/graphql/model/AdminCommunityView.ts +++ b/backend/src/graphql/model/AdminCommunityView.ts @@ -3,6 +3,7 @@ import { FederatedCommunity as DbFederatedCommunity } from '@entity/FederatedCom import { ObjectType, Field } from 'type-graphql' import { FederatedCommunity } from './FederatedCommunity' +import { Point } from './Point' @ObjectType() export class AdminCommunityView { @@ -36,6 +37,7 @@ export class AdminCommunityView { this.uuid = dbCom.communityUuid this.authenticatedAt = dbCom.authenticatedAt this.gmsApiKey = dbCom.gmsApiKey + this.location = dbCom.location ? dbCom.location as Point : new Point() } @Field(() => Boolean) @@ -62,6 +64,9 @@ export class AdminCommunityView { @Field(() => String, { nullable: true }) gmsApiKey: string | null + @Field(() => Point) + location: Point + @Field(() => Date, { nullable: true }) creationDate: Date | null diff --git a/backend/src/graphql/model/Point.ts b/backend/src/graphql/model/Point.ts new file mode 100644 index 000000000..bddb50598 --- /dev/null +++ b/backend/src/graphql/model/Point.ts @@ -0,0 +1,10 @@ +import { Position, Point as geojsonPoint } from 'geojson' + +export class Point implements geojsonPoint { + constructor() { + this.coordinates = [] + this.type = 'Point' + } + type: 'Point' + coordinates: Position +} diff --git a/backend/src/graphql/resolver/CommunityResolver.ts b/backend/src/graphql/resolver/CommunityResolver.ts index 2d2323865..0dc844b5c 100644 --- a/backend/src/graphql/resolver/CommunityResolver.ts +++ b/backend/src/graphql/resolver/CommunityResolver.ts @@ -78,7 +78,9 @@ export class CommunityResolver { @Authorized([RIGHTS.COMMUNITY_UPDATE]) @Mutation(() => Community) - async updateHomeCommunity(@Args() { uuid, gmsApiKey }: EditCommunityInput): Promise { + async updateHomeCommunity( + @Args() { uuid, gmsApiKey, location }: EditCommunityInput, + ): Promise { const homeCom = await getCommunityByUuid(uuid) if (!homeCom) { throw new LogError('HomeCommunity with uuid not found: ', uuid) @@ -86,8 +88,9 @@ export class CommunityResolver { if (homeCom.foreign) { throw new LogError('Error: Only the HomeCommunity could be modified!') } - if (homeCom.gmsApiKey !== gmsApiKey) { + if (homeCom.gmsApiKey !== gmsApiKey || homeCom.location !== location) { homeCom.gmsApiKey = gmsApiKey + homeCom.location = location await DbCommunity.save(homeCom) } return new Community(homeCom) diff --git a/backend/src/graphql/scalar/Point.ts b/backend/src/graphql/scalar/Point.ts index 06af56bfc..015704a15 100644 --- a/backend/src/graphql/scalar/Point.ts +++ b/backend/src/graphql/scalar/Point.ts @@ -1,23 +1,25 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ -import { Point as DbPoint } from '@dbTools/typeorm' import { GraphQLScalarType, Kind } from 'graphql' +import { Point } from '@/graphql/model/Point' export const PointScalar = new GraphQLScalarType({ name: 'Point', description: 'The `Point` scalar type to represent longitude and latitude values of a geo location', - serialize(value: DbPoint) { + serialize(value: Point) { // Check type of value if (value.type !== 'Point') { - throw new Error(`PointScalar can only serialize Geometry type 'Point' values`) + throw new Error(`PointScalar can only serialize Geometry type 'Point' values`, ) } return value }, - parseValue(value): DbPoint { - const point = JSON.parse(value) as DbPoint - return point + parseValue(value): Point { + if (value.type !== 'Point') { + throw new Error(`PointScalar can only deserialize Geometry type 'Point' values`, ) + } + return value as Point }, parseLiteral(ast) { @@ -25,7 +27,7 @@ export const PointScalar = new GraphQLScalarType({ throw new TypeError(`${String(ast)} is not a valid Geometry value.`) } - const point = JSON.parse(ast.value) as DbPoint + const point = JSON.parse(ast.value) as Point return point }, }) diff --git a/backend/src/graphql/schema.ts b/backend/src/graphql/schema.ts index bcb8081a6..4aa5ae2e1 100644 --- a/backend/src/graphql/schema.ts +++ b/backend/src/graphql/schema.ts @@ -7,8 +7,10 @@ import { buildSchema } from 'type-graphql' import { Location } from '@model/Location' import { isAuthorized } from './directive/isAuthorized' +import { Point } from './model/Point' import { DecimalScalar } from './scalar/Decimal' import { LocationScalar } from './scalar/Location' +import { PointScalar } from './scalar/Point' export const schema = async (): Promise => { return buildSchema({ @@ -17,6 +19,7 @@ export const schema = async (): Promise => { scalarsMap: [ { type: Decimal, scalar: DecimalScalar }, { type: Location, scalar: LocationScalar }, + { type: Point, scalar: PointScalar }, ], validate: { validationError: { target: false }, diff --git a/backend/src/graphql/validator/Point.ts b/backend/src/graphql/validator/Point.ts new file mode 100644 index 000000000..e82836e67 --- /dev/null +++ b/backend/src/graphql/validator/Point.ts @@ -0,0 +1,29 @@ +import { registerDecorator, ValidationOptions, ValidationArguments } from 'class-validator' +import { Point } from '@/graphql/model/Point' + +export function isValidPoint(validationOptions?: ValidationOptions) { + // eslint-disable-next-line @typescript-eslint/ban-types + return function (object: Object, propertyName: string) { + registerDecorator({ + name: 'isValidPoint', + target: object.constructor, + propertyName, + options: validationOptions, + validator: { + validate(value: Point) { + if (value.type === 'Point') { + if (value.coordinates.length === 2) { + return value.coordinates.every((coord) => typeof coord === 'number') + } else if(value.coordinates.length === 0) { + return true + } + } + return false + }, + defaultMessage(args: ValidationArguments) { + return `${propertyName} must be a valid Point in geoJSON Format, ${args.property}` + }, + }, + }) + } +} diff --git a/backend/yarn.lock b/backend/yarn.lock index 26f861772..caddf50a0 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -994,6 +994,11 @@ dependencies: "@types/node" "*" +"@types/geojson@^7946.0.13": + version "7946.0.14" + resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.14.tgz#319b63ad6df705ee2a65a73ef042c8271e696613" + integrity sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg== + "@types/glob@^7.1.3": version "7.1.4" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.4.tgz#ea59e21d2ee5c517914cb4bc8e4153b99e566672" @@ -3696,7 +3701,7 @@ graceful-fs@^4.1.6, graceful-fs@^4.2.0: integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== "gradido-database@file:../database": - version "2.2.1" + version "2.3.1" dependencies: "@types/uuid" "^8.3.4" cross-env "^7.0.3" @@ -3774,6 +3779,11 @@ graphql-tools@^4.0.8: iterall "^1.1.3" uuid "^3.1.0" +graphql-type-json@0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/graphql-type-json/-/graphql-type-json-0.3.2.tgz#f53a851dbfe07bd1c8157d24150064baab41e115" + integrity sha512-J+vjof74oMlCWXSvt0DOf2APEdZOCdubEvGDUAlqH//VBYcOYsGgRW7Xzorr44LvkjiuvecWc8fChxuZZbChtg== + graphql@^15.5.1: version "15.6.1" resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.6.1.tgz#9125bdf057553525da251e19e96dab3d3855ddfc" diff --git a/database/entity/0085-add_community_location/Community.ts b/database/entity/0085-add_community_location/Community.ts new file mode 100644 index 000000000..60410c8ce --- /dev/null +++ b/database/entity/0085-add_community_location/Community.ts @@ -0,0 +1,89 @@ +import { + BaseEntity, + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + OneToMany, + JoinColumn, + Geometry, +} from 'typeorm' +import { FederatedCommunity } from '../FederatedCommunity' +import { GeometryTransformer } from '../../src/typeorm/GeometryTransformer' +import { User } from '../User' + +@Entity('communities') +export class Community extends BaseEntity { + @PrimaryGeneratedColumn('increment', { unsigned: true }) + id: number + + @Column({ name: 'foreign', type: 'bool', nullable: false, default: true }) + foreign: boolean + + @Column({ name: 'url', length: 255, nullable: false }) + url: string + + @Column({ name: 'public_key', type: 'binary', length: 32, nullable: false }) + publicKey: Buffer + + @Column({ name: 'private_key', type: 'binary', length: 64, nullable: true }) + privateKey: Buffer | null + + @Column({ + name: 'community_uuid', + type: 'char', + length: 36, + nullable: true, + collation: 'utf8mb4_unicode_ci', + }) + communityUuid: string | null + + @Column({ name: 'authenticated_at', type: 'datetime', nullable: true }) + authenticatedAt: Date | null + + @Column({ name: 'name', type: 'varchar', length: 40, nullable: true }) + name: string | null + + @Column({ name: 'description', type: 'varchar', length: 255, nullable: true }) + description: string | null + + @CreateDateColumn({ name: 'creation_date', type: 'datetime', nullable: true }) + creationDate: Date | null + + @Column({ name: 'gms_api_key', type: 'varchar', length: 512, nullable: true, default: null }) + gmsApiKey: string | null + + @Column({ + name: 'location', + type: 'geometry', + default: null, + nullable: true, + transformer: GeometryTransformer, + }) + location: Geometry | null + + @CreateDateColumn({ + name: 'created_at', + type: 'datetime', + default: () => 'CURRENT_TIMESTAMP(3)', + nullable: false, + }) + createdAt: Date + + @UpdateDateColumn({ + name: 'updated_at', + type: 'datetime', + onUpdate: 'CURRENT_TIMESTAMP(3)', + nullable: true, + }) + updatedAt: Date | null + + @OneToMany(() => User, (user) => user.community) + @JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' }) + users: User[] + + @OneToMany(() => FederatedCommunity, (federatedCommunity) => federatedCommunity.community) + @JoinColumn({ name: 'public_key', referencedColumnName: 'publicKey' }) + federatedCommunities?: FederatedCommunity[] +} diff --git a/database/entity/Community.ts b/database/entity/Community.ts index ccc752cd8..750a2e842 100644 --- a/database/entity/Community.ts +++ b/database/entity/Community.ts @@ -1 +1 @@ -export { Community } from './0083-join_community_federated_communities/Community' +export { Community } from './0085-add_community_location/Community' diff --git a/database/migrations/0085-add_community_location.ts b/database/migrations/0085-add_community_location.ts new file mode 100644 index 000000000..b6f0ea917 --- /dev/null +++ b/database/migrations/0085-add_community_location.ts @@ -0,0 +1,13 @@ + +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { + await queryFn( + 'ALTER TABLE `communities` ADD COLUMN IF NOT EXISTS `location` geometry DEFAULT NULL NULL AFTER `gms_api_key`;', + ) +} + +export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { + await queryFn('ALTER TABLE `communities` DROP COLUMN IF EXISTS `location`;') +} diff --git a/dht-node/src/config/index.ts b/dht-node/src/config/index.ts index f557eee83..08d5a7053 100644 --- a/dht-node/src/config/index.ts +++ b/dht-node/src/config/index.ts @@ -4,7 +4,7 @@ import dotenv from 'dotenv' dotenv.config() const constants = { - DB_VERSION: '0084-introduce_humhub_registration', + DB_VERSION: '0085-add_community_location', LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info LOG_LEVEL: process.env.LOG_LEVEL ?? 'info', diff --git a/dht-node/yarn.lock b/dht-node/yarn.lock index 5f42f71a7..4bf9fa916 100644 --- a/dht-node/yarn.lock +++ b/dht-node/yarn.lock @@ -2260,6 +2260,11 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== +geojson@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/geojson/-/geojson-0.5.0.tgz#3cd6c96399be65b56ee55596116fe9191ce701c0" + integrity sha512-/Bx5lEn+qRF4TfQ5aLu6NH+UKtvIv7Lhc487y/c8BdludrCTpiWf9wyI0RTyqg49MFefIAvFDuEi5Dfd/zgNxQ== + get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -2389,18 +2394,20 @@ graceful-fs@^4.2.4: integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== "gradido-database@file:../database": - version "1.22.3" + version "2.2.1" dependencies: "@types/uuid" "^8.3.4" cross-env "^7.0.3" crypto "^1.0.1" decimal.js-light "^2.5.1" dotenv "^10.0.0" + geojson "^0.5.0" mysql2 "^2.3.0" reflect-metadata "^0.1.13" ts-mysql-migrate "^1.0.2" typeorm "^0.3.16" uuid "^8.3.2" + wkx "^0.5.0" grapheme-splitter@^1.0.4: version "1.0.4" @@ -4888,6 +4895,13 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +wkx@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/wkx/-/wkx-0.5.0.tgz#c6c37019acf40e517cc6b94657a25a3d4aa33e8c" + integrity sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg== + dependencies: + "@types/node" "*" + word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" diff --git a/dlt-database/migrations/0004-fix_spelling.ts b/dlt-database/migrations/0004-fix_spelling.ts index 3b2153a7d..1507ab590 100644 --- a/dlt-database/migrations/0004-fix_spelling.ts +++ b/dlt-database/migrations/0004-fix_spelling.ts @@ -1,7 +1,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { await queryFn(` ALTER TABLE \`transactions\` - RENAME COLUMN \`paring_transaction_id\` TO \`pairing_transaction_id\`, + RENAME COLUMN \`paring_transaction_id\` TO \`pairing_transaction_id\` ; `) } @@ -9,7 +9,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { await queryFn(` ALTER TABLE \`transactions\` - RENAME COLUMN \`pairing_transaction_id\` TO \`paring_transaction_id\`, + RENAME COLUMN \`pairing_transaction_id\` TO \`paring_transaction_id\` ; `) } diff --git a/federation/src/config/index.ts b/federation/src/config/index.ts index 26b727841..793d9957e 100644 --- a/federation/src/config/index.ts +++ b/federation/src/config/index.ts @@ -10,7 +10,7 @@ Decimal.set({ }) const constants = { - DB_VERSION: '0084-introduce_humhub_registration', + DB_VERSION: '0085-add_community_location', DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0 LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info