Fixes the client-side tests after the removal of the <base/> tag from
the main layout.
These fixes aren't ideal. At the moment, they will suffice. This comment
(https://github.com/angular-ui/ui-router/issues/212#issuecomment-60803437),
among others in that issue, led me to choose this method as the fix to
avoid having to change any other core code.
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
* fix(articles): Article controllers name conflicts
Fixes the naming conflicts for the Articles controllers.
Due to how Angular injects the controllers into the StateProvider,
naming conflicts were caused between the Articles public & admin module
controllers.
To resolve the issue the referenced controllers in the Articles admin
route configurations must be unique, and match up with the Admin
controllers.
* Client-side tests failing
Fixed the client-side tests that were failing due to the naming
conflicts.
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.
Update the core module to implement the style guidelines.
Reduce size of init.js - moved filter logic out to it's own config.
Rename Menus to menuService
Adds an angular $urlRouterProvider service Rule to the Core module
configuration, that removes any trailing slashes in the URL for all routes.
The Rule is defined in the core routes configuration. Thus, in order for
this to work on all routes in the application, we have to inject the Core
module into each client module, as a dependecy in the client.module
configuration. Otherwise, we'd have to define the Rule in each module's route
configuration individually.
Adds missing client-side route configuration tests.
Tests demonstrate that the various route configurations can handle a trailing
slash in the URL, and gets resolved to the correct client route.
Fixes#1075
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
Added the timeout option to the Mocha grunt task; set to 10000.
Removed the individual test suite timeouts, for all server tests.
Also, added global timeout for Mocha gulp task.
Added a timeout of 10000 ms to each server test file. This is an attempt
to solve the timeout issues that we're experiencing with the Mocha
tests. Especially, this is hoping to address the build fails that are
caused by such timeouts.
Issue is described in https://github.com/meanjs/mean/issues/955