Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Integrate PouchDB #1025

Closed
wants to merge 65 commits into from
Closed

[WIP] Integrate PouchDB #1025

wants to merge 65 commits into from

Conversation

midsorbet
Copy link
Contributor

@midsorbet midsorbet commented May 19, 2018

(related to #48)
What works?

  • Authentication (Signing up normal users and logging in, used in login-form and auth-guard)
  • Fetching and viewing courses from the Courses Database through the local PouchDB instance

If you want to test it please do the following:

  • Create a database called "test" in CouchDB which is needed for authentication. It is a temporary placeholder for the roles (learner, intern) databases.
  • Test it while logged in as the administration. Normal users will not work because they don't have any roles set and CouchDB has rules that allows only specific users to query those databases.

Notes:

  1. I am storing the localdb and the authdb in separate dedicated variables but the other databases in an object. It will make it easier to replicate changes.
  2. I have created an index for the field "kind" but some of the documents do not have that field so I think we should update them to include that. Indexing makes the lookup faster. Right now, all the courses are in the local PouchDB but you can't see them all in the app because some of them do not have the field "kind".
  3. Similarly, some courses documents do not have the field "createdAt" which is used for sorting. This needs to be fixed and sorting should be fixed.

Copy link
Member

@paulbert paulbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LKhadka A lot of the changes on here were stylistic rather than meaningful additions. Once or twice is fine, but with such a large change to our code base we can't effectively review changes when so many line changes do not change anything in the app. If you're having trouble with the code style, raise it as an issue so we can discuss adding a lint rule with PR.

Also, please install our pre push hook for tslint with npm run install-hooks because some of those changes broke our lint rules.

}

ngOnDestroy() {
this.onDestroy$.next();
this.onDestroy$.complete();
this.onDestroy$.next(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onDestroy$ is no longer used with a subscription, and we should stick to next/complete for consistency when we use it.

@midsorbet
Copy link
Contributor Author

Closing for new PR

@midsorbet midsorbet closed this May 26, 2018
@midsorbet midsorbet deleted the pouchdb branch May 29, 2018 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants