Skip to content

Commit

Permalink
Fixed: Edit Button not Appearing After Experiment Publication
Browse files Browse the repository at this point in the history
Now that we handle this button state by asking the backend whether a user has permission for a certain
action, it doesn't make sense to base the div component's visibility off the publication date of the
experiment. Make the div visible always, and control the button visibility conditionally based on
backend responses.
  • Loading branch information
bencap committed Oct 28, 2024
1 parent 80ca380 commit c9c9561
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/screens/ExperimentView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
<div class="mave-screen-title-bar">
<div class="mave-screen-title">{{ item.title || 'Untitled experiment' }}</div>
<div v-if="userIsAuthenticated">
<div v-if="!item.publishedDate" class="mave-screen-title-controls">
<div class="mave-screen-title-controls">
<Button v-if="userIsAuthorized.add_score_set" class="p-button-sm" @click="addScoreSet">Add a score set</Button>
<Button v-if="userIsAuthorized.update" class="p-button-sm" @click="editItem">Edit</Button>
<Button v-if="userIsAuthorized.delete" class="p-button-sm p-button-danger" @click="deleteItem">Delete</Button>
</div>
<div v-else>
<Button v-if="userIsAuthorized.add_score_set" class="p-button-sm" @click="addScoreSet">Add a score set</Button>
</div>
</div>
</div>
<div v-if="item.shortDescription" class="mave-score-set-description">{{ item.shortDescription }}</div>
Expand Down

0 comments on commit c9c9561

Please sign in to comment.