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

Commit

Permalink
MUMUP-2898 Widget Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vertein committed Apr 11, 2017
1 parent 6060fb9 commit 730e8cd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion uw-frame-components/js/app-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define(['angular'], function(angular) {
'shibbolethSessionURL' : null, //'/Shibboleth.sso/Session.json'
'portalLayoutRestEndpoint' : null, //'/portal/api/layout',
'widgetApi': {
'entry': '/portal/api/marketplace/entry/', // For local testing, change to 'staticFeeds/'
'entry': '/portal/api/portlet/', // For local testing, change to 'staticFeeds/'
'entries': '/portal/api/marketplace/entries.json'
}
})
Expand Down
5 changes: 3 additions & 2 deletions uw-frame-components/portal/widgets/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define(['angular'], function(angular) {
/**
* Initial widget setup -- gets data for a single widget from the provided fname attribute
*/
var initializeWidget = function(fname) {
var initializeWidget = function(fname, unremovable) {
// Initialize scope variables
$scope.widget = {};
$scope.widgetType = '';
Expand All @@ -54,6 +54,7 @@ define(['angular'], function(angular) {
if (data) {
$scope.widget = data;
$scope.widgetType = widgetType(data);
$scope.cantRemove = unremovable;
}
})
.catch(function(error) {
Expand Down Expand Up @@ -83,7 +84,7 @@ define(['angular'], function(angular) {

// Initialize the widget
if ($scope.fname) {
initializeWidget($scope.fname);
initializeWidget($scope.fname, $scope.unremovable);
} else {
$log.warn('WidgetCardController didn\'t get an fname.');
}
Expand Down
3 changes: 2 additions & 1 deletion uw-frame-components/portal/widgets/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ define(['angular', 'require'], function(angular, require) {
return {
restrict: 'E',
scope: {
fname: '@'
fname: '@',
unremovable : '=?',
},
templateUrl: require.toUrl('./partials/widget-card.html'),
controller: 'WidgetCardController'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- OPTION-LINK ICON -->
<div class="option-link-icon">
<a href="{{ widget.selectedUrl }}" target="_blank" rel="noopener noreferrer">
<frame-widget-icon></frame-widget-icon>
<widget-icon></widget-icon>
</a>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<div ng-switch-when="basic">
<a tabindex="-1" ng-href="{{ renderUrl() }}" target="{{ widget.target }}" class="basic-widget" rel="noopener noreferrer">
<div class="widget-icon-container" layout="column" layout-align="center center">
<frame-widget-icon></frame-widget-icon>
<widget-icon></widget-icon>
</div>
</a>
<launch-button data-href="{{ renderUrl() }}"
Expand Down
4 changes: 2 additions & 2 deletions uw-frame-components/portal/widgets/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ define(['angular'], function(angular) {
var getSingleWidgetData = function getSingleWidgetData(fname) {
return $http.get(SERVICE_LOC.widgetApi.entry + fname + '.json')
.then(function(result) {
if (result.data.entry.layoutObject != undefined) {
return result.data.entry.layoutObject;
if (result.data.portlet != undefined) {
return result.data.portlet;
}
})
.catch(function(error) {
Expand Down

0 comments on commit 730e8cd

Please sign in to comment.