Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Jul 13, 2019
2 parents 2a2075b + 9c725f1 commit 757ac1d
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 78 deletions.
13 changes: 13 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@


## 2.4.1

Features

- Organism and Group tab should searchable. [2081](https://github.com/GMOD/Apollo/pull/2081)

Bug

- Bump JBrowse version to 1.16.6 to fix drag error on Chrome mac. <https://github.com/GMOD/jbrowse/issues/1397>



## 2.4.0

Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Launchable public Amazon Web Services (AWS) EC2 images may be [launched from Com
Launch settings should be 2 vCPU, 8 GB recommended, 80 GB storage depending on the size of your data, and ports 22 and 8080 open at a minimum.
The server will be available at <http://aws.public.ip:8080/apollo/>. Binaries with be in the `apollo/bin` directory though it should be in the path.

Apollo may be launched from [Docker](docs/Setup.md#configure-for-docker) as well.
Apollo may be launched from [Docker](docs/Docker.md) as well.

The [quick-start guide for developers](docs/Apollo2Build.md) shows how to easily get started with Apollo.

Expand Down
2 changes: 1 addition & 1 deletion application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
app.grails.version=2.5.5
app.name=apollo
app.servlet.version=3.0
app.version=2.4.0
app.version=2.4.1
3 changes: 3 additions & 0 deletions docker-files/createenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ echo "export APOLLO_ADMIN_PASSWORD=$APOLLO_ADMIN_PASSWORD" >> $SET_ENV_FILE
echo "export APOLLO_ADMIN_FIRST_NAME=$APOLLO_ADMIN_FIRST_NAME" >> $SET_ENV_FILE
echo "export APOLLO_ADMIN_LAST_NAME=$APOLLO_ADMIN_LAST_NAME" >> $SET_ENV_FILE

# If we want to change authentication methods
echo "export WEBAPOLLO_REMOTE_USER_AUTH=$WEBAPOLLO_REMOTE_USER_AUTH" >> $SET_ENV_FILE
echo "export WEBAPOLLO_USER_PASSWORD_AUTH=$WEBAPOLLO_USER_PASSWORD_AUTH" >> $SET_ENV_FILE
12 changes: 12 additions & 0 deletions docker-files/docker-apollo-config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ apollo {
firstName = System.getenv("APOLLO_ADMIN_FIRST_NAME") ?: "Ad"
lastName = System.getenv("APOLLO_ADMIN_LAST_NAME") ?: "min"
}
authentications = [
[
"name":"Remote User Authenticator",
"className":"remoteUserAuthenticatorService",
"active": System.getenv("WEBAPOLLO_REMOTE_USER_AUTH") ?: false
],
[
"name":"Username Password Authenticator",
"className":"usernamePasswordAuthenticatorService",
"active": System.getenv("WEBAPOLLO_USER_PASSWORD_AUTH") ?: true
]
]
}

jbrowse {
Expand Down
11 changes: 0 additions & 11 deletions docs/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ server `apollo run-local` or `apollo debug` use the development environment (i.e
* `apollo test` uses the test environment (i.e. only when running unit tests)



#### Configure for H2:
- H2 is an embedded database engine, so no external setups are needed. Simply copy sample-h2-apollo-config.groovy to
apollo-config.groovy.
Expand All @@ -88,21 +87,11 @@ server `apollo run-local` or `apollo debug` use the development environment (i.e
- Copy the sample-postgres-apollo-config.groovy to apollo-config.groovy.



#### Configure for MySQL:
- Create a new MySQL database for production mode (i.e. run ``create database `apollo-production``` in the mysql
console) and copy the sample-postgres-apollo-config.groovy to apollo-config.groovy.


#### Configure for Docker:
- Set up and export all of the environment variables you wish to configure. At bare minimum you will likely wish to set
`WEBAPOLLO_DB_USERNAME`, `WEBAPOLLO_DB_PASSWORD`, `WEBAPOLLO_DB_DRIVER`, `WEBAPOLLO_DB_DIALECT`, and
`WEBAPOLLO_DB_URI`
- Create a new database in your chosen database backend and copy the sample-docker-apollo-config.groovy to
apollo-config.groovy.
- [Instructions and a script for launching docker with apollo and PostgreSQL](https://github.com/GMOD/docker-apollo).


#### Apollo in Galaxy
Apollo can always be used externally from Galaxy, but there are a few integrations available as well.

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Javascript client that runs in a web browser as a JBrowse plugin.

You can find the latest release here: https://github.com/GMOD/Apollo/releases/latest and our setup guide: http://genomearchitect.readthedocs.io/en/latest/Setup.html

- Apollo general documentation: `https://genomearchitect.github.io/ <https://genomearchitect.github.io>`__
- Apollo general documentation: `http://genomearchitect.github.io/ <http://genomearchitect.github.io>`__

- JBrowse general documentation: `http://jbrowse.org <http://jbrowse.org>`__

Expand Down
4 changes: 2 additions & 2 deletions grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ auditLog {
jbrowse {
git {
url = "https://github.com/gmod/jbrowse"
branch = "1.16.5-release"
// branch = "dev"
branch = "1.16.6-release"
// branch = "dev"
// tag = "15dfd2309f2d508d8bed782d0f68b38dd9927bb4"
alwaysPull = true
alwaysRecheck = true
Expand Down
36 changes: 0 additions & 36 deletions grails-app/views/auth/login.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,12 @@
<g:form action="signIn">
<input type="hidden" name="targetUri" value="${targetUri}" class="col-md-4"/>
<div class="col-md-5 col-lg-offset-1" style="margin-top: 10px;">
%{--<input type="username" class="form-control" placeholder="Username (email)" required autofocus>--}%
%{--<input type="password" class="form-control" placeholder="Password" required>--}%
%{--<button class="btn btn-lg btn-primary btn-block" type="submit">--}%
%{--Sign in</button>--}%
%{--<label class="checkbox pull-left">--}%
%{--<input type="checkbox" value="${rememberMe}">--}%
%{--Remember me--}%
%{--</label>--}%
%{--<table>--}%
%{--<tbody>--}%
%{--<tr>--}%
%{--<td>Username:</td>--}%
%{--<td>--}%
<input name="username" value="${username}" type="username" class="form-control col-md-4"
style="margin:10px;"
placeholder="Username (email)"
required autofocus/>
%{--</td>--}%
%{--</tr>--}%
%{--<tr>--}%
%{--<td>Password:</td>--}%
%{--<td><input type="password" name="password" value="" /></td>--}%
<input type="password" name="password" value="" class="form-control" placeholder="Password" required
style="margin:10px;"/>
%{--</tr>--}%
%{--<tr>--}%
%{--<td>Remember me?:</td>--}%
%{--<td><g:checkBox name="rememberMe" value="${rememberMe}" /></td>--}%
%{--<div class="col-md-5 row" style="margin-bottom: 10px;">--}%
<input class="col-md-4 col-md-offset-1 btn btn-lg btn-primary" type="submit"
value="Login">

Expand All @@ -49,19 +26,6 @@
<input class="checkbox" type="checkbox" name="rememberMe" value="${rememberMe}"/>
Remember me
</label>
%{--</div>--}%

%{--<div class="col-md-5 row">--}%
%{--</div>--}%
%{--</tr>--}%
%{--<tr>--}%
%{--<td />--}%
%{--<input type="submit" value="Sign in"/>--}%
%{--<button class="btn btn-lg btn-primary btn-block" type="submit" value="Login">--}%
%{--<td><input type="submit" value="Sign in" /></td>--}%
%{--</tr>--}%
%{--</tbody>--}%
%{--</table>--}%
</div>
</g:form>
</body>
Expand Down
5 changes: 5 additions & 0 deletions src/gwt/org/bbop/apollo/gwt/client/Annotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ public void onResponseReceived(Request request, Response response) {
if(statusCode==200 && response.getText().equals("{}")){
GWT.log("Still connected");
}
else
if(statusCode==200 && response.getText().contains("/apollo/auth/signIn")){
GWT.log("Back up and trying to login");
Window.Location.reload();
}
else{
if(!confirmOpen){
confirmOpen = true ;
Expand Down
31 changes: 27 additions & 4 deletions src/gwt/org/bbop/apollo/gwt/client/GroupPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.gwtbootstrap3.extras.bootbox.client.callback.ConfirmCallback;
import org.gwtbootstrap3.extras.select.client.ui.MultipleSelect;
import org.gwtbootstrap3.extras.select.client.ui.Option;
import org.gwtbootstrap3.extras.select.client.ui.Select;

import java.util.ArrayList;
import java.util.Comparator;
Expand Down Expand Up @@ -92,9 +91,14 @@ interface UserGroupBrowserPanelUiBinder extends UiBinder<Widget, GroupPanel> {
MultipleSelect availableGroupAdmin;
@UiField
Button updateGroupAdmin;
@UiField
static TextBox nameSearchBox;

static private ListDataProvider<GroupInfo> dataProvider = new ListDataProvider<>();
private static List<GroupInfo> groupInfoList = new ArrayList<>();
private static List<GroupInfo> filteredGroupInfoList = dataProvider.getList();


private ListDataProvider<GroupInfo> dataProvider = new ListDataProvider<>();
private List<GroupInfo> groupInfoList = dataProvider.getList();
private SingleSelectionModel<GroupInfo> selectionModel = new SingleSelectionModel<>();
private GroupInfo selectedGroupInfo;
private ColumnSortEvent.ListHandler<GroupInfo> groupSortHandler = new ColumnSortEvent.ListHandler<>(groupInfoList);
Expand Down Expand Up @@ -183,6 +187,7 @@ public void onGroupChanged(GroupChangeEvent userChangeEvent) {
case GROUPS_RELOADED:
selectedGroupInfo = null;
selectionModel.clear();
filterList();
break;


Expand All @@ -194,7 +199,7 @@ public void onGroupChanged(GroupChangeEvent userChangeEvent) {
@Override
public boolean execute() {
if (MainPanel.getInstance().getCurrentUser() != null) {
if(MainPanel.getInstance().isCurrentUserInstructorOrBetter()) {
if (MainPanel.getInstance().isCurrentUserInstructorOrBetter()) {
GroupRestService.loadGroups(groupInfoList);
UserRestService.loadUsers(allUsersList);
}
Expand Down Expand Up @@ -441,6 +446,24 @@ public void reload() {
}
}

@UiHandler("nameSearchBox")
public void doSearch(KeyUpEvent keyUpEvent) {
filterList();
}

static void filterList() {
String text = nameSearchBox.getText();
filteredGroupInfoList.clear();
if (text.trim().length() == 0) {
filteredGroupInfoList.addAll(groupInfoList);
return;
}
for (GroupInfo groupInfo : groupInfoList) {
if (groupInfo.getName().toLowerCase().contains(text.toLowerCase())) {
filteredGroupInfoList.add(groupInfo);
}
}
}

private void createOrganismPermissionsTable() {
TextColumn<GroupOrganismPermissionInfo> organismNameColumn = new TextColumn<GroupOrganismPermissionInfo>() {
Expand Down
3 changes: 3 additions & 0 deletions src/gwt/org/bbop/apollo/gwt/client/GroupPanel.ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<gwt:north size="40">
<b:Container fluid="true" width="100%">
<b:Row styleName="{style.northPanel}">
<b:Column size="MD_4">
<b:TextBox placeholder="Search" ui:field="nameSearchBox"/>
</b:Column>
<b:Column size="MD_4">
<b:Button ui:field="createButton" icon="PLUS">Add Group</b:Button>
<b:Button ui:field="saveButton" icon="SAVE" visible="false" type="PRIMARY">Save</b:Button>
Expand Down
37 changes: 31 additions & 6 deletions src/gwt/org/bbop/apollo/gwt/client/OrganismPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import com.google.gwt.cell.client.NumberCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.DoubleClickEvent;
import com.google.gwt.event.dom.client.DoubleClickHandler;
import com.google.gwt.event.dom.client.*;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;
Expand Down Expand Up @@ -38,6 +35,7 @@
import org.gwtbootstrap3.extras.bootbox.client.Bootbox;
import org.gwtbootstrap3.extras.bootbox.client.callback.ConfirmCallback;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

Expand Down Expand Up @@ -113,14 +111,20 @@ interface OrganismBrowserPanelUiBinder extends UiBinder<Widget, OrganismPanel> {
TextBox organismUploadSpecies;
@UiField
TextBox organismUploadNonDefaultTranslationTable;
@UiField
static TextBox nameSearchBox;

boolean creatingNewOrganism = false; // a special flag for handling the clearSelection event when filling out new organism info
boolean savingNewOrganism = false; // a special flag for handling the clearSelection event when filling out new organism info

final LoadingDialog loadingDialog;
final ErrorDialog errorDialog;
private ListDataProvider<OrganismInfo> dataProvider = new ListDataProvider<>();
private List<OrganismInfo> organismInfoList = dataProvider.getList();

static private ListDataProvider<OrganismInfo> dataProvider = new ListDataProvider<>();
private static List<OrganismInfo> organismInfoList = new ArrayList<>();
private static List<OrganismInfo> filteredOrganismInfoList = dataProvider.getList();


private final SingleSelectionModel<OrganismInfo> singleSelectionModel = new SingleSelectionModel<>();

public OrganismPanel() {
Expand Down Expand Up @@ -200,6 +204,7 @@ public Integer getValue(OrganismInfo object) {
public void onOrganismChanged(OrganismChangeEvent organismChangeEvent) {
organismInfoList.clear();
organismInfoList.addAll(MainPanel.getInstance().getOrganismInfoList());
filterList();
}
});

Expand Down Expand Up @@ -274,6 +279,26 @@ public int compare(OrganismInfo o1, OrganismInfo o2) {

}


@UiHandler("nameSearchBox")
public void doSearch(KeyUpEvent keyUpEvent) {
filterList();
}

static void filterList() {
String text = nameSearchBox.getText();
filteredOrganismInfoList.clear();
if(text.trim().length()==0){
filteredOrganismInfoList.addAll(organismInfoList);
return ;
}
for (OrganismInfo organismInfo : organismInfoList) {
if (organismInfo.getName().toLowerCase().contains(text.toLowerCase())) {
filteredOrganismInfoList.add(organismInfo);
}
}
}

public void loadOrganismInfo() {
loadOrganismInfo(singleSelectionModel.getSelectedObject());
}
Expand Down
Loading

0 comments on commit 757ac1d

Please sign in to comment.