Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

Feature/liveblog #261

Merged
merged 26 commits into from
Mar 27, 2017
Merged

Feature/liveblog #261

merged 26 commits into from
Mar 27, 2017

Conversation

tjwelde
Copy link
Contributor

@tjwelde tjwelde commented Mar 7, 2017

Make sure these boxes are checked before submitting your pull request - thank you!

  • All coding styles are fulfilled. (How to check for cs issues?)
  • All tests are running locally. (How to run the test?)
  • Necessary update hooks are provided.
  • User roles have correct access for new introduced permission.
  • Every thunder module has a README.md in its root. Follow this guidelines, but we don't need every topic.
  • Code is covered with well-balanced amount of inline comments.

If you are really awesome, then your feature is covered by additional tests. Well done!

Copy link
Member

@chrfritsch chrfritsch left a 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');
Copy link
Member

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',
Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor Author

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'] = [
Copy link
Member

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

Copy link
Contributor Author

@tjwelde tjwelde Mar 8, 2017

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.

Copy link
Contributor Author

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:
screenshot 2017-03-08 11 28 17

@@ -0,0 +1,17 @@
name: 'Thunder Liveblog'
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Contributor

@mtodor mtodor left a 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:

  1. [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.
  2. [LB] When "header" (liveblog content) is changed, it would be nice that it's also changed in live stream page.
  3. [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?
  4. [Integration] I would be nice to add description for Liveblog content type.
  5. [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());
Copy link
Contributor

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.

@tjwelde
Copy link
Contributor Author

tjwelde commented Mar 13, 2017

@mtodor Regarding 2) Which header do you mean? From an individual Liveblog Post?

@mtodor
Copy link
Contributor

mtodor commented Mar 13, 2017

@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.

@tjwelde
Copy link
Contributor Author

tjwelde commented Mar 16, 2017

  1. is adressed in seperate ticket
    • fixed: post not saved and error shown
  2. is adressed in seperate ticket
  3. fixed
  4. fixed
  5. is adressed in seperate ticket

@mtodor
Copy link
Contributor

mtodor commented Mar 20, 2017

From my point of view, this looks good.

@chrfritsch chrfritsch merged commit 5125cc3 into develop Mar 27, 2017
@chrfritsch chrfritsch deleted the feature/liveblog branch March 27, 2017 10:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants