Skip to content
Snippets Groups Projects
Commit e9341dae authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Merge branch 'feature/49-add-mandatory-input-and-output-docs' into 'development'

Resolve "Add mandatory input and output docs to workflow"

Closes #49

See merge request !42
parents e6bdfdff 18b178ec
No related branches found
No related tags found
2 merge requests!84Remove development branch,!42Resolve "Add mandatory input and output docs to workflow"
Pipeline #27669 passed
...@@ -16,7 +16,7 @@ export type WorkflowExecutionIn = { ...@@ -16,7 +16,7 @@ export type WorkflowExecutionIn = {
*/ */
parameters: any; parameters: any;
/** /**
* Bucket where to save the Nextflow report. If None, no report will be generated * Bucket where to save the Nextflow report. If None, no report will be generated. With our without prefix 's3://'
*/ */
report_output_bucket?: string; report_output_bucket?: string;
}; };
......
...@@ -34,9 +34,17 @@ export type WorkflowVersionFull = { ...@@ -34,9 +34,17 @@ export type WorkflowVersionFull = {
*/ */
readme_url: string; readme_url: string;
/** /**
* URL to download CHAnGELOG.md from * URL to download CHANGELOG.md from
*/ */
changelog_url: string; changelog_url: string;
/**
* URL to download usage.md from
*/
usage_url: string;
/**
* URL to download output.md from
*/
output_url: string;
/** /**
* URL to download nextflow_schema.json from * URL to download nextflow_schema.json from
*/ */
......
...@@ -5,6 +5,8 @@ export const requiredRepositoryFiles = [ ...@@ -5,6 +5,8 @@ export const requiredRepositoryFiles = [
"CHANGELOG.md", "CHANGELOG.md",
"README.md", "README.md",
"nextflow_schema.json", "nextflow_schema.json",
"docs/usage.md",
"docs/output.md",
]; ];
export function determineGitIcon(repo_url?: string): string { export function determineGitIcon(repo_url?: string): string {
...@@ -64,7 +66,7 @@ export abstract class GitRepository { ...@@ -64,7 +66,7 @@ export abstract class GitRepository {
} else if (repoUrl.includes("gitlab")) { } else if (repoUrl.includes("gitlab")) {
return new GitlabRepository(repoUrl, gitCommitHash); return new GitlabRepository(repoUrl, gitCommitHash);
} }
throw new Error(`Repository is not supported.`); throw new Error("Repository is not supported.");
} }
} }
......
...@@ -18,6 +18,8 @@ const versionState = reactive<{ ...@@ -18,6 +18,8 @@ const versionState = reactive<{
version: undefined | WorkflowVersionFull; version: undefined | WorkflowVersionFull;
descriptionMarkdown: string; descriptionMarkdown: string;
changelogMarkdown: string; changelogMarkdown: string;
usageMarkdown: string;
outputMarkdown: string;
errorLoading: boolean; errorLoading: boolean;
parameterSchema: Record<string, never>; parameterSchema: Record<string, never>;
}>({ }>({
...@@ -27,6 +29,8 @@ const versionState = reactive<{ ...@@ -27,6 +29,8 @@ const versionState = reactive<{
errorLoading: false, errorLoading: false,
descriptionMarkdown: "", descriptionMarkdown: "",
changelogMarkdown: "", changelogMarkdown: "",
usageMarkdown: "",
outputMarkdown: "",
parameterSchema: {}, parameterSchema: {},
}); });
...@@ -49,8 +53,9 @@ function updateVersion(versionId: string, workflowId: string) { ...@@ -49,8 +53,9 @@ function updateVersion(versionId: string, workflowId: string) {
) )
.then((version) => { .then((version) => {
versionState.version = version; versionState.version = version;
downloadVersionFiles(version); return version;
}) })
.then(downloadVersionFiles)
.catch(() => { .catch(() => {
versionState.version = undefined; versionState.version = undefined;
}) })
...@@ -72,11 +77,21 @@ function downloadVersionFiles(version: WorkflowVersionFull) { ...@@ -72,11 +77,21 @@ function downloadVersionFiles(version: WorkflowVersionFull) {
.then((response) => { .then((response) => {
versionState.parameterSchema = response.data; versionState.parameterSchema = response.data;
}); });
Promise.all([descriptionPromise, changelogPromise, parameterPromise]).finally( const usagePromise = axios.get(version.usage_url).then((response) => {
() => { versionState.usageMarkdown = response.data;
versionState.fileLoading = false; });
} const outputPromise = axios.get(version.output_url).then((response) => {
); versionState.outputMarkdown = response.data;
});
Promise.all([
descriptionPromise,
changelogPromise,
parameterPromise,
usagePromise,
outputPromise,
]).finally(() => {
versionState.fileLoading = false;
});
} }
onMounted(() => { onMounted(() => {
...@@ -95,6 +110,14 @@ onMounted(() => { ...@@ -95,6 +110,14 @@ onMounted(() => {
>Description >Description
</router-link> </router-link>
</li> </li>
<li class="nav-item">
<router-link
class="nav-link"
:to="{ query: { tab: 'usage' } }"
:class="{ active: props.activeTab === 'usage' }"
>Usage
</router-link>
</li>
<li class="nav-item"> <li class="nav-item">
<router-link <router-link
class="nav-link" class="nav-link"
...@@ -103,6 +126,14 @@ onMounted(() => { ...@@ -103,6 +126,14 @@ onMounted(() => {
>Parameters >Parameters
</router-link> </router-link>
</li> </li>
<li class="nav-item">
<router-link
class="nav-link"
:to="{ query: { tab: 'output' } }"
:class="{ active: props.activeTab === 'output' }"
>Output
</router-link>
</li>
<li class="nav-item"> <li class="nav-item">
<router-link <router-link
class="nav-link" class="nav-link"
...@@ -139,6 +170,12 @@ onMounted(() => { ...@@ -139,6 +170,12 @@ onMounted(() => {
<p v-else-if="props.activeTab === 'changes'"> <p v-else-if="props.activeTab === 'changes'">
<markdown-renderer :markdown="versionState.changelogMarkdown" /> <markdown-renderer :markdown="versionState.changelogMarkdown" />
</p> </p>
<p v-else-if="props.activeTab === 'output'">
<markdown-renderer :markdown="versionState.outputMarkdown" />
</p>
<p v-else-if="props.activeTab === 'usage'">
<markdown-renderer :markdown="versionState.usageMarkdown" />
</p>
</div> </div>
</template> </template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment