Skip to content
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

mgr/dashboard: add permanent notifications #29530

Closed
wants to merge 4 commits into from

Conversation

s0nea
Copy link
Member

@s0nea s0nea commented Aug 7, 2019

Fixes: https://tracker.ceph.com/issues/40328

Signed-off-by: Sebastian Krah skrah@suse.com
Signed-off-by: Tatjana Dehler tdehler@suse.com

Screenshot_2019-09-06_11-51-20

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test docs
  • jenkins render docs

@s0nea s0nea added the dashboard label Aug 7, 2019
@s0nea s0nea force-pushed the wip-dashboard-permanent-notification branch 5 times, most recently from 97b278c to 52b5c07 Compare August 15, 2019 13:25
@s0nea s0nea marked this pull request as ready for review August 15, 2019 13:28
@s0nea s0nea requested a review from a team as a code owner August 15, 2019 13:28
@callithea
Copy link
Member

jenkins test dashboard

@callithea
Copy link
Member

jenkins test make check arm64

@s0nea s0nea force-pushed the wip-dashboard-permanent-notification branch 3 times, most recently from ae464d8 to 1d19733 Compare September 3, 2019 13:27
@s0nea
Copy link
Member Author

s0nea commented Sep 4, 2019

jenkins test docs

@s0nea s0nea force-pushed the wip-dashboard-permanent-notification branch from 1d19733 to 65e0fb6 Compare September 4, 2019 14:27
@s0nea
Copy link
Member Author

s0nea commented Sep 5, 2019

jenkins test submodules

@s0nea s0nea force-pushed the wip-dashboard-permanent-notification branch from 65e0fb6 to 71ca18f Compare September 5, 2019 08:21
s0nea and others added 4 commits September 6, 2019 11:31
Add a ToastComponent in order to encapsulate all Toast
related settings. This provides three advantages:
* We can define our own Toast template
* We need only one config class (CdNotificationConfig)
* We need to deal with less HTML related strings in the
  *.ts files

Signed-off-by: Tatjana Dehler <tdehler@suse.com>
Fixes: https://tracker.ceph.com/issues/40328
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
UI blocking notifications should only appear if an error occurs which makes the
frontend unusable. The UI will be released as soon as the error is fixed. For
example the UI would be blocked if the api is unreachable.

Signed-off-by: Sebastian Krah <skrah@suse.com>
(cherry picked from commit 662e17b)
@s0nea s0nea force-pushed the wip-dashboard-permanent-notification branch from 71ca18f to 09f70b2 Compare September 6, 2019 09:39
@s0nea
Copy link
Member Author

s0nea commented Sep 6, 2019

jenkins test dashboard

Copy link
Contributor

@tspmelo tspmelo left a comment

Choose a reason for hiding this comment

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

I know I am late with the suggestion - I apologize for not having noticed that earlier. But I don't think we should be misusing toasties to display this information.
Since we are now showing a "modal", we could instead use the bootstrap modal component.
By doing so we could reuse some of our components and styles, thus removing the need to change the current toast implementation and the amount of code needed.

The idea would be to create a service and a component for the permanent notifications.
The service would store all the data that would be displayed and the component would have the elements for the modal.
This service would then be called from the api-interceptor.service.ts, to know when and what to display.

What do you think? Sorry again for requesting such a major change at this point.

);
});
}

private removeNotification() {
Copy link
Contributor

Choose a reason for hiding this comment

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

It took about 15s for the notification to be removed after the 1st successful request.
Although this is not critical, it would be nice to have a lower waiting time.

-moz-box-shadow: none;
box-shadow: none;

.toast-title {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have the same background color as the modals we use. Same for the footer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh yeah this might would make sense. I just looked up the background color of the dialog content, because at that time I had no intention to also style the title of the dialog. After I did style the title I did not double check whether the title uses another background color or not :)

public notificationService: NotificationService
) {}

intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(request).pipe(
tap(() => {
this.removeNotification();
Copy link
Contributor

Choose a reason for hiding this comment

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

Not related to this line, but I think we should show a notification of the failure.
Otherwise it looks like nothing happened.

@s0nea s0nea closed this Sep 10, 2019
@s0nea
Copy link
Member Author

s0nea commented Sep 10, 2019

As mentioned in #29530 (review) and discussed afterwards, we decided to decline the PR as it's using the wrong approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants