From b50066171ddbe7650418f5551246df558708c107 Mon Sep 17 00:00:00 2001
From: Steve Reis <stevereis93@gmail.com>
Date: Tue, 10 May 2022 15:24:06 +0200
Subject: [PATCH] feat: Added config property :  ontology url

---
 api/src/engine/engine.constants.ts           | 1 +
 api/src/engine/engine.resolver.ts            | 2 ++
 api/src/engine/models/configuration.model.ts | 3 +++
 api/src/schema.gql                           | 1 +
 docs/for-developers/configuration/gateway.md | 1 +
 5 files changed, 8 insertions(+)

diff --git a/api/src/engine/engine.constants.ts b/api/src/engine/engine.constants.ts
index 3c9ae32..641ceed 100644
--- a/api/src/engine/engine.constants.ts
+++ b/api/src/engine/engine.constants.ts
@@ -1,3 +1,4 @@
 export const ENGINE_MODULE_OPTIONS = 'EngineModuleOption';
 export const ENGINE_SERVICE = 'EngineService';
 export const ENGINE_SKIP_TOS = 'TOS_SKIP';
+export const ENGINE_ONTOLOGY_URL = 'ONTOLOGY_URL';
diff --git a/api/src/engine/engine.resolver.ts b/api/src/engine/engine.resolver.ts
index 6260111..d5acde6 100644
--- a/api/src/engine/engine.resolver.ts
+++ b/api/src/engine/engine.resolver.ts
@@ -6,6 +6,7 @@ import { GQLRequest } from '../common/decorators/gql-request.decoractor';
 import { Md5 } from 'ts-md5';
 import {
   ENGINE_MODULE_OPTIONS,
+  ENGINE_ONTOLOGY_URL,
   ENGINE_SERVICE,
   ENGINE_SKIP_TOS,
 } from './engine.constants';
@@ -55,6 +56,7 @@ export class EngineResolver {
         true,
       ),
       matomo,
+      ontologyUrl: this.configSerivce.get(ENGINE_ONTOLOGY_URL),
     };
 
     const version = Md5.hashStr(JSON.stringify(data));
diff --git a/api/src/engine/models/configuration.model.ts b/api/src/engine/models/configuration.model.ts
index 6ffe779..9471881 100644
--- a/api/src/engine/models/configuration.model.ts
+++ b/api/src/engine/models/configuration.model.ts
@@ -25,4 +25,7 @@ export class Configuration {
 
   @Field(() => Matomo, { nullable: true })
   matomo?: Matomo;
+
+  @Field({ nullable: true })
+  ontologyUrl?: string;
 }
diff --git a/api/src/schema.gql b/api/src/schema.gql
index b93416b..8265eb0 100644
--- a/api/src/schema.gql
+++ b/api/src/schema.gql
@@ -40,6 +40,7 @@ type Configuration {
   skipTos: Boolean
   enableSSO: Boolean
   matomo: Matomo
+  ontologyUrl: String
 }
 
 type Dataset {
diff --git a/docs/for-developers/configuration/gateway.md b/docs/for-developers/configuration/gateway.md
index 2b16dac..7f879ca 100644
--- a/docs/for-developers/configuration/gateway.md
+++ b/docs/for-developers/configuration/gateway.md
@@ -18,6 +18,7 @@ description: >-
 | GATEWAY\_PORT      | number  | 8081                            | Indicate the port that should be used by the gateway                                        |
 | NODE\_ENV          | string  | dev                             | Value can be `prod` or `dev`                                                                |
 | BASE\_URL\_CONTEXT | string  | null                            | Define context of the gateway. E.g. `api` if the api is under `http://127.0.0.1/api/`       |
+| ONTOLOGY\_URL      | string  | null                            | Define ontology's url                                                                       |
 
 #### Authentication
 
-- 
GitLab