Commit Graph

28 Commits

Author SHA1 Message Date
Fabian Becker
0e779e7c37 Post Settings Menu - Step 1
closes #3936
- Implement new PSM
- Hook up close action
- Automatically close when view is destroyed
- Close on click and when pressing ESC
2014-09-10 17:31:19 +02:00
Matt Enlow
fb6c3c6b56 Change Ember function.property() to Ember.computed
Closes #3417
2014-08-19 10:01:17 -06:00
Jason Williams
77af056fd0 Reset slug input text box after invalid input.
No Issue
- When an invalid, all whitespace slug is entered into the
  slug input in the post settings menu, it's rejected but
  the input's value still remains the same.  This resets the
  input back to its original value.
- Added test for the above behavior.
- Only show success notification if slug was actually changed.
- Convert whitespace from tabs to spaces in post-settings-menu.hbs
2014-08-18 21:10:57 +01:00
Kirill Yakovenko
a0d5817203 Fix TypeError when updating slug
- added check slug before trim
2014-08-12 17:46:14 +03:00
Robert Jackson
9e07e18d2a Ensure PSM author is reset when changing posts. 2014-08-10 10:40:04 -04:00
Sebastian Gierlinger
1c104c8f00 Merge pull request #3569 from morficus/issue-3549
fix most recent post stolen by the last logged in user AND only show active users in post-settings-menu drop-down
2014-08-04 10:51:07 +02:00
Hannah Wolfe
4db3cb06e4 Merge pull request #3576 from morficus/issue-3523
Error modifying "author" attribute before post record has been created
2014-08-03 17:24:09 +01:00
Maurice Williams
44dd5ed286 fix most recent post stolen by the last logged in user AND only show active users in post-settings-menu drop-down
fixes #3549 fixes #3528
- instead of grabbing and setting the author after fetching the list of users, get the author info from the models "author" property and set it when that value returns. (3549)
- added filter to the PSM's "authors" attribute to only display active users (3528)
2014-08-02 21:28:02 -04:00
Maurice Williams
6ee5ba2291 Error modifying "author" attribute before post record has been created
fixes #3523
- when changing the author, added a check to NOT trigger a save if the post has not been created/saved as yet
2014-08-02 14:35:19 -04:00
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
Jason Williams
27e14b7ad9 Fix for missing author when switching posts
No Issue
- Fixes the case where the authors dropdown in the
  post settings menu has no author selected after
  switching between posts.
2014-07-31 20:19:52 +00:00
Maurice Williams
e6115c4126 custom slugging capabilities for individual user pages
closes #3401
- modifying slug-generator to be more generic
- adding slugging capabilities for /settings/users/:slug
- modified posts to use the updated slug-generator
2014-07-31 08:14:22 -04:00
Matt Enlow
9ad9e6e645 Add Author dropdown to PostSettingsMenu
Ref #3084
This PR does NOT hide the dropdown as required to close 3084.

- `EditorNewRoute` creates post with the author set to the current user
- added `authors` ArrayPromiseProxy (whoa, what?) to PSM
- added `changeAuthor` function that sets author and saves model when the user selects a new author
2014-07-18 17:29:46 -06:00
Jason Williams
da28b2f605 Prevent duplicate slug request on saving new post
No Issue
- Do not run generateSlugPlaceholder if save has been initiated
  and the title has already been set on the post. At that stage
  a slug has already been generated and another API call is not
  necessary.
2014-07-18 15:05:10 +00:00
Matt Enlow
f80f2e1a24 Remove minor notifications; Close persistent notifications even on error
Closes #3105, Closes #3175

- Removed notification on successful post's `page` status change
- Removed notification on successful post `featured` status change
- Added `closePassive()` notifications on error in the post-settings-menu
- Persistent notifications will close whether their `DELETE` request was
  successful or not.

 #### Misc
- Added `name` attribute to `post-setting-menu.hbs` inputs to facilitate testing
- Removed `return <Promise>` from action in `PostSettingsMenuController`. Actions should only return `true`
- Toggling `post.featured` won't fire NProgress.
2014-07-15 09:03:18 -06: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
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
Matt Enlow
ccd319b426 PostSettingsMenu: Don't save new posts, reset values on failure
Closes #3158, Closes #3143, Closes #3134
- Added `model.rollback()` when PSM fails to save.
- Added `showErrors` and `showSuccess` helper functions to PSM to abstract
  closing and showing of notifications.
- Added `togglePage` action to indirect the setting of `page`.
- Removed `isStaticPage` property in favor of `togglePage` action
- moved `updateSlug` error catching to outer promise (slugGenerator promise)
- modifying the `page` and `published_at` properties will no longer cause a new post to save
- Close passive notifications on published date parse fail
- Removed promise creation in catch statements

- Changed tests to click on label, rather than the input for
  .post-setting-static-page.
2014-07-02 15:29:15 -06: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
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
Hannah Wolfe
c6dc8c0eea Functional tests for Ember
issue #2989

- Adds lodash for bind and isNumber - looking for a better solution for this
- Still needs the editor and flow tests porting
- Some of the tests are commented out awaiting further implementations
2014-06-20 15:20:59 +01:00
Jason Williams
38df3972c7 Fix removeObserver for title property 2014-06-17 15:47:03 +00:00
Jason Williams
6a49b95980 Fix slug create and update logic for posts
-Remove unnecessary calls to the slug API endpoint on the
 content screen.
-Only make slug API endpoint calls in editor when the post is new.
-Improve logic for when to update the slug.
2014-06-16 14:09:46 +00: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
Hannah Wolfe
f0259eb467 Merge pull request #2946 from halfdan/fix-page
Fixes static pages when permalinks are active.
2014-06-14 18:12:39 +02: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
Fabian Becker
5eafa15b1b Fixes static pages when permalinks are active.
fixes #2938
- Fix `page === 1` occurences
- Fix ember logic
2014-06-13 01:00:18 +02: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