Skip to content

Commit

Permalink
Workflow best practice -> migrate long descriptions to readmes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Feb 13, 2025
1 parent 4a8625f commit e49c3a9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
26 changes: 24 additions & 2 deletions client/src/components/Workflow/Editor/Lint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@
success-message="This workflow has a short description. Ideally, this helps the executors of the workflow
understand the purpose and usage of the workflow."
:warning-message="bestPracticeWarningAnnotation"
attribute-link="Annotate your Workflow."
attribute-link="Describe your Workflow."
@onClick="onAttributes('annotation')" />
<LintSection
:okay="checkAnnotationLength"
:success-message="annotationLengthSuccessMessage"
:warning-message="bestPracticeWarningAnnotationLength"
attribute-link="Shorten your Workflow Description."
@onClick="onAttributes('annotation')" />
<LintSection
:okay="checkReadme"
success-message="This workflow has a readme. Ideally, this helps the researchers understand the purpose, limitations, and usage of the workflow."
:warning-message="bestPracticeWarningReadme"
attribute-link="Annotate your Workflow."
attribute-link="Provider Readme for your Workflow."
@onClick="onAttributes('readme')" />
<LintSection
:okay="checkCreator"
Expand Down Expand Up @@ -81,6 +87,7 @@ import { useWorkflowStores } from "@/composables/workflowStores";
import {
bestPracticeWarningAnnotation,
bestPracticeWarningAnnotationLength,
bestPracticeWarningCreator,
bestPracticeWarningLicense,
bestPracticeWarningReadme,
Expand Down Expand Up @@ -143,6 +150,7 @@ export default {
data() {
return {
bestPracticeWarningAnnotation: bestPracticeWarningAnnotation,
bestPracticeWarningAnnotationLength: bestPracticeWarningAnnotationLength,
bestPracticeWarningCreator: bestPracticeWarningCreator,
bestPracticeWarningLicense: bestPracticeWarningLicense,
bestPracticeWarningReadme: bestPracticeWarningReadme,
Expand All @@ -157,6 +165,20 @@ export default {
checkAnnotation() {
return !!this.annotation;
},
checkAnnotationLength() {
const annotation = this.annotation;
if (annotation && annotation.length > 250) {
return false;
}
return true;
},
annotationLengthSuccessMessage() {
if (this.annotation) {
return "This workflow has a short description of appropriate length.";
} else {
return "This workflow does not have a short description.";
}
},
checkReadme() {
return !!this.annotation;
},
Expand Down
12 changes: 10 additions & 2 deletions client/src/components/Workflow/Editor/WorkflowAttributes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
:show.sync="showAnnotationHightlight"
triggers="manual"
title="Best Practice"
:content="bestPracticeWarningAnnotation">
:content="annotationBestPracticeMessage">
</b-popover>
</div>
<div
Expand Down Expand Up @@ -133,6 +133,7 @@ import { Services } from "@/components/Workflow/services";
import {
bestPracticeWarningAnnotation,
bestPracticeWarningAnnotationLength,
bestPracticeWarningCreator,
bestPracticeWarningLicense,
} from "./modules/linting";
Expand Down Expand Up @@ -209,7 +210,6 @@ export default {
},
data() {
return {
bestPracticeWarningAnnotation: bestPracticeWarningAnnotation,
bestPracticeWarningCreator: bestPracticeWarningCreator,
bestPracticeWarningLicense: bestPracticeWarningLicense,
message: null,
Expand Down Expand Up @@ -259,6 +259,13 @@ export default {
}
return versions;
},
annotationBestPracticeMessage() {
if (this.annotationCurrent) {
return bestPracticeWarningAnnotationLength;
} else {
return bestPracticeWarningAnnotation;
}
},
},
watch: {
version() {
Expand All @@ -277,6 +284,7 @@ export default {
this.creatorCurrent = creator;
},
annotation() {
this.showAnnotationHightlight = false;
this.annotationCurrent = this.annotation;
},
name() {
Expand Down
2 changes: 2 additions & 0 deletions client/src/components/Workflow/Editor/modules/linting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ interface LintState {

export const bestPracticeWarningAnnotation =
"This workflow does not provide a short description. Providing a short description helps workflow executors understand the purpose and usage of the workflow.";
export const bestPracticeWarningAnnotationLength =
"This workflow includes a very long short description. The best practice is to break up long descriptions of a workflow into readme and help text and keep the short description field a relatively brief description of the workflow appropriate for displaying in lists of workflows.";
export const bestPracticeWarningCreator =
"This workflow does not specify creator(s). This is important metadata for workflows that will be published and/or shared to help workflow executors know how to cite the workflow authors.";
export const bestPracticeWarningLicense =
Expand Down

0 comments on commit e49c3a9

Please sign in to comment.