feat(editor): Add scrolling to API keys list (no-changelog) (#13658)

This commit is contained in:
Ricardo Espinoza 2025-03-04 12:43:02 +01:00 committed by GitHub
parent 2a5738aebe
commit 2c03f8640e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 71 additions and 46 deletions

View file

@ -198,6 +198,16 @@ const onSelect = (value: number) => {
expirationDate.value = '';
showExpirationDateSelector.value = false;
};
async function handleEnterKey(event: KeyboardEvent) {
if (event.key === 'Enter') {
if (props.mode === 'new') {
await onSave();
} else {
await onEdit();
}
}
}
</script>
<template>
@ -212,7 +222,7 @@ const onSelect = (value: number) => {
:show-close="true"
>
<template #content>
<div>
<div @keyup.enter="handleEnterKey">
<n8n-card v-if="newApiKey" class="mb-4xs">
<CopyInput
:label="newApiKey.label"

View file

@ -138,17 +138,21 @@ function onEdit(id: string) {
</i18n-t>
</n8n-text>
</p>
<div :class="$style.apiKeysContainer">
<template v-if="apiKeysSortByCreationDate.length">
<el-row
v-for="apiKey in apiKeysSortByCreationDate"
v-for="(apiKey, index) in apiKeysSortByCreationDate"
:key="apiKey.id"
:gutter="10"
:class="$style.destinationItem"
:class="[{ [$style.destinationItem]: index !== apiKeysSortByCreationDate.length - 1 }]"
>
<el-col>
<ApiKeyCard :api-key="apiKey" @delete="onDelete" @edit="onEdit" />
</el-col>
</el-row>
</template>
</div>
<div v-if="isPublicApiEnabled && apiKeysSortByCreationDate.length" :class="$style.BottomHint">
<N8nText size="small" color="text-light">
@ -179,14 +183,17 @@ function onEdit(id: string) {
</n8n-link>
</div>
<div class="mt-m text-right">
<n8n-button size="large" @click="onCreateApiKey">
<n8n-button
v-if="isPublicApiEnabled && apiKeysSortByCreationDate.length"
size="large"
@click="onCreateApiKey"
>
{{ i18n.baseText('settings.api.create.button') }}
</n8n-button>
</div>
</template>
<n8n-action-box
v-else-if="!isPublicApiEnabled && cloudPlanStore.userIsTrialing"
v-if="!isPublicApiEnabled && cloudPlanStore.userIsTrialing"
data-test-id="public-api-upgrade-cta"
:heading="i18n.baseText('settings.api.trial.upgradePlan.title')"
:description="i18n.baseText('settings.api.trial.upgradePlan.description')"
@ -246,5 +253,13 @@ function onEdit(id: string) {
.BottomHint {
margin-bottom: var(--spacing-s);
margin-top: var(--spacing-s);
}
.apiKeysContainer {
max-height: 45vh;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: none;
}
</style>