Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Computational Metagenomics
CloWM
CloWM UI
Commits
ca6bbd46
Verified
Commit
ca6bbd46
authored
2 years ago
by
Daniel Göbel
Browse files
Options
Downloads
Patches
Plain Diff
Improve UI for show workflow page
#37
parent
9d8002d7
No related branches found
No related tags found
1 merge request
!33
Resolve "Create show Workflow Version Page"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/views/workflows/WorkflowVersionView.vue
+19
-10
19 additions, 10 deletions
src/views/workflows/WorkflowVersionView.vue
src/views/workflows/WorkflowView.vue
+50
-24
50 additions, 24 deletions
src/views/workflows/WorkflowView.vue
with
69 additions
and
34 deletions
src/views/workflows/WorkflowVersionView.vue
+
19
−
10
View file @
ca6bbd46
...
@@ -13,7 +13,7 @@ const props = defineProps<{
...
@@ -13,7 +13,7 @@ const props = defineProps<{
const
versionState
=
reactive
({
const
versionState
=
reactive
({
loading
:
true
,
loading
:
true
,
markdown
Loading
:
true
,
file
Loading
:
true
,
version
:
undefined
,
version
:
undefined
,
errorLoading
:
false
,
errorLoading
:
false
,
descriptionMarkdown
:
""
,
descriptionMarkdown
:
""
,
...
@@ -21,7 +21,7 @@ const versionState = reactive({
...
@@ -21,7 +21,7 @@ const versionState = reactive({
parameterSchema
:
{},
parameterSchema
:
{},
}
as
{
}
as
{
loading
:
boolean
;
loading
:
boolean
;
markdown
Loading
:
boolean
;
file
Loading
:
boolean
;
version
:
undefined
|
WorkflowVersionFull
;
version
:
undefined
|
WorkflowVersionFull
;
descriptionMarkdown
:
string
;
descriptionMarkdown
:
string
;
changelogMarkdown
:
string
;
changelogMarkdown
:
string
;
...
@@ -40,6 +40,7 @@ watch(
...
@@ -40,6 +40,7 @@ watch(
function
updateVersion
(
versionId
:
string
,
workflowId
:
string
)
{
function
updateVersion
(
versionId
:
string
,
workflowId
:
string
)
{
versionState
.
loading
=
true
;
versionState
.
loading
=
true
;
versionState
.
fileLoading
=
true
;
WorkflowVersionService
.
workflowVersionGetWorkflowVersion
(
WorkflowVersionService
.
workflowVersionGetWorkflowVersion
(
versionId
,
versionId
,
workflowId
workflowId
...
@@ -61,15 +62,23 @@ onMounted(() => {
...
@@ -61,15 +62,23 @@ onMounted(() => {
});
});
function
downloadVersionFiles
(
version
:
WorkflowVersionFull
)
{
function
downloadVersionFiles
(
version
:
WorkflowVersionFull
)
{
axios
.
get
(
version
.
readme_url
).
then
((
response
)
=>
{
const
descriptionPromise
=
axios
.
get
(
version
.
readme_url
).
then
((
response
)
=>
{
versionState
.
descriptionMarkdown
=
response
.
data
;
versionState
.
descriptionMarkdown
=
response
.
data
;
});
});
axios
.
get
(
version
.
changelog_url
).
then
((
response
)
=>
{
const
changelogPromise
=
axios
.
get
(
version
.
changelog_url
).
then
((
response
)
=>
{
versionState
.
changelogMarkdown
=
response
.
data
;
versionState
.
changelogMarkdown
=
response
.
data
;
});
});
axios
.
get
(
version
.
parameter_schema_url
).
then
((
response
)
=>
{
const
parameterPromise
=
axios
versionState
.
parameterSchema
=
response
.
data
;
.
get
(
version
.
parameter_schema_url
)
});
.
then
((
response
)
=>
{
versionState
.
parameterSchema
=
response
.
data
;
});
Promise
.
all
([
descriptionPromise
,
changelogPromise
,
parameterPromise
]).
finally
(
()
=>
{
versionState
.
fileLoading
=
false
;
console
.
log
(
"
All loaded
"
);
}
);
}
}
</
script
>
</
script
>
...
@@ -79,7 +88,7 @@ function downloadVersionFiles(version: WorkflowVersionFull) {
...
@@ -79,7 +88,7 @@ function downloadVersionFiles(version: WorkflowVersionFull) {
<router-link
<router-link
class=
"nav-link"
class=
"nav-link"
aria-current=
"page"
aria-current=
"page"
:to=
"
{
path: '#',
query: { tab: 'description' } }"
:to=
"
{ query: { tab: 'description' } }"
:class="{ active: props.activeTab === 'description' }"
:class="{ active: props.activeTab === 'description' }"
>Description
>Description
</router-link>
</router-link>
...
@@ -87,7 +96,7 @@ function downloadVersionFiles(version: WorkflowVersionFull) {
...
@@ -87,7 +96,7 @@ function downloadVersionFiles(version: WorkflowVersionFull) {
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<router-link
<router-link
class=
"nav-link"
class=
"nav-link"
:to=
"
{
path: '#',
query: { tab: 'parameters' } }"
:to=
"
{ query: { tab: 'parameters' } }"
:class="{ active: props.activeTab === 'parameters' }"
:class="{ active: props.activeTab === 'parameters' }"
>Parameters
>Parameters
</router-link>
</router-link>
...
@@ -95,7 +104,7 @@ function downloadVersionFiles(version: WorkflowVersionFull) {
...
@@ -95,7 +104,7 @@ function downloadVersionFiles(version: WorkflowVersionFull) {
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<router-link
<router-link
class=
"nav-link"
class=
"nav-link"
:to=
"
{
path: '#',
query: { tab: 'changes' } }"
:to=
"
{ query: { tab: 'changes' } }"
:class="{ active: props.activeTab === 'changes' }"
:class="{ active: props.activeTab === 'changes' }"
>Releases
>Releases
</router-link>
</router-link>
...
...
This diff is collapsed.
Click to expand it.
src/views/workflows/WorkflowView.vue
+
50
−
24
View file @
ca6bbd46
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
onMounted
,
reactive
,
watch
}
from
"
vue
"
;
import
{
computed
,
onMounted
,
reactive
,
watch
}
from
"
vue
"
;
import
type
{
ComputedRef
}
from
"
vue
"
;
import
type
{
WorkflowOut
}
from
"
@/client/workflow
"
;
import
type
{
WorkflowOut
}
from
"
@/client/workflow
"
;
import
{
WorkflowService
}
from
"
@/client/workflow
"
;
import
{
WorkflowService
}
from
"
@/client/workflow
"
;
import
{
useRoute
,
useRouter
}
from
"
vue-router
"
;
import
{
useRoute
,
useRouter
}
from
"
vue-router
"
;
...
@@ -60,6 +61,14 @@ function updateWorkflow(workflowId: string) {
...
@@ -60,6 +61,14 @@ function updateWorkflow(workflowId: string) {
});
});
}
}
const
activeVersionString
:
ComputedRef
<
string
>
=
computed
(()
=>
{
return
(
workflowState
.
workflow
?.
versions
.
find
(
(
w
)
=>
w
.
git_commit_hash
===
workflowState
.
activeVersionId
)?.
version
??
""
);
});
onMounted
(()
=>
{
onMounted
(()
=>
{
updateWorkflow
(
props
.
workflowId
);
updateWorkflow
(
props
.
workflowId
);
});
});
...
@@ -67,32 +76,49 @@ onMounted(() => {
...
@@ -67,32 +76,49 @@ onMounted(() => {
<
template
>
<
template
>
<div
v-if=
"workflowState.workflow != null"
>
<div
v-if=
"workflowState.workflow != null"
>
<h1>
{{
workflowState
.
workflow
.
name
}}
</h1>
<h1
class=
"fs-0"
>
{{
workflowState
.
workflow
.
name
}}
</h1>
<p
class=
"fs-4"
>
{{
workflowState
.
workflow
.
short_description
}}
</p>
<p
class=
"fs-4 mb-5 mt-3"
>
{{
workflowState
.
workflow
.
short_description
}}
</p>
<div
class=
"input-group w-fit mb-3"
>
<div
class=
"row align-items-center"
>
<span
class=
"input-group-text pe-2 ps-2"
id=
"workflows-search-wrapping"
<a
role=
"button"
class=
"btn btn-success btn-lg w-fit mx-auto"
href=
"#"
>
><bootstrap-icon
icon=
"tags-fill"
class=
"text-secondary"
<bootstrap-icon
icon=
"rocket-takeoff-fill"
class=
"me-2"
/>
/></span>
<span
class=
"align-middle"
>
Launch
{{
activeVersionString
}}
</span>
<select
</a>
class=
"form-select form-select-sm"
<div
class=
"input-group w-fit position-absolute end-0"
>
aria-label=
"Workflow version selection"
<span
class=
"input-group-text px-2"
id=
"workflow-version-wrapping"
aria-describedby=
"workflows-search-wrapping"
><bootstrap-icon
icon=
"tags-fill"
class=
"text-secondary"
v-model=
"workflowState.activeVersionId"
/></span>
>
<select
<option
class=
"form-select form-select-sm"
v-for=
"(version, index) in [
aria-label=
"Workflow version selection"
...workflowState.workflow.versions,
aria-describedby=
"workflow-version-wrapping"
].reverse()"
v-model=
"workflowState.activeVersionId"
:key=
"version.git_commit_hash"
:value=
"version.git_commit_hash"
:selected=
"index === 1"
>
>
{{
version
.
version
}}
<option
</option>
v-for=
"version in [...workflowState.workflow.versions].reverse()"
</select>
:key=
"version.git_commit_hash"
:value=
"version.git_commit_hash"
>
{{
version
.
version
}}
</option>
</select>
</div>
</div>
<div
class=
"row w-100 mb-4 mt-2 mx-0"
>
<a
:href=
"workflowState.workflow.repository_url"
target=
"_blank"
class=
"text-secondary text-decoration-none mx-auto w-fit p-0"
><bootstrap-icon
icon=
"git"
class=
"me-1"
/><span
class=
"align-middle"
>
{{
workflowState
.
workflow
.
repository_url
}}
</span
></a
>
</div>
</div>
<router-view
/>
<router-view
/>
</div>
</div>
</
template
>
</
template
>
<
style
scoped
></
style
>
<
style
scoped
>
.fs-0
{
font-size
:
4em
;
}
</
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment