forked from jsnbuchanan/crowd-funder-for-time-pwa
Complete ContactsView Enhanced Triple Migration Pattern (3 minutes)
- Remove legacy logConsoleAndDb import and 8 usage calls - Replace with PlatformServiceMixin () method - Component now technically compliant with zero legacy patterns - Maintains existing notification helpers and database operations - Performance: 80% faster than estimated (3 min vs 15-20 min)
This commit is contained in:
@@ -135,7 +135,7 @@ import ContactListHeader from "../components/ContactListHeader.vue";
|
|||||||
import ContactBulkActions from "../components/ContactBulkActions.vue";
|
import ContactBulkActions from "../components/ContactBulkActions.vue";
|
||||||
import LargeIdenticonModal from "../components/LargeIdenticonModal.vue";
|
import LargeIdenticonModal from "../components/LargeIdenticonModal.vue";
|
||||||
import { APP_SERVER, AppString, NotificationIface } from "../constants/app";
|
import { APP_SERVER, AppString, NotificationIface } from "../constants/app";
|
||||||
import { logConsoleAndDb } from "../db/index";
|
// Legacy logging import removed - using PlatformServiceMixin methods
|
||||||
import { Contact } from "../db/tables/contacts";
|
import { Contact } from "../db/tables/contacts";
|
||||||
import { getContactJwtFromJwtUrl } from "../libs/crypto";
|
import { getContactJwtFromJwtUrl } from "../libs/crypto";
|
||||||
import { decodeEndorserJwt } from "../libs/crypto/vc";
|
import { decodeEndorserJwt } from "../libs/crypto/vc";
|
||||||
@@ -383,7 +383,7 @@ export default class ContactsView extends Vue {
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
const fullError = "Error redeeming invite: " + errorStringForLog(error);
|
const fullError = "Error redeeming invite: " + errorStringForLog(error);
|
||||||
logConsoleAndDb(fullError, true);
|
this.$logAndConsole(fullError, true);
|
||||||
let message = "Got an error sending the invite.";
|
let message = "Got an error sending the invite.";
|
||||||
if (
|
if (
|
||||||
error.response &&
|
error.response &&
|
||||||
@@ -566,7 +566,7 @@ export default class ContactsView extends Vue {
|
|||||||
this.givenToMeUnconfirmed = givenToMeUnconfirmed;
|
this.givenToMeUnconfirmed = givenToMeUnconfirmed;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const fullError = "Error loading gives: " + errorStringForLog(error);
|
const fullError = "Error loading gives: " + errorStringForLog(error);
|
||||||
logConsoleAndDb(fullError, true);
|
this.$logAndConsole(fullError, true);
|
||||||
this.notify.error(NOTIFY_GIVES_LOAD_ERROR.message);
|
this.notify.error(NOTIFY_GIVES_LOAD_ERROR.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -639,7 +639,7 @@ export default class ContactsView extends Vue {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
const fullError =
|
const fullError =
|
||||||
"Error adding contacts from CSV: " + errorStringForLog(e);
|
"Error adding contacts from CSV: " + errorStringForLog(e);
|
||||||
logConsoleAndDb(fullError, true);
|
this.$logAndConsole(fullError, true);
|
||||||
this.notify.error(NOTIFY_CONTACTS_ADD_ERROR.message);
|
this.notify.error(NOTIFY_CONTACTS_ADD_ERROR.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -727,7 +727,7 @@ export default class ContactsView extends Vue {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
const fullError =
|
const fullError =
|
||||||
"Error adding contacts from array: " + errorStringForLog(e);
|
"Error adding contacts from array: " + errorStringForLog(e);
|
||||||
logConsoleAndDb(fullError, true);
|
this.$logAndConsole(fullError, true);
|
||||||
this.notify.error(NOTIFY_CONTACT_INPUT_PARSE_ERROR.message);
|
this.notify.error(NOTIFY_CONTACT_INPUT_PARSE_ERROR.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -872,7 +872,7 @@ export default class ContactsView extends Vue {
|
|||||||
private handleContactAddError(err: any): void {
|
private handleContactAddError(err: any): void {
|
||||||
const fullError =
|
const fullError =
|
||||||
"Error when adding contact to storage: " + errorStringForLog(err);
|
"Error when adding contact to storage: " + errorStringForLog(err);
|
||||||
logConsoleAndDb(fullError, true);
|
this.$logAndConsole(fullError, true);
|
||||||
|
|
||||||
let message = NOTIFY_CONTACT_IMPORT_ERROR.message;
|
let message = NOTIFY_CONTACT_IMPORT_ERROR.message;
|
||||||
if (
|
if (
|
||||||
@@ -918,7 +918,7 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const fullError = "Error when registering: " + errorStringForLog(error);
|
const fullError = "Error when registering: " + errorStringForLog(error);
|
||||||
logConsoleAndDb(fullError, true);
|
this.$logAndConsole(fullError, true);
|
||||||
let userMessage = NOTIFY_REGISTRATION_ERROR_GENERIC.message;
|
let userMessage = NOTIFY_REGISTRATION_ERROR_GENERIC.message;
|
||||||
const serverError = error as AxiosError;
|
const serverError = error as AxiosError;
|
||||||
if (serverError.isAxiosError) {
|
if (serverError.isAxiosError) {
|
||||||
@@ -1085,7 +1085,7 @@ export default class ContactsView extends Vue {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
const fullError =
|
const fullError =
|
||||||
"Error updating contact-amounts setting: " + errorStringForLog(err);
|
"Error updating contact-amounts setting: " + errorStringForLog(err);
|
||||||
logConsoleAndDb(fullError, true);
|
this.$logAndConsole(fullError, true);
|
||||||
// Use notification helper and constant
|
// Use notification helper and constant
|
||||||
this.notify.error(
|
this.notify.error(
|
||||||
NOTIFY_CONTACT_SETTING_SAVE_ERROR.message,
|
NOTIFY_CONTACT_SETTING_SAVE_ERROR.message,
|
||||||
@@ -1225,7 +1225,7 @@ export default class ContactsView extends Vue {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logConsoleAndDb(
|
this.$logAndConsole(
|
||||||
"Error checking meeting status:" + errorStringForLog(error),
|
"Error checking meeting status:" + errorStringForLog(error),
|
||||||
);
|
);
|
||||||
// Use notification helper
|
// Use notification helper
|
||||||
|
|||||||
Reference in New Issue
Block a user