Skip to content

Commit ac8907c

Browse files
improvement to readme preview in workflow editor
Uses the `Heading` component to show the workflow name and then the workflow logo (if it exists) _**inline**_ in the readme preview.
1 parent 2c0f6de commit ac8907c

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

client/src/components/Workflow/Editor/WorkflowAttributes.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,18 @@
127127
</div>
128128
</div>
129129
<BModal v-model="showReadmePreview" hide-header centered ok-only>
130-
<ToolHelpMarkdown :content="readmePreviewMarkdown" />
130+
<div class="d-flex justify-content-between align-items-center mb-2">
131+
<Heading class="flex-grow-1" truncate separator size="md">
132+
{{ nameCurrent || "Workflow Readme Preview" }}
133+
</Heading>
134+
<img
135+
v-if="logoUrlCurrent"
136+
:src="logoUrlCurrent"
137+
:alt="`${nameCurrent} workflow logo`"
138+
style="max-height: 30px"
139+
class="ml-2 mb-2" />
140+
</div>
141+
<ToolHelpMarkdown :content="readmeCurrent" />
131142
</BModal>
132143
</ActivityPanel>
133144
</template>
@@ -148,6 +159,7 @@ import {
148159
} from "./modules/linting";
149160
import { UntypedParameters } from "./modules/parameters";
150161
162+
import Heading from "@/components/Common/Heading.vue";
151163
import LicenseSelector from "@/components/License/LicenseSelector.vue";
152164
import ActivityPanel from "@/components/Panels/ActivityPanel.vue";
153165
import CreatorEditor from "@/components/SchemaOrg/CreatorEditor.vue";
@@ -160,6 +172,7 @@ export default {
160172
name: "WorkflowAttributes",
161173
components: {
162174
FontAwesomeIcon,
175+
Heading,
163176
StatelessTags,
164177
LicenseSelector,
165178
CreatorEditor,
@@ -253,19 +266,6 @@ export default {
253266
hasParameters() {
254267
return this.parameters && this.parameters.parameters.length > 0;
255268
},
256-
readmePreviewMarkdown() {
257-
let content = "";
258-
if (this.nameCurrent) {
259-
content += `# ${this.nameCurrent}\n\n`;
260-
}
261-
if (this.logoUrlCurrent) {
262-
content += `![${this.nameCurrent || "workflow"} logo](${this.logoUrlCurrent})\n\n`;
263-
}
264-
if (this.readmeCurrent) {
265-
content += this.readmeCurrent;
266-
}
267-
return content;
268-
},
269269
versionOptions() {
270270
const versions = [];
271271
for (let i = 0; i < this.versions.length; i++) {

0 commit comments

Comments
 (0)