Skip to content

Commit bfa6bd3

Browse files
authored
[PLA-1671] fix settings api token copy (#84)
1 parent 569569e commit bfa6bd3

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

resources/js/components/CollapseCard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="bg-white shadow rounded-lg">
33
<div class="flex divide-x divide-gray-200 transition-all" :class="{ 'border-b border-gray-200': open }">
4-
<div class="flex justify-between px-4 py-5 flex-1" @click="toggleCard">
4+
<div class="flex justify-between px-4 py-5 flex-1 cursor-pointer" @click="toggleCard">
55
<div class="inline-flex">
66
<label>{{ title }}</label>
77
<slot name="icon" />
@@ -22,9 +22,9 @@
2222
<transition
2323
enter-active-class="duration-300"
2424
enter-from-class="transform opacity-0 max-h-0 delay-150"
25-
enter-to-class="opacity-100 max-h-[300px]"
25+
enter-to-class="opacity-100 max-h-[600px]"
2626
leave-active-class="duration-300"
27-
leave-from-class="opacity-100 max-h-[300px]"
27+
leave-from-class="opacity-100 max-h-[600px]"
2828
leave-to-class="transform opacity-0 max-h-0"
2929
>
3030
<slot v-if="open" />

resources/js/components/CopyTextIcon.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<ClipboardIcon class="inline-block ml-1 mb-1 w-4 h-4 cursor-pointer hover:text-primary" @click="copyText" />
2+
<div @click="copyText">
3+
<slot />
4+
<ClipboardIcon class="inline-block ml-1 my-auto w-4 h-4 cursor-pointer hover:text-primary flex-shrink-0" />
5+
</div>
36
</template>
47

58
<script setup lang="ts">

resources/js/components/pages/SettingsApiTokens.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,33 @@
3434
v-for="token in tokens"
3535
:key="token.name"
3636
>
37-
<div class="flex items-center">
37+
<div class="flex-1 truncate flex items-center">
3838
<KeyIcon class="w-5 h-5 mr-4 text-green-500" />
3939
<span class="text-gray-900 mr-4">{{ token.name }}</span>
40-
<span class="text-gray-400 text-sm mt-1">
41-
{{
42-
shortString(token.plainTextToken?.substring(token.plainTextToken?.indexOf('|') + 1 ?? 0)) ??
43-
'*******'
44-
}}
40+
<span class="text-gray-400 text-sm mt-1 truncate">
41+
<span v-if="!token.plainTextToken">
42+
{{ '*******' }}
43+
</span>
4544
<CopyTextIcon
4645
v-if="token.plainTextToken"
46+
ref="copyIconRef"
47+
class="cursor-pointer flex mr-4"
4748
:text="token.plainTextToken.substring(token.plainTextToken?.indexOf('|') + 1 ?? 0)"
48-
/>
49+
>
50+
<span class="truncate">
51+
{{ token.plainTextToken?.substring(token.plainTextToken?.indexOf('|') + 1 ?? 0) }}
52+
</span>
53+
</CopyTextIcon>
4954
</span>
5055
</div>
51-
<Btn :dusk="`btn__revoke-api-${token.name}`" error @click="confirmRevoke(token.name)"> Revoke </Btn>
56+
<Btn
57+
class="flex-shrink-0"
58+
:dusk="`btn__revoke-api-${token.name}`"
59+
error
60+
@click="confirmRevoke(token.name)"
61+
>
62+
Revoke
63+
</Btn>
5264
</div>
5365
</div>
5466

@@ -64,7 +76,7 @@
6476

6577
<script setup lang="ts">
6678
import { KeyIcon } from '@heroicons/vue/24/outline';
67-
import { shortString, snackbarErrors } from '~/util';
79+
import { snackbarErrors } from '~/util';
6880
import CopyTextIcon from '../CopyTextIcon.vue';
6981
import { computed, ref, watch } from 'vue';
7082
import { useAppStore } from '~/store';

0 commit comments

Comments
 (0)