uPortal-Attic / uportal-app-framework

Framework for creating uPortal Applications
http://uportal-project.github.io/uportal-app-framework/
Apache License 2.0
23 stars 31 forks source link

Filter list-of-links links to audiences #707

Open apetro opened 6 years ago

apetro commented 6 years ago

Reminiscent of the retired-from-service "Dynamic Menu Portlet":

Add optional .audience field to links in list-of-links widgets, with value array of Strings representing group names. Filter away links that specify an audience none of the groups of which include the viewing user.

Punchline: whereas content like

{
               "launchText":"Open website",
               "links":[
                  {
                     "title":"Employee wellness",
                     "href":"https://uwell.wisc.edu/employee/",
                     "icon":"loyalty",
                     "target":"_blank"
                  },
                  {
                     "title":"Student wellness",
                     "href":"https://uwell.wisc.edu/student/",
                     "icon":"group",
                     "target":"_blank"
                  }
               ]
            }

currently usually shows a typical user two links only one of which is relevant, evolved content like

{
               "launchText":"Open website",
               "links":[
                  {
                     "title":"Employee wellness",
                     "href":"https://uwell.wisc.edu/employee/",
                     "icon":"loyalty",
                     "target":"_blank",
                     "audience": ["employees"]
                  },
                  {
                     "title":"Student wellness",
                     "href":"https://uwell.wisc.edu/student/",
                     "icon":"group",
                     "target":"_blank",
                      "audience": ["students"]
                  }
               ]
            }

would show only the relevant links to the user.

apetro commented 6 years ago

From discussions: a better way to do this is a better microservice vending the list-of-links JSON, avoiding more complexity client-side.