Skip to content

Commit

Permalink
Merge pull request #514 from G-Node/banners
Browse files Browse the repository at this point in the history
Preparation for release v1.3

LGTM
  • Loading branch information
achilleas-k authored Oct 30, 2020
2 parents 9e82587 + 759c318 commit 296af07
Show file tree
Hide file tree
Showing 67 changed files with 4,261 additions and 363 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ dist
/RUNNING_PID
/.settings
*.db
banner
figures
figures_mobile
banners
banners_mobile

# provided via cdn but keeping a local copy
# makes auto completion available
Expand All @@ -29,3 +32,7 @@ conf/*.disabled
# production files
application-log*
logger.xml

# python related information
test/frontend/.pytest_cache/
test/frontend/__pycache__/
38 changes: 36 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,41 @@
Used to document all changes from previous releases and collect changes
until the next release.

# Latest changes in master
# Release v1.3

## Database changes
This release contains required database changes. After redeployment the database needs to be updated manually using script `patch/patch_v1_2_to_v1_3.sql` and the database service restarted for the changes to take effect.

## Build issues
The current project setup is still using an outdated build tool (`activator`) and is several versions behind the current state of the play framework. The default sbt CDNs for the underlying build dependencies have been updated and no longer provide the required dependencies. Therefore additional CDNs have been added to the project build to keep it in a buildable state. The docker build has been changed to a layered build to decrease build times. See issue #497 and PRs #498 and #509 for details.

## Features
- Stars will be shown in the conference abstract list, indicating favourite abstracts of a user. For details see issue #419.
- The favour/disfavour abstract methods in abstract-list.js now only use javascript.
- Conference banners can now be uploaded via the conference admin pages instead of providing an external link to a banner. The corresponding banners are used when displaying a conference. For details see issue #385.
- Mobile versions of Figures and conference banners are now automatically created when a figure or banner is uploaded.
- Both site and conference admins are now able to upload banners via the conference administration.
- The selenium framework is introduced to integrate frontend tests.
- The way a DOI is represented in the abstract submission form has been updated. For details see issue #478.
- A conference dependent notice can now be added via the conference administration page. The text will be displayed for the respective conference only. This change requires a database change. After deployment of this version, the database needs to be updated manually using script `patch/patch_v1_2_to_v1_3.sql`. For details see issue #470.
- A search field has been added to the abstract list of a conference. For details see PR #505.
- Print view specific stylesheets were added for useful print rendering of abstract pages. See issue #508 for details.

## Fixes
- The string length of notes when changing abstract states will be limited to 255 to avoid database problems. For details see issue #448.
- Added feedback when a user signs up with an already registered email address. For details see issue #464.
- Added failed login notice. For details see issue #465.
- Added feedback on a failed password change attempt. For details see issue #466.
- Added feedback on a failed email change attempt. For details see issue #467.
- Added sign-up notification after new user registration. For details see issue #473.
- The login status is now always properly displayed. For details see issue #468.
- Added error messages on abstract reference validation, if the input is numeric. For details see issue #499.
- The outdated mapbox.js plugin was updated to the latest version. See issue #510 for details.
- An issue was resolved where the sortid of an abstract was removed when an abstract was re-submitted. See issue #507 for details.
- The outdated mathjax.js plugin was updated to version 2.7.7. See issue #506 for details.


# Release v1.2

## Features
- Added docker support to the project. GCA-Web can now also be run using docker containers.
Expand All @@ -30,7 +64,7 @@ until the next release.
- The password reset page now properly resolves error template messages. See #434 for details.


# Release 1.1
# Release v1.1
Major changes since the last release:

- Support for conference description
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ FROM java:8
ENV ACTIVATOR_VERSION 1.3.7
ENV DEBIAN_FRONTEND noninteractive

# Use existing sbt cache from existing container to avoid downloads
# This should be removed once the service has been upgraded to latest
# sbt and play version.
FROM gnode/gca:dependencies

RUN rm /tmp/typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip
RUN rm -r /usr/local/activator-${ACTIVATOR_VERSION}-minimal

WORKDIR /tmp
RUN wget https://downloads.typesafe.com/typesafe-activator/${ACTIVATOR_VERSION}/typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip
RUN unzip -q typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip -d /usr/local
Expand All @@ -15,6 +23,8 @@ ENV PATH /usr/local/activator-${ACTIVATOR_VERSION}-minimal:$PATH
RUN mkdir -p /srv/gca
RUN mkdir -p /srv/gca/figures
RUN mkdir -p /srv/gca/figures_mobile
RUN mkdir -p /srv/gca/banners
RUN mkdir -p /srv/gca/banners_mobile

ADD app /srv/gca/app
ADD conf /srv/gca/conf
Expand All @@ -36,6 +46,8 @@ RUN activator test stage
VOLUME ["/srv/gca/db"]
VOLUME ["/srv/gca/figures"]
VOLUME ["/srv/gca/figures_mobile"]
VOLUME ["/srv/gca/banners"]
VOLUME ["/srv/gca/banners_mobile"]

# Add an external directory for production config files.
RUN mkdir -p /srv/ext_conf
Expand Down
35 changes: 35 additions & 0 deletions Dockerfile_dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Dockerfile preparing the dependencies for the full GCA-Web build
FROM java:8

ENV ACTIVATOR_VERSION 1.3.7
ENV DEBIAN_FRONTEND noninteractive

WORKDIR /tmp
RUN wget https://downloads.typesafe.com/typesafe-activator/${ACTIVATOR_VERSION}/typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip
RUN unzip -q typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip -d /usr/local

ENV PATH /usr/local/activator-${ACTIVATOR_VERSION}-minimal:$PATH

# install to srv gca
RUN mkdir -p /srv/gca
RUN mkdir -p /srv/gca/figures
RUN mkdir -p /srv/gca/figures_mobile
RUN mkdir -p /srv/gca/banners
RUN mkdir -p /srv/gca/banners_mobile

ADD app /srv/gca/app
ADD conf /srv/gca/conf
ADD project/plugins.sbt /srv/gca/project/
ADD project/build.properties /srv/gca/project/
ADD public /srv/gca/public
ADD test /srv/gca/test
ADD build.sbt /srv/gca/

# only required for local tests
RUN mkdir -p /srv/gca/db
RUN echo "db.default.url=\"jdbc:h2:/srv/gca/db/gca-web\"" >> /srv/gca/conf/application.dev.conf

# test and stage
WORKDIR /srv/gca
# Required to get dependencies before running the startup script.
RUN activator test stage
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ The current version is stable.
A previous version of the application can be found in the "oldstable" branch.

Please find the latest release notes in the [release section](https://github.com/G-Node/GCA-Web/releases).


## Frontend tests using Selenium

The application suite provides frontend test using Selenium. A full setup and usage description can be found in the
[frontend test readme](./test/frontend/Readme.md).
49 changes: 35 additions & 14 deletions app/assets/javascripts/abstract-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ require(["lib/models", "lib/tools", "knockout", "sammy", "lib/offline"], functio
self.selectedAbstract = ko.observable(null);
self.isFavouriteAbstract = ko.observable(false);
self.groups = ko.observableArray(null);
self.filter = ko.observable(null);
self.error = ko.observable(false);
self.messageSuccess = ko.observable(false);
self.favs = ko.observableArray(null);
self.favAbsArr = [];
self.favAbstracts = ko.observableArray(null);

// maps for uuid -> abstract, doi -> abstract,
// neighbours -> prev & next of current list
Expand Down Expand Up @@ -132,7 +132,7 @@ require(["lib/models", "lib/tools", "knockout", "sammy", "lib/offline"], functio

function success(obj) {
// Reload the abstract view to refresh the favourite status
self.favAbsArr.push(obj);
self.favAbstracts.push(obj);
self.showAbstractByUUID(obj);
self.setInfo("Abstract has been added to the favourite abstracts list");
}
Expand All @@ -159,7 +159,7 @@ require(["lib/models", "lib/tools", "knockout", "sammy", "lib/offline"], functio

function success(obj) {
// Reload the abstract view to refresh the favourite status
self.favAbsArr.splice(self.favAbsArr.indexOf(obj), 1);
self.favAbstracts.splice(self.favAbstracts.indexOf(obj), 1);
self.showAbstractByUUID(obj);
self.setInfo("Abstract has been removed from the favourite abstracts list");
}
Expand Down Expand Up @@ -290,27 +290,48 @@ require(["lib/models", "lib/tools", "knockout", "sammy", "lib/offline"], functio
return self.neighbours[uuid].prev;
};

self.isFavourite = function(abstract) {
self.isFavouriteAbstract(self.favAbsArr.includes(abstract.uuid, 0));
self.isFavourite = function (abstract) {
if (self.favAbstracts) {
return self.favAbstracts().includes(abstract.uuid, 0);
} else {
return false;
}
};

self.getFavourites = function() {
var favUsersUrl = "/api/user/self/conferences/" + self.conference().uuid + "/favabstractuuids";
$.get(favUsersUrl, onFavouriteData).fail(self.ioFailHandler);

function onFavouriteData(absList) {
absList.forEach(function(obj) {
self.favAbsArr.push(obj);
});
self.favAbstracts(absList);
for (var i = 0; i < self.abstractsData.length; i++) {
var isFav = self.favAbsArr.includes(self.abstractsData[i].uuid, 0);
self.favs.push(isFav);
self.isFavourite(self.abstractsData[i]);
}
}
};

if (self.selectedAbstract()) {
self.isFavouriteAbstract(self.favAbsArr.includes(self.selectedAbstract().uuid, 0));
}
self.filteredAbsArr = ko.computed(function () {
let filteredAbs = [];
if (self.filter() && self.abstracts()) {
filteredAbs = self.abstracts().filter(function (abstract) {
const checkFields = [abstract.title, abstract.text];
abstract.authors.forEach(function (author) {
checkFields.push(author.firstName);
checkFields.push(author.lastName);
});

return (checkFields.filter(cFd =>
cFd.toLowerCase().includes(self.filter().toLowerCase())).length > 0);
});
}
return filteredAbs;
});

self.isInFiltered = function (abstract) {
if (self.filter()) {
return self.filteredAbsArr().includes(abstract, 0);
}
return true;
};

// Data IO
Expand Down
Loading

0 comments on commit 296af07

Please sign in to comment.