-
Notifications
You must be signed in to change notification settings - Fork 30
Improve job list view, unify ID rendering #9068
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
Open
fm3
wants to merge
22
commits into
master
Choose a base branch
from
improve-job-list-view
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ba901f8
WIP: Improve job list view
fm3 90ff6d5
fix loading spinner, add workflow report link
fm3 698fcd0
wip FormattedId
fm3 2b6d1e1
remove unused css entry
fm3 7fc613e
wording
fm3 7e9592b
Merge branch 'master' into improve-job-list-view
fm3 45ec618
Merge branch 'master' into improve-job-list-view
fm3 4496402
move schema and evolutions
fm3 ce44cda
Merge branch 'master' into improve-job-list-view
fm3 f13d4b7
WIP speed up job list request
fm3 fff1fe6
unify full and compact job json
fm3 5be2ef4
cleanup, make single job writes superset of list writes
fm3 cf6af3a
cleanup
fm3 e45b31f
changelog
fm3 2640071
Merge branch 'master' into improve-job-list-view
fm3 ab68dc2
implement coderabbit feedback
fm3 4040e0f
Merge branch 'master' into improve-job-list-view
fm3 8edfac8
Implement backend PR feedback
fm3 64b4cbb
implement more coderabbit feedback
fm3 eb941c0
undo redundant changes
fm3 6b08d83
Merge branch 'master' into improve-job-list-view
fm3 f6716e9
fix sorting in list query (newest first)
fm3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,62 @@ | ||
| package models.job | ||
|
|
||
| import com.scalableminds.util.objectid.ObjectId | ||
| import models.job.JobCommand.JobCommand | ||
| import models.job.JobState.JobState | ||
| import play.api.libs.json.JsObject | ||
|
|
||
| trait JobResultLinks { | ||
| def args: JsObject | ||
| def command: JobCommand | ||
| def returnValue: Option[String] | ||
| protected def id: ObjectId | ||
|
|
||
| protected def effectiveState: JobState | ||
|
|
||
| def datasetName: Option[String] = argAsStringOpt("dataset_name") | ||
|
|
||
| def datasetId: Option[String] = argAsStringOpt("dataset_id") | ||
|
|
||
| protected def argAsStringOpt(key: String): Option[String] = (args \ key).toOption.flatMap(_.asOpt[String]) | ||
|
|
||
| protected def argAsBooleanOpt(key: String): Option[Boolean] = (args \ key).toOption.flatMap(_.asOpt[Boolean]) | ||
|
|
||
| def constructResultLink(organizationId: String): Option[String] = | ||
| if (effectiveState != JobState.SUCCESS) None | ||
| else { | ||
| command match { | ||
| case JobCommand.convert_to_wkw | JobCommand.compute_mesh_file => | ||
| datasetId.map { datasetId => | ||
| val datasetNameMaybe = datasetName.map(name => s"$name-").getOrElse("") | ||
| Some(s"/datasets/$datasetNameMaybe$datasetId/view") | ||
| }.getOrElse(datasetName.map(name => s"/datasets/$organizationId/$name/view")) | ||
| case JobCommand.export_tiff | JobCommand.render_animation => | ||
| Some(s"/api/jobs/${this.id}/export") | ||
| case JobCommand.infer_neurons if this.argAsBooleanOpt("do_evaluation").getOrElse(false) => | ||
| returnValue.map { resultAnnotationLink => | ||
| resultAnnotationLink | ||
| } | ||
| case JobCommand.infer_nuclei | JobCommand.infer_neurons | JobCommand.materialize_volume_annotation | | ||
| JobCommand.infer_with_model | JobCommand.infer_mitochondria | JobCommand.align_sections | | ||
| JobCommand.infer_instances => | ||
| // There exist jobs with dataset name as return value, some with directoryName, and newest with datasetId | ||
| // Construct links that work in either case. | ||
| returnValue.map { datasetIdentifier => | ||
| ObjectId | ||
| .fromStringSync(datasetIdentifier) | ||
| .map { asObjectId => | ||
| s"/datasets/$asObjectId/view" | ||
| } | ||
| .getOrElse(s"/datasets/$organizationId/$datasetIdentifier/view") | ||
| } | ||
| case _ => None | ||
| } | ||
| } | ||
|
|
||
| def resultLinkPublic(organizationId: String, webknossosPublicUrl: String): Option[String] = | ||
| for { | ||
| resultLink <- constructResultLink(organizationId) | ||
| resultLinkPublic = if (resultLink.startsWith("/")) s"$webknossosPublicUrl$resultLink" | ||
| else s"$resultLink" | ||
| } yield resultLinkPublic | ||
| } |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these lines were moved to a trait, see below