diff --git a/browser-extensions/chrome/src/pages/CredentialDetails.tsx b/browser-extensions/chrome/src/pages/CredentialDetails.tsx index 369c53fad..b7e482dfd 100644 --- a/browser-extensions/chrome/src/pages/CredentialDetails.tsx +++ b/browser-extensions/chrome/src/pages/CredentialDetails.tsx @@ -59,18 +59,17 @@ const CredentialDetails: React.FC = () => {
+

Login credentials

- - { type="password" />
+ +
+

Alias

+ + + + + {credential.Alias.NickName && ( + + )} +
+ + {credential.Notes && ( +
+

Notes

+
+

+ {credential.Notes} +

+
+
+ )} ); diff --git a/browser-extensions/chrome/src/types/Credential.ts b/browser-extensions/chrome/src/types/Credential.ts index fed03ae16..d5a7b459e 100644 --- a/browser-extensions/chrome/src/types/Credential.ts +++ b/browser-extensions/chrome/src/types/Credential.ts @@ -1,10 +1,18 @@ export type Credential = { Id: string; Username: string; - ServiceId: string; - ServiceName: string; - Email: string; - ServiceUrl: string; - Logo: Uint8Array; Password: string; + Email: string; + ServiceName: string; + ServiceUrl?: string; + Logo?: Uint8Array; + Notes?: string; + Alias: { + FirstName: string; + LastName: string; + NickName?: string; + BirthDate: string; + Gender?: string; + Email?: string; + }; } \ No newline at end of file diff --git a/browser-extensions/chrome/src/utils/SqliteClient.tsx b/browser-extensions/chrome/src/utils/SqliteClient.tsx index 86b0208f2..973527ba9 100644 --- a/browser-extensions/chrome/src/utils/SqliteClient.tsx +++ b/browser-extensions/chrome/src/utils/SqliteClient.tsx @@ -99,23 +99,48 @@ class SqliteClient { * @returns Array of Credential objects with service details */ public getAllCredentials(): Credential[] { - return this.executeQuery(` - SELECT + const query = ` + SELECT DISTINCT c.Id, c.Username, + c.Notes, c.ServiceId, s.Name as ServiceName, s.Url as ServiceUrl, s.Logo as Logo, - MAX(p.Value) as Password, - a.Email as Email + a.FirstName, + a.LastName, + a.NickName, + a.BirthDate, + a.Gender, + a.Email, + p.Value as Password FROM Credentials c - JOIN Services s ON s.Id = c.ServiceId + LEFT JOIN Services s ON c.ServiceId = s.Id + LEFT JOIN Aliases a ON c.AliasId = a.Id LEFT JOIN Passwords p ON p.CredentialId = c.Id - LEFT JOIN Aliases a ON a.Id = c.AliasId AND a.IsDeleted = 0 - WHERE c.IsDeleted = 0 - GROUP BY c.Id, c.Username, c.ServiceId, s.Name, s.Url, s.Logo - `); + WHERE c.IsDeleted = 0`; + + const results = this.executeQuery(query); + + return results.map((row: any) => ({ + Id: row.Id, + Username: row.Username, + Password: row.Password, + Email: row.Email, + ServiceName: row.ServiceName, + ServiceUrl: row.ServiceUrl, + Logo: row.Logo, + Notes: row.Notes, + Alias: { + FirstName: row.FirstName, + LastName: row.LastName, + NickName: row.NickName, + BirthDate: row.BirthDate, + Gender: row.Gender, + Email: row.Email + } + })); } /**