feat(core): Show Public API key value only once (no-changelog) (#10126)

This commit is contained in:
Ricardo Espinoza
2024-07-29 14:13:54 -04:00
committed by GitHub
parent de50ef7590
commit cf70b06545
7 changed files with 42 additions and 14 deletions

View File

@@ -6,13 +6,14 @@
[$style.copyText]: true,
[$style[size]]: true,
[$style.collapsed]: collapse,
[$style.noHover]: disableCopy,
'ph-no-capture': redactValue,
}"
data-test-id="copy-input"
@click="copy"
>
<span ref="copyInputValue">{{ value }}</span>
<div :class="$style.copyButton">
<div v-if="!disableCopy" :class="$style.copyButton">
<span>{{ copyButtonText }}</span>
</div>
</div>
@@ -36,6 +37,7 @@ type Props = {
size?: 'medium' | 'large';
collapse?: boolean;
redactValue?: boolean;
disableCopy: boolean;
};
const props = withDefaults(defineProps<Props>(), {
@@ -46,6 +48,7 @@ const props = withDefaults(defineProps<Props>(), {
size: 'medium',
copyButtonText: useI18n().baseText('generic.copy'),
toastTitle: useI18n().baseText('generic.copiedToClipboard'),
disableCopy: false,
});
const emit = defineEmits<{
copy: [];
@@ -55,6 +58,8 @@ const clipboard = useClipboard();
const { showMessage } = useToast();
function copy() {
if (props.disableCopy) return;
emit('copy');
void clipboard.copy(props.value ?? '');
@@ -88,6 +93,10 @@ function copy() {
}
}
.noHover {
cursor: default;
}
.large {
span {
font-size: var(--font-size-s);