Merge branch 'build-improvement' into performance-optimizations-testing

This commit is contained in:
Matthew Raymer
2025-08-06 06:41:02 +00:00
19 changed files with 800 additions and 74 deletions

View File

@@ -35,17 +35,6 @@ import { IIdentifier } from "@veramo/core";
import { DEFAULT_ROOT_DERIVATION_PATH } from "./crypto";
// Consolidate this with src/utils/PlatformServiceMixin._parseJsonField
function parseJsonField<T>(value: unknown, defaultValue: T): T {
if (typeof value === "string") {
try {
return JSON.parse(value);
} catch {
return defaultValue;
}
}
return (value as T) || defaultValue;
}
function mapQueryResultToValues(
record: { columns: string[]; values: unknown[][] } | undefined,
): Array<Record<string, unknown>> {
@@ -806,7 +795,7 @@ export const contactToCsvLine = (contact: Contact): string => {
// Handle contactMethods array by stringifying it
const contactMethodsStr = contact.contactMethods
? escapeField(JSON.stringify(parseJsonField(contact.contactMethods, [])))
? escapeField(JSON.stringify(contact.contactMethods))
: "";
const fields = [
@@ -918,7 +907,7 @@ export const contactsToExportJson = (contacts: Contact[]): DatabaseExport => {
contact,
);
exContact.contactMethods = contact.contactMethods
? JSON.stringify(parseJsonField(contact.contactMethods, []))
? JSON.stringify(contact.contactMethods)
: undefined;
return exContact;
});

View File

@@ -11,7 +11,7 @@
class="px-4 py-2 rounded mr-2 transition-colors"
@click="testInsert"
>
Test Insert
Test Contact Insert
</button>
<button
:class="
@@ -22,7 +22,7 @@
class="px-4 py-2 rounded mr-2 transition-colors"
@click="testUpdate"
>
Test Update
Test Contact Update
</button>
<button
:class="
@@ -44,7 +44,7 @@
class="px-4 py-2 rounded mr-2 transition-colors"
@click="testDatabaseStorage"
>
Test Database Storage Format
Test SearchBox Database Storage -- Beware: Changes Your Search Box
</button>
<button
:class="

View File

@@ -1661,14 +1661,12 @@ export default class AccountViewView extends Vue {
}
onShareInfo() {
// Call the existing logic for sharing info, e.g., open the share dialog
this.openShareDialog();
}
// Placeholder for share dialog logic
openShareDialog() {
// TODO: Implement share dialog logic
this.notify.info("Share dialog not yet implemented.");
// Navigate to QR code sharing page - mobile uses full scan, web uses basic
if (Capacitor.isNativePlatform()) {
this.$router.push({ name: "contact-qr-scan-full" });
} else {
this.$router.push({ name: "contact-qr" });
}
}
onRecheckLimits() {

View File

@@ -151,7 +151,6 @@ import { getContactJwtFromJwtUrl } from "../libs/crypto";
import {
CONTACT_CSV_HEADER,
CONTACT_IMPORT_CONFIRM_URL_PATH_TIME_SAFARI,
generateEndorserJwtUrlForAccount,
register,
setVisibilityUtil,
} from "../libs/endorserServer";
@@ -162,7 +161,6 @@ import { logger } from "../utils/logger";
import { QRScannerFactory } from "@/services/QRScanner/QRScannerFactory";
import { CameraState } from "@/services/QRScanner/types";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
import { Account } from "@/db/tables/accounts";
import { createNotifyHelpers } from "@/utils/notify";
import {
NOTIFY_QR_INITIALIZATION_ERROR,
@@ -547,6 +545,7 @@ export default class ContactQRScanShow extends Vue {
name: contact.name,
});
this.notify.toast(
"Submitted",
NOTIFY_QR_REGISTRATION_SUBMITTED.message,
QR_TIMEOUT_SHORT,
);
@@ -611,20 +610,15 @@ export default class ContactQRScanShow extends Vue {
}
async onCopyUrlToClipboard() {
const account = (await libsUtil.retrieveFullyDecryptedAccount(
this.activeDid,
)) as Account;
const jwtUrl = await generateEndorserJwtUrlForAccount(
account,
this.isRegistered,
this.givenName,
this.profileImageUrl,
true,
);
// Copy the CSV format QR code value instead of generating a deep link
useClipboard()
.copy(jwtUrl)
.copy(this.qrValue)
.then(() => {
this.notify.toast(NOTIFY_QR_URL_COPIED.message, QR_TIMEOUT_MEDIUM);
this.notify.toast(
"Copied",
NOTIFY_QR_URL_COPIED.message,
QR_TIMEOUT_MEDIUM,
);
});
}

View File

@@ -189,7 +189,7 @@
{{
recipientDid
? "This was given to " + recipientName + "."
: "No individual benefitted."
: "No named individual benefitted."
}}
</label>
<font-awesome
@@ -626,6 +626,7 @@ export default class GiftedDetails extends Vue {
this.notify.toast(
NOTIFY_GIFTED_DETAILS_RECORDING_GIVE.message,
undefined,
TIMEOUTS.SHORT,
);

View File

@@ -1971,17 +1971,6 @@ export default class HomeView extends Vue {
(this.$refs.feedFilters as FeedFilters).open(this.reloadFeedOnChange);
}
/**
* Shows toast notification to user
*
* @internal
* Used for various user notifications
* @param message Message to display
*/
toastUser(message: string) {
this.notify.toast("FYI", message, TIMEOUTS.SHORT);
}
/**
* Computes CSS classes for known person icons
*

View File

@@ -638,16 +638,18 @@ export default class ProjectsView extends Vue {
* - Alternative sharing methods for remote users
*/
promptForShareMethod() {
this.notify.confirm(
NOTIFY_CAMERA_SHARE_METHOD.title,
NOTIFY_CAMERA_SHARE_METHOD.text,
this.$notify(
{
group: "modal",
type: "confirm",
title: NOTIFY_CAMERA_SHARE_METHOD.title,
text: NOTIFY_CAMERA_SHARE_METHOD.text,
onYes: () => this.handleQRCodeClick(),
onNo: () => this.$router.push({ name: "share-my-contact-info" }),
yesText: NOTIFY_CAMERA_SHARE_METHOD.yesText,
noText: NOTIFY_CAMERA_SHARE_METHOD.noText,
timeout: TIMEOUTS.MODAL,
},
TIMEOUTS.MODAL,
);
}