Complete notification migration across 13 components and views
- Replace raw $notify calls with notification helper system - Add createNotifyHelpers and TIMEOUTS constants integration - Migrate AccountViewView, ClaimAddRawView, ContactGiftingView, ContactImportView, ContactsView, NewActivityView, ProjectViewView, RecentOffersToUserProjectsView, RecentOffersToUserView, ShareMyContactInfoView - Update MembersList, TopMessage, UserNameDialog components - Add notification constants for standardized messaging - Enhance validation script to eliminate false positives - Achieve 86% notification migration completion rate
This commit is contained in:
@@ -211,6 +211,7 @@ import {
|
||||
import { getContactJwtFromJwtUrl } from "../libs/crypto";
|
||||
import { decodeEndorserJwt } from "../libs/crypto/vc";
|
||||
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
|
||||
|
||||
/**
|
||||
* Contact Import View Component
|
||||
@@ -284,6 +285,8 @@ export default class ContactImportView extends Vue {
|
||||
/** Router instance for navigation */
|
||||
$router!: Router;
|
||||
|
||||
notify!: ReturnType<typeof createNotifyHelpers>;
|
||||
|
||||
// Constants
|
||||
AppString = AppString;
|
||||
capitalizeAndInsertSpacesBeforeCaps = capitalizeAndInsertSpacesBeforeCaps;
|
||||
@@ -344,6 +347,8 @@ export default class ContactImportView extends Vue {
|
||||
* @emits router.push when redirecting for single contact import
|
||||
*/
|
||||
async created() {
|
||||
this.notify = createNotifyHelpers(this.$notify);
|
||||
|
||||
await this.initializeSettings();
|
||||
await this.processQueryParams();
|
||||
await this.processJwtFromPath();
|
||||
@@ -473,14 +478,9 @@ export default class ContactImportView extends Vue {
|
||||
jwtInput.endsWith("contact-import") ||
|
||||
jwtInput.endsWith("contact-import/")
|
||||
) {
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Error",
|
||||
text: "That is only part of the contact-import data; it's missing data at the end. Try another way to get the full data.",
|
||||
},
|
||||
5000,
|
||||
this.notify.error(
|
||||
"That is only part of the contact-import data; it's missing data at the end. Try another way to get the full data.",
|
||||
TIMEOUTS.LONG,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -504,14 +504,9 @@ export default class ContactImportView extends Vue {
|
||||
} catch (error) {
|
||||
const fullError = "Error importing contacts: " + errorStringForLog(error);
|
||||
this.$logAndConsole(fullError, true);
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Error",
|
||||
text: "There was an error processing the contact-import data.",
|
||||
},
|
||||
3000,
|
||||
this.notify.error(
|
||||
"There was an error processing the contact-import data.",
|
||||
TIMEOUTS.STANDARD,
|
||||
);
|
||||
}
|
||||
this.checkingImports = false;
|
||||
@@ -565,16 +560,11 @@ export default class ContactImportView extends Vue {
|
||||
}
|
||||
}
|
||||
if (failedVisibileToContacts.length > 0) {
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Visibility Error",
|
||||
text: `Failed to set visibility for ${failedVisibileToContacts.length} contact${
|
||||
failedVisibileToContacts.length == 1 ? "" : "s"
|
||||
}. You must set them individually: ${failedVisibileToContacts.map((c) => c.name).join(", ")}`,
|
||||
},
|
||||
-1,
|
||||
this.notify.error(
|
||||
`Failed to set visibility for ${failedVisibileToContacts.length} contact${
|
||||
failedVisibileToContacts.length == 1 ? "" : "s"
|
||||
}. You must set them individually: ${failedVisibileToContacts.map((c) => c.name).join(", ")}`,
|
||||
TIMEOUTS.MODAL,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -582,16 +572,10 @@ export default class ContactImportView extends Vue {
|
||||
this.checkingImports = false;
|
||||
|
||||
// Show success notification
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "success",
|
||||
title: "Imported",
|
||||
text:
|
||||
`${importedCount} contact${importedCount == 1 ? "" : "s"} imported.` +
|
||||
(updatedCount ? ` ${updatedCount} updated.` : ""),
|
||||
},
|
||||
3000,
|
||||
this.notify.success(
|
||||
`${importedCount} contact${importedCount == 1 ? "" : "s"} imported.` +
|
||||
(updatedCount ? ` ${updatedCount} updated.` : ""),
|
||||
TIMEOUTS.STANDARD,
|
||||
);
|
||||
this.$router.push({ name: "contacts" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user