Skip to content

Commit

Permalink
Fix test summary
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Jun 13, 2024
1 parent 01bfe2a commit f3bc952
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/components/ResourceItemInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@
<h2>
Test Summary
</h2>
<span v-if="resourceItem.type == 'model'">
<span
v-if="
resourceItem.type == 'model' &&
resourceItem.apps &&
resourceItem.apps.some(app => app.isLinkedApp)
"
>
This {{ resourceItem.type }} can be used in:
<app-icons :onlyLinked="true" :apps="resourceItem.apps"></app-icons>
<br />
Expand Down Expand Up @@ -237,8 +243,8 @@ export default {
if (!this.resourceItem.test_summary) {
// replace the trailing file name "rdf.yaml" into "test_summary.yaml"
const url = this.resourceItem.source.replace(
/rdf\.yaml$/,
"test_summary.yaml"
/\/files\/rdf\.yaml$/,
"/test_summary.yaml"
);
fetchTestSummary(url).then(summary => {
this.resourceItem.test_summary = summary;
Expand Down
2 changes: 1 addition & 1 deletion src/components/TestSummary.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="test-summary">
<div class="test-summary" v-if="Object.keys(summary.tests).length > 1">
It has been tested with:
<code
v-for="(tests, consumer) in summary.tests"
Expand Down
4 changes: 3 additions & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export const store = new Vuex.Store({
typeof author === "string" ? { name: author } : author
);
if (item.source && !item.source.startsWith("http")) {
item.source = encodeURI(concatAndResolveUrl(item.root_url, item.source));
item.source = encodeURI(
concatAndResolveUrl(item.root_url, item.source)
);
}
item.config = item.config || {};
if (item.owners) {
Expand Down

0 comments on commit f3bc952

Please sign in to comment.