From 4bc1c1db752efaf9a70ca65a21f1e56729e22a7e Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sat, 8 Oct 2022 22:38:26 -0700 Subject: [PATCH] WORKING APP & WORKER - very few plugins work in the Web-worker context - authentication working - SYNC not working - UPSERT not working - CORS issues AETNA - REFRESH TOKEN ISSUES --- .gitignore | 1 + frontend/package.json | 1 + .../app/models/queue/source-sync-message.ts | 2 +- .../medical-sources.component.html | 2 +- .../medical-sources.component.ts | 21 +- .../src/app/services/fasten-db.service.ts | 195 +++++- frontend/src/app/workers/queue.service.ts | 2 +- .../src/app/workers/source-sync.worker.ts | 61 +- frontend/src/lib/database/interface.ts | 2 - .../src/lib/database/pouchdb_repository.ts | 124 ++-- frontend/yarn.lock | 604 +++++++++++++++++- 11 files changed, 867 insertions(+), 148 deletions(-) diff --git a/.gitignore b/.gitignore index a194d0f7..8ec096a1 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ fabric.properties vendor fasten.db test.go +/.couchdb diff --git a/frontend/package.json b/frontend/package.json index ddfffd3d..8c61b993 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -40,6 +40,7 @@ "ngx-highlightjs": "^7.0.1", "observable-webworker": "^4.0.1", "pouchdb": "^7.3.0", + "pouchdb-authentication": "^1.1.3", "pouchdb-find": "^7.3.0", "pouchdb-upsert": "^2.2.0", "rxjs": "~6.5.4", diff --git a/frontend/src/app/models/queue/source-sync-message.ts b/frontend/src/app/models/queue/source-sync-message.ts index fab099b3..7372c026 100644 --- a/frontend/src/app/models/queue/source-sync-message.ts +++ b/frontend/src/app/models/queue/source-sync-message.ts @@ -2,5 +2,5 @@ import {Source} from '../../../lib/models/database/source'; export class SourceSyncMessage { source: Source - database_name: string + userIdentifier: string } diff --git a/frontend/src/app/pages/medical-sources/medical-sources.component.html b/frontend/src/app/pages/medical-sources/medical-sources.component.html index b36ac1d3..8994e7ae 100644 --- a/frontend/src/app/pages/medical-sources/medical-sources.component.html +++ b/frontend/src/app/pages/medical-sources/medical-sources.component.html @@ -79,7 +79,7 @@