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:
@@ -84,7 +84,6 @@ import GiftedDialog from "../components/GiftedDialog.vue";
|
||||
import InfiniteScroll from "../components/InfiniteScroll.vue";
|
||||
import QuickNav from "../components/QuickNav.vue";
|
||||
import { NotificationIface } from "../constants/app";
|
||||
import * as databaseUtil from "../db/databaseUtil";
|
||||
import { Contact } from "../db/tables/contacts";
|
||||
import { Router } from "vue-router";
|
||||
import { OfferToPlanSummaryRecord } from "../interfaces";
|
||||
@@ -95,13 +94,17 @@ import {
|
||||
} from "../libs/endorserServer";
|
||||
import { retrieveAccountDids } from "../libs/util";
|
||||
import { logger } from "../utils/logger";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
|
||||
@Component({
|
||||
components: { EntityIcon, GiftedDialog, InfiniteScroll, QuickNav },
|
||||
mixins: [PlatformServiceMixin],
|
||||
})
|
||||
export default class RecentOffersToUserView extends Vue {
|
||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||
$router!: Router;
|
||||
|
||||
notify!: ReturnType<typeof createNotifyHelpers>;
|
||||
activeDid = "";
|
||||
allContacts: Array<Contact> = [];
|
||||
allMyDids: string[] = [];
|
||||
@@ -116,20 +119,16 @@ export default class RecentOffersToUserView extends Vue {
|
||||
displayAmount = displayAmount;
|
||||
|
||||
async created() {
|
||||
this.notify = createNotifyHelpers(this.$notify);
|
||||
|
||||
try {
|
||||
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
const settings = await this.$accountSettings();
|
||||
this.apiServer = settings.apiServer || "";
|
||||
this.activeDid = settings.activeDid || "";
|
||||
this.lastAckedOfferToUserProjectsJwtId =
|
||||
settings.lastAckedOfferToUserProjectsJwtId || "";
|
||||
|
||||
const contactQueryResult =
|
||||
await PlatformServiceFactory.getInstance().dbQuery(
|
||||
"SELECT * FROM contacts",
|
||||
);
|
||||
this.allContacts = databaseUtil.mapQueryResultToValues(
|
||||
contactQueryResult,
|
||||
) as unknown as Contact[];
|
||||
this.allContacts = await this.$getAllContacts();
|
||||
|
||||
this.allMyDids = await retrieveAccountDids();
|
||||
|
||||
@@ -146,14 +145,9 @@ export default class RecentOffersToUserView extends Vue {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} catch (err: any) {
|
||||
logger.error("Error retrieving settings & contacts:", err);
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Error",
|
||||
text: err.message || "There was an error retrieving your activity.",
|
||||
},
|
||||
5000,
|
||||
this.notify.error(
|
||||
err.message || "There was an error retrieving your activity.",
|
||||
TIMEOUTS.LONG,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user