-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
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.
"Liveblog paragraphs" it's not possible to enable that module in Thunder
'revert liveblog revisions', | ||
'view liveblog revisions', | ||
]; | ||
$config = $config_factory->getEditable('user.role.editor'); |
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.
Use a for-loop over the roles
|
||
$form['thunder_liveblog']['description'] = [ | ||
'#type' => 'item', | ||
'#markup' => $this->t('Register a new account at <a href=":pusher_url" target="_blank">:pusher_url</a>, create a new app and note down your keys. You can provide theme right here or at a later stage on the liveblog settings form', |
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.
Missing dot at the end
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.
Please mention that the pusher app must be registered in the US cluster. Also add that note to the liveblog settings page.
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.
You don't have to register it in the US cluster, but I will add to the description, that you have to note down your cluster.
'#title' => t('Secret'), | ||
]; | ||
|
||
$form['thunder_liveblog']['pusher_cluster'] = [ |
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.
Cluster field should be a select box, like it is on pusher app creation. Also add that to the liveblog settings page
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.
Yeah, I also thought about that. Unfortunately, I can't get the available clusters from the Pusher API, so we would have to track changes there and modify it, each time.
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.
I filed a ticket https://support.pusher.com/hc/en-us/requests/10412.
When someone opens up a new app, he also gets the cluster as a string, so I think it is ok for now:
@@ -0,0 +1,17 @@ | |||
name: 'Thunder Liveblog' |
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.
Add a "Liveblog" paragraph into thunder_liveblog to make it possible to integrate a liveblog into an article
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.
hmm, this wasn't planned like that, since the liveblog lazyloads, so it must be always added to the end and it should be easily possible to set the "live" flag.
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.
I would propose adding paragraphs to the Liveblog Content Type
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.
Or I could add an entity reference to liveblog at the end of an article. The downside of this could be that you can't easily mark your liveblogs in a special way on the frontpage, or make a view with all articles which have a liveblog.
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.
In general this looks good. I have tested it drush + composer install, with initial install and with post install, with settings provided in install and after. Worked in all cases.
There are few things that I have found. I don't know what is part of liveblog module, what for integration, but here is list:
- [LB] When I make big post (>10kb), limit for Pusher is 10kb, error occurs in log, that it can't be pushed.
But in live blog form I get success message: "Liveblog post was successfully created."
In log: "Failed to send a message to Pusher. See the request log..."
And also, since it's not pushed to pusher, user does not see post until page is reloaded.
-> maybe it should be considered to notify editor about error occurred. Best would be to not create post in Drupal, if it's not pushed to pusher. In general this should be atomic action, so post is successfully created only if it's created properly in both places -> Pusher + Drupal. - [LB] When "header" (liveblog content) is changed, it would be nice that it's also changed in live stream page.
- [Integration] When I post some media paragraph, there is title above it: "Embed media". I'm not sure is that needed and can we hide label?
- [Integration] I would be nice to add description for Liveblog content type.
- [LB] Looks like that sometimes content is not loaded properly. Fe. If I create 2 posts really quickly (withing same minute) with titles 123 and 456 (in that order). Post will be correct in stream, when I reload page order is reverse and 123 is displayed before 456.
foreach ($this->optionalModulesManager->getDefinitions() as $provider) { | ||
$providers = $this->optionalModulesManager->getDefinitions(); | ||
|
||
uasort($providers, static::sortWeights()); |
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.
This is a bit confusing -> when I see sortWeights()
, I would expect that method will sort weights, but actually it returns function.
I would suggest if you want to have helper function, just pass array to it and do everything inside. Then you can say static::sortByWeights($providers);
-> you have to accept array as reference (&$array), what is ugly, but that's case with all sort functions.
@mtodor Regarding 2) Which header do you mean? From an individual Liveblog Post? |
@goldquest Regarding 2) That's why I quoted it there ("header"), because I don't know how to describe it. 2nd try: What is displayed when you don't have any post -> that's liveblog content (static liveblog part). When you click on Edit on liveblog from content list page. |
Now using it as a thunder integration module
Let the user configure pusher on the installation screen
Background: Thunder demo must be installed first, since it has its IDs hardcoded.
ad4ab83
to
050f61d
Compare
|
From my point of view, this looks good. |
Make sure these boxes are checked before submitting your pull request - thank you!
If you are really awesome, then your feature is covered by additional tests. Well done!