Skip to content

Commit 2281a70

Browse files
committed
Standardize "open in new tab" functionality across interactive tools
Added new tab icon button to panel view and removed "(new tab)" text from center, replacing with consistent external link icons.
1 parent 7ecbdb4 commit 2281a70

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

client/src/components/InteractiveTools/InteractiveTools.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,16 @@ onMounted(() => {
125125
:name="row.item.name"
126126
@click.prevent="openInteractiveTool(row.item.id)"
127127
>{{ row.item.name }}
128-
<FontAwesomeIcon :icon="faExternalLinkAlt" />
129128
</a>
130-
<!-- Add a direct link option as well -->
131129
<a
130+
v-if="row.item.target"
132131
:id="createId('external-link', row.item.id)"
133132
v-b-tooltip
134133
class="ml-2"
135134
title="Open in new tab"
136135
:href="row.item.target"
137136
target="_blank">
138-
<small>(new tab)</small>
137+
<FontAwesomeIcon :icon="faExternalLinkAlt" />
139138
</a>
140139
</template>
141140
<template v-slot:cell(job_info)="row">

client/src/components/Panels/InteractiveToolsPanel.vue

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { faStop, faTools } from "@fortawesome/free-solid-svg-icons";
2+
import { faExternalLinkAlt, faStop, faTools } from "@fortawesome/free-solid-svg-icons";
33
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
44
import { storeToRefs } from "pinia";
55
import { computed, onMounted, ref } from "vue";
@@ -88,12 +88,22 @@ function openInteractiveTool(toolId: string) {
8888
| Created <UtcDate :date="tool.created_time" mode="elapsed" />
8989
</div>
9090
</div>
91-
<button
92-
class="btn btn-sm btn-link text-danger"
93-
title="Stop this interactive tool"
94-
@click="stopInteractiveTool(tool.id, tool.name)">
95-
<FontAwesomeIcon :icon="faStop" />
96-
</button>
91+
<div class="d-flex align-items-center">
92+
<a
93+
v-if="tool.target"
94+
:href="tool.target"
95+
target="_blank"
96+
class="btn btn-sm btn-link text-muted me-1"
97+
title="Open in new tab">
98+
<FontAwesomeIcon :icon="faExternalLinkAlt" />
99+
</a>
100+
<button
101+
class="btn btn-sm btn-link text-danger"
102+
title="Stop this interactive tool"
103+
@click="stopInteractiveTool(tool.id, tool.name)">
104+
<FontAwesomeIcon :icon="faStop" />
105+
</button>
106+
</div>
97107
</div>
98108
</div>
99109
</div>

0 commit comments

Comments
 (0)