feat: enhance GenericVerifiableCredential interface with explicit optional properties
- Add name, description, and agent as optional properties to GenericVerifiableCredential - Improve type safety and IntelliSense for common claim properties - Maintain backward compatibility with existing code - Reduce need for type assertions when accessing claim properties
This commit is contained in:
@@ -154,12 +154,7 @@
|
||||
v-model:zoom="zoom"
|
||||
:center="[0, 0]"
|
||||
class="!z-40 rounded-md"
|
||||
@click="
|
||||
(event) => {
|
||||
latitude = event.latlng.lat;
|
||||
longitude = event.latlng.lng;
|
||||
}
|
||||
"
|
||||
@click="onMapClick"
|
||||
>
|
||||
<l-tile-layer
|
||||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
@@ -230,6 +225,7 @@ import {
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { LMap, LMarker, LTileLayer } from "@vue-leaflet/vue-leaflet";
|
||||
import { RouteLocationNormalizedLoaded, Router } from "vue-router";
|
||||
import { LeafletMouseEvent } from "leaflet";
|
||||
|
||||
import ImageMethodDialog from "../components/ImageMethodDialog.vue";
|
||||
import QuickNav from "../components/QuickNav.vue";
|
||||
@@ -239,8 +235,7 @@ import {
|
||||
NotificationIface,
|
||||
} from "../constants/app";
|
||||
import * as databaseUtil from "../db/databaseUtil";
|
||||
import { retrieveSettingsForActiveAccount } from "../db/index";
|
||||
import { PlanVerifiableCredential } from "../interfaces";
|
||||
import { PlanActionClaim } from "../interfaces/claims";
|
||||
import {
|
||||
createEndorserJwtVcFromClaim,
|
||||
getHeaders,
|
||||
@@ -277,7 +272,7 @@ export default class NewEditProjectView extends Vue {
|
||||
endDateInput?: string;
|
||||
endTimeInput?: string;
|
||||
errorMessage = "";
|
||||
fullClaim: PlanVerifiableCredential = {
|
||||
fullClaim: PlanActionClaim = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "PlanAction",
|
||||
name: "",
|
||||
@@ -445,7 +440,7 @@ export default class NewEditProjectView extends Vue {
|
||||
|
||||
private async saveProject() {
|
||||
// Make a claim
|
||||
const vcClaim: PlanVerifiableCredential = this.fullClaim;
|
||||
const vcClaim: PlanActionClaim = this.fullClaim;
|
||||
if (this.projectId) {
|
||||
vcClaim.lastClaimId = this.lastClaimJwtId;
|
||||
}
|
||||
@@ -823,5 +818,10 @@ export default class NewEditProjectView extends Vue {
|
||||
7000,
|
||||
);
|
||||
}
|
||||
|
||||
onMapClick(event: LeafletMouseEvent) {
|
||||
this.latitude = event.latlng.lat;
|
||||
this.longitude = event.latlng.lng;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user