- 05 Jun, 2015 5 commits
-
-
Nick Stenning authored
When we call `form.validate()` and the validation fails, the raised exception is a `deform.ValidationFailure`. This object has an `error` attribute which represents the underlying validation error object for the entire form. Previously, if the validation failure were a result of top-level validation errors (such as the fact that an unactivated user is trying to log in), this error would be lost, because we only reported errors for the forms fields, or "children". This commit changes `h.accounts.views.validate_form` so that it converts the entire `colander.Invalid` object into a dictionary using its `asdict()` instance method. By doing this, we get two immediate benefits: - top-level validation errors are reported in the '' (empty string) field - we avoid the need to aggregate form field errors by hand in ajax_form In addition, we need to deal with this case on the frontend, so this commit also changes the formRespond directive so that if no overall "reason" is provided for failure, then an empty-string member of the "errors" object can set the overall validation status (and error message) for the form.
-
Nick Stenning authored
Refactor search
-
Nick Stenning authored
Ask for "Username or email address" when logging in
-
Sean Hammond authored
-
Sean Hammond authored
-
- 04 Jun, 2015 3 commits
-
-
Randall Leeds authored
Fully isolate os.environ during config testing
-
Sean Hammond authored
Dehorusify the AuthController
-
Nick Stenning authored
Keep app css and inject css separate
-
- 03 Jun, 2015 3 commits
-
-
Randall Leeds authored
Structure is good. Bonus fewer false dependencies on asset rebuilds for the app.
-
Randall Leeds authored
Dehorusify ProfileController
-
Randall Leeds authored
Fix display regression on help/first-run pages
-
- 02 Jun, 2015 17 commits
-
-
Nick Stenning authored
Let users change their email addresses
-
Sean Hammond authored
1. Go to the Change Your Email Address form 2. Type in a new email address (twice) and your password 3. Select part of the text showing your current email address with the cursor 4. Click Update => The display of your current email address is updated to a nonsense value. This commit fixes the issue, your email address will be displayed correctly.
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Move the user's current email address out of the placeholder attribute of the new email address <input> field. Just put it in a <p> instead. This is much better for usability.
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Quite a lot of repetition in these tests, some shared helper functions needed.
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Begin adding frontend tests for the new AccountController code that deals with the new form for changing the logged-in user's email address. I've done this as a new top-level describe() with a new way of writing Angular controller tests, rather than adding to the stuff already in account-controller-test.coffee. The aims of this way of writing tests is to make the tests easier to understand and modify (either to fix a broken test or to add new ones) by: - Reducing special Angular knowledge needed to understand the tests - Reducing globals (both global variables and beforeEach() functions) used in tests. These increase the "travel" needed to understand a given test method because you have to read the whole test module to understand everything that happens before the test runs and what all the global variables the test uses are. The aim is that reading only the test function (and not the rest of the code in the file) should be enough to understand the test. Similarly I shouldn't have to read and understand the whole test file to add a new test. Globals and beforeEach()'s also tie the tests together. For example if a bunch of stub services and a controller are created in beforeEach() functions then any new tests added to the file inherit this stubbing behaviour even though they may not want it or may need something else. This again makes changing or adding just one test harder - need to understand the whole file, changes made for one test may break other tests. Implementation notes: - Used a new top-level describe(), didn't want to inherit all the globals, beforeEach()'s and stubbing of the existing one. - Because we now have two top-level describe()s had to use a try ... catch in the second one to avoid creating the "h" Angular module twice. - Tried to decouple the tests from Angular as much as possible, reduce the amount of Angular knowledge (especially about providing and injecting dependencies) needed to understand the tests. Angular's $provide isn't used at all, and inject() (which I don't think can be removed completely) is contained in two helper functions. - Rather than a beforeEach() and global variables we use a controller() function that creates the AccountController and stubs for the services it depends on and returns an object of all of them. Tests can then call controller() and use destructuring assignment to get only the bits they need. Every variable used in a test method is defined in the test method (sometimes by calling a helper function and getting a return value). - controller() by default uses minimal stubbing, but the caller can optionally pass in their own object for each of the stubbed dependencies.
-
Sean Hammond authored
-
Sean Hammond authored
Fixes #174. account.html: - Add a new "Change Your Email Address" form accounts/views.py: - Add email to the user dict returned at /app?__formid__=profile (or session.profile() in Angular) - When resetting the form after a successful submission, put the new (or unchanged) email address into the user dict returned in the response. AccountController needs this (see below). account-controller.coffee: - Add $scope.email (the user's current email address), to use for placeholder text in the email form field. - After a successful form submission set $scope.email to the one from the response. This sets the placeholder text in the email field to the new value, instead of continuing to show the old email address as placeholder. - Add changeEmail() method to receive email form submissions.
-
- 28 May, 2015 2 commits
-
-
Randall Leeds authored
Display KaTeX parse error upon faliure to parse
-
Mohamed Baig authored
Added mathjax fallback to inline rendering
-
- 22 May, 2015 1 commit
-
-
Nick Stenning authored
This change introduces a new top-level stylesheet for the help page. This will hopefully make it easier to tell where styles affecting the help page come from, and minimise the number of times that changes to unrelated CSS will alter the display of the help page.
-
- 21 May, 2015 1 commit
-
-
Nick Stenning authored
Overriding properties on the body in the otherwise component-specific `topbar.scss` is a cause for confusion. This resulted in the styling for the help page being broken when topbar was bundled into `app.scss`.
-
- 20 May, 2015 6 commits
-
-
Sean Hammond authored
-
Nick Stenning authored
-
Nick Stenning authored
Add URL params to /stream.atom
-
Nick Stenning authored
This reverts commit f6787df785c8c8e2bdbf4d7b65a9176adad64d19, reversing changes made to 29d975367171b8d4e69941c3f0e5d40ddfc98ddc. I'm afraid I've had to revert this: - it introduced a crashing bug on master (see https://github.com/hypothesis/h/pull/2131#discussion_r30692024) - feature flags are no longer accessible by view functions (the configurator object is not available from the request), thus this blocks #2131
-
Nick Stenning authored
Prospector tweaks
-
Randall Leeds authored
-
- 18 May, 2015 2 commits
-
-
Randall Leeds authored
Make our Prospector settings much stricter
-
Randall Leeds authored
Features cleanup
-