Skip to content

Commit

Permalink
Merge pull request #15902 from nsoranzo/merge_23.0_forward
Browse files Browse the repository at this point in the history
Merge 23.0 into dev
  • Loading branch information
mvdbeek committed Apr 6, 2023
2 parents 6dd0fae + 0804f0e commit 851625c
Show file tree
Hide file tree
Showing 40 changed files with 677 additions and 380 deletions.
12 changes: 12 additions & 0 deletions client/src/components/Workflow/Editor/Draggable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const props = defineProps({
const emit = defineEmits(["mousedown", "mouseup", "move", "dragstart", "start", "stop"]);
let dragImg: HTMLImageElement | undefined;
const draggable = ref();
const size = reactive(useAnimationFrameSize(draggable));
const transform: Ref<ZoomTransform> | undefined = inject("transform");
Expand All @@ -40,8 +41,16 @@ const onStart = (position: Position, event: DragEvent) => {
emit("start");
emit("mousedown", event);
if (event.type == "dragstart") {
dragImg = document.createElement("img");
dragImg.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
document.body.appendChild(dragImg);
// I guess better than copy ?
event.dataTransfer!.effectAllowed = "link";
try {
event.dataTransfer!.setDragImage(dragImg, 0, 0);
} catch (e) {
console.error(e);
}
if (props.dragData) {
event.dataTransfer!.setData("text/plain", JSON.stringify(props.dragData));
}
Expand All @@ -66,6 +75,9 @@ const onMove = (position: Position, event: DragEvent) => {
};
const onEnd = (position: Position, event: DragEvent) => {
if (dragImg) {
document.body.removeChild(dragImg);
}
emit("stop");
emit("mouseup");
};
Expand Down
20 changes: 8 additions & 12 deletions client/src/components/Workflow/Editor/Node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@
triggers="hover"
placement="bottom"
:show.sync="popoverShow">
<Recommendations
v-if="popoverShow"
:step-id="id"
:datatypes-mapper="datatypesMapper"
@onCreate="onCreate" />
<div>
<Recommendations
v-if="popoverShow"
:step-id="id"
:datatypes-mapper="datatypesMapper"
@onCreate="onCreate" />
</div>
</b-popover>
</b-button-group>
<i :class="iconClass" />
Expand Down Expand Up @@ -232,13 +234,7 @@ const invalidOutputs = computed(() => {
});
});
const outputs = computed(() => {
let stepOutputs = props.step.outputs;
if (props.step.when) {
stepOutputs = stepOutputs.map((output) => {
return { ...output, optional: true };
});
}
return [...stepOutputs, ...invalidOutputs.value];
return [...props.step.outputs, ...invalidOutputs.value];
});
function onDragConnector(dragPosition: TerminalPosition, terminal: OutputTerminals) {
Expand Down
46 changes: 46 additions & 0 deletions client/src/components/Workflow/Editor/NodeOutput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from "@/stores/workflowStepStore";
import { assertDefined, ensureDefined } from "@/utils/assertions";
import type { UseScrollReturn } from "@vueuse/core";
import { NULL_COLLECTION_TYPE_DESCRIPTION, type CollectionTypeDescriptor } from "./modules/collectionTypeDescription";
const props = defineProps<{
output: OutputTerminalSource;
Expand Down Expand Up @@ -204,6 +205,50 @@ const terminalClass = computed(() => {
return cls;
});
function collectionTypeToDescription(collectionTypeDescription: CollectionTypeDescriptor) {
let collectionDescription = collectionTypeDescription.collectionType;
if (
collectionTypeDescription &&
collectionTypeDescription.isCollection &&
collectionTypeDescription.collectionType
) {
// we'll give a prettier label to the must common nested lists
switch (collectionTypeDescription.collectionType) {
case "list:paired": {
collectionDescription = "list of pairs dataset collection";
break;
}
case "list:list": {
collectionDescription = "list of lists dataset collection";
break;
}
default: {
if (collectionTypeDescription.rank > 1) {
collectionDescription = `dataset collection with ${collectionTypeDescription.rank} levels of nesting`;
}
break;
}
}
}
return collectionDescription;
}
const outputDetails = computed(() => {
let collectionType = "collectionType" in terminal.value && terminal.value.collectionType;
const outputType =
collectionType && collectionType.isCollection && collectionType.collectionType
? `output is ${collectionTypeToDescription(collectionType)}`
: `output is dataset`;
if (isMultiple.value) {
if (!collectionType) {
collectionType = NULL_COLLECTION_TYPE_DESCRIPTION;
}
const effectiveOutputType = terminal.value.mapOver.append(collectionType);
return `${outputType} and mapped-over to produce a ${collectionTypeToDescription(effectiveOutputType)} `;
}
return outputType;
});
onBeforeUnmount(() => {
stateStore.deleteOutputTerminalPosition(props.stepId, props.output.name);
});
Expand Down Expand Up @@ -245,6 +290,7 @@ onBeforeUnmount(() => {
@move="onMove">
<div
ref="icon"
v-b-tooltip.hover="outputDetails"
class="icon prevent-zoom"
tabindex="0"
:aria-label="`Connect output ${output.name} to input. Press space to see a list of available inputs`"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ export function useTerminal(
) {
const terminal: Ref<ReturnType<typeof terminalFactory> | null> = ref(null);
const stepStore = useWorkflowStepStore();
const step = computed(() => stepStore.getStep(stepId.value));
const isMappedOver = computed(() => stepStore.stepMapOver[stepId.value]?.isCollection ?? false);

watch(
[stepId, terminalSource, datatypesMapper],
[step, terminalSource, datatypesMapper],
() => {
// rebuild terminal if any of the tracked dependencies change
const newTerminal = terminalFactory(stepId.value, terminalSource.value, datatypesMapper.value);
Expand Down
12 changes: 12 additions & 0 deletions client/src/components/Workflow/Editor/modules/terminals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,18 @@ describe("canAccept", () => {
dataInTwo.disconnect(dataOut);
expect(dataIn.mapOver).toEqual(NULL_COLLECTION_TYPE_DESCRIPTION);
});
it("maintains step map over state when disconnecting output", () => {
const listListOut = terminals["list:list input"]?.["output"] as OutputCollectionTerminal;
const filterFailedInput = terminals["filter_failed"]?.["input"] as InputCollectionTerminal;
const filterFailedOutput = terminals["filter_failed"]?.["output"] as OutputCollectionTerminal;
const dataIn = terminals["simple data"]?.["input"] as InputTerminal;
filterFailedInput.connect(listListOut);
dataIn.connect(filterFailedOutput);
expect(filterFailedInput.isMappedOver()).toBe(true);
expect(stepStore.stepMapOver[filterFailedOutput.stepId]?.isCollection).toBe(true);
dataIn.disconnect(filterFailedOutput);
expect(stepStore.stepMapOver[filterFailedOutput.stepId]?.isCollection).toBe(true);
});
it("rejects connecting incompatible connection types", () => {
const pairedOut = terminals["paired input"]!["output"] as OutputCollectionTerminal;
const collectionIn = terminals["list collection input"]!["input1"] as InputCollectionTerminal;
Expand Down
20 changes: 15 additions & 5 deletions client/src/components/Workflow/Editor/modules/terminals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ class BaseInputTerminal extends Terminal {
const terminalSource = step.outputs[0];
if (terminalSource) {
const terminal = terminalFactory(step.id, terminalSource, this.datatypesMapper);
// drop mapping restrictions
terminal.resetMappingIfNeeded();
// re-establish map over through inputs
step.inputs.forEach((input) => {
terminalFactory(step.id, input, this.datatypesMapper).getStepMapOver();
});
}
} else {
console.error(`Invalid step. Could not fine step with id ${stepId} in store.`);
Expand Down Expand Up @@ -359,9 +364,6 @@ class BaseInputTerminal extends Terminal {
});
}
const postJobActionKey = `ChangeDatatypeAction${connection.output.name}`;
if (outputStep.when) {
terminalSource = { ...terminalSource, optional: true };
}
if (
"extensions" in terminalSource &&
outputStep.post_job_actions &&
Expand Down Expand Up @@ -626,7 +628,7 @@ class BaseOutputTerminal extends Terminal {
constructor(attr: BaseOutputTerminalArgs) {
super(attr);
this.datatypes = attr.datatypes;
this.optional = attr.optional;
this.optional = attr.optional || Boolean(this.stepStore.getStep(this.stepId)?.when);
this.terminalType = "output";
}
getConnectedTerminals(): InputTerminalsAndInvalid[] {
Expand Down Expand Up @@ -743,7 +745,15 @@ export class OutputCollectionTerminal extends BaseOutputTerminal {
otherCollectionType.canMapOver(collectionType)
);
if (connectedCollectionType) {
return connectedCollectionType;
if (connectedCollectionType.collectionType === "any") {
// if the input collection type is "any" this output's collection type
// is exactly the same as the connected output
return otherCollectionType;
} else {
// else we pick the matching input collection type
// so that the map over logic applies correctly
return connectedCollectionType;
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions client/src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3767,6 +3767,8 @@ export interface components {
* @description The current state of this dataset.
*/
state: components["schemas"]["galaxy__model__Dataset__states"];
/** Tags */
tags: string[];
};
/**
* HDASummary
Expand Down
1 change: 1 addition & 0 deletions client/src/utils/navigation/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _: # global stuff
selectors:
editable_text: '.editable-text'
tooltip_balloon: '.tooltip'
tooltip_inner: .tooltip-inner
left_panel_drag: '#left > .unified-panel-footer > .drag'
left_panel_collapse: '#left > .unified-panel-footer > .panel-collapse'
right_panel_drag: '#right > .unified-panel-footer > .drag'
Expand Down
6 changes: 3 additions & 3 deletions config/plugins/webhooks/demo/search/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

.search-screen {
position: fixed;
z-index: 202;
z-index: 5100;
width:100%;
height:100%;
display:none;
Expand All @@ -15,7 +15,7 @@
top:0;
left:0;
background: rgba(224, 224, 224, 0.75);
z-index: 201;
z-index: 5000;
width:100%;
height:100%;
display:none;
Expand Down Expand Up @@ -64,7 +64,7 @@
position: fixed;
top: 34px;
width: 100%;
z-index: 203;
z-index: 5200;
}

.txtbx-search-data {
Expand Down
6 changes: 3 additions & 3 deletions config/plugins/webhooks/gtn/styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#gtn-screen {
position: fixed;
z-index: 202;
z-index: 5100;
width:100%;
height:100%;
}
Expand All @@ -10,7 +10,7 @@
top:0;
left:0;
background: rgba(224, 224, 224, 0.75);
z-index: 201;
z-index: 5000;
width:100%;
height:100%;
opacity: 2;
Expand All @@ -20,7 +20,7 @@
position: fixed;
height: 100%;
width: 100%;
z-index: 203;
z-index: 5200;
display: flex;
justify-content: center;
flex-direction: column;
Expand Down
6 changes: 3 additions & 3 deletions config/plugins/webhooks/news/styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#news-screen {
position: fixed;
z-index: 202;
z-index: 5100;
width:100%;
height:100%;
}
Expand All @@ -10,7 +10,7 @@
top:0;
left:0;
background: rgba(224, 224, 224, 0.75);
z-index: 201;
z-index: 5000;
width:100%;
height:100%;
opacity: 2;
Expand All @@ -20,7 +20,7 @@
position: fixed;
height: 100%;
width: 100%;
z-index: 203;
z-index: 5200;
display: flex;
justify-content: center;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/dependencies/pinned-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fsspec==2023.1.0 ; python_version >= "3.7" and python_version < "3.12"
future==0.18.3 ; python_version >= "3.7" and python_version < "3.12"
galaxy-sequence-utils==1.1.5 ; python_version >= "3.7" and python_version < "3.12"
galaxy2cwl==0.1.4 ; python_version >= "3.7" and python_version < "3.12"
gravity==1.0.1 ; python_version >= "3.7" and python_version < "3.12"
gravity==1.0.2 ; python_version >= "3.7" and python_version < "3.12"
greenlet==2.0.2 ; python_version >= "3.7" and platform_machine == "aarch64" and python_version < "3.12" or python_version >= "3.7" and platform_machine == "ppc64le" and python_version < "3.12" or python_version >= "3.7" and platform_machine == "x86_64" and python_version < "3.12" or python_version >= "3.7" and platform_machine == "amd64" and python_version < "3.12" or python_version >= "3.7" and platform_machine == "AMD64" and python_version < "3.12" or python_version >= "3.7" and platform_machine == "win32" and python_version < "3.12" or python_version >= "3.7" and platform_machine == "WIN32" and python_version < "3.12"
gunicorn==20.1.0 ; python_version >= "3.7" and python_version < "3.12"
gxformat2==0.17.0 ; python_version >= "3.7" and python_version < "3.12"
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/jobs/runners/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ def write_command(self, job_wrapper: "MinimalJobWrapper") -> str:
"exit_code_path": exit_code_path,
"working_directory": job_wrapper.working_directory,
"shell": job_wrapper.shell,
"galaxy_virtual_env": None,
}
job_file_contents = self.get_job_file(job_wrapper, **job_script_props)
self.write_executable_script(job_file, job_file_contents, job_io=job_wrapper.job_io)
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/managers/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def get(self, trans, history_id, bucket_name, objects, authz_id, input_args=None
incoming = params.__dict__
history = trans.sa_session.query(trans.app.model.History).get(history_id)
if not history:
raise ObjectNotFound(f"History with ID `{trans.app.security.encode_id(history_id)}` not found.")
raise ObjectNotFound("History with the ID provided was not found.")
output = trans.app.toolbox.get_tool("upload1").handle_input(trans, incoming, history=history)

job_errors = output.get("job_errors", [])
Expand Down Expand Up @@ -360,7 +360,7 @@ def send(self, trans, history_id, bucket_name, authz_id, dataset_ids=None, overw

history = trans.sa_session.query(trans.app.model.History).get(history_id)
if not history:
raise ObjectNotFound(f"History with ID `{trans.app.security.encode_id(history_id)}` not found.")
raise ObjectNotFound("History with the provided ID not found.")

sent = []
failed = []
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/managers/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def __get_history_collection_instance(
instance_id
)
if not collection_instance:
raise RequestParameterInvalidException(f"History dataset collection association {id} not found")
raise RequestParameterInvalidException("History dataset collection association not found")
history = getattr(trans, "history", collection_instance.history)
if check_ownership:
self.history_manager.error_unless_owner(collection_instance.history, trans.user, current_history=history)
Expand All @@ -808,7 +808,7 @@ def __get_library_collection_instance(
instance_id
)
if not collection_instance:
raise RequestParameterInvalidException(f"Library dataset collection association {id} not found")
raise RequestParameterInvalidException("Library dataset collection association not found")
if check_accessible:
if not trans.app.security_agent.can_access_library_item(
trans.get_current_user_roles(), collection_instance, trans.user
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/managers/collections_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def dictify_element_reference(element, rank_fuzzy_counts=None, recursive=True, s
object_details["state"] = element_object.state
object_details["hda_ldda"] = "hda"
object_details["history_id"] = element_object.history_id
object_details["tags"] = element_object.make_tag_string_list()

dictified["object"] = object_details
else:
Expand Down
5 changes: 2 additions & 3 deletions lib/galaxy/managers/group_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from galaxy import model
from galaxy.exceptions import ObjectNotFound
from galaxy.managers.context import ProvidesAppContext
from galaxy.schema.fields import DecodedDatabaseIdField
from galaxy.structured_app import MinimalManagerApp

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -63,13 +62,13 @@ def delete(self, trans: ProvidesAppContext, role_id: int, group_id: int) -> mode
def _get_group(self, trans: ProvidesAppContext, group_id: int) -> model.Group:
group = trans.sa_session.query(model.Group).get(group_id)
if not group:
raise ObjectNotFound(f"Group with id {DecodedDatabaseIdField.encode(group_id)} was not found.")
raise ObjectNotFound("Group with the id provided was not found.")
return group

def _get_role(self, trans: ProvidesAppContext, role_id: int) -> model.Role:
role = trans.sa_session.query(model.Role).get(role_id)
if not role:
raise ObjectNotFound(f"Role with id {DecodedDatabaseIdField.encode(role_id)} was not found.")
raise ObjectNotFound("Role with the id provided was not found.")
return role

def _get_group_role(
Expand Down
Loading

0 comments on commit 851625c

Please sign in to comment.