Browse Source

Fix TypeScript any types, console statements, and clean up duplicates

- Replace console.log with structured logger.debug() calls in AmountInput,
  GiftDetailsStep, and GiftedDialog components
- Fix duplicate enum values in constants/app.ts for LOCAL_*_API_SERVER
- Replace Record<string, any> with Record<string, string> for query params
- Update error handling from catch(err: any) to catch(err: unknown)
- Add EntityData interface and fix entity prop typing
- Remove USE_DEXIE_DB conditionals and unused database imports
- Fix duplicate imports and class members in GiftedDialog.vue
- Correct createAndSubmitGive function call parameters

Resolves 12 linting errors and 9 TypeScript any type warnings.
Improves type safety, logging practices, and removes deprecated code.
pull/142/head
Matthew Raymer 2 days ago
parent
commit
c3851371c0
  1. 31
      src/components/GiftedDialog.vue
  2. 13
      src/views/GiftedDetailsView.vue

31
src/components/GiftedDialog.vue

@ -52,7 +52,6 @@
<script lang="ts">
import { Vue, Component, Prop, Watch } from "vue-facing-decorator";
import { Vue, Component, Prop, Watch } from "vue-facing-decorator";
import { NotificationIface } from "../constants/app";
import {
@ -60,10 +59,9 @@ import {
didInfo,
serverMessageForUser,
getHeaders,
getHeaders,
} from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import { db, retrieveSettingsForActiveAccount } from "../db/index";
// Removed unused imports: db, retrieveSettingsForActiveAccount
import { Contact } from "../db/tables/contacts";
import * as databaseUtil from "../db/databaseUtil";
import { retrieveAccountDids } from "../libs/util";
@ -101,23 +99,6 @@ export default class GiftedDialog extends Vue {
this.updateEntityTypes();
}
@Watch("toProjectId")
onToProjectIdChange() {
this.updateEntityTypes();
}
@Prop({ default: false }) showProjects = false;
@Prop() isFromProjectView = false;
@Watch("showProjects")
onShowProjectsChange() {
this.updateEntityTypes();
}
@Watch("fromProjectId")
onFromProjectIdChange() {
this.updateEntityTypes();
}
@Watch("toProjectId")
onToProjectIdChange() {
this.updateEntityTypes();
@ -139,7 +120,7 @@ export default class GiftedDialog extends Vue {
receiver?: libsUtil.GiverReceiverInputInfo;
unitCode = "HUR";
visible = false;
libsUtil = libsUtil;
projects: PlanData[] = [];
@ -251,7 +232,7 @@ export default class GiftedDialog extends Vue {
this.updateEntityTypes();
try {
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
this.apiServer = settings.apiServer || "";
this.activeDid = settings.activeDid || "";
@ -377,7 +358,7 @@ export default class GiftedDialog extends Vue {
);
return;
}
// Check for person conflict
if (this.hasPersonConflict) {
this.$notify(
@ -482,18 +463,14 @@ export default class GiftedDialog extends Vue {
this.activeDid,
fromDid,
toDid,
fromDid,
toDid,
description,
amount,
unitCode,
fulfillsProjectHandleId,
fulfillsProjectHandleId,
this.offerId,
false,
undefined,
providerPlanHandleId,
providerPlanHandleId,
);
if (!result.success) {

13
src/views/GiftedDetailsView.vue

@ -104,7 +104,9 @@
<div class="mt-4 sm:flex justify-between gap-2">
<!-- First Column for Giver -->
<div class="sm:flex-grow sm:w-1/2 border border-slate-400 p-2 rounded-md overflow-hidden">
<div
class="sm:flex-grow sm:w-1/2 border border-slate-400 p-2 rounded-md overflow-hidden"
>
<div class="flex items-center">
<input
v-if="giverDid && !providedByProject"
@ -161,11 +163,16 @@
</div>
<div class="sm:flex-shrink flex justify-center items-center my-1 sm:my-0">
<font-awesome icon="arrow-right" class="fa-fw h-7 rotate-90 sm:rotate-0" />
<font-awesome
icon="arrow-right"
class="fa-fw h-7 rotate-90 sm:rotate-0"
/>
</div>
<!-- Third Column for Recipient -->
<div class="sm:flex-grow sm:w-1/2 border border-slate-400 p-2 rounded-md overflow-hidden">
<div
class="sm:flex-grow sm:w-1/2 border border-slate-400 p-2 rounded-md overflow-hidden"
>
<div class="flex items-center">
<input
v-if="recipientDid && !givenToProject"

Loading…
Cancel
Save