-
Couldn't load subscription status.
- Fork 78
Comment publish preview flow #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This is good. I like the fact that this is so data-down, actions-up, and can be reused. Good thinking here. 👍 |
|
This will also make it easier to use it in-line when editing posts/comments that are already published. |
|
The flow is done, but this still needs work. There's a lot of things to cover and, while I wrote spec first, I can't be sure I covered it all, so I'm slowly going through the app and figuring it out manually, updating and adding new specs as I go along. I could use a second pair of eyes on this. I'll also go through the code and rewrite anything that ended up being ugly, now that the major specs are covering the behavior. I'll also add comments to anything that's unclear. |
cbb4672 to
ec22dfa
Compare
|
@joshsmith I think this is in a mergeable state. I wrote what I believe are thorough specs, tested manually to ensure everything is consistent with the API and all of the features are covered. The styles are added are not intended to be final. It's just something I put in so I can actually see what I'm clicking at in the UI. We should probably work on styling in a separate PR. I also took the liberty of getting rid of all the deprecation errors I could detect. They consisted of 3 groups in total
|
|
Should we have an open issue for background loading records to remind ourselves when it does change? |
|
Good idea, I'll make one. |
|
And thanks for getting rid of those warnings. The notices for async relationships in particular were a pain. |
|
Some things I'm noticing while working through this: Post creation without a title gives you something like:
Ideally we should try to give the user a better error. Switching to the editing tab on posts/comments causes a 422 error and "Loading preview..." to render. We should maybe not send the body at all in this case and just render a blank preview. |
|
|
||
| session: Ember.inject.service(), | ||
|
|
||
| currentUserId: Ember.computed.alias('session.session.authenticated.user_id'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to refactor this later with the currentUser object I'm introducing in #76.
|
@begedin and maybe also @hbrysiewicz can answer, I notice that |
| return userId === authorId; | ||
| }), | ||
|
|
||
| canEdit: Ember.computed.and('session.isAuthenticated', 'currentUserIsCommentAuthor'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common to keep the aliases all together near the top after static attributes, then computed properties, then methods, then actions. Keeps the files clean and clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm having trouble seeing how you want this reordered. Can you order it in something like:
- classNames
- classNameBindings
- canEdit
- whateverElse
so I can understand better?
|
I was actually wondering the same thing, @joshsmith but I know that I am having trouble using the UI (edit buttons overlapping other elements) but I think it was mentioned this should be a separate issue, correct? Functionally it works. Otherwise my only feedback was on the organization of file for clarity. Looks wonderful! Really like how clear the functionality is with actions and naming. Awesome PR |
|
By having trouble using UI, you just mean the design is poor, right? That's expected, if so. If it's a "something didn't work", then that's not expected. |
|
Yes @joshsmith just that its poor design :) functionally working so +1 |
Comment publish preview flow
|
I've added #83, #84, #85, and #86 as follow-up tasks for this. Also there are design follow-up tasks that will come when @jimmynotjim helps figure out UI of this, and we can implement. |
Implemented
editor-with-previewcomponent, which has two "tabs". It starts in editing mode by default and shows a regular text area.generatePreviewis triggered, with the textarea content as a parameter.