Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into UserBasedObjectStore2
Browse files Browse the repository at this point in the history
  • Loading branch information
VJalili committed Feb 21, 2019
2 parents 6c559a5 + 4bb57e5 commit e714f8f
Show file tree
Hide file tree
Showing 208 changed files with 3,336 additions and 4,556 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ doc/schema.md
doc/source/admin/config_logging_default_yaml.rst
doc/source/api/api.rst
doc/source/api/ts_api.rst
doc/source/dev/schema.md
doc/source/dev/schema.rst

# webpack stats
Expand Down
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ python: 2.7
os:
- linux
env:
- TOX_ENV=py34-lint
- TOX_ENV=py27-lint
- TOX_ENV=py27-unit
- TOX_ENV=py27-first_startup
- TOX_ENV=py27-lint_docstring_include_list

matrix:
include:
- env: TOX_ENV=py34-first_startup
- env: TOX_ENV=py35-lint
addons:
apt:
packages:
- python3.5
- env: TOX_ENV=py35-first_startup
addons:
&py3_addons
apt:
packages:
- python3.5
# For psutil, pyyaml, uwsgi...
- libpython3.4-dev
- libpython3.5-dev
- env: TOX_ENV=validate_test_tools
addons:
apt:
Expand All @@ -28,7 +33,7 @@ matrix:
apt:
packages:
- ack-grep
- env: TOX_ENV=py34-unit
- env: TOX_ENV=py35-unit
addons: *py3_addons
- os: osx
# No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ docs: ## Generate HTML documentation.
# $ ./scripts/common_startup.sh
# $ . .venv/bin/activate
# $ pip install -r lib/galaxy/dependencies/dev-requirements.txt
# You also need to install pandoc separately.
$(IN_VENV) $(MAKE) -C doc clean
$(IN_VENV) $(MAKE) -C doc html

Expand Down
1 change: 1 addition & 0 deletions client/.node_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.13.0
24 changes: 11 additions & 13 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,30 @@ Client Build System
===================

Installs, stages, and builds the client-side scripts necessary for running the
Galaxy webapp. There's no need to use this system unless you are modifying or
developing client-side scripts, or are running the development branch of
Galaxy. When started through `run.sh` or any other method that utilizes
`common_startup.sh`, Galaxy will also (since 18.09) *automatically* build
Galaxy webapp. When started through `run.sh` or any other method that utilizes
`scripts/common_startup.sh`, Galaxy will (since 18.09) *automatically* build
the client as a part of server startup, when it detects changes, unless that
functionality is explicitly disabled.

The base dependencies used are Node.js and Yarn. Galaxy now includes these in
the virtual environment, and they can be accessed by activating that with
`source .venv/bin/activate` from the Galaxy root directory.
`. .venv/bin/activate` from the Galaxy root directory.

If you'd like to install your own dependencies, on OSX the easiest way to get
set up is using homebrew and the command `brew install nodejs yarn`. More
information including instructions for other platforms is available at
nodejs.org and yarnpkg.com.
set up is using `homebrew` and the command `brew install nodejs yarn`. More
information, including instructions for other platforms, is available at
https://nodejs.org/ and https://yarnpkg.com/ .

The Galaxy client build has necessarily grown more complex in the past several
years, but we're still trying to keep things as simple as possible for
developers (everyone, really). If you're having any trouble with building the
client after following the instructions below please create an issue on GitHub
years, but we are still trying to keep things as simple as possible for
everyone. If you're having any trouble with building the
client after following the instructions below, please create an issue on GitHub
or reach out for help directly on Gitter at
https://gitter.im/galaxyproject/Lobby.
https://gitter.im/galaxyproject/Lobby .


Complete Client Build
================================================
=====================

There are many moving parts to the client build system, but the entry point for
most people is the 'client' rule in the Makefile at the root of the Galaxy
Expand Down
66 changes: 66 additions & 0 deletions client/galaxy/scripts/components/login/Index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<template>
<div>
<template v-if="showLogin">
<login :show_welcome_with_login="show_welcome_with_login" :welcome_url="welcome_url" />
</template>
<template v-else>
<register
:registration_warning_message="registration_warning_message"
:mailing_join_addr="mailing_join_addr"
:smtp_server="smtp_server"
/>
</template>
</div>
</template>
<script>
import Login from "components/login/Login.vue";
import Register from "components/login/Register.vue";
import Vue from "vue";
import BootstrapVue from "bootstrap-vue";
Vue.use(BootstrapVue);
export default {
data() {
return {
login: true
};
},
computed: {
showLogin: function() {
return this.login;
}
},
components: {
login: Login,
register: Register
},
methods: {
toggleLogin: function() {
this.login = !this.login;
}
},
props: {
show_welcome_with_login: {
type: Boolean,
required: false
},
welcome_url: {
type: String,
required: false
},
registration_warning_message: {
type: String,
required: false
},
mailing_join_addr: {
type: String,
required: false
},
smtp_server: {
type: String,
required: false
}
}
};
</script>
72 changes: 54 additions & 18 deletions client/galaxy/scripts/components/login/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,33 @@
<div class="row justify-content-md-center">
<div class="col col-lg-6">
<b-alert :show="messageShow" :variant="messageVariant" v-html="messageText" />
<b-form id="login" @submit.prevent="submit()">
<b-card header="Welcome to Galaxy, please log in">
<b-form-group label="Username or Email Address">
<b-form-input name="login" type="text" v-model="login" />
</b-form-group>
<b-form-group label="Password">
<b-form-input name="password" type="password" v-model="password" />
<b-form-text
>Forgot password? Click here to <a @click="reset" href="#">reset</a> your
password.</b-form-text
>
</b-form-group>
<b-button type="submit">Login</b-button>
<b-form id="login" @submit.prevent="submitGalaxyLogin()">
<b-card no-body header="Welcome to Galaxy, please log in">
<b-card-body>
<b-form-group label="Username or Email Address">
<b-form-input name="login" type="text" v-model="login" />
</b-form-group>
<b-form-group label="Password">
<b-form-input name="password" type="password" v-model="password" />
<b-form-text
>Forgot password? Click here to <a @click="reset" href="#">reset</a> your
password.</b-form-text
>
</b-form-group>
<b-button name="login" type="submit">Login</b-button>
</b-card-body>
<b-card-footer>
Don't have an account?
<a id="register-toggle" href="#" @click.prevent="toggleLogin">Register here.</a>
</b-card-footer>
</b-card>
</b-form>
</div>
<b-card header="Other Login Options">
<b-form id="oidc" @submit.prevent="submitOIDCLogin()">
<b-form-group> <b-button type="submit">Log in with Google</b-button> </b-form-group>
</b-form>
</b-card>
<div v-if="show_welcome_with_login" class="col">
<b-embed type="iframe" :src="welcome_url" aspect="1by1" />
</div>
Expand Down Expand Up @@ -46,28 +57,37 @@ export default {
}
},
data() {
let Galaxy = getGalaxyInstance();
let galaxy = getGalaxyInstance();
return {
login: null,
password: null,
url: null,
provider: null,
messageText: null,
messageVariant: null,
redirect: Galaxy.params.redirect
redirect: galaxy.params.redirect,
session_csrf_token: galaxy.session_csrf_token
};
},
computed: {
messageShow() {
return this.messageText != null;
},
showOIDC() {
let Galaxy = getGalaxyInstance();
return Galaxy.config.enable_oidc == true;
}
},
methods: {
submit: function(method) {
toggleLogin: function() {
if (this.$root.toggleLogin) {
this.$root.toggleLogin();
}
},
submitGalaxyLogin: function(method) {
let rootUrl = getAppRoot();
let data = { login: this.login, password: this.password, redirect: this.redirect };
axios
.post(`${rootUrl}user/login`, data)
.post(`${rootUrl}user/login`, this.$data)
.then(response => {
if (response.data.message && response.data.status) {
alert(response.data.message);
Expand All @@ -86,6 +106,22 @@ export default {
this.messageText = message || "Login failed for an unknown reason.";
});
},
submitOIDCLogin: function(method) {
let rootUrl = getAppRoot();
axios
.post(`${rootUrl}authnz/google/login`)
.then(response => {
if (response.data.redirect_uri) {
window.location = encodeURI(response.data.redirect_uri);
}
// Else do something intelligent or maybe throw an error -- what else does this endpoint possibly return?
})
.catch(error => {
this.messageVariant = "danger";
let message = error.response.data && error.response.data.err_msg;
this.messageText = message || "Login failed for an unknown reason.";
});
},
reset: function(ev) {
let rootUrl = getAppRoot();
ev.preventDefault();
Expand Down
115 changes: 115 additions & 0 deletions client/galaxy/scripts/components/login/Register.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<template>
<div class="container">
<div class="row justify-content-md-center">
<div class="col col-lg-6">
<b-alert :show="registration_warning_message" variant="danger">
{{ registration_warning_message }}
</b-alert>
<b-alert :show="messageShow" :variant="messageVariant" v-html="messageText" />
<b-form id="registration" @submit.prevent="submit()">
<b-card no-body header="Create a Galaxy account">
<b-card-body>
<b-form-group label="Email Address">
<b-form-input name="email" type="text" v-model="email" />
</b-form-group>
<b-form-group label="Password">
<b-form-input name="password" type="password" v-model="password" />
</b-form-group>
<b-form-group label="Confirm password">
<b-form-input name="confirm" type="password" v-model="confirm" />
</b-form-group>
<b-form-group label="Public name">
<b-form-input name="username" type="text" v-model="username" />
<b-form-text
>Your public name is an identifier that will be used to generate addresses for
information you share publicly. Public names must be at least three characters in
length and contain only lower-case letters, numbers, dots, underscores, and dashes
('.', '_', '-').</b-form-text
>
</b-form-group>
<b-form-group v-if="mailing_join_addr && smtp_server" label="Subscribe to mailing list">
<input name="subscribe" type="checkbox" v-model="subscribe" />
</b-form-group>
<b-button name="create" type="submit">Create</b-button>
</b-card-body>
<b-card-footer>
Already have an account?
<a id="login-toggle" href="#" @click.prevent="toggleLogin">Log in here.</a>
</b-card-footer>
</b-card>
</b-form>
</div>
</div>
</div>
</template>
<script>
import axios from "axios";
import Vue from "vue";
import BootstrapVue from "bootstrap-vue";
import { getGalaxyInstance } from "app";
import { getAppRoot } from "onload";
Vue.use(BootstrapVue);
export default {
props: {
registration_warning_message: {
type: String,
required: false
},
smtp_server: {
type: String,
required: false
},
mailing_join_addr: {
type: String,
required: false
},
redirect: {
type: String,
required: false
}
},
data() {
let galaxy = getGalaxyInstance();
return {
email: null,
password: null,
username: null,
confirm: null,
subscribe: null,
messageText: null,
messageVariant: null,
session_csrf_token: galaxy.session_csrf_token
};
},
computed: {
messageShow() {
return this.messageText != null;
}
},
methods: {
toggleLogin: function() {
if (this.$root.toggleLogin) {
this.$root.toggleLogin();
}
},
submit: function(method) {
let rootUrl = getAppRoot();
axios
.post(`${rootUrl}user/create`, this.$data)
.then(response => {
if (response.data.message && response.data.status) {
alert(response.data.message);
}
window.location = this.redirect || rootUrl;
})
.catch(error => {
this.messageVariant = "danger";
let message = error.response.data && error.response.data.err_msg;
this.messageText = message || "Registration failed for an unknown reason.";
});
}
}
};
</script>
Loading

0 comments on commit e714f8f

Please sign in to comment.