feat(editor): Add correct credential owner contact details for readonly credentials (#5208)
* feat: add correct credential owner contact details for readonly credentials * chore: remove unnecessary translation * fix: update credential owner name to be retrieved using usedCredentials * fix: correct credentialownername getter typing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { INodeUi } from './../Interface';
|
||||
import { INodeUi, IUsedCredential } from './../Interface';
|
||||
import {
|
||||
createNewCredential,
|
||||
deleteCredential,
|
||||
@@ -177,13 +177,19 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, {
|
||||
};
|
||||
},
|
||||
getCredentialOwnerName() {
|
||||
return (credentialId: string): string => {
|
||||
const credential = this.getCredentialById(credentialId);
|
||||
return credential && credential.ownedBy && credential.ownedBy.firstName
|
||||
return (credential: ICredentialsResponse | IUsedCredential | undefined): string => {
|
||||
return credential?.ownedBy?.firstName
|
||||
? `${credential.ownedBy.firstName} ${credential.ownedBy.lastName} (${credential.ownedBy.email})`
|
||||
: i18n.baseText('credentialEdit.credentialSharing.info.sharee.fallback');
|
||||
};
|
||||
},
|
||||
getCredentialOwnerNameById() {
|
||||
return (credentialId: string): string => {
|
||||
const credential = this.getCredentialById(credentialId);
|
||||
|
||||
return this.getCredentialOwnerName(credential);
|
||||
};
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setCredentialTypes(credentialTypes: ICredentialType[]): void {
|
||||
|
||||
Reference in New Issue
Block a user