mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix: Rename button in ApiKeyCreateOrEditModal and remove redundant scope (no-changelog) (#14811)
This commit is contained in:
@@ -33,7 +33,6 @@ export const OWNER_API_KEY_SCOPES: ApiKeyScope[] = [
|
||||
'execution:delete',
|
||||
'execution:read',
|
||||
'execution:list',
|
||||
'execution:get',
|
||||
'credential:create',
|
||||
'credential:move',
|
||||
'credential:delete',
|
||||
@@ -59,7 +58,6 @@ export const MEMBER_API_KEY_SCOPES: ApiKeyScope[] = [
|
||||
'execution:delete',
|
||||
'execution:read',
|
||||
'execution:list',
|
||||
'execution:get',
|
||||
'credential:create',
|
||||
'credential:move',
|
||||
'credential:delete',
|
||||
|
||||
@@ -329,11 +329,11 @@ describe('ApiKeyCreateOrEditModal', () => {
|
||||
|
||||
await fireEvent.update(labelInput, 'updated api key');
|
||||
|
||||
const editButton = getByText('Edit');
|
||||
const saveButton = getByText('Save');
|
||||
|
||||
expect(editButton).toBeInTheDocument();
|
||||
expect(saveButton).toBeInTheDocument();
|
||||
|
||||
await fireEvent.click(editButton);
|
||||
await fireEvent.click(saveButton);
|
||||
|
||||
expect(apiKeysStore.updateApiKey).toHaveBeenCalledWith('123', {
|
||||
label: 'updated api key',
|
||||
|
||||
@@ -119,7 +119,9 @@ onMounted(() => {
|
||||
const apiKey = apiKeysById[props.activeId];
|
||||
label.value = apiKey.label ?? '';
|
||||
apiKeyCreationDate.value = getApiKeyCreationTime(apiKey);
|
||||
selectedScopes.value = !apiKeyScopesEnabled.value ? apiKeyStore.availableScopes : apiKey.scopes;
|
||||
selectedScopes.value = !apiKeyScopesEnabled.value
|
||||
? apiKeyStore.availableScopes
|
||||
: apiKey.scopes.filter((scope) => apiKeyStore.availableScopes.includes(scope));
|
||||
}
|
||||
|
||||
if (props.mode === 'new' && !apiKeyScopesEnabled.value) {
|
||||
@@ -343,7 +345,7 @@ async function handleEnterKey(event: KeyboardEvent) {
|
||||
<N8nButton
|
||||
v-if="mode === 'edit'"
|
||||
:disabled="!allFormFieldsAreSet"
|
||||
:label="i18n.baseText('settings.api.view.modal.edit.button')"
|
||||
:label="i18n.baseText('settings.api.view.modal.save.button')"
|
||||
@click="onEdit"
|
||||
/>
|
||||
<N8nText v-if="mode === 'edit'" size="small" color="text-light">{{
|
||||
|
||||
@@ -1989,7 +1989,6 @@
|
||||
"settings.api.view.modal.title.create": "Create API Key",
|
||||
"settings.api.view.modal.title.edit": "Edit API Key",
|
||||
"settings.api.view.modal.done.button": "Done",
|
||||
"settings.api.view.modal.edit.button": "Edit",
|
||||
"settings.api.view.modal.save.button": "Save",
|
||||
"settings.api.scopes.placeholder": "Select",
|
||||
"settings.api.scopes.selectAll": "Select All",
|
||||
|
||||
Reference in New Issue
Block a user