Skip to content

Commit

Permalink
Merge pull request #2 from dannon/conditional_galaxycloudrunner
Browse files Browse the repository at this point in the history
Conditional galaxycloudrunner
  • Loading branch information
nuwang committed Jan 17, 2019
2 parents e822f95 + c14c358 commit 76ac198
Show file tree
Hide file tree
Showing 197 changed files with 2,347 additions and 2,262 deletions.
25 changes: 21 additions & 4 deletions .travis.yml
Expand Up @@ -6,15 +6,11 @@ env:
- TOX_ENV=py34-lint
- TOX_ENV=py27-lint
- TOX_ENV=py27-unit
- TOX_ENV=qunit
- TOX_ENV=py27-first_startup
- TOX_ENV=py27-lint_docstring_include_list

matrix:
include:
- env: TOX_ENV=qunit
addons:
chrome: stable
- env: TOX_ENV=py34-first_startup
addons:
&py3_addons
Expand All @@ -38,6 +34,27 @@ matrix:
# No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312
language: generic
env: TOX_ENV=py27-first_startup
- name: js-unit
language: node_js
node_js:
- 10
before_install:
- cd client
install:
- yarn
- yarn run build
script:
- yarn run test
- name: js-lint
language: node_js
node_js:
- 10
before_install:
- cd client
install:
- yarn
script:
- yarn run eslint

before_install:
# Workaround for https://github.com/travis-ci/travis-ci/issues/7940
Expand Down
10 changes: 4 additions & 6 deletions Makefile
Expand Up @@ -160,13 +160,11 @@ client-format: node-deps ## Reformat client code
client-watch: node-deps ## A useful target for parallel development building.
cd client && yarn run watch

_client-test-mocha: ## Run mocha tests via karma
cd client && yarn run test-mocha
client-test: node-deps ## Run JS unit tests via Karma
cd client && yarn run test

_client-test-qunit: ## Run qunit tests via karma
cd client && yarn run test-qunit

client-test: client _client-test-mocha _client-test-qunit ## Run JS unit tests via Karma
client-eslint: node-deps ## Run client linting
cd client && yarn run eslint

client-test-watch: client ## Watch and run qunit tests on changes via Karma
cd client && yarn run test-watch
Expand Down
6 changes: 6 additions & 0 deletions client/.eslintignore
@@ -0,0 +1,6 @@
*.test.js
galaxy/scripts/qunit
galaxy/scripts/mocha
galaxy/scripts/libs
galaxy/scripts/nls
galaxy/scripts/legacy
19 changes: 19 additions & 0 deletions client/.eslintrc.js
@@ -0,0 +1,19 @@
module.exports = {
extends: ["eslint:recommended", "plugin:vue/essential"], // airbnb-base, eventually
env: {
browser: true
},
parserOptions: { parser: "babel-eslint" },
plugins: ["html"],
rules: {
"no-console": "off",
"no-unused-vars": ["error", { args: "none" }],
// I'd love to turn on camelcase, but it's a big shift with tons of current errors.
// camelcase: [
// "error",
// {
// properties: "always"
// }
// ]
}
};
12 changes: 9 additions & 3 deletions client/galaxy/scripts/app/galaxy.js
Expand Up @@ -149,10 +149,14 @@ GalaxyApp.prototype._initLogger = function _initLogger(loggerOptions) {
// load any logging namespaces from localStorage if we can
try {
loggerOptions.consoleNamespaceWhitelist = localStorage.getItem(NAMESPACE_KEY).split(",");
} catch (storageErr) {}
} catch (storageErr) {
console.debug(storageErr);
}
try {
loggerOptions.consoleFlattenMessages = localStorage.getItem(FLATTEN_LOG_MESSAGES_KEY) == "true";
} catch (storageErr) {}
} catch (storageErr) {
console.debug(storageErr);
}
console.log(loggerOptions.consoleFlattenMessages);
}

Expand Down Expand Up @@ -233,7 +237,9 @@ GalaxyApp.prototype._setUpListeners = function _setUpListeners() {
var data = options.data;
try {
data = JSON.parse(data);
} catch (err) {}
} catch (err) {
// data isn't JSON, skip.
}

self.lastAjax = {
url: location.href.slice(0, -1) + options.url,
Expand Down
4 changes: 1 addition & 3 deletions client/galaxy/scripts/components/Alert.vue
@@ -1,8 +1,6 @@
<template>
<b-alert :variant="galaxyKwdToBootstrap" :show="showP" v-bind="$props">
<slot>
{{ message }}
</slot>
<slot> {{ message }} </slot>
</b-alert>
</template>

Expand Down
24 changes: 13 additions & 11 deletions client/galaxy/scripts/components/Citations.vue
Expand Up @@ -2,23 +2,24 @@
<b-card>
<h4 slot="header" class="mb-0">
Citations
<b-button v-if="viewRender" @click="toggleViewRender" title="Show all in BibTeX format." class="citations-to-bibtex">
<i class="fa fa-pencil-square-o"></i>
Show BibTeX
<b-button
v-if="viewRender"
@click="toggleViewRender"
title="Show all in BibTeX format."
class="citations-to-bibtex"
>
<i class="fa fa-pencil-square-o"></i> Show BibTeX
</b-button>
<b-button v-else @click="toggleViewRender" title="Return to formatted citation list.">
<i class="fa fa-times"></i>
Hide BibTeX
<i class="fa fa-times"></i> Hide BibTeX
</b-button>
</h4>
<div v-if="source === 'histories'" class="infomessage">
When writing up your analysis, remember to include all references that should be cited in order
to completely describe your work. Also, please remember to <a href="https://galaxyproject.org/citing-galaxy">cite Galaxy</a>.
When writing up your analysis, remember to include all references that should be cited in order to
completely describe your work. Also, please remember to
<a href="https://galaxyproject.org/citing-galaxy">cite Galaxy</a>.
</div>
<span v-if="viewRender" class="citations-formatted">
<p v-html="formattedReferences">
</p>
</span>
<span v-if="viewRender" class="citations-formatted"> <p v-html="formattedReferences"></p> </span>
<pre v-else>
<code class="citations-bibtex">
{{ content }}
Expand All @@ -27,6 +28,7 @@
</b-card>
</template>
<script>
import _ from "underscore";
import { getAppRoot } from "onload/loadConfig";
import axios from "axios";
import * as bibtexParse from "libs/bibtexParse";
Expand Down
39 changes: 13 additions & 26 deletions client/galaxy/scripts/components/DataDialog.vue
@@ -1,29 +1,28 @@
<template>
<b-modal class="data-dialog-modal" v-model="modalShow" :ok-only="true" ok-title="Close">
<template slot="modal-header">
<h5 class="modal-title">{{modalTitle}}</h5>
<b-input-group v-if="optionsShow">
<b-input v-model="filter" placeholder="Type to Search"/>
<b-input v-model="filter" placeholder="Type to Search" />
<b-input-group-append>
<b-btn :disabled="!filter" @click="filter = ''">Clear</b-btn>
</b-input-group-append>
</b-input-group>
</template>
<b-alert v-if="errorMessage" variant="danger" :show="errorShow">
{{ errorMessage }}
</b-alert>
<b-alert v-if="errorMessage" variant="danger" :show="errorShow"> {{ errorMessage }} </b-alert>
<div v-else>
<div v-if="optionsShow">
<b-table small hover
<b-table
small
hover
:items="items"
:fields="fields"
:filter="filter"
@row-clicked="clicked"
@filtered="filtered">
@filtered="filtered"
>
<template slot="name" slot-scope="data">
<i v-if="data.item.history_content_type == 'dataset'" class="fa fa-file-o"/>
<i v-else class="fa fa-copy"/>
{{ data.item.hid }}: {{ data.value }}
<i v-if="data.item.history_content_type == 'dataset'" class="fa fa-file-o" />
<i v-else class="fa fa-copy" /> {{ data.item.hid }}: {{ data.value }}
</template>
<template slot="extension" slot-scope="data">
{{ data.value ? data.value : "-" }}
Expand All @@ -32,14 +31,9 @@
{{ data.value ? data.value.substring(0, 16).replace("T", " ") : "-" }}
</template>
</b-table>
<div v-if="nItems == 0">
No search results found for: {{ this.filter }}.
</div>
</div>
<div v-else>
<span class="fa fa-spinner fa-spin"/>
<span>Please wait...</span>
<div v-if="nItems == 0">No search results found for: {{ this.filter }}.</div>
</div>
<div v-else><span class="fa fa-spinner fa-spin" /> <span>Please wait...</span></div>
</div>
</b-modal>
</template>
Expand All @@ -49,6 +43,7 @@ import { getAppRoot } from "onload/loadConfig";
import axios from "axios";
import Vue from "vue";
import BootstrapVue from "bootstrap-vue";
import { getGalaxyInstance } from "app";
Vue.use(BootstrapVue);
Expand All @@ -59,15 +54,6 @@ export default {
required: true
}
},
computed: {
modalTitle() {
if (this.errorMessage) {
return "Failed to load datasets";
} else if (!this.optionsShow) {
return "Loading datasets";
}
}
},
data() {
return {
fields: {
Expand Down Expand Up @@ -106,6 +92,7 @@ export default {
this.modalShow = false;
},
load: function() {
let Galaxy = getGalaxyInstance();
this.historyId = Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model.id;
if (this.historyId) {
axios
Expand Down
11 changes: 6 additions & 5 deletions client/galaxy/scripts/components/DisplayStructured.vue
@@ -1,16 +1,16 @@
<template>
<div>
<!-- eslint-disable-next-line vue/require-v-for-key -->
<div v-for="error in errorMessages">
<div class="alert alert-danger" role="alert">
{{ error }}
</div>
</div>
<div v-html="historyTemplate">
<div class="alert alert-danger" role="alert">{{ error }}</div>
</div>
<div v-html="historyTemplate"></div>
</div>
</template>

<script>
import $ from "jquery";
import { getGalaxyInstance } from "app";
import { getAppRoot } from "onload/loadConfig";
import axios from "axios";
import HDAModel from "mvc/history/hda-model";
Expand Down Expand Up @@ -62,6 +62,7 @@ export default {
},
makeHistoryView: function(historyDict) {
window.hdas = historyDict.map(hda => {
let Galaxy = getGalaxyInstance();
return new HDAListItemEdit.HDAListItemEdit({
model: new HDAModel.HistoryDatasetAssociation(hda),
el: $("#hda-" + hda.id),
Expand Down
8 changes: 5 additions & 3 deletions client/galaxy/scripts/components/GalaxyLoader.vue
@@ -1,7 +1,9 @@
<template>
<div class="galaxy-loader"
:class="[`galaxy-loader_${style}`, {'galaxy-loader_center': center}]"
:style="{transform: `scale(${size/100})`}">
<div
class="galaxy-loader"
:class="[`galaxy-loader_${style}`, { 'galaxy-loader_center': center }]"
:style="{ transform: `scale(${size / 100})` }"
>
<div class="galaxy-loader_strip-1"></div>
<div class="galaxy-loader_strip-2"></div>
<div class="galaxy-loader_strip-3"></div>
Expand Down
8 changes: 2 additions & 6 deletions client/galaxy/scripts/components/HistoryImport.vue
Expand Up @@ -3,12 +3,8 @@
<b-card title="Import a history from an archive">
<b-alert :show="hasErrorMessage" variant="danger">{{ errorMessage }}</b-alert>
<p>Please provide a Galaxy history export URL or a history file.</p>
<b-form-group label="Archived History URL">
<b-form-input type="url" v-model="sourceURL"/>
</b-form-group>
<b-form-group label="Archived History File">
<b-form-file v-model="sourceFile"/>
</b-form-group>
<b-form-group label="Archived History URL"> <b-form-input type="url" v-model="sourceURL" /> </b-form-group>
<b-form-group label="Archived History File"> <b-form-file v-model="sourceFile" /> </b-form-group>
<b-button type="submit">Import history</b-button>
</b-card>
</b-form>
Expand Down
28 changes: 19 additions & 9 deletions client/galaxy/scripts/components/HistoryView.vue
@@ -1,38 +1,47 @@
<template>
<div id="structured-history-view">
<div id="history-view-controls" class="clear">
<div id="history-view-controls" class="clear">
<div class="float-left">
<span v-if="historyHistory['purged'] == false" >
<span v-if="historyData.user_is_owner == false" >
<span v-if="historyHistory['purged'] == false">
<span v-if="historyData.user_is_owner == false">
<button id="import" class="btn btn-secondary">Import and start using history</button>
</span>
<span v-if="historyData.user_is_owner && historyData.history_is_current == false">
<button id="switch-history" class="btn btn-secondary" v-on:click="switchHistory">Switch to this history</button>
<button id="switch-history" class="btn btn-secondary" v-on:click="switchHistory">
Switch to this history
</button>
</span>
<button id="show-structure" class="btn btn-secondary" v-on:click="showStructure">Show structure</button>
<button id="show-structure" class="btn btn-secondary" v-on:click="showStructure">
Show structure
</button>
</span>
</div>
<div class="float-right">
<button id="toggle-deleted" class="btn btn-secondary">Include deleted</button>
<button id="toggle-hidden" class="btn btn-secondary">Include hidden</button>
</div>
</div>
<!-- eslint-disable-next-line vue/require-v-for-key -->
<div v-for="error in errorMessages">
<div class="alert alert-danger" role="alert">
{{ error }}
</div>
<div class="alert alert-danger" role="alert">{{ error }}</div>
</div>
<div :id="'history-' + historyHistory['id']" class="history-panel unified-panel-body" style="overflow: auto;"></div>
<div
:id="'history-' + historyHistory['id']"
class="history-panel unified-panel-body"
style="overflow: auto;"
></div>
</div>
</template>

<script>
import $ from "jquery";
import { getAppRoot } from "onload/loadConfig";
import axios from "axios";
import Vue from "vue";
import DisplayStructure from "components/DisplayStructured.vue";
import QueryStringParsing from "utils/query-string-parsing";
import HistoryView from "mvc/history/history-view";
import { getGalaxyInstance } from "app";
export default {
props: {
Expand Down Expand Up @@ -95,6 +104,7 @@ export default {
});
},
showStructure: function() {
let Galaxy = getGalaxyInstance();
let displayStructureInstance = Vue.extend(DisplayStructure),
mountView = document.createElement("div");
Galaxy.page.center.display(mountView);
Expand Down
1 change: 0 additions & 1 deletion client/galaxy/scripts/components/Masthead/index.vue
Expand Up @@ -37,7 +37,6 @@ export default {
};
</script>


<style lang="scss">
#masthead:empty {
display: none;
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/components/Message.vue
@@ -1,5 +1,5 @@
<template>
<div v-if="message" :class="[status + 'message']">{{ message }}</div>
<div v-if="message" :class="[status + 'message']">{{ message }}</div>
</template>

<script>
Expand Down

0 comments on commit 76ac198

Please sign in to comment.