feat(config): Mongo Seed 2.0
Adds a more configurable and easily extended MongoDB Seed feature.
Adds additional options at the collection, and collection item level to
allow more control over how each environment config handles the seeding
feature.
Enforces seed order based on the order of the environment's seeding configuration object.
Removes the previous SeedDB config file.
Adds chalk to messages logged to the console for readability.
Refactors the Mongo Seed configuration tests.
Adds Gulp tasks to perform Mongo Seed operations for default, prod, and
test environment configurations. Also, adds accommodating npm scripts.
Upgrades Mongoose to 4.11.1
Updates Mongoose connection implementation to accommodate deprecated
features & connection options.
Also, updates the Gulp Mocha tasks to reflect changes to the Mongoose
implementation.
Fixes tests to get the database from the existing Mongoose singleton.
Derives from changes in https://github.com/meanjs/mean/pull/1816
Closes https://github.com/meanjs/mean/issues/1814
Fixes incorrest usage of 400 HTTP responses being returned from the
server, in favor of using 422.
Also, changed a few return codes to 401 where it was more appropriate.
See this article for reasoning behind moving to 422, and why 400 isn't
appropriate for these cases.
For ref:
6be12f8a06
Related:
https://github.com/meanjs/mean/pull/1547https://github.com/meanjs/mean/pull/1510
This feature introduces a breaking change, that restricts the User's that
can create/edit/delete Articles to only those that have the `admin` Role.
Fixed ESLint issues.
Resolved merge conflicts, and moved new client Article Service
`createOrUpdate` functionality to new Admin feature controller.
Removed edit functionality from client-side Article controller.
Adds a custom field named `isCurrentUserOwner` to the Article document before
it's returned to the client. This field is used to determine if the current
User should is the "owner", and should see the edit/delete controls on the
client-side when viewing a single article. This custom (ad-hoc) field is NOT
persisted to the database; it's merely attached to the document.
Added server-side route tests for verifying the ad-hoc
"isCurrentUserOwner" field is properly set on the a single Article document.
Fixes#1146
Changed some bad comments referencing the Articles module in other modules.
Typo fixed in xxx.client.modules.js files ("Application" => "Applicaion")
Full stop character removed at the end of line comments
Adds an additional check for the existence of a populated user
reference, when determining if the current user has immediate access to
the requested article.
Without this fix, the server will throw an error if the requested
article doesn't have a populated user field.
Modified the article & articles list view's to check if the article has
a populated user. If not, then it will display "Deleted User" in place
of the missing user reference.
Added a server-side test that ensures we can get a single article if
the article.user field is referencing a deleted user.
Fixes#1082
The bug was not exposed by the original test, since it was mixing two (related) aspects:
* An invalid Id (a badly formed mongodb identifier)
* An non-existent Id (an identifier with no corresponding document in the database)
Modifications:
- Fixed the message property in the article controller (the error message follows the wording of the error message in "users.password.server.controller.js", in case of username not found)
- Added a new test to check modifications and avoid regressions