Commit Graph

45 Commits

Author SHA1 Message Date
Jason Williams
1c6216777c Refactor notifications to prevent stacking.
Closes #3511, Closes #3512, Closes #3526
- show* methods now close existing passive notifications by
  default.  They also now take an optional options object where
  existing parameters such as "delayed" and "defaultErrorText"
  can be passed in as well as the new "doNotClosePassive" flag.
- Removed all explicit calls to notifications.closePassive except
  for the few places where it makes sense to call it separately.
2014-08-01 16:57:29 +00:00
John O'Nolan
601ad25716 Shorter notifications
Basic notifications are unnecessarily verbose and, in some instances, even cause line-wrapping to occur. This change shortens them to short, concsise statements to indicate what action has taken place.
2014-07-31 19:19:47 +03:00
Matt Enlow
c93b7631d6 Keyboard shortcuts for Mac vs All
Closes #3029, Ref #3469
- Editor shortcuts are now built in a separate file, which uses `ctrlOrCmd` to correctly set OS specific shortcuts.
- Removed `newLine` and `selectWord` shortcuts
2014-07-31 08:00:52 -06:00
Alan Richards
4d074c3e55 Settings screens redirect for certain roles
Closes #3291
- Adds redirects based on roles as defined in the case
- Adds new mixin `CurrentUserSettings`
- For authors, all settings pages redirect to `users/self`
- For editors, all settings pages other than specific users redirect to `users`. Any user that is not self or an author redirects to `users`
2014-07-30 00:57:16 -07:00
Jason Williams
039f5fd693 Add a mixin for saving a subset of a model.
Closes #3403
- Add SelectiveSaveMixin so that a DS.Model can save one or more
  properties at a time while preserving other outstanding changes.
2014-07-27 21:04:35 +00:00
Maurice Williams
fb170d1725 Pagination for Users Management screen
closes #3222
- implementing server-side pagination for /users API
- passing /users?limit=none will return all users
- passing /users?status=invited will filter base on user status
- creating 3 mixins (route, controller and view) to keep pagination logic DRY
- updating route, controller and view for Posts to use new mixing
- implementing infinite scrolling for Users Management screen (using new mixins)
- Users Management screen displays all invited users, but paginates active users
2014-07-21 14:03:26 -04:00
Matt Enlow
0122ecd593 Fire NProgress on User, Post, and Settings save
Closes #3037
- Created `NProgressSaveMixin`, which extends the `save` method of a model
  to fire NProgress.
- Extended `UserModel`, `PostModel`, and `SettingModel` with the new
  mixin.
- NProgress can be disabled by passing an options hash to the save function with the `{disableNProgress:true}`
- Now that the ValidationEngine isn't the only thing playing with options inside of `model#save`, refactored it to pass the options down the super chain.
2014-07-13 14:19:27 -06:00
Jason Williams
faf6832cab Add validation to invite new user form.
Closes #3246
- Add a UserValidator to the validation engine that runs a set
  of validations based on the user status.
- Added validations for invited users and active users.
2014-07-11 19:09:34 +00:00
Matt Enlow
15f1591383 Indirect post title in editor
Closes #3179
- Add `titleScratch` property to `PostModel`.
- Changed references to `title` to `titleScratch`
2014-07-03 11:09:05 -06:00
Kevin Ansfield
f1cf98efd9 Persistent notifications
closes #3057
- add Notification model
- update injected Notifications object to handle persistent notifications
- load server notifications on setup if logged in otherwise on successful sign-in
- changed all existing notifications.closeAll calls to closePassive
- fixed dismissable/dismissible spelling in server API & tests
- add notifications.closeNotification method so DELETE calls can be made for server-originating notifications
2014-07-01 11:36:21 +02:00
David Arvelo
ac9f269085 Better handling of validation errors + more documentation
closes #3153
- this is all about the validation engine
- add a option, `opts.model`, to use a passed-in model directly if needed
- handle validators that return an array of strings, array of objects, or both
- ajax util returns either an array of errors or a single concat'd string
- remove formatErrors function from the mixin and make it private
- allow validation options to be passed into `.save()` since ember-data doesn't take params on `.save()` anyway
- streamline control flow
2014-06-30 22:35:03 -04:00
Hannah Wolfe
d4222ed87d Merge pull request #3146 from darvelo/tags-tracking
Fix tag updating on model save in editor controller
2014-06-30 16:48:27 +01:00
Hannah Wolfe
f6781664f6 Merge pull request #3144 from darvelo/sort-new-posts
New posts pass PostsController sorting function at the top
2014-06-30 16:23:51 +01:00
Gabor Javorszky
3a7be0c2fd Made ember version of reset password work
Closes #2843

* Implemnted the ember validator correctly for both reset request and actual reset (with the token)
* added reset validator
* changed the request route addresses to be `/authentication/passwordreset`
* changed the format of data to be `{ thing: [ {data } ] }`

Missing:
* notifications
* tests for these use cases
2014-06-30 14:37:49 +01:00
David Arvelo
9f9749d123 New posts pass PostsController sorting function at the top
- PostsController orderBy function sorts posts with isNew to the top, otherwise their undefined dates fail to compare
- also catch when `updated_at` is undefined, happens when model is being written with results from the server
- catch objects of type Error in validation engine, helps catching client errors
- join server errors with BR tag in ajax util
- add `emberBuild` task to `grunt test-functional`
- add a test helper, `thenTransitionAndWaitForScreenLoad`, to test transitioning to major parts of the app
- add a test that transitions from Content to the Editor, and back to Content
2014-06-29 21:49:32 -04:00
David Arvelo
f8d1e7fe15 Fix tag updating on model save in editor controller
closes #3131
- create a hook in the editor controller that fires on a model's save events
- use this hook to perform all the things that need to happen on save, regardless of where the save originated
- remove logic from instances of model.save() that now belongs in the modelSaved hook
- detach the model event listeners on willTransition in the editor routes
2014-06-28 23:50:24 -04:00
Hannah Wolfe
2fa4a00dac Merge pull request #3115 from halfdan/2850-post-notifications
Show correct post notificatons based on status.
2014-06-27 21:52:28 +01:00
Fabian Becker
b359d4122b New setup screen for blog installation.
fixes #3072
- Change router to handle /ember/setup/
- Adjust doSignup to also handle setup
- Adjust tests and add new where necessary
- Add setup controller, setup validation, setup route
- Adjust casper emberSetup to handle new setup
2014-06-26 15:31:44 +02:00
Fabian Becker
e148a98106 Show correct post notificatons based on status.
closes #2850
- Add messageMap from old admin
- Add two methods to pick the correct notification based on prev status and current status
2014-06-26 09:42:29 +00:00
Jason Williams
f4de1199d1 Enable validation for settings/general screen
Closes #3036 Refs #3012
-Enable validation for settings/general
-Turn on functional tests for the validations
-Move notification closeAll calls so that notifications
 are cleared on attempted saves instead of just on
 successful saves
2014-06-24 13:32:47 +00:00
Hannah Wolfe
e8d30fd35e Merge pull request #3058 from halfdan/3012-close-notifications
Close notifications on transition or user action.
2014-06-24 13:45:51 +01:00
Fabian Becker
989d19837e Close notifications on transition or user action.
closes #3012
- Inject notification object into router
- Listen to didTransition / observe currentPath to close notifications
- Close notifications on successful save actions
2014-06-24 13:51:47 +02:00
Kevin Ansfield
07e18dac86 Ensure incomplete tags aren't lost on save
closes #2991, references #2172, references #2453
- moved and separated tags logic from EditorTagsView into PostTagsInputController/View
- call out to PostTagsInputController when saving post to ensure an incomplete tag is completed before save
- added Tab key support for suggestion selection / tag completion
- don't show suggestions list when input field doesn't have focus
- added code for #2172 but left commented-out as it causes side effects with completion on save
- updated suggestion highlighting so it doesn't bork on html/regex chars (#2453)
2014-06-24 12:14:27 +02:00
Jacob Gable
ab97c8c861 Add validation for signin/signup
Closes #2976, Closes #3017

- Move logic to signup controller
  - Add ValidationEngine mixin to signup controller
  - Add signup validator with code from clientold login view
- Add signin validator and integrate into signin controller
- Add validation to forgotten controller
  - Switch to button action to support hitting enter in text field to submit
- Clear all notifications in notifications.closeAll
- Modify ValidationEngine.validate to not format errors based on option
- Update casper test for signin to wait for notification before trying
to do another signin
2014-06-23 21:17:57 -05:00
Hannah Wolfe
9c9c81697b Update shortcut for zen mode
closes #2988

- includes tests
2014-06-23 22:24:28 +01:00
Hannah Wolfe
b0e556d304 Merge pull request #3024 from morficus/nprogress-loading-indicator
Re-implementing the loading indicator for the Ember admin
2014-06-23 16:11:31 +01:00
Maurice Williams
2afc1ff04f Re-implementing the loading indicator for the Ember admin
closes #2855 , closes #2848
- New  mixin that utilizes NProgress for displaying a loading indictor for all routes who's model issue a "loading" event (aka: when requesting data from the server during a route change).
- Also removing (the now unnecessary) "loading" template.
2014-06-23 10:01:33 -04:00
Hannah Wolfe
d6914e26c5 Merge pull request #3023 from darvelo/promise-rejection
Fix promise rejection during validation
2014-06-23 11:45:04 +01:00
David Arvelo
1f9751f753 Fix promise rejection
fixes #3013
- bubble promise rejection on post model validation/save error so that it doesn't bubble as resolved
- prefer `.catch()` for promise handlers as per recommendations
- check if `.save()` is being called from model.destroyRecord() and forgo validation if so
- normalize output for both `.validate()` and `.save()`
2014-06-22 14:49:09 -04:00
Matt Enlow
52118c16e3 Implement Markdown Shortcuts
Closes #2984, #3020
Ref #1463, #3019

 #### Shortcut Values
Shortcut values can now be either strings (as before) or objects like
{action:string, options:hash}.
 #### Markdown shortcuts added
- 'ctrl+alt+u' strkethrough
- 'ctrl+alt+1' h1
- 'ctrl+alt+2' h2
- 'ctrl+alt+3' h3
- 'ctrl+alt+4' h4
- 'ctrl+alt+5' h5
- 'ctrl+alt+6' h6
- 'ctrl+shift+i' image
- 'ctrl/command+k' link
- 'ctrl+l' list

Left behind commented out stubs for additional markdown shortcuts.

 #### Editor Controllers (New and Edit)
- Moved shared init function into editor-base-controller.
- Removed MarkerManager mixin from editor controllers as it's included in
  the base.
2014-06-21 15:10:46 -06:00
Hannah Wolfe
1256c3c2fe Merge pull request #3011 from darvelo/validations
Add Validations Layer and Post Validations
2014-06-21 17:41:28 +01:00
Hannah Wolfe
700e9644e2 Merge pull request #3002 from novaugust/shortcuts
Implement Shortcuts in Ember
2014-06-21 15:15:50 +01:00
David Arvelo
af47f88648 Add Validations Layer and Post Validations
closes #2893, issue #2850, issue #2856
- this is a stable, but quick and dirty validations layer for the time constraints
- this could be replaced with a unified server/client layer later. the infrastructure is there.
- create a validation engine mixin to match validators with models
- override the save method in the mixin to perform validations first
- create a post validator
- fixup calls to .save() to make sure they catch errors properly
2014-06-21 00:12:55 -04:00
Matt Enlow
71bee2fd46 Implement Shortcuts in Ember
Closes #2988, #2752
Ref #1463, #2984,
 # Shortcuts via Keymaster
- Added KeyMaster to bower dependencies. KeyMaster is a minimal keyboard
  shortcuts library.
- Added `ShortcutsRouteMixin` for routes that will use shortcuts.
  Currently, only routes can have shortcuts. See the extensive comment
  at the top of `core/client/mixins/shortcuts-route.js` for a
  description of how to implement shortcuts.

 ## Other Changes
- Injected popover service into ApplicationRoute
- Created `EditorRouteBase` mixin for the `editor.new` and
  `editor.edit` routes to mixin.
- `StyleBodyMixin` now calls `this._super()` on `activate` and
  `deactivate` to play nicely with other mixins.

 ## Shortcuts and Stubs implemented
 #### Application-Wide
- `'esc':'closePopups'` shortcut **stub** to close popovers,
 modals, and notifcations

 #### Editor Shortcuts
- `'ctrl+s, command+s': 'save'` note that `command` is the
  `meta` key.
- `'ctrl+alt+p': 'publish'`
- `'ctrl+alt+z': 'toggleZenMode'`
2014-06-19 15:07:42 -06:00
David Arvelo
2dd5c5218a Fix deletion of Post Model in Editor and Content screens
fixes #2999
- handle undefined argument in openModal function
- catch whether a model is deleted in Editor routes to aid transition
- move updateTags function to the PostModel
- add call to updateTags in delete-post modal
2014-06-19 14:31:56 -04:00
Matt Enlow
6972902adb Cleanup Misc Ember Code
No issue

Misc Places
- Removed expired, irrelevant, and fixed todos

FloatingHeaderPartial
- Fixed "Written" vs "Published" text logic

SettingsGeneralController
- Removed single quotes from property names

EditorBaseController, MarkerManagerMixin
- Aligned var declarations

PostItemView
- Commented out unfunctional code for feature request #2398
- Switched `isPage`, `isFeatured` to be computed properties in `Po
- use `toggleProperty` in `PostController.action.toggleFeatured`
2014-06-17 14:59:15 -06:00
Matt Enlow
7412493575 Create boundOneWay util function
Closes #2958
- Created `boundOneWay` util to extract common pattern of having a oneWay property that doesn't break its binding after being set
- Changed `EditorControllerMixin.willPublish`,  `PostSettingsMenuController.publishedAtValue` and `.slugValue` to use the new `boundOneWay` util
2014-06-14 15:27:52 -06:00
David Arvelo
2151d8a49f Reach Editor parity with Ember
closes #2426, closes #2781, closes #2913
- Concatenate vendor files on change of js in core/shared/
- Add all the markerManager stuff to its own mixin
- make markers a shared object for all that mix it in. makes it easier to use helper functions in different modules
- add getMarkdown method, returns object with two keys holding the markdown: one with markers, the other without
- Clear markers when codemirror is destroyed
- make Editor subcomponents communicate through the Editor Controller
- Set Codemirror and html preview shared scrolling
- Set CodeMirror, html preview css scroll class with util
- Create 'scratch' property in Editor controller; prevents a model save wiping image markers due to markdown bindings
- Add editor and html preview actions to handle img upload start/finish
- disable codemirror when an image is being uploaded, enables on success or failure
- Fix editor wordcount when there are 0 words
- Add modal dialog when transitioning out of the editor with an unsaved post
- Add window.onbeforeunload handling with `.unloadDirtyMessage()` on editor controller
- and various other things
2014-06-13 18:12:03 -04:00
Matt Enlow
b58573ded5 Refactored PostSettingsMenuController
Closes #2845.
Ref #1351.
- Refactored `PostSettingsMenuController` to appropriately set and display
  slug and publish date and their placeholders.
- Removed api spam on title change by putting `slugPlaceholder` generation
  inside of an `Ember.run.debounce` call.
- Renamed `gh-blur-text-field` to `gh-blur-input`
- Created `SlugGenerator` class to abstract slug generation.
- Added `timestampVerification` function to `utils/date-formatting`
- `utils/date-formatting` now uses `strict` parsing of dates
- Added more acceptable date formats to accommodate strict parsing
- Moved `isDraft` and `isPublished` computed properties from
  `EditorController` to `PostModel`
2014-06-13 12:14:58 -06:00
David Arvelo
beb409dd5f Fix serializing/deserializing Tags on save from the Editor
closes #2947
- make a PostSerializer to embed the tags objects in the posts POST/PUT request
- on editor save, clear out tags from the post and data store that have `id: null`
2014-06-13 02:44:45 -04:00
Matt Enlow
25f692cdf6 Transition to editor.edit after saving a new post
Closes #2860
- `editor-base-controller`'s `save` action returns a promise with the model
  after saving
- `EditorNewController` will transition to `EditorEditController` upon a
  successful save (model has an id)
- Removed a console.log in editor's save function
2014-06-11 15:44:18 -06:00
Matt Enlow
70e22807a3 Fix Editor Save Button not allowing unpublish
Closes #2918
2014-06-09 08:37:16 -06:00
David Arvelo
f1a02b88a9 Split PostController amongst new Editor/PostSettingsMenu Controllers
closes #2910
- create EditorController, PostSettingsMenuController
- remove `posts.post` controllerName dependency on EditorRoute/NewRoute
- `{{render}}` the PostSettingsMenuView with its own controller
- break up properties/methods from PostsPostController into all three controllers
- fix EditorRoute pagination options to now be comparable to PostsRoute
- add NewController to force NewRoute to refresh editor with blank model. Identical to Editor's
- EditorController and NewController are based on a shared mixin
- NewView created, templateName is 'editor'
2014-06-08 14:01:32 -04:00
Matt Enlow
78643344e4 Added popover component
Closes #2418, #2714
Ref #2446, #2565

- Added and injected `popover` service to globally control popovers
- Added `gh-popover-button` component
- Added `popover-mixin` for popover and popover-buttons to mixin
- Added body-event-listener mixin for popover service to watch for body
  clicks with
- Post settings and post save button both now use `gh-popover`
- Added hacks to `ember-hacks.css` to make popovers work until ghost-ui
  consolidates functionality
2014-05-31 17:23:41 -06:00
Manuel Mitasch
275f623278 Amend fixtures & put body classes in styleBody mixin
- Change fixture response of posts route to actual format.
- Extracted classNames logic of routes into style-body mixin.
- Additionally replaced all double-quotes with single-quotes for style conformance.
2014-03-09 15:30:54 +00:00