Skip to content

Commit

Permalink
replace highlighted button icons with whole card border
Browse files Browse the repository at this point in the history
remove unused imports
  • Loading branch information
ahmedhamidawan committed Oct 23, 2023
1 parent 76ad096 commit cf3dfad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
8 changes: 6 additions & 2 deletions client/src/components/History/Content/ContentItem.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
:id="contentId"
:class="['content-item m-1 p-0 rounded btn-transparent-background', contentCls]"
:class="['content-item m-1 p-0 rounded btn-transparent-background', contentCls, isBeingUsed]"
:data-hid="id"
:data-state="state"
tabindex="0"
Expand Down Expand Up @@ -211,6 +211,9 @@ export default {
visualize: `/visualizations?dataset_id=${id}`,
};
},
isBeingUsed() {
return Object.values(this.itemUrls).includes(this.$route.path) ? "being-used" : "";
},
},
methods: {
onKeyDown(event) {
Expand Down Expand Up @@ -286,7 +289,8 @@ export default {
}
// improve focus visibility
&:deep(.btn:focus) {
&:deep(.btn:focus),
&.being-used {
box-shadow: 0 0 0 0.2rem transparentize($brand-primary, 0.75);
}
}
Expand Down
15 changes: 3 additions & 12 deletions client/src/components/History/Content/ContentOptions.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<script setup lang="ts">
import { BDropdown } from "bootstrap-vue";
import { computed, type Ref, ref } from "vue";
import { useRoute } from "vue-router/composables";
import { prependPath } from "@/utils/redirect";
const route = useRoute();
const props = defineProps({
writable: { type: Boolean, default: true },
isDataset: { type: Boolean, required: true },
Expand Down Expand Up @@ -49,12 +46,6 @@ const canShowCollectionDetails = computed(() => props.itemUrls.showDetails);
const showCollectionDetailsUrl = computed(() => prependPath(props.itemUrls.showDetails));
const isDisplaying = computed(() => route.path === displayUrl.value);
const isEditing = computed(() => route.path === editUrl.value);
const isShowingDetails = computed(() => route.path === showCollectionDetailsUrl.value);
const tabindex = computed(() => (props.keyboardSelectable ? "0" : "-1"));
function onDelete($event: MouseEvent) {
Expand Down Expand Up @@ -93,7 +84,7 @@ function onDisplay($event: MouseEvent) {
class="collection-job-details-btn px-1"
title="Show Details"
size="sm"
:variant="!isShowingDetails ? 'link' : 'primary'"
variant="link"
:href="showCollectionDetailsUrl"
@click.prevent.stop="emit('showCollectionInfo')">
<icon icon="info-circle" />
Expand All @@ -106,7 +97,7 @@ function onDisplay($event: MouseEvent) {
:tabindex="tabindex"
class="display-btn px-1"
size="sm"
:variant="!isDisplaying ? 'link' : 'primary'"
variant="link"
:href="displayUrl"
@click.prevent.stop="onDisplay($event)">
<icon icon="eye" />
Expand All @@ -118,7 +109,7 @@ function onDisplay($event: MouseEvent) {
:tabindex="tabindex"
class="edit-btn px-1"
size="sm"
:variant="!isEditing ? 'link' : 'primary'"
variant="link"
:href="editUrl"
@click.prevent.stop="emit('edit')">
<icon icon="pen" />
Expand Down

0 comments on commit cf3dfad

Please sign in to comment.