Skip to content

Commit

Permalink
Render errors and warnings from blocks in the UI rather than erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Feb 18, 2024
1 parent 2e33699 commit 6990bac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions webapp/src/components/datablocks/DataBlockBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,31 @@
:style="{ 'max-height': contentMaxHeight }"
class="datablock-content"
>
<!-- Show any warnings or errors reported by the block -->
<div
class="alert alert-danger d-flex align-items-center ml-3"
role="alert"
v-if="block.errors"
>
<ul class="fa-ul">
<li v-for="(error, index) in block.errors" :key="index">
<font-awesome-icon class="fa-li" icon="exclamation-circle" />
{{ error }}
</li>
</ul>
</div>
<div
class="alert alert-warning d-flex align-items-center ml-3"
role="alert"
v-if="block.warnings"
>
<ul class="fa-ul">
<li v-for="(warning, index) in block.warnings" :key="index">
<font-awesome-icon class="fa-li" icon="exclamation-triangle" />
{{ warning }}
</li>
</ul>
</div>
<slot></slot>
<TinyMceInline v-model="BlockDescription"></TinyMceInline>
</div>
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
faQuestionCircle,
faLink,
faUnlink,
faExclamationTriangle,
faExclamationCircle,
faListOl,
faSearch,
Expand Down Expand Up @@ -69,6 +70,7 @@ library.add(
faHdd,
faLink,
faUnlink,
faExclamationTriangle,
faExclamationCircle,
faListOl,
faSearch,
Expand Down

0 comments on commit 6990bac

Please sign in to comment.