From 80ec15723dd67461970a9c8cd9c7d182a64410eb Mon Sep 17 00:00:00 2001 From: mrzapp Date: Wed, 3 Feb 2021 11:30:09 +0100 Subject: [PATCH 1/2] Added documentation strings for common classes --- src/Common/Entity/Context.js | 2 ++ src/Common/Entity/Resource/ResourceBase.js | 2 +- src/Common/Entity/Resource/SchemaBase.js | 2 +- src/Common/Entity/View/ViewBase.js | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Common/Entity/Context.js b/src/Common/Entity/Context.js index 3f92ec14a..db94a31c5 100644 --- a/src/Common/Entity/Context.js +++ b/src/Common/Entity/Context.js @@ -2,6 +2,8 @@ /** * A class for holding information about the current context + * + * @memberof HashBrown.Common.Entity */ class Context extends HashBrown.Entity.EntityBase { /** diff --git a/src/Common/Entity/Resource/ResourceBase.js b/src/Common/Entity/Resource/ResourceBase.js index c7728ade2..4e6cf3f89 100644 --- a/src/Common/Entity/Resource/ResourceBase.js +++ b/src/Common/Entity/Resource/ResourceBase.js @@ -3,7 +3,7 @@ /** * Basic resource class * - * @memberof HashBrown.Common.Entity + * @memberof HashBrown.Common.Entity.Resource */ class ResourceBase extends HashBrown.Entity.EntityBase { /** diff --git a/src/Common/Entity/Resource/SchemaBase.js b/src/Common/Entity/Resource/SchemaBase.js index 35b96f615..b4c802973 100644 --- a/src/Common/Entity/Resource/SchemaBase.js +++ b/src/Common/Entity/Resource/SchemaBase.js @@ -3,7 +3,7 @@ /** * The base class for all Schema types * - * @memberof HashBrown.Common.Entity.Resource + * @memberof HashBrown.Common.Entity.Resource.Schema */ class SchemaBase extends HashBrown.Entity.Resource.ResourceBase { set icon(name) { this.customIcon = name; } diff --git a/src/Common/Entity/View/ViewBase.js b/src/Common/Entity/View/ViewBase.js index f6ee6383f..fde045266 100644 --- a/src/Common/Entity/View/ViewBase.js +++ b/src/Common/Entity/View/ViewBase.js @@ -2,6 +2,8 @@ /** * The base view class + * + * @memberof HashBrown.Common.Entity.View */ class ViewBase extends HashBrown.Entity.EntityBase { /** From f6c233c814f13c0281cf4d0841946a23b3cbd6b3 Mon Sep 17 00:00:00 2001 From: mrzapp Date: Tue, 9 Feb 2021 09:52:55 +0100 Subject: [PATCH 2/2] Fixes #349 --- package.json | 3 --- src/Server/Controller/ControllerBase.js | 2 +- src/Server/Controller/ViewController.js | 2 ++ src/Server/Service/ConfigService.js | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 251d3774e..29328c9d4 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,9 @@ "scripts": { "build:frontend": "webpack --progress", "watch:frontend": "webpack --watch --progress", - "start": "npm run build:frontend && node hashbrown.js", "update": "git pull && git submodule update --recursive --init && npm install && npm run build:frontend", - "watch:nodemon": "nodemon hashbrown.js", - "db:docker": "cd ./docker && sudo docker-compose exec mongodb mongo", "restart:docker": "cd ./docker && sudo docker-compose restart", "start:docker": "npm run build:frontend && cd ./docker && sudo docker-compose up --build -d", diff --git a/src/Server/Controller/ControllerBase.js b/src/Server/Controller/ControllerBase.js index d4ee86714..986fcac28 100644 --- a/src/Server/Controller/ControllerBase.js +++ b/src/Server/Controller/ControllerBase.js @@ -173,7 +173,7 @@ class ControllerBase extends require('Common/Controller/ControllerBase') { static error(error, context) { checkParam(error, 'error', Error, true); - debug.error(error, this, true); + debug.error(error, this); return new HashBrown.Http.Response(error.message || 'Unexpected error', error.code || 500, error.headers || {}); } diff --git a/src/Server/Controller/ViewController.js b/src/Server/Controller/ViewController.js index 6bf2e76e0..9e1ec7875 100644 --- a/src/Server/Controller/ViewController.js +++ b/src/Server/Controller/ViewController.js @@ -91,6 +91,8 @@ class ViewController extends HashBrown.Controller.ControllerBase { error.code = 500; } + debug.error(error, this); + switch(error.code) { default: return this.render('error', { message: error.message, context: context }, error.code); diff --git a/src/Server/Service/ConfigService.js b/src/Server/Service/ConfigService.js index 2e71c44ab..203760060 100644 --- a/src/Server/Service/ConfigService.js +++ b/src/Server/Service/ConfigService.js @@ -91,7 +91,7 @@ class ConfigService { all[configName] = await this.get(configName); } - if(!all.system) { all.system = {}; } + if(!all.system) { all.system = { rootUrl: '' }; } if(!all.database) { all.database = {}; } return all;