Skip to content

[Notifier][WebProfilerBundle][FrameworkBundle] Add notifier section to profiler #36479

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

Merged
merged 1 commit into from
Oct 4, 2020

Conversation

jschaedl
Copy link
Contributor

@jschaedl jschaedl commented Apr 17, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -

This is the first iteration of adding a profiler panel for the new Notifier component:

WebProfiler Toolbar:
Screenshot 2020-10-02 at 10 26 35

WebProfiler Notifier Panel:

Screenshot 2020-10-02 at 10 28 19
Screenshot 2020-10-02 at 10 28 29
Screenshot 2020-10-02 at 10 28 35
Screenshot 2020-10-02 at 10 28 42

An example project can to test the new profiler panel can be found here: https://github.com/jschaedl/notifier-profiler-integration

{% set events = collector.events %}

<span class="label {{ events.messages|length ? '' : 'disabled' }}">
<span class="icon">{{ include('@WebProfiler/Icon/mailer.svg') }}</span>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • exchange icon

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javiereguiluz Can you work on an icon for the notifier profiler?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being late, but our designer just sent us the icon for the notifier. It uses the "bell icon" which is universal for notifications:

<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path fill="#AAA" d="M11.23,4.8c-3,.83-5.07,3.18-5.07,5.9H7.39c0-2.21,1.77-4,4.17-4.72ZM7.49,0A12.22,12.22,0,0,0,0,11.59H2.07A10.14,10.14,0,0,1,8.23,2Zm8.24,2a10.14,10.14,0,0,1,6.16,9.64H24A12.24,12.24,0,0,0,16.47,0ZM4.41,15.64V10.7a7.57,7.57,0,0,1,15.14,0v4.94l3.3,4.4H1.11Zm4.45,5.3A3.06,3.06,0,0,0,11.92,24H12a3.07,3.07,0,0,0,3.07-3.06Z"/></svg>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javiereguiluz as this PR is already merged, it might be better if you create a new PR with the new icon instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @javiereguiluz I created a new PR: #38545

@nicolas-grekas nicolas-grekas added this to the next milestone Apr 18, 2020
@fabpot
Copy link
Member

fabpot commented Aug 6, 2020

@jschaedl Will you have time to finish this PR? Any blockers?

@fabpot
Copy link
Member

fabpot commented Aug 13, 2020

We might need to take into account the new SentMessage class (not sure if this is worth it though).

@jschaedl
Copy link
Contributor Author

@fabpot

@jschaedl Will you have time to finish this PR? Any blockers?

Sorry for the delay. There are no blockers so far, only limited time. But will try to work on this PR at the end of this week.

@jschaedl jschaedl force-pushed the notifier-profiler-integration branch from c87bf07 to 77a07d9 Compare September 13, 2020 12:07
@jschaedl jschaedl marked this pull request as ready for review September 13, 2020 12:51
@jschaedl jschaedl force-pushed the notifier-profiler-integration branch from 77a07d9 to 3af0d99 Compare September 13, 2020 15:42
@fabpot
Copy link
Member

fabpot commented Sep 30, 2020

@jschaedl Do you think you will have something that we can merge before the end of the week (for 5.2)? Even if it's not finished?

@jschaedl
Copy link
Contributor Author

jschaedl commented Oct 1, 2020

Hi @fabpot, yes I think so. I was planning to work on it tmrw again and will let you know how far I've come.

@jschaedl jschaedl force-pushed the notifier-profiler-integration branch 2 times, most recently from 7ecc8f9 to 45e23a7 Compare October 2, 2020 08:38
@jschaedl
Copy link
Contributor Author

jschaedl commented Oct 2, 2020

@fabpot Ready for review. :-)

@@ -34,6 +34,10 @@ public function __construct(EventDispatcherInterface $dispatcher = null)

public function send(MessageInterface $message): SentMessage
{
if (null === $message->getTransport()) {
$message->transport((string) $this);
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 needed to make sure that every transport has a name to show this name in the profiler panel.

@@ -25,4 +25,6 @@ public function getSubject(): string;
public function getOptions(): ?MessageOptionsInterface;

public function getTransport(): ?string;

public function transport(string $transport): self;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big fan, but I don't have any better idea for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could decorate the message with a DebugMessage that exposes this information?

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 like this idea and gave it a try: #38474 WDYT?

@fabpot
Copy link
Member

fabpot commented Oct 4, 2020

Thank you @jschaedl.

@fabpot fabpot force-pushed the notifier-profiler-integration branch from 45e23a7 to f39e74b Compare October 4, 2020 07:43
@fabpot fabpot merged commit edb5fed into symfony:master Oct 4, 2020
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.2 Oct 5, 2020
@fabpot fabpot mentioned this pull request Oct 5, 2020
fabpot added a commit that referenced this pull request Oct 8, 2020
…tter in MessageInterface (jschaedl)

This PR was merged into the 5.x branch.

Discussion
----------

[Notifier] Introduce NullMessage and remove transport setter in MessageInterface

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

Follow-up PR of #36479

Commits
-------

5701e89 Introduce NullMessage and remove transport setter in MessageInterface
fabpot added a commit that referenced this pull request Oct 13, 2020
…l icon (jschaedl)

This PR was squashed before being merged into the 5.x branch.

Discussion
----------

[Notifier][WebProfilerBundle] Add notifier profiler panel icon

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 5.x.
-->

relates to #36479

Commits
-------

303096e [Notifier][WebProfilerBundle] Add notifier profiler panel icon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants