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

Commit

Permalink
Merge branch 'master' into fail-safe-no-portlet-title
Browse files Browse the repository at this point in the history
  • Loading branch information
apetro committed May 9, 2018
2 parents 73704e2 + fa079cf commit 0f8a777
Show file tree
Hide file tree
Showing 19 changed files with 203 additions and 118 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ docs/_site
docs/Gemfile.lock
docs/\.ruby-version
web/src/main/webapp/META-INF
.vscode
45 changes: 39 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,36 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased][]

### Deprecated

* Support for Font Awesome icons (the `faIcon` parameter in `portlet-definition`
entity files) is formally deprecated, with Material icons (`mdIcon`) preferred
instead. Documentation is updated to reflect this preference and deprecation.
Support for Font Awesome icons will be removed in some future release.

### Changed

* Adjusted "Undo" action toasts to better support rapid widget deletion (#812)
* Removed side navigation link to unused "New Features" page (#814)
* "About" page now actually has information about MyUW (#814)

### Added
* Side navigation link to new "Version information" page (#814)

## [8.1.1][] - 2018-03-30


### Changes

* Tweaked "Undo" action toasts to better conform to [material guidelines](https://material.io/guidelines/components/snackbars-toasts.html#) (#808)

### Dependency upgrades

* Updated app-framework to 9.0.2

## [8.1.0][] - 2018-03-30
Expand All @@ -20,35 +43,45 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
uPortal's identity impersonation and attribute swapping features (#802)

### Changed
* Removing widget from home screen now displays a toast allowing UNDO action before saving changes (#805)

* Removing widget from home screen now displays a toast allowing UNDO action
before saving changes (#805)
* App search results now order by matching titles first, then matching
descriptions/keywords (#809)

### Fixed
* Fixed bug that sometimes caused the wrong widget to be removed from user's layout (#804)

* Fixed bug that sometimes caused the wrong widget to be removed from user's
layout (#804)

### Dependency upgrades
* Updated app-framework to 9.0.1

### Removed
* Updated app-framework to 9.0.1

## [8.0.0][] - 2018-03-21

### Added
* Sort widget layout by keyboard -- arrow keys when the widget has focus will move it left or right (#795)

* Sort widget layout by keyboard -- arrow keys when the widget has focus will
move it left or right (#795)
* Added `public-myuw` to localhost mock app directory to demonstrate
`list-of-links` widget sourcing its links from a URL rather than from direct
configuration. (#792)

### Changed

* Replaced bootstrap in widget layout with CSS-grid and flex fallback (#795)
* Replaced jQuery UI Sortable with angular-drag-and-drop-lists (#795)

### Fixed

* Removed defective (always zero) search results total badge (#797)
* Alphabetically sort by `title` not `name` in app directory browse (#791)
* Made `relatedPortlets` arrays empty in `entries.json` (#787)
* Fail safe when `portlet` data record lacks `title` (#798)

### Dependency upgrades

* chore(deps): update stylelint to version 9.1.3 #793

## [7.2.0][] - 2018-01-11
Expand Down
19 changes: 18 additions & 1 deletion docs/app-directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,28 @@ Description text displays

App directory entries optionally have an icon.

##### Preferred: Material icons

```xml
<parameter>
<name>mdIcon</name>
<value>person</value>
</parameter>
```

These can be any of the [Material icons][].

##### Deprecated: Font Awesome icons

```xml
<parameter><name>faIcon</name><value>fa-user</value></parameter>
```

These can be any of the [Font Awesome icons][]. (uPortal-home intends to transition to using [Material icons][] instead in the near future.)
These can be any of the [Font Awesome icons][].

Support for Font Awesome icons is deprecated and will be removed in some future
release, in the interest of continuing to standardize on and leverage Material
Design.

#### Categories

Expand Down
2 changes: 1 addition & 1 deletion mock-portal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apereo.uportal</groupId>
<artifactId>uportal-home-parent</artifactId>
<version>8.1.2-SNAPSHOT</version>
<version>8.1.3-SNAPSHOT</version>
</parent>

<artifactId>uportal-home-mock-portal</artifactId>
Expand Down
12 changes: 9 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<groupId>org.apereo.uportal</groupId>
<artifactId>uportal-home-parent</artifactId>
<packaging>pom</packaging>
<version>8.1.2-SNAPSHOT</version>
<version>8.1.3-SNAPSHOT</version>
<name>uPortal-home Parent Project</name>
<description>An alternative homepage for uPortal</description>
<url>https://github.com/uPortal-Project/uportal-home</url>
Expand Down
4 changes: 2 additions & 2 deletions web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apereo.uportal</groupId>
<artifactId>uportal-home-parent</artifactId>
<version>8.1.2-SNAPSHOT</version>
<version>8.1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -42,7 +42,7 @@
<groupId>org.apereo.uportal</groupId>
<artifactId>uportal-app-framework</artifactId>
<type>war</type>
<version>9.0.3-SNAPSHOT</version>
<version>9.1.1-SNAPSHOT</version>
</dependency>

<!-- Test -->
Expand Down
1 change: 1 addition & 0 deletions web/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<url-pattern>/expanded</url-pattern>
<url-pattern>/compact</url-pattern>
<url-pattern>/widget-creator</url-pattern>
<url-pattern>/session-info</url-pattern>
</servlet-mapping>

<welcome-file-list>
Expand Down
8 changes: 8 additions & 0 deletions web/src/main/webapp/css/search-results.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
.search-results {
padding: 3px 0 0;

.search-term {
padding: 0 18px;

> span {
font-weight: 600;
}
}

.no-result {
padding: 10px 16px;
}
Expand Down
53 changes: 7 additions & 46 deletions web/src/main/webapp/css/toast.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,58 +18,19 @@
*/
md-toast {
&.toast__widget-removal {
.md-toast-content {
background-color: @white;
color: @black;
padding: 0;
align-items: flex-start;
max-height: 126px;
max-width: 320px;

&::before {
min-height: 0;
}

.toast__message {
padding: 16px;
width: 100%;

.toast__source {
font-size: 12px;
}

.toast__icon-container {
display: flex;
height: 44px;
width: 44px;
max-width: 44px;
margin-right: 16px;
background: #e5e5e5;
border-radius: 50%;
justify-content: center;
align-items: center;
position: fixed;
padding: 16px;

.fa,
.material-icons {
font-size: 24px;
}
}
}

.toast__actions {
background-color: @grayscale2;
width: 100%;
}
.md-toast-content {
background: @grayscale9;
color: @white;

.md-button {
min-width: 60px;
@media (min-width: @sm) {
min-width: 350px;
}
}

@media (max-width: @sm) {
position: fixed;
padding: 16px;

.md-toast-content {
max-width: none;

Expand Down
1 change: 1 addition & 0 deletions web/src/main/webapp/js/override.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ define(['angular'], function(angular) {
},
'SERVICE_LOC': {
'aboutURL': '/portal/api/session.json',
'aboutPageURL': '/web/staticFeeds/about-page.json',
'sessionInfo': '/portal/api/session.json',
'sidebarInfo': '/web/staticFeeds/sidebar.json',
'newstuffInfo': '/web/staticFeeds/new-stuff.json',
Expand Down
59 changes: 43 additions & 16 deletions web/src/main/webapp/my-app/layout/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ define(['angular', 'jquery'], function(angular, $) {
$sessionStorage, $filter, $mdColors, layoutService) {
var vm = this;
$scope.selectedNodeId = '';
$scope.widgetsToRemove = [];

/**
* Set the selected widget in scope to track focus
Expand Down Expand Up @@ -100,6 +101,30 @@ define(['angular', 'jquery'], function(angular, $) {
}
};

/**
* Move a widget with a drag and drop action
* @param {Object} widget the widget being moved
* @param {Number} dropIndex index of the new location
* @return {Boolean} true if widget moved, false if otherwise
*/
$scope.moveWithDrag = function(widget, dropIndex) {
var sourceIndex =
findLayoutIndex($scope.layout, 'nodeId', widget.nodeId);
$log.info('index:'+sourceIndex+' dropIndex:'+dropIndex);
if (sourceIndex != dropIndex) {
$scope.layout.splice(sourceIndex, 1);
if (dropIndex > sourceIndex) {
dropIndex--;
}
$scope.layout.splice(dropIndex, 0, widget);
saveLayoutOrder(dropIndex, $scope.layout.length, widget.nodeId);
$scope.logMoveEvent('dragEnd', widget.fname, dropIndex);
return true;
} else {
return false;
}
};

/**
* Respond to arrow key-presses when focusing a movable list element
* @param widget {Object} The widget trying to move
Expand Down Expand Up @@ -166,6 +191,10 @@ define(['angular', 'jquery'], function(angular, $) {
// Remove the widget from layout in scope
$scope.layout.splice(data.removedIndex, 1);

// Track the widget fname for removal upon
// toast timeout
$scope.widgetsToRemove.push(data.removedWidget.fname);

// Dismiss any open toasts (success), then show new one
// eslint-disable-next-line promise/always-return
$mdToast.hide().then(function() {
Expand Down Expand Up @@ -195,23 +224,20 @@ define(['angular', 'jquery'], function(angular, $) {
}

// Configure and show the toast message
// Pass in widget for <widget-icon> directive
// Pass in widget title for toast text display
$mdToast.show({
hideDelay: 2500,
hideDelay: 4000,
parent: angular.element(document).find('.wrapper__frame-page')[0],
position: 'top right',
position: 'bottom right',
locals: {
widget: data.removedWidget,
color: accentColor,
removedTitle: data.removedWidget.title,
},
bindToController: true,
templateUrl:
require.toUrl('my-app/layout/partials/toast-widget-removal.html'),
controller: function RemoveToastController($scope, $mdToast, widget,
controller: function RemoveToastController($scope, $mdToast,
color, removedTitle) {
$scope.widget = widget;
$scope.accentColorRgb = color;
$scope.removedTitle = removedTitle;
/**
Expand All @@ -230,9 +256,17 @@ define(['angular', 'jquery'], function(angular, $) {
if (response === 'undo') {
// Add the removed widget back to the layout
$scope.layout.splice(data.removedIndex, 0, data.removedWidget);

// Delete the last fname added to the removal array
$scope.widgetsToRemove.pop();
} else {
// Persist changes
saveLayoutRemoval(data.removedWidget.fname, data.removedIndex);
// Save deletion of any widgets in the tracking array
for (var i = 0; i < $scope.widgetsToRemove.length; i++) {
var fname = $scope.widgetsToRemove[i];
saveLayoutRemoval(fname);
// Remove saved deletions from tracking array
$scope.widgetsToRemove.splice(i, 1);
}
}
return response;
})
Expand All @@ -245,18 +279,11 @@ define(['angular', 'jquery'], function(angular, $) {
* Call layout service to save the removal of the widget from the user's
* home layout.
* @param fname {String} The fname of the removed widget
* @param index {Number} The index of the removed widget in the layout
*/
var saveLayoutRemoval = function(fname, index) {
var saveLayoutRemoval = function(fname) {
// Call layout service to persist change
layoutService.removeFromHome(fname)
.success(function() {
// Remove from layout in scope
// $scope.layout.splice(index, 1);

// Reset CSS hiding
$scope.hideWidgetIndex = null;

// Clear marketplace flag
if ($sessionStorage.marketplace != null) {
// Filter for fname match in marketplace
Expand Down

0 comments on commit 0f8a777

Please sign in to comment.