Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Show app directory search results the user can BROWSE but not SUBSCRIBE #844

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ and this project adheres to

### Fixed

* Includes in search results items the searching user has permission to `BROWSE`
but not permission to `SUBSCRIBE`. Previously these results had been
suppressed. This fulfills some of the intention of the `BROWSE` permission.
(#844)
* Restores app directory search results count badge that had been removed in
8.3.0 (#843) as temporary mitigation for bug wherein the badge did not
reliably show a correct count. Since the BROWSE-but-not-SUBSCRIBE items that
it had been counting now show in search results, the counts it reports are
correct. (#844)

### Deprecated

## [8.3.2][] - 2018-08-01
Expand Down
28 changes: 15 additions & 13 deletions mock-portal/src/main/webapp/api/marketplace/entries.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,30 @@
"target": "_blank"
},
{
"canAdd": true,
"canAdd": false,
"layoutObject": {
"nodeId": "-1",
"title": "Box",
"description": "Access your UW-Madison Box account.",
"title": "Not SUBSCRIBE-able",
"description": "Mock app directory entry on which the user has BROWSE but not SUBSCRIBE.",
"url": "https://uwmadison.box.com",
"iconUrl": null,
"faIcon": "fa-cube",
"fname": "box",
"fname": "no-subscribe-for-you",
"target": "_blank",
"widgetURL": null,
"widgetType": null,
"widgetTemplate": null,
"widgetConfig": null,
"staticContent": "\n \n Click <a href=\"https://uwmadison.box.com\">here</a> to access Box.\n \n\t\t",
"pithyStaticContent": "\n \n<p><a class=\"btn btn-default\"\n href=\"https://uwmadison.box.com\" target=\"_blank\"\n title=\"Launch Box.\">Launch Box</a></p>\n <p>Box is a file storage and sharing service.</p>\n \n ",
"altMaxUrl": true,
"renderOnWeb": false
"staticContent": "<p>You cannot add this to your layout.</p>",
"pithyStaticContent": "<p>You still cannot add this to your layout.</p>",
"altMaxUrl": false,
"renderOnWeb": true
},
"portletName": "cms",
"categories": [
"Applications"
],
"title": "Box",
"title": "Not SUBSCRIBE-able",
"relatedPortlets": [],
"lifecycleState": "PUBLISHED",
"rating": 0,
Expand All @@ -87,11 +87,13 @@
"keywords": [
"dropbox",
"UW Box",
"drop box"
"drop box",
"BROWSE",
"permissions demo"
],
"fname": "box",
"description": "Access your UW-Madison Box account.",
"name": "Box",
"fname": "no-subscribe-for-you",
"description": "Mock app directory entry on which the user has BROWSE but not SUBSCRIBE.",
"name": "Not SUBSCRIBE-able",
"id": "45",
"type": "Portlet",
"target": "_blank"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,65 @@ <h4 class="md-subhead">
<div ng-show="myuwResults.length != 0 && filteredApps.length == 0" class="no-result">
No {{ portal.theme.title }} results. <a href="apps">See all apps?</a>
</div>
<div class="result" ng-repeat="app in filteredApps | showApplicable:showAll | limitTo:searchResultLimit">
<h4><a ng-href="{{ getLaunchURL(app, guestMode) }}" target="{{::app.target}}" rel="{{::app.target | targetToRel}}">{{ app.title }}</a> <small ng-if="guestMode && !app.canAdd">(login to use)</small></h4>

<!-- matching app directory entries directly usable by viewing user -->
<div class="result"
ng-repeat="app in filteredApps | canAdd:true | limitTo:searchResultLimit">
<h4>
<a ng-href="{{ getLaunchURL(app, guestMode) }}"
target="{{::app.target}}" rel="{{::app.target | targetToRel}}">
{{ app.title }}
</a>
</h4>
<p>{{ app.description }}</p>
<p>
<md-button ng-click="addToHome(app)"
ng-if="app.canAdd && !app.hasInLayout && !guestMode"
class="md-primary add" aria-label="add {{ app.title }} to home">
<md-button
aria-label="add {{ app.title }} to home"
ng-click="addToHome(app)"
ng-if="!app.hasInLayout && !guestMode"
class="md-primary add">
<i class="fa fa-plus"></i> Add to home
</md-button>
<span ng-if="app.canAdd && app.hasInLayout && !guestMode" class="added"><i class="fa fa-check"></i> Added to home</span>
<md-button class="md-default" aria-label="See more about {{ app.title }}" ng-click="navToDetails(app, 'Search')">Details</md-button>
<span ng-if="app.hasInLayout && !guestMode" class="added">
<i class="fa fa-check"></i> Added to home
</span>
<md-button
aria-label="See more about {{ app.title }}"
ng-click="navToDetails(app, 'Search')"
class="md-default">
Details
</md-button>
<span><span uib-rating ng-if="app.userRating" ng-model="app.rating" read-only="true" class="rating"></span></span>
</p>
</div>

<!-- matching app directory entries browseable
but not directly usable by viewing user-->
<div class="result"
ng-repeat="app in filteredApps | canAdd:false | limitTo:searchResultLimit">
<h4>
<span>
{{ app.title }}
<md-tooltip ng-if="!guestMode">
You do not have sufficient permissions to launch {{app.title}}.
</md-tooltip>
</span>
<small ng-if="guestMode">
<a aria-label="Log in to use {{ app.title }}."
ng-href="{{ getLaunchURL(app, guestMode) }}"
target="{{::app.target}}" rel="{{::app.target | targetToRel}}">
(login to use)
</a>
</small>
</h4>
<p>{{ app.description }}</p>
<p>
<md-button
aria-label="See more about {{ app.title }}"
ng-click="navToDetails(app, 'Search')"
class="md-default">
Details
</md-button>
<span><span uib-rating ng-if="app.userRating" ng-model="app.rating" read-only="true" class="rating"></span></span>
</p>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<!-- MyUW RESULTS ONLY -->
<md-tab ng-if="googleSearchEnabled || directoryEnabled">
<md-tab-label>
{{ portal.theme.title }}
{{ portal.theme.title }}&nbsp;&nbsp;<span class="badge">{{ appDirectoryResultsBadge }}</span>
</md-tab-label>
<md-tab-body>
<md-content>
Expand Down