Skip to content

Commit 1a937e8

Browse files
authored
Merge branch 'master' into legend
2 parents 3bdd959 + e7380aa commit 1a937e8

File tree

6 files changed

+229
-10
lines changed

6 files changed

+229
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a work-in-progress [Spring Boot](http://projects.spring.io/spring-boot/) MVC application which fetches [Common Workflow Language](http://www.commonwl.org/) files from a Github repository and creates a page for it detailing the main workflow and its inputs, outputs and steps.
44

5-
[![Build Status](https://travis-ci.org/common-workflow-language/cwlviewer.svg?branch=master)](https://travis-ci.org/common-workflow-language/cwlviewer) [![Gitter](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/common-workflow-language/common-workflow-language?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![](https://images.microbadger.com/badges/image/commonworkflowlanguage/cwlviewer.svg)](https://microbadger.com/images/commonworkflowlanguage/cwlviewer "MicroBadger commonworkflowlanguage/cwlviewer") [![Docker image commonworkflowlanguage/cwlviewer](https://images.microbadger.com/badges/version/commonworkflowlanguage/cwlviewer.svg)](https://hub.docker.com/r/commonworkflowlanguage/cwlviewer/ "Docker Hub commonworkflowlanguage/cwlviewer")
5+
[![Build Status](https://travis-ci.org/common-workflow-language/cwlviewer.svg?branch=master)](https://travis-ci.org/common-workflow-language/cwlviewer) [![Gitter](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/common-workflow-language/cwlviewer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![](https://images.microbadger.com/badges/image/commonworkflowlanguage/cwlviewer.svg)](https://microbadger.com/images/commonworkflowlanguage/cwlviewer "MicroBadger commonworkflowlanguage/cwlviewer") [![Docker image commonworkflowlanguage/cwlviewer](https://images.microbadger.com/badges/version/commonworkflowlanguage/cwlviewer.svg)](https://hub.docker.com/r/commonworkflowlanguage/cwlviewer/ "Docker Hub commonworkflowlanguage/cwlviewer")
66

77

88

src/main/java/org/commonwl/view/graphviz/DotWriter.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ private void writeSteps(Workflow workflow) throws IOException {
193193
}
194194
}
195195
}
196+
197+
// Workaround to force outputs to lowest ranking, see #104
198+
writeLine("");
199+
writeLine(" // Invisible links to force outputs to be at lowest rank");
200+
for (Map.Entry<String, CWLStep> step : workflow.getSteps().entrySet()) {
201+
writeLine(" \"" + step.getKey() + "\" -> \"" +
202+
workflow.getOutputs().keySet().iterator().next() +
203+
"\" [style=invis];");
204+
}
205+
196206
}
197207

198208
/**

src/main/java/org/commonwl/view/workflow/WorkflowService.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,16 @@ public Workflow getWorkflow(GithubDetails githubInfo) {
123123
if (workflow != null) {
124124
// Delete the existing workflow if the cache has expired
125125
if (cacheExpired(workflow)) {
126-
// Update by trying to add a new workflow
126+
removeWorkflow(workflow);
127+
128+
// Add the new workflow if it exists
127129
Workflow newWorkflow = createWorkflow(workflow.getRetrievedFrom());
128130

129-
// Only replace workflow if it could be successfully parsed
130131
if (newWorkflow == null) {
132+
// Add back the old workflow if it is broken now
131133
logger.error("Could not parse updated workflow " + workflow.getID());
134+
workflowRepository.save(workflow);
132135
} else {
133-
// Delete the existing workflow
134-
removeWorkflow(workflow);
135-
136-
// Save new workflow
137-
workflowRepository.save(newWorkflow);
138136
workflow = newWorkflow;
139137
}
140138
}
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
body {
21+
padding-top: 61px;
22+
}
23+
24+
.hide {
25+
display: none;
26+
}
27+
28+
:target {
29+
padding-top: 61px;
30+
margin-top: -61px;
31+
}
32+
33+
.alert-grey {
34+
color: #7d7d7d;
35+
background-color: #f8f8f8;
36+
}
37+
38+
#logo {
39+
height: 61px;
40+
padding: 5px;
41+
}
42+
43+
#explore {
44+
padding-top: 20px;
45+
}
46+
47+
#githubURL {
48+
background: url("/img/GitHub-Mark-32px.png") no-repeat scroll 7px 4px;
49+
background-size: 25px 25px;
50+
padding-left: 45px;
51+
}
52+
53+
#githubLogo {
54+
margin-right: 5px;
55+
}
56+
57+
#dockerLogo {
58+
height: 75px;
59+
margin-left: 10px;
60+
}
61+
62+
.logos {
63+
margin-top: 1em;
64+
}
65+
66+
.logos img {
67+
height: 3em;
68+
align: top;
69+
margin-left: 1em;
70+
margin-right: 1em;
71+
}
72+
73+
.graphControl {
74+
position: absolute;
75+
top: 10px;
76+
right: 25px;
77+
cursor: pointer;
78+
font-size: 25px;
79+
opacity: 0.333;
80+
}
81+
82+
.graphControl:hover {
83+
opacity: 1;
84+
}
85+
86+
#fullscreen-close {
87+
top: 25px;
88+
}
89+
90+
#selectChildren, #selectParents {
91+
top: 8px;
92+
width: 30px;
93+
height: 35px;
94+
}
95+
96+
#selectChildren {
97+
left: 25px;
98+
}
99+
100+
#selectParents {
101+
left: 62px;
102+
height: 32px;
103+
width: 50px;
104+
}
105+
106+
#fullScreenGraphModal .modal-dialog {
107+
width: 98%;
108+
height: 92%;
109+
padding: 0;
110+
}
111+
112+
#fullScreenGraphModal .modal-body {
113+
width: 100%;
114+
height: 100%;
115+
}
116+
117+
#fullScreenGraphModal .modal-content {
118+
height: 99%;
119+
}
120+
121+
#graphFullscreen {
122+
background-color: #eeeeee;
123+
width: 100%;
124+
height: 90%;
125+
}
126+
127+
#graph-menu {
128+
margin-bottom: 5px;
129+
}
130+
131+
.icon-view {
132+
font-size: 20px;
133+
}
134+
135+
.workflow-thumb {
136+
width:100%;
137+
max-height:300px;
138+
}
139+
140+
#visualisation {
141+
overflow: hidden;
142+
padding: 0;
143+
height: 500px;
144+
}
145+
146+
@media (max-width: 767px) {
147+
#visualisation {
148+
height: 300px;
149+
}
150+
}
151+
152+
#graph {
153+
width: 100%;
154+
height: 100%;
155+
}
156+
157+
#graph svg text {
158+
cursor: default;
159+
-webkit-user-select: none;
160+
-moz-user-select: none;
161+
-ms-user-select: none;
162+
user-select: none;
163+
}
164+
165+
#graph svg text::selection {
166+
background: none;
167+
}
168+
169+
#download-gv {
170+
margin-bottom: 5px;
171+
}
172+
173+
#dot {
174+
margin-top: 5px;
175+
margin-bottom: 10px;
176+
}
177+
178+
#modalTitle {
179+
margin-top: 0;
180+
}
181+
182+
.notFound {
183+
color: #c30000;
184+
}
185+
186+
tr.selected, .table-hover tbody tr.selected:hover td, .table-hover tbody tr.selected:hover th {
187+
background-color: #b9ffbb !important;
188+
}
189+
190+
tr.hover, .table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
191+
background-color: #c9ffcb !important;
192+
}
193+
194+
polygon.selected, polygon.hover.selected {
195+
fill: #b9ffbb;
196+
}
197+
198+
polygon.hover {
199+
fill: #c9ffcb;
200+
}
201+
202+
#footer {
203+
text-align: center;
204+
font-style: italic;
205+
margin-bottom: 30px;
206+
}

src/main/resources/templates/fragments/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
<nav th:fragment="navbar" class="navbar navbar-default navbar-fixed-top">
2828
<div class="container">
2929
<div class="navbar-header">
30-
<a class="navbar-brand" href="/">
30+
<a href="/" class="navbar-left">
3131
<img id="logo" src="/img/CWL-Logo-nofonts.svg"></img>
3232
</a>
3333
<a href="/workflows" class="button navbar-toggle">Explore</a>
3434
</div>
3535
<div class="collapse navbar-collapse">
3636
<ul class="nav navbar-nav navbar-right">
37-
<li><a href="/workflows">Explore</a></li>
37+
<li><a id="explore" href="/workflows">Explore</a></li>
3838
</ul>
3939
</div>
4040
</div>

src/test/resources/graphviz/testWorkflow.dot

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,9 @@ digraph workflow {
4949
"input2" -> "step1";
5050
"default1" [label="examplefile.jar", fillcolor="#D5AEFC"]
5151
"default1" -> "step1";
52+
53+
// Invisible links to force outputs to be at lowest rank
54+
"default1" -> "output" [style=invis];
55+
"step2" -> "output" [style=invis];
56+
"step1" -> "output" [style=invis];
5257
}

0 commit comments

Comments
 (0)