diff --git a/README.md b/README.md index a59cccb..f75d067 100644 --- a/README.md +++ b/README.md @@ -195,11 +195,11 @@ Because I like seeing the numbers. Language | Files | Blank | Comment | Code -----------|--------:|---------:|---------:|---------: -TypeScript | 66 | 949 | 119 | 4058 -PHP | 18 | 660 | 24 | 2034 -HTML | 21 | 255 | 0 | 1533 -SASS | 14 | 295 | 10 | 1333 -**SUM:** | **119** | **2159** | **153** | **8958** +TypeScript | 66 | 959 | 120 | 4060 +PHP | 18 | 665 | 24 | 2043 +HTML | 21 | 257 | 0 | 1538 +SASS | 14 | 296 | 10 | 1338 +**SUM:** | **119** | **2177** | **154** | **8978** Command: `cloc --exclude-dir=vendor --exclude-ext=json,svg,ini src/` @@ -207,8 +207,8 @@ Command: `cloc --exclude-dir=vendor --exclude-ext=json,svg,ini src/` Language | Files | Blank | Comment | Code -----------|-------:|---------:|---------:|---------: -TypeScript | 38 | 995 | 7 | 3442 +TypeScript | 38 | 1002 | 8 | 3481 PHP | 11 | 793 | 16 | 2338 -**SUM:** | **49** | **1788** | **23** | **5780** +**SUM:** | **49** | **1795** | **24** | **5819** Command: `cloc --exclude-ext=xml test/` diff --git a/angular.json b/angular.json index 04b12b2..f828f92 100644 --- a/angular.json +++ b/angular.json @@ -40,6 +40,7 @@ }, "configurations": { "production": { + "aot": true, "optimization": true, "outputHashing": "all", "sourceMap": false, diff --git a/src/api/composer.lock b/src/api/composer.lock index a5477bf..e0e533c 100644 --- a/src/api/composer.lock +++ b/src/api/composer.lock @@ -166,16 +166,16 @@ }, { "name": "gabordemooij/redbean", - "version": "v5.4.2", + "version": "v5.5", "source": { "type": "git", "url": "https://github.com/gabordemooij/redbean.git", - "reference": "58d366ac135cf14c7b952cda075a7723dfb425a7" + "reference": "8b8326f7dbe8023675b0d1936df4800fe0cce0b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/gabordemooij/redbean/zipball/58d366ac135cf14c7b952cda075a7723dfb425a7", - "reference": "58d366ac135cf14c7b952cda075a7723dfb425a7", + "url": "https://api.github.com/repos/gabordemooij/redbean/zipball/8b8326f7dbe8023675b0d1936df4800fe0cce0b3", + "reference": "8b8326f7dbe8023675b0d1936df4800fe0cce0b3", "shasum": "" }, "require": { @@ -203,7 +203,7 @@ "keywords": [ "orm" ], - "time": "2019-12-26T17:14:58+00:00" + "time": "2020-04-26T13:31:18+00:00" }, { "name": "jeremeamia/superclosure", @@ -794,24 +794,21 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", "shasum": "" }, "require": { "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "~6" - }, "type": "library", "extra": { "branch-alias": { @@ -842,7 +839,7 @@ "reflection", "static analysis" ], - "time": "2018-08-07T13:53:10+00:00" + "time": "2020-04-27T09:25:28+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -1336,16 +1333,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.3", + "version": "8.5.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "67750516bc02f300e2742fed2f50177f8f37bedf" + "reference": "8474e22d7d642f665084ba5ec780626cbd1efd23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/67750516bc02f300e2742fed2f50177f8f37bedf", - "reference": "67750516bc02f300e2742fed2f50177f8f37bedf", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8474e22d7d642f665084ba5ec780626cbd1efd23", + "reference": "8474e22d7d642f665084ba5ec780626cbd1efd23", "shasum": "" }, "require": { @@ -1425,7 +1422,7 @@ "type": "github" } ], - "time": "2020-03-31T08:52:04+00:00" + "time": "2020-04-23T04:39:42+00:00" }, { "name": "psr/container", @@ -2433,16 +2430,16 @@ }, { "name": "slim/psr7", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim-Psr7.git", - "reference": "7ca5b5d96687b7c563238715cc80b12675d8b895" + "reference": "3c76899e707910779f13d7af95fde12310b0a5ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/7ca5b5d96687b7c563238715cc80b12675d8b895", - "reference": "7ca5b5d96687b7c563238715cc80b12675d8b895", + "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/3c76899e707910779f13d7af95fde12310b0a5ae", + "reference": "3c76899e707910779f13d7af95fde12310b0a5ae", "shasum": "" }, "require": { @@ -2503,7 +2500,7 @@ "psr-7", "psr7" ], - "time": "2020-01-04T23:05:43+00:00" + "time": "2020-05-01T14:24:20+00:00" }, { "name": "slim/slim", @@ -2600,16 +2597,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" + "reference": "1aab00e39cebaef4d8652497f46c15c1b7e45294" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1aab00e39cebaef4d8652497f46c15c1b7e45294", + "reference": "1aab00e39cebaef4d8652497f46c15c1b7e45294", "shasum": "" }, "require": { @@ -2621,7 +2618,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.16-dev" } }, "autoload": { @@ -2668,20 +2665,20 @@ "type": "tidelift" } ], - "time": "2020-02-27T09:26:54+00:00" + "time": "2020-05-08T16:50:20+00:00" }, { "name": "symfony/polyfill-php56", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "d51ec491c8ddceae7dca8dd6c7e30428f543f37d" + "reference": "14b55b0e88c67c6a14526799abaea197dde78911" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/d51ec491c8ddceae7dca8dd6c7e30428f543f37d", - "reference": "d51ec491c8ddceae7dca8dd6c7e30428f543f37d", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/14b55b0e88c67c6a14526799abaea197dde78911", + "reference": "14b55b0e88c67c6a14526799abaea197dde78911", "shasum": "" }, "require": { @@ -2691,7 +2688,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.16-dev" } }, "autoload": { @@ -2738,20 +2735,20 @@ "type": "tidelift" } ], - "time": "2020-03-09T19:04:49+00:00" + "time": "2020-05-08T16:50:20+00:00" }, { "name": "symfony/polyfill-util", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "d8e76c104127675d0ea3df3be0f2ae24a8619027" + "reference": "fa1fdaf94e8a60932d8821692eb1ed07efc52db2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/d8e76c104127675d0ea3df3be0f2ae24a8619027", - "reference": "d8e76c104127675d0ea3df3be0f2ae24a8619027", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/fa1fdaf94e8a60932d8821692eb1ed07efc52db2", + "reference": "fa1fdaf94e8a60932d8821692eb1ed07efc52db2", "shasum": "" }, "require": { @@ -2760,7 +2757,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.16-dev" } }, "autoload": { @@ -2804,7 +2801,7 @@ "type": "tidelift" } ], - "time": "2020-03-02T11:55:35+00:00" + "time": "2020-05-02T14:56:09+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/api/index.php b/src/api/index.php index fb6ab07..e788ba0 100644 --- a/src/api/index.php +++ b/src/api/index.php @@ -1,4 +1,6 @@ set('logger', function() { return $logger; }); +$container->set('strings', function() { + $json = file_get_contents('../json/en.json'); + + return json_decode($json); +}); + $errorMiddleware->setErrorHandler(HttpNotFoundException::class, - function () { + function (ServerRequestInterface $request) { $response = new Response(); + $message = 'Matching API call not found.'; + + if (strpos($request->getUri()->getPath(), 'uploads')) { + $message = 'File not found.'; + } + $response->withHeader('Content-Type', 'application/json') - ->getBody()->write('{ message: "Matching API call not found." }'); + ->getBody()->write('{ message: "' . $message . '" }'); return $response->withStatus(404); } diff --git a/src/app/app.api-http.ts b/src/app/app.api-http.ts index d002b26..0cd54ef 100644 --- a/src/app/app.api-http.ts +++ b/src/app/app.api-http.ts @@ -20,10 +20,12 @@ export class ApiInterceptor implements HttpInterceptor { constructor(private router: Router) {} - intercept(request: HttpRequest, next: HttpHandler): Observable> { + intercept(request: HttpRequest, next: HttpHandler): + Observable> { + const headers = (request.body instanceof FormData) - ? { } - : { 'Content-Type': 'application/json' }; + ? { } + : { 'Content-Type': 'application/json' }; const token = sessionStorage.getItem(this.JWT_KEY); if (token !== null) { diff --git a/src/app/board/board.component.html b/src/app/board/board.component.html index e33d8cb..737776e 100644 --- a/src/app/board/board.component.html +++ b/src/app/board/board.component.html @@ -84,6 +84,8 @@
+
{{ strings['loading'] }}...
+ diff --git a/src/app/board/board.service.ts b/src/app/board/board.service.ts index efea658..bf9c48a 100644 --- a/src/app/board/board.service.ts +++ b/src/app/board/board.service.ts @@ -34,14 +34,14 @@ export class BoardService { this.initMarked(); } - convertMarkdown(markdown: string, callback = this.defaultCallback, doCount = false): MarkedReturn { + async convertMarkdown(markdown: string, callback = this.defaultCallback, + doCount = false): Promise { this.checkCounts.total = 0; this.checkCounts.complete = 0; const retVal: MarkedReturn = { html: '', counts: {} }; - retVal.html = marked(markdown); - callback(false, retVal.html); + retVal.html = callback(false, marked(markdown)); if (doCount) { retVal.counts = this.checkCounts; diff --git a/src/app/board/column/column.component.html b/src/app/board/column/column.component.html index ea00dbe..7e6a33c 100644 --- a/src/app/board/column/column.component.html +++ b/src/app/board/column/column.component.html @@ -77,6 +77,7 @@
+ {{ strings['boards_taskComments'] }}
-
+