Skip to content

Commit

Permalink
UI tweaks from review
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Jun 27, 2024
1 parent a576227 commit b34ed78
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/static/src/app/components/code/CodeTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
</div>
<error-info :error="error"></error-info>
<div class="mt-3">
<vertical-collapse v-if="showSelectedVariables" title="Select variables" collapse-id="select-variables">
<vertical-collapse v-if="showSelectedVariables" title="Graphs" collapse-id="select-variables">
<div class="ms-2">
Drag variables to move to another graph, or to hide variable.
Drag variables to 'Hidden variables' to remove them from your graph, or click 'Add Graph' to create a
new graph to move them to.
</div>
<selected-variables
v-for="(_, index) in graphsConfig"
Expand All @@ -26,12 +27,14 @@
:dragging="draggingVariable"
@setDragging="setDraggingVariable"
></selected-variables>
<button class="btn btn-primary mt-2 ms-2" id="add-graph-btn" @click="addGraph">
<vue-feather size="20" class="inline-icon" type="plus"></vue-feather>
Add Graph
</button>
<hidden-variables
@setDragging="setDraggingVariable"
:dragging="draggingVariable"
style="clear: both"
></hidden-variables>
<button class="btn btn-primary mt-2 float-end" id="add-graph-btn" @click="addGraph">Add Graph</button>
</vertical-collapse>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions app/static/src/app/components/code/SelectedVariables.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
@dragend="endDrag"
>
{{ variable }}
<span class="variable-delete">
<button @click="removeVariable(graphIndex, variable)" v-tooltip="'Remove variable'">×</button>
</span>
</span>
</template>
<div v-if="!selectedVariables.length" style="height: 3rem; background-color: #eee" class="p-2 me-4">
Expand Down Expand Up @@ -101,6 +104,7 @@ export default defineComponent({
return {
selectedVariables,
removeVariable,
getStyle,
startDrag,
endDrag,
Expand Down
15 changes: 15 additions & 0 deletions app/static/src/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,19 @@ $grey: #ccc;

.drop-zone-inactive {
border-color: #fff;
}

.variable-delete {
font-weight: normal;
margin-left: 0.3rem;
span {
opacity: 0.5;
}

button {
background-color: transparent;
border-width: 0;
color: white;
padding: 0;
}
}

0 comments on commit b34ed78

Please sign in to comment.