Skip to content

Commit

Permalink
Better handle case where block in database is not implemented by app/API
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Oct 15, 2024
1 parent 389eae1 commit 4054f52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions webapp/src/components/datablocks/DataBlockBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
/>
<input v-model="BlockTitle" class="form-control-plaintext block-title" type="text" />
<span class="blocktype-label ml-auto mr-3">{{ blockType }}</span>
<span class="block-header-icon"><StyledBlockInfo :block-info="blockInfo" /></span>
<span v-if="blockInfo" class="block-header-icon"
><StyledBlockInfo :block-info="blockInfo"
/></span>
<font-awesome-icon
:icon="['fa', 'sync']"
class="block-header-icon"
Expand Down Expand Up @@ -170,7 +172,7 @@ export default {
return this.$store.state.updatingDelayed[this.block_id];
},
blockInfo() {
return this.$store.state.blocksInfos[this.blockType];
return this.$store.state.blocksInfos?.[this.blockType];
},
BlockTitle: createComputedSetterForBlockField("title"),
BlockDescription: createComputedSetterForBlockField("freeform_comment"),
Expand Down
5 changes: 4 additions & 1 deletion webapp/src/components/datablocks/NotImplementedBlock.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<DataBlockBase>
<div class="alert alert-danger">This block type has not been implemented!</div>
<div class="alert alert-danger">
This block type is not implemented/installed for this <i>datalab</i> instance. Please contact
your <i>datalab</i> administrator.
</div>
</DataBlockBase>
</template>

Expand Down

0 comments on commit 4054f52

Please sign in to comment.