-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow rule based operations on existing collections.
Allow the rules DSL & GUI component to operate on existing collections to allow filtering, sorting, modifying identifiers and general re-organization of existing collections (e.g. the outputs of tools). Implementing this as a collection operation tool so that it should be executable interactively in the tool form and in a batch fashion as part of workflow executions. For this to be tracked properly as a tool execution and to work properly in the tool form, I've implemented a new tool framework and tool form parameter type called "rules". This can thought of as a more GUI friendly alternative to my proposed collection operations that consumed JavaScript expressions. This includes API tests for both tool and workflow execution of the new tool as well as Selenium tests for tool form execution, workflow editor interactions, and workflow running.
- Loading branch information
Showing
38 changed files
with
1,981 additions
and
197 deletions.
There are no files selected for viewing
301 changes: 200 additions & 101 deletions
301
client/galaxy/scripts/components/RuleCollectionBuilder.vue
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<template> | ||
<div> | ||
<ol class="rules"> | ||
<rule-display-preview | ||
v-for="(rule, index) in rules" | ||
v-bind:rule="rule" | ||
v-bind:index="index" | ||
v-bind:key="index" | ||
:col-headers="columnData.colHeadersPerRule[index]" /> | ||
<identifier-display-preview v-for="(map, index) in mapping" | ||
v-bind="map" | ||
v-bind:index="index" | ||
v-bind:key="map.type" | ||
:col-headers="colHeaders" /> | ||
</ol> | ||
</div> | ||
</template> | ||
<script> | ||
import RuleDefs from "mvc/rules/rule-definitions"; | ||
import _l from "utils/localization"; | ||
// read-only variants of the components for displaying these rules and mappings in builder widget. | ||
const RuleDisplayPreview = { | ||
template: ` | ||
<li class="rule"> | ||
<span class="rule-display">{{ title }} | ||
</span> | ||
<span class="rule-warning" v-if="rule.warn"> | ||
{{ rule.warn }} | ||
</span> | ||
<span class="rule-error" v-if="rule.error"> | ||
<span class="alert-message">{{ rule.error }}</span> | ||
</span> | ||
</li> | ||
`, | ||
props: { | ||
rule: { | ||
required: true, | ||
type: Object | ||
}, | ||
colHeaders: { | ||
type: Array, | ||
required: false | ||
} | ||
}, | ||
computed: { | ||
title() { | ||
const ruleType = this.rule.type; | ||
return RuleDefs.RULES[ruleType].display(this.rule, this.colHeaders); | ||
} | ||
}, | ||
methods: {} | ||
}; | ||
const IdentifierDisplayPreview = { | ||
template: ` | ||
<li class="rule" :title="help"> | ||
Set {{ columnsLabel }} as {{ typeDisplay }} | ||
</li> | ||
`, | ||
props: { | ||
type: { | ||
type: String, | ||
required: true | ||
}, | ||
columns: { | ||
required: true | ||
}, | ||
colHeaders: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
typeDisplay() { | ||
return RuleDefs.MAPPING_TARGETS[this.type].label; | ||
}, | ||
help() { | ||
return RuleDefs.MAPPING_TARGETS[this.type].help || ""; | ||
}, | ||
columnsLabel() { | ||
return RuleDefs.columnDisplay(this.columns, this.colHeaders); | ||
} | ||
} | ||
}; | ||
export default { | ||
data: function() { | ||
return {}; | ||
}, | ||
computed: { | ||
mapping: function() { | ||
return this.inputRules ? this.inputRules.mapping : []; | ||
}, | ||
rules: function() { | ||
return this.inputRules ? this.inputRules.rules : []; | ||
}, | ||
columnData: function() { | ||
const colHeadersPerRule = []; | ||
const hotData = RuleDefs.applyRules([], [], [], this.rules, colHeadersPerRule); | ||
return { colHeadersPerRule: colHeadersPerRule, columns: hotData.columns }; | ||
}, | ||
colHeaders: function() { | ||
const columns = this.columnData.columns; | ||
return RuleDefs.colHeadersFor([], columns); | ||
} | ||
}, | ||
props: { | ||
inputRules: { | ||
required: false, | ||
type: Object | ||
} | ||
}, | ||
components: { | ||
RuleDisplayPreview, | ||
IdentifierDisplayPreview | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.