From 14dc9c2447cf6d399eb52dbcec63af6150384da3 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Thu, 5 May 2022 20:57:30 -0500 Subject: [PATCH] Fix work items date rendering --- .idea/misc.xml | 8 ++++++++ package.json | 6 ++++-- pnpm-lock.yaml | 14 +++++++------- src/app/http/controllers/Home.controller.ts | 14 +++++++------- 4 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 .idea/misc.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..283b9b4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/package.json b/package.json index 03e7e39..eda1336 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lib": "lib" }, "dependencies": { - "@extollo/lib": "^0.9.32", + "@extollo/lib": "^0.9.43", "copyfiles": "^2.4.1", "feed": "^4.2.2", "gotify": "^1.1.0", @@ -23,7 +23,9 @@ "test": "echo \"Error: no test specified\" && exit 1", "build": "excc -c package.json -t tsconfig.json", "app": "pnpm run build && node lib/index.js", - "cli": "pnpm run build && node lib/cli.js" + "cli": "pnpm run build && node lib/cli.js", + "docker:build": "docker build -t ${DOCKER_REGISTRY}/garrettmills/www .", + "docker:push": "docker push ${DOCKER_REGISTRY}/garrettmills/www" }, "files": [ "lib/**/*" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8367547..c44e2e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,7 +2,7 @@ lockfileVersion: 5.3 specifiers: '@extollo/cc': ^0.6.0 - '@extollo/lib': ^0.9.32 + '@extollo/lib': ^0.9.43 copyfiles: ^2.4.1 feed: ^4.2.2 gotify: ^1.1.0 @@ -14,7 +14,7 @@ specifiers: zod: ^3.11.6 dependencies: - '@extollo/lib': 0.9.32 + '@extollo/lib': 0.9.43 copyfiles: 2.4.1 feed: 4.2.2 gotify: 1.1.0 @@ -114,8 +114,8 @@ packages: - supports-color dev: true - /@extollo/lib/0.9.32: - resolution: {integrity: sha512-3DuRrLFmYY6w0rK5QKSlNWbGZnel6Lj2vjSGwwbj1IEJXGcZSA+TMXLghAwPkKyUsyX0WwdXVn6S51jmRHyWJw==} + /@extollo/lib/0.9.43: + resolution: {integrity: sha512-gsoP/q638AiMdMe9AReiuEqibm5Y6jMVQbmICOgAPZRLJWTiuc5+puEHUWyuvBcuP0w8YxNS+Vn/hZeF/EECLQ==} dependencies: '@atao60/fse-cli': 0.1.7 '@extollo/ui': 0.1.0_@types+node@14.18.12 @@ -1278,7 +1278,7 @@ packages: source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.15.3 + uglify-js: 3.15.4 dev: false /has-flag/4.0.0: @@ -2690,8 +2690,8 @@ packages: engines: {node: '>=4.2.0'} hasBin: true - /uglify-js/3.15.3: - resolution: {integrity: sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg==} + /uglify-js/3.15.4: + resolution: {integrity: sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==} engines: {node: '>=0.8.0'} hasBin: true requiresBuild: true diff --git a/src/app/http/controllers/Home.controller.ts b/src/app/http/controllers/Home.controller.ts index 2978a5c..50f08c3 100644 --- a/src/app/http/controllers/Home.controller.ts +++ b/src/app/http/controllers/Home.controller.ts @@ -35,16 +35,16 @@ export class Home extends Controller { public async welcome(feedPosts: Collection) { const workItems = await this.getWorkItems() + const workItemYears = workItems.map(item => item.startDate.getFullYear()).unique() + const workItemVisibleYears = workItems.filter(item => !item.endDate) + .map(item => item.startDate.getFullYear()) + .unique() + return view('welcome', { feedPosts: feedPosts.toArray(), workItemGroups: workItems.groupBy(item => item.startDate.getFullYear()), - workItemYears: workItems.map(item => item.startDate.getFullYear()) - .unique() - .toArray(), - workItemHiddenYears: workItems.filter(item => item.endDate) - .map(item => item.startDate.getFullYear()) - .unique() - .toArray() + workItemYears: workItemYears.toArray(), + workItemHiddenYears: workItemYears.diff(workItemVisibleYears) }) }