refactor(core, editor): Remove legacy nodesAccess (no-changelog) (#9016)

This commit is contained in:
Iván Ovejero
2024-04-05 13:17:34 +02:00
committed by GitHub
parent ba986fb018
commit b8ab049932
39 changed files with 45 additions and 266 deletions

View File

@@ -12,9 +12,6 @@ export const credentialFactory = Factory.extend<ICredentialsResponse>({
name() {
return faker.company.name();
},
nodesAccess() {
return [];
},
type() {
return 'notionApi';
},

View File

@@ -68,7 +68,6 @@ export default defineComponent({
updatedAt: '',
type: '',
name: '',
nodesAccess: [],
sharedWith: [],
ownedBy: {} as IUser,
}),

View File

@@ -119,7 +119,6 @@ import type { ICredentialsResponse, IUser } from '@/Interface';
import type {
CredentialInformation,
ICredentialDataDecryptedObject,
ICredentialNodeAccess,
ICredentialsDecrypted,
ICredentialType,
INode,
@@ -165,10 +164,6 @@ import { isValidCredentialResponse, isCredentialModalState } from '@/utils/typeG
import { isExpression, isTestableExpression } from '@/utils/expressions';
import { useExternalHooks } from '@/composables/useExternalHooks';
interface NodeAccessMap {
[nodeType: string]: ICredentialNodeAccess | null;
}
export default defineComponent({
name: 'CredentialEdit',
components: {
@@ -212,7 +207,6 @@ export default defineComponent({
credentialName: '',
credentialData: {} as ICredentialDataDecryptedObject,
modalBus: createEventBus(),
nodeAccess: {} as NodeAccessMap,
isDeleting: false,
isSaving: false,
isTesting: false,
@@ -233,8 +227,6 @@ export default defineComponent({
isCredentialModalState(this.uiStore.modals[CREDENTIAL_EDIT_MODAL_KEY]) &&
this.uiStore.modals[CREDENTIAL_EDIT_MODAL_KEY].showAuthSelector === true;
this.setupNodeAccess();
if (this.mode === 'new' && this.credentialTypeName) {
this.credentialName = await this.credentialsStore.getNewCredentialName({
credentialTypeName: this.defaultCredentialTypeName,
@@ -765,7 +757,6 @@ export default defineComponent({
name: this.credentialName,
type: this.credentialTypeName!,
data: credentialData,
nodesAccess: [],
};
this.isRetesting = true;
@@ -817,7 +808,6 @@ export default defineComponent({
name: this.credentialName,
type: this.credentialTypeName!,
data: data as unknown as ICredentialDataDecryptedObject,
nodesAccess: [],
sharedWith,
ownedBy,
};
@@ -1091,7 +1081,6 @@ export default defineComponent({
if (credentialsForType) {
this.selectedCredential = credentialsForType.name;
this.resetCredentialData();
this.setupNodeAccess();
// Update current node auth type so credentials dropdown can be displayed properly
updateNodeAuthType(this.ndvStore.activeNode, type);
// Also update credential name but only if the default name is still used
@@ -1103,9 +1092,6 @@ export default defineComponent({
}
}
},
setupNodeAccess(): void {
this.nodeAccess = {};
},
resetCredentialData(): void {
if (!this.credentialType) {
return;

View File

@@ -51,7 +51,6 @@ export const newCredential = (
updatedAt: faker.date.past().toISOString(),
id: faker.string.alphanumeric({ length: 16 }),
name: faker.commerce.productName(),
nodesAccess: [],
...opts,
});
@@ -61,16 +60,6 @@ export const credentialsTelegram1: ICredentialsResponse = {
id: 'YaSKdvEcT1TSFrrr1',
name: 'Telegram account',
type: 'telegramApi',
nodesAccess: [
{
nodeType: 'n8n-nodes-base.telegram',
date: new Date('2023-11-23T14:26:07.962Z'),
},
{
nodeType: 'n8n-nodes-base.telegramTrigger',
date: new Date('2023-11-23T14:26:07.962Z'),
},
],
ownedBy: {
id: '713ef3e7-9e65-4b0a-893c-8a653cbb2c4f',
email: 'user@n8n.io',
@@ -86,16 +75,6 @@ export const credentialsTelegram2: ICredentialsResponse = {
id: 'YaSKdvEcT1TSFrrr2',
name: 'Telegram account',
type: 'telegramApi',
nodesAccess: [
{
nodeType: 'n8n-nodes-base.telegram',
date: new Date('2023-11-23T14:26:07.962Z'),
},
{
nodeType: 'n8n-nodes-base.telegramTrigger',
date: new Date('2023-11-23T14:26:07.962Z'),
},
],
ownedBy: {
id: '713ef3e7-9e65-4b0a-893c-8a653cbb2c4f',
email: 'user@n8n.io',