Overlay repository

I am trying to use vaadin overlay add-on that uses an addon according to this link.

I am using this line to register dependency:

    compile ('com.haulmont.thirdparty:overlays:1.1.3')

However, I am getting the following exception:

    Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.haulmont.thirdparty:overlays:1.1.3.
Searched in the following locations:
  - file:/Users/mak/.m2/repository/com/haulmont/thirdparty/overlays/1.1.3/overlays-1.1.3.pom
  - file:/Users/mak/.m2/repository/com/haulmont/thirdparty/overlays/1.1.3/overlays-1.1.3.jar
  - https://repo.cuba-platform.com/content/groups/work/com/haulmont/thirdparty/overlays/1.1.3/overlays-1.1.3.pom
  - https://repo.cuba-platform.com/content/groups/work/com/haulmont/thirdparty/overlays/1.1.3/overlays-1.1.3.jar
  - https://cuba-platform.bintray.com/premium/com/haulmont/thirdparty/overlays/1.1.3/overlays-1.1.3.pom
  - https://cuba-platform.bintray.com/premium/com/haulmont/thirdparty/overlays/1.1.3/overlays-1.1.3.jar

Hi,

The Overlays add-on isn’t published:

Installation

Download JAR files from releases and use in your application

More over it requires Vaadin 7.6, i.e. can’t be used in CUBA 7.

Gleb

Is there any alternative to this? I want to use this with an alert icon on the top panel of my application

04%20PM

Extend the main screen (Root Screens - CUBA Platform. Developer’s Manual) and inject your alert icon there, based on a service or other mechanism to publish app-level alerts.

P.

I have extended the main screen and have done some customization. I used to use overlay add-on in earlier version of Cuba but it doesn’t support anymore. I have the mechanism established for getting the alerts but what I used overlay add on is to visualize it.looking forward for any suggestions.

Why? Maybe I don’t grasp your exact requirements, but it seems you need:

  • a bell icon as a visual indicator of the presence (or not) of some pending alerts
  • if the icon is grayed, there are no new alerts
  • if the icon is highlighted (for example in bright white) there are pending alerts. A nice plus could be a small badge with the number of unread alerts…
  • clicking on the icon opens a list of alerts/messages, sorted by timestamp descending (the most recent at the top). The unread ones could be printed in bold, while the other in normal weight. Opening the list resets the pending number (removes the badge if any, and changes the bell icon color to muted).

The alerts list can be opened either as a sidebar on the right (it’s the usual UX in many apps, and even on most OSes), or as an overlay (absolutely positioned div with high z-index).
EDIT: this last part (the overlay div) is the only thing you can use that Vaadin component for, but it’s really trivial to do with small html/css directly in your application.

This is your desired outcome, or have I missed something?

P.

Yes Paolo exactly, I want to show the number of the pending job as a badge with the bell, preferably highlighted with a colour. Any thoughts?

That’s pretty much easy stuff with plain HTML + CSS with modern browsers, plus small JS if supporting older browsers, like IE11 (not recommended anyway) … you only need to add the needed markup to the main window, and the CSS to the theme extension.

First example after a quick search: Create a CSS Notification Badge - CSSPortal
This clearly is going to work only on modern browsers, but its advantage is that does not need any JS to work…

Yup, if it supports modern browsers, that’s good enough. the CSS codes looks straight-forward but would appreciate how this can be implemented in CUBA including making it data-aware from a container.

Yeah, for a straightforward (and reusable) integration you’re going to need some plumbing java/js code to implement it as a control. But even in that case is not so hard (the complexity is the same than the sample here and here in the docs).

I’m very busy ATM, but maybe I’ll be able to put something together some evening (no promise, sorry :wink: )

P.

1 Like

Paolo, that will do, appreciated.