refactor: standardize notify helper usage and document migration workflow

- Refactor notify usage in GiftedDialog.vue, AccountViewView.vue, ClaimView.vue, and DataExportSection.vue:
  • Use notify as a property initialized in created() with createNotifyHelpers(this.$notify)
  • Remove getter-based notify patterns for consistency and lifecycle safety
  • Fix linter/type errors related to notify property initialization

- Add mandatory per-file migration workflow to doc/migration-progress-tracker.md:
  • For each file: (1) migrate to PlatformServiceMixin, (2) immediately standardize notify usage and fix linter/type errors
  • Clarifies this two-step process is required for every file, not as a global sweep

All migrated files are now consistent, maintainable, and ready for further migration work.
This commit is contained in:
Matthew Raymer
2025-07-06 11:56:12 +00:00
parent b8ee2464ba
commit 6d85c54a02
8 changed files with 76 additions and 125 deletions

View File

@@ -817,6 +817,10 @@ import {
const inputImportFileNameRef = ref<Blob>();
interface UserNameDialogRef {
open: (cb: (name?: string) => void) => void;
}
@Component({
components: {
EntityIcon,
@@ -908,6 +912,10 @@ export default class AccountViewView extends Vue {
private profileService!: ProfileService;
private notify!: ReturnType<typeof createNotifyHelpers>;
created() {
this.notify = createNotifyHelpers(this.$notify);
}
/**
* Async function executed when the component is mounted.
* Initializes the component's state with values from the database,
@@ -916,7 +924,6 @@ export default class AccountViewView extends Vue {
* @throws Will display specific messages to the user based on different errors.
*/
async mounted(): Promise<void> {
this.notify = createNotifyHelpers(this.$notify);
this.profileService = createProfileService(
this.axios,
this.partnerApiServer,
@@ -1601,7 +1608,7 @@ export default class AccountViewView extends Vue {
// IdentitySection event handlers
onEditName() {
const dialog = this.$refs.userNameDialog as any;
const dialog = this.$refs.userNameDialog as UserNameDialogRef | undefined;
if (dialog && typeof dialog.open === "function") {
dialog.open((name?: string) => {
if (name) this.givenName = name;
@@ -1613,7 +1620,10 @@ export default class AccountViewView extends Vue {
title: "Dialog Error",
text: "Name dialog not available.",
});
console.error("UserNameDialog ref is missing or open() is not a function", dialog);
logger.error(
"UserNameDialog ref is missing or open() is not a function",
dialog,
);
}
}
onShowQrCode() {