Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor changes to the dataset show_params page #11244

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3fd04aa
add links to dataset info page
simonbray Jan 22, 2021
023dea1
stop CodeRow recollapsing on click
simonbray Jan 22, 2021
fac42f5
add workflow information to job API
simonbray Jan 25, 2021
1f00680
add workflow information to show_params page
simonbray Jan 26, 2021
d1c33c3
fix testing and linting
simonbray Jan 28, 2021
7e4cd2d
Merge remote-tracking branch 'upstream/dev' into show-params
simonbray Jan 28, 2021
71d1f62
Merge remote-tracking branch 'upstream/dev' into show-params
simonbray Feb 8, 2021
6d08759
some fixes
simonbray Feb 8, 2021
3b9c243
add showWorkflowInfo param to JobInformation component
simonbray Feb 25, 2021
c248ffa
Revert "stop CodeRow recollapsing on click"
simonbray Feb 25, 2021
718a692
Merge remote-tracking branch 'upstream/dev' into show-params
simonbray Feb 25, 2021
3c5ae83
js lint
simonbray Feb 25, 2021
ba31769
Merge remote-tracking branch 'upstream/dev' into show-params
simonbray Feb 25, 2021
fe70406
Merge remote-tracking branch 'upstream/dev' into show-params
simonbray May 4, 2021
9c058fd
Merge remote-tracking branch 'upstream/dev' into show-params
simonbray Aug 10, 2021
6ce88a7
use stored_workflow_id on show_params page, make view a variable
simonbray Aug 10, 2021
80bcf5e
capital letter history
OlegZharkov Aug 12, 2021
bd9fce4
add a few buttons
OlegZharkov Aug 12, 2021
a77b3b2
fix `Created by workflow?`
OlegZharkov Aug 12, 2021
d016d43
change edit button
OlegZharkov Aug 12, 2021
7cff66a
fix root path
OlegZharkov Aug 12, 2021
33b6385
fix linting
OlegZharkov Aug 12, 2021
6daa29e
Merge remote-tracking branch 'upstream/dev' into show-params
simonbray Sep 8, 2021
8d7196c
update show_params buttons mouseover text
simonbray Sep 9, 2021
3389afc
Merge remote-tracking branch 'upstream/dev' into show-params
simonbray Sep 10, 2021
3417847
remove superfluous buttons
simonbray Sep 10, 2021
4a96b6d
js lint
simonbray Sep 10, 2021
bfadef7
resolve conflict
simonbray Dec 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions client/src/components/DatasetInformation/DatasetInformation.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<DatasetProvider :id="hda_id" v-slot="{ item: dataset, loading }">
<div v-if="!loading">
<h3>Dataset Information</h3>
<h3>Dataset Information (<a :href="'/datasets/edit?dataset_id=' + dataset.id" target="_top">edit</a>)</h3>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a edit button here ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

<table id="dataset-details" class="tabletip info_data_table">
<tbody>
<tr>
<td>Number</td>
<td>Number in history</td>
<td id="number">{{ dataset.hid }}</td>
</tr>
<tr>
Expand Down Expand Up @@ -43,7 +43,13 @@
<tr v-if="dataset.history_id">
<td>History API ID</td>
<td>
<div id="history_id">{{ dataset.history_id }} <decoded-id :id="dataset.history_id" /></div>
<div id="history_id">
{{ dataset.history_id }} <decoded-id :id="dataset.history_id" /> (<a
:href="'/histories/view?id=' + dataset.history_id"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to get away from this direct navigation, but I'm not sure what the replacement is. @dannon is that how you would do this ? Might also be better to have a button for this ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, we kinda have to deal with it for now, not sure about global Vue router status

target="_top"
>view</a
>)
</div>
</td>
</tr>
<tr v-if="dataset.uuid">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe("JobInformation/JobInformation.vue", () => {
expect(jobInfoTable).toBeTruthy();
const rows = jobInfoTable.findAll("tr");
// should contain 9 rows
expect(rows.length).toBe(9);
expect(rows.length).toBe(10);
});

it("stdout and stderr should be rendered", async () => {
Expand Down
30 changes: 28 additions & 2 deletions client/src/components/JobInformation/JobInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<tr v-if="job && job.tool_id">
<td>Galaxy Tool ID:</td>
<td id="galaxy-tool-id">
{{ job.tool_id }}
{{ job.tool_id }} (<a :href="'/root?tool_id=' + job.tool_id" target="_top">run</a>)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a button here as well ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

<copy-to-clipboard
message="Tool ID was copied to your clipboard"
:text="job.tool_id"
Expand All @@ -18,6 +18,24 @@
<td>Galaxy Tool Version:</td>
<td id="galaxy-tool-version">{{ job.tool_version }}</td>
</tr>
<tr v-if="job && showWorkflowInfo">
<td>Created by workflow?</td>
<td id="created-by-workflow">{{ job.workflow_invocation_step != None }}</td>
</tr>
<tr v-if="job && job.workflow_invocation_step && showWorkflowInfo">
<td>Workflow ID:</td>
<td id="workflow-id">
{{ job.workflow_invocation_step.id }} (<a
:href="'/workflow/display_by_id?id=' + job.workflow_invocation_step.id"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably the workflow id, not the Stored Workflow id. Are you sure this is correct ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

target="_top"
>view</a
>)
</td>
</tr>
<tr v-if="job && job.workflow_invocation_step && showWorkflowInfo">
<td>Invocation ID:</td>
<td id="invocation-id">{{ job.workflow_invocation_step.workflow_invocation_id }}</td>
</tr>
<tr v-if="job && includeTimes">
<td>Created</td>
<td id="created" v-if="job.create_time">
Expand Down Expand Up @@ -47,7 +65,11 @@
</tr>
<tr v-if="job && job.id">
<td>Job API ID:</td>
<td id="encoded-job-id">{{ job.id }} <decoded-id :id="job.id" /></td>
<td id="encoded-job-id">
{{ job.id }} <decoded-id :id="job.id" /> (<a :href="'/root?job_id=' + job.id" target="_top"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the rerun a button (like it is in the history panel)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

>rerun</a
>)
</td>
</tr>
<tr v-if="job && job.copied_from_job_id">
<td>Copied from Job API ID:</td>
Expand Down Expand Up @@ -84,6 +106,10 @@ export default {
type: Boolean,
default: false,
},
showWorkflowInfo: {
type: Boolean,
default: true,
},
},
created: function () {
this.fetchJob(this.job_id);
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/WorkflowInvocationState/JobStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
<div v-if="loading"><b-spinner label="Loading Job..."></b-spinner></div>
<div v-else>
<job-information :job_id="item.id" v-if="item" />
<job-information :job_id="item.id" v-if="item" :showWorkflowInfo="false" />
<p></p>
<job-parameters v-if="item" :jobId="item.id" :includeTitle="false" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/store/jobStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const getters = {

const actions = {
fetchJob: async ({ commit }, jobId) => {
const { data } = await axios.get(`${getAppRoot()}api/jobs/${jobId}?full=true`);
const { data } = await axios.get(`${getAppRoot()}api/jobs/${jobId}?full=true&view=workflow`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to fetch the expensive details for every job here. You need to make the view a variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

commit("saveJobForJobId", { jobId, job: data });
},
};
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/managers/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ def replace_dataset_ids(path, key, value):
return None


def view_show_job(trans, job, full: bool) -> typing.Dict:
def view_show_job(trans, job, view, full: bool) -> typing.Dict:
is_admin = trans.user_is_admin
job_dict = trans.app.security.encode_all_ids(job.to_dict('element', system_details=is_admin), True)
job_dict = trans.app.security.encode_all_ids(job.to_dict(view, system_details=is_admin), True)
if full:
job_dict.update(dict(
tool_stdout=job.tool_stdout,
Expand Down
7 changes: 7 additions & 0 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ class TaskMetricNumeric(BaseJobMetric, RepresentById):
class Job(JobLike, UsesCreateAndUpdateTime, Dictifiable, RepresentById):
dict_collection_visible_keys = ['id', 'state', 'exit_code', 'update_time', 'create_time', 'galaxy_version']
dict_element_visible_keys = ['id', 'state', 'exit_code', 'update_time', 'create_time', 'galaxy_version', 'command_version']
dict_workflow_visible_keys = ['id', 'state', 'exit_code', 'update_time', 'create_time', 'galaxy_version']

"""
A job represents a request to run a tool given input datasets, tool
Expand Down Expand Up @@ -1130,6 +1131,11 @@ def to_dict(self, view='collection', system_details=False):
rval = super().to_dict(view=view)
rval['tool_id'] = self.tool_id
rval['history_id'] = self.history_id

if view == 'workflow':
if self.workflow_invocation_step:
rval['workflow_invocation_step'] = self.workflow_invocation_step.to_dict() if self.workflow_invocation_step else {}

if system_details:
# System level details that only admins should have.
rval['external_id'] = self.job_runner_external_id
Expand Down Expand Up @@ -5706,6 +5712,7 @@ def to_dict(self, view='collection', value_mapper=None):
rval['order_index'] = self.workflow_step.order_index
rval['workflow_step_label'] = self.workflow_step.label
rval['workflow_step_uuid'] = str(self.workflow_step.uuid)
rval['workflow_invocation_id'] = self.workflow_invocation.id
# Following no longer makes sense...
# rval['state'] = self.job.state if self.job is not None else None
if view == 'element':
Expand Down
7 changes: 4 additions & 3 deletions lib/galaxy/webapps/galaxy/api/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class FastAPIJobs:
hda_manager: hdas.HDAManager = depends(hdas.HDAManager)

@router.get("/api/job/{id}")
def show(self, id: EncodedDatabaseIdField, trans: ProvidesUserContext = DependsOnTrans, full: typing.Optional[bool] = False) -> typing.Dict:
def show(self, id: EncodedDatabaseIdField, trans: ProvidesUserContext = DependsOnTrans, view='element', full: typing.Optional[bool] = False) -> typing.Dict:
"""
Return dictionary containing description of job data

Expand All @@ -70,7 +70,7 @@ def show(self, id: EncodedDatabaseIdField, trans: ProvidesUserContext = DependsO
"""
id = trans.app.security.decode_id(id)
job = self.job_manager.get_accessible_job(trans, id)
return view_show_job(trans, job, bool(full))
return view_show_job(trans, job, view, bool(full))


class JobController(BaseGalaxyAPIController, UsesVisualizationMixin):
Expand Down Expand Up @@ -177,7 +177,8 @@ def show(self, trans: ProvidesUserContext, id, **kwd):
"""
job = self.__get_job(trans, id)
full_output = util.asbool(kwd.get('full', 'false'))
return view_show_job(trans, job, full_output)
view = kwd.get('view', 'element')
return view_show_job(trans, job, view, full_output)

@expose_api
def common_problems(self, trans: ProvidesUserContext, id, **kwd):
Expand Down