Giter Site home page Giter Site logo

uportal-project / notificationportlet Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 28.0 5.05 MB

JSR-286 portlet implementing notifications in uPortal.

Home Page: https://wiki.jasig.org/pages/viewpage.action?pageId=47875986

License: Apache License 2.0

Java 86.13% CSS 0.21% JavaScript 8.53% Groovy 1.55% Less 3.59%
hacktoberfest java portal portlet uportal uportal-start-bundled

notificationportlet's People

Contributors

apetro avatar asgrant avatar bjagg avatar chasegawa avatar christianmurphy avatar codepuppet avatar doodelicious avatar drewwills avatar groybal avatar imgbotapp avatar jgribonvald avatar jhelmer-unicon avatar joshbrudnak avatar landisaurus avatar loulou2u avatar mindblender avatar msultzaberger avatar renovate-bot avatar renovate[bot] avatar rmathis avatar sbramhall avatar timlevett avatar vertein avatar xdhmoore avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notificationportlet's Issues

Modal web component sends user away even though the action is ReadAction

Describe the bug
When the modal (web component) has ReadAction as one of its available actions, clicking the button would send the user to /NotificationPortlet/api/v2/action/ReadAction/modal-005?_csrf=...

{
  "categories": [
    {
      "title": "Portal Message",
      "entries": [
        {
          "id": "modal-005",
          "priority": 1,
          "title": "Student Portal Updates",
          "body": "Welcome to the new student portal based on <a href=\"https://apereo.org/projects/uPortal\">uPortal 5</a>. There are several exciting new features included with this update. Please take a moment to familiarize yourself with the new content & options.",
          "source": "Demo Service",
          "url": "http:\/\/library.university\/parking",
          "availableActions": [
            {
              "label": "Acknowledge",
              "clazz": "org.jasig.portlet.notice.action.read.ReadAction"
            }
          ]
        }
      ]
    }
  ]
}

Expected behavior
Fire the action in the background and hide the modal

Enhance JpaNotificationService to support NotificationRestV2Controller

New UI components in the NotifificationPortlet project are Web Components (not portlets at all). They use the NotificationRestV2Controller to access and interact with Notification data.

The NotificationRestV2Controller interacts with data sources (beans that implement INotificationService) using servlet-based methods, not portlet-based methods.

Most data sources have been updated to support this approach, but not this one (yet).

Create demo pages for components

uPortal-web-components provides demo pages for most of it's components.
E.G.

Each demo comes with two parts.

  1. A page the includes the component and related polyfills
  2. Some sample data to drive the component

It would be great to have similar demo pages for the notification web components.

Issue with Oracle and bell icon

Tracked down an issue with a JPA call that is incompatible with Oracle CLOBs. This came to light with the new bell icon web component -- likely calling a JPA backed method that is not called for the normal portlet view

Discoverable services inject unwanted notices into emergency alerts

Previous to v4 (?), each component would load it's own set of notification sources. This allowed source distinctions between regular notices and those from emergency alerts, for example. With discoverable sources implemented in CacheNotificationService.java, those will appear in all notification portlets, including Emergency Alerts.

One solution is to have an option to disable the discovery code when the bean is defined. This would allow configuration to revert this behavior.

Another approach may be to add more filter options.

Soffit JWT signature key is never read from uPortal.properties so reverts to default.

The SIGNATURE_KEY_PROPERTY (org.apereo.portal.soffit.jwt.signatureKey) in SecurityConfiguration.java is never read from the uPortal.properties file so it always reverts to the default. This causes notifications to not be read into the notification icon if the signatureKey is changed in uPortal.properties.

It looks like the setup is sort of mimicking the way it's set up in the uPortal project (which works), using the AbstractJwtService, but in the uPortal project the AbstractJwtService is extended in other classes (like PortalRequestService) which are annotated with @​Service.

Ack Per Session Action sometimes fails

Scenario: notices are displayed in notification-banner with Acknowledge (Per Session) Action.

Sometimes, when the user acknowledges that notices after logging in, the notices are displayed again on second page refresh.

Provide the notification icon with a preview dropdown so students can see high priority notifications without leaving their current work flow

Problem Statement

Student want a faster way to view priority notifications without navigating to a new page.

Proposed Solution

Provide the notification icon with a preview dropdown so students can see high priority notifications without leaving their current work flow

Technical Goals

  1. Make rendering of component, framework agnostic
  2. Provide content in a format accessible with keyboard navigation and a screen reader
  3. Allow content to be translated into multiple languages
  4. Seemlessly integrate the build for frontend and backend code

Technology

How Technology Achieves Technical Goals

  1. React component is wrapped as a Web Component and is given a custom element API. The page only knows that it needs the custom tag <notification-icon>, that component can be in any framework.
  2. Reactstrap and react font awesome both provide appropriate WAI-ARIA attributes by default
  3. I18Next allows for external translation files to be loaded into the UI
  4. Gradle plugin node installs a local version of node js, installs yarn and lerna to manage web components, then uses lerna scripts to manage components.

Still TODO

Integrate with uPortal-Project/uPortal#1162 and #69

Future work

Enhance AbstractJdbcNotificationService (and subclasses) to support NotificationRestV2Controller

New UI components in the NotifificationPortlet project are Web Components (not portlets at all). They use the NotificationRestV2Controller to access and interact with Notification data.

The NotificationRestV2Controller interacts with data sources (beans that implement INotificationService) using servlet-based methods, not portlet-based methods.

Most data sources have been updated to support this approach, but not this one (yet).

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency org.junit.vintage:junit-vintage-engine to v5.10.3
  • Update dependency org.projectlombok:lombok to v1.18.34
  • Update dependency commons-codec:commons-codec to v1.17.1
  • Update dependency org.apache.commons:commons-lang3 to v3.15.0
  • πŸ” Create all rate-limited PRs at once πŸ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/CI.yml
  • actions/checkout v4
  • actions/setup-java v4
gradle
gradle.properties
  • org.apache.portals:portlet-api_2.1.0_spec 1.0
  • com.fasterxml.jackson.core:jackson-annotations 2.13.4
  • com.fasterxml.jackson.core:jackson-core 2.13.4
  • com.fasterxml.jackson.core:jackson-databind 2.14.2
  • commons-lang:commons-lang 2.6
  • org.slf4j:slf4j-api 1.7.36
  • javax.annotation:javax.annotation-api 1.3.2
  • javax.xml.bind:jaxb-api 2.3.1
  • org.projectlombok:lombok 1.18.32
  • javax.servlet:servlet-api 2.5
  • com.google.guava:guava 31.1-jre
  • com.jayway.jsonpath:json-path 2.7.0
  • commons-codec:commons-codec 1.16.1
  • commons-dbcp:commons-dbcp 1.4
  • io.springfox:springfox-swagger2 2.9.2
  • io.springfox:springfox-swagger-ui 2.9.2
  • javax.servlet:jstl 1.2
  • joda-time:joda-time 2.12.7
  • net.sf.dozer:dozer 5.5.1
  • net.sf.dozer:dozer-spring 5.5.1
  • org.ehcache:ehcache 3.9.0
  • org.apache.commons:commons-lang3 3.14.0
  • org.apache.httpcomponents:httpclient 4.5.14
  • org.aspectj:aspectjweaver 1.9.7
  • org.codehaus.janino:janino 3.1.12
  • org.hibernate:hibernate-core 5.4.26.Final
  • org.hibernate:hibernate-ehcache 5.4.26.Final
  • org.hibernate:hibernate-entitymanager 5.4.26.Final
  • org.jasig.resourceserver:resource-server-utils 1.5.0
  • org.jasig.portal:uPortal-soffit-renderer 5.16.1
  • org.jasig.portal:uPortal-spring 5.16.1
  • org.jasypt:jasypt-spring31 1.9.3
  • org.springframework:spring-jdbc 4.3.30.RELEASE
  • org.springframework:spring-orm 4.3.30.RELEASE
  • org.springframework:spring-tx 4.3.30.RELEASE
  • org.springframework:spring-webmvc-portlet 4.3.30.RELEASE
  • org.springframework.security.oauth:spring-security-oauth2 2.5.2.RELEASE
  • com.rometools:rome 1.19.0
  • org.hsqldb:hsqldb 2.5.0
settings.gradle
build.gradle
  • net.researchgate.release 2.8.1
  • junit:junit 4.13.2
  • org.junit.vintage:junit-vintage-engine 5.10.2
notification-portlet-api/build.gradle
notification-portlet-webapp/build.gradle
  • org.springframework.boot:spring-boot-gradle-plugin 1.5.22.RELEASE
  • com.github.node-gradle.node 5.0.0
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 6.9.4
npm
notification-portlet-webapp/package.json
  • clean-css-cli ^4.3.0
  • less ^3.11.3
  • uglifyjs-folder ^3.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Add support for PER SESSION notifications

Business need: to show some notices (such as holds) in the Notification Modal web component only once per session / login. The notices should still show in bell icon and list web components, but not display in a modal again for that session. However, the notices will display again in a modal on next login.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Order notifications by 'soonest expiring'

There is a REST controller for managing notifications. In particular, there is a Get REST API endpoint for retrieving Notifications. Currently the notifications returned are unsorted.

It would be good to have them be sorted by the 'soonest expiring' notification.

For now, the order can be hard-coded.

Webcomponent build fails due to terser

 ERROR  Failed to compile with 1 errors                                                                                                                                                                                                                              3:34:23 PM

 error  

notification-banner.min.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (/home/christian/Projects/uPortal/Portlets/NotificationPortlet/notification-portlet-webcomponents/notification-banner/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
    at module.exports (/home/christian/Projects/uPortal/Portlets/NotificationPortlet/notification-portlet-webcomponents/notification-banner/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
    at handle (/home/christian/Projects/uPortal/Portlets/NotificationPortlet/notification-portlet-webcomponents/notification-banner/node_modules/worker-farm/lib/child/index.js:44:8)
    at process.<anonymous> (/home/christian/Projects/uPortal/Portlets/NotificationPortlet/notification-portlet-webcomponents/notification-banner/node_modules/worker-farm/lib/child/index.js:51:3)
    at process.emit (events.js:197:13)
    at emit (internal/child_process.js:828:12)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)

This issue is the same as: vuejs/vue-cli#3407
and will be resolved when: terser/terser#254 is merged

[Icon web component] Bootstrap stylesheet affects the entire page on Firefox

Describe the bug
The Bootstrap stylesheet that is loaded for the icon web component is affecting the entire page as opposed to just the web component

To Reproduce
Steps to reproduce the behavior:

  1. Deploy uPortal-Project/uPortal-start@ceaf941
  2. Removed waffle menu (it prevents the icon from loading on Firefox unless you bump the version to 1.13.5)
  3. Log in and observe. You will see that the eyebrow goes from the right to left and that the font sizes shrink once the stylesheet loads

Screenshots
screenshot from 2018-10-15 08-54-10

Platform:

  • uPortal Version: 5.3.0
  • Notification Portlet: 4.0.0
  • Browser: Firefox 62.0.3

regeneratorRuntime is not defined

Describe the bug
A regeneratorRuntime is not defined is preventing the modal notification from rendering

To Reproduce

  1. Deploy portlet with a modal notification web component such as uPortal-Project/uPortal-start#226
  2. Open developer tools
  3. Navigate to the page containing the modal notification web component

Expected behavior
A notification modal

Screenshots
screenshot from 2018-10-04 14-33-13

screenshot from 2018-10-04 14-32-43

Platform:

  • Notification Portlet Version: 4.3.1
  • Browser: Chrome/ium and Firefox

Oracle throws ORA-00972: identifier is too long

Describe the bug
NotificationPortlet attempts to create tables that exceed the Oracle Object Name limit in versions previous to 12.2. Databases need to be configured with COMPATIBLE set to 12.2.

To Reproduce
Steps to reproduce the behavior:

  1. Set up an Oracle database to back uPortal
  2. Build and run uPortal ./gradlew portalInit portalOpen
  3. Grep NotificationPortlet.log for ORA-00972

Expected behavior
Tables successfully created.

Additional context
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Database-Object-Names-and-Qualifiers.html#GUID-75337742-67FD-4EC0-985F-741C93D918DA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.