diff --git a/src/components/MeetingProjectDialog.vue b/src/components/ProjectSelectionDialog.vue similarity index 95% rename from src/components/MeetingProjectDialog.vue rename to src/components/ProjectSelectionDialog.vue index 4262334c53..a760506620 100644 --- a/src/components/MeetingProjectDialog.vue +++ b/src/components/ProjectSelectionDialog.vue @@ -39,7 +39,7 @@ import { PlanData } from "../interfaces/records"; import { NotificationIface } from "../constants/app"; /** - * MeetingProjectDialog - Dialog for selecting a project link for a meeting + * ProjectSelectionDialog - Dialog for selecting a project * * Features: * - EntityGrid integration for project selection @@ -52,7 +52,7 @@ import { NotificationIface } from "../constants/app"; EntityGrid, }, }) -export default class MeetingProjectDialog extends Vue { +export default class ProjectSelectionDialog extends Vue { /** Whether the dialog is visible */ visible = false; diff --git a/src/interfaces/claims.ts b/src/interfaces/claims.ts index 49e2b4a8c0..76572fd89b 100644 --- a/src/interfaces/claims.ts +++ b/src/interfaces/claims.ts @@ -80,6 +80,7 @@ export interface PlanActionClaim extends ClaimObject { agent?: { identifier: string }; description?: string; endTime?: string; + fulfills?: { "@type": string; identifier?: string; lastClaimId?: string }; identifier?: string; image?: string; lastClaimId?: string; diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index 7f0964bf60..dae7d3fdbe 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -114,6 +114,49 @@ @assign="handleRepresentativeAssigned" /> + +
Beware!
@@ -283,6 +326,7 @@ import { LeafletMouseEvent } from "leaflet";
import EntityIcon from "../components/EntityIcon.vue";
import ImageMethodDialog from "../components/ImageMethodDialog.vue";
import ProjectRepresentativeDialog from "../components/ProjectRepresentativeDialog.vue";
+import ProjectSelectionDialog from "../components/ProjectSelectionDialog.vue";
import QuickNav from "../components/QuickNav.vue";
import {
AppString,
@@ -311,6 +355,7 @@ import {
PROJECT_TIMEOUT_VERY_LONG,
} from "../constants/notifications";
import { PlanActionClaim } from "../interfaces/claims";
+import { PlanData } from "../interfaces/records";
import {
createEndorserJwtVcFromClaim,
getHeaders,
@@ -378,6 +423,7 @@ import { logger } from "../utils/logger";
components: {
EntityIcon,
ImageMethodDialog,
+ ProjectSelectionDialog,
ProjectRepresentativeDialog,
LMap,
LMarker,
@@ -429,6 +475,8 @@ export default class NewEditProjectView extends Vue {
latitude = 0;
longitude = 0;
numAccounts = 0;
+ parentProjectHandleId = "";
+ parentProjectName = "";
projectId = "";
projectIssuerDid = "";
sendToTrustroots = false;
@@ -510,6 +558,10 @@ export default class NewEditProjectView extends Vue {
);
}
}
+ if (this.fullClaim?.fulfills?.identifier) {
+ this.parentProjectHandleId = this.fullClaim.fulfills.identifier;
+ this.loadParentProjectName(this.parentProjectHandleId);
+ }
if (this.fullClaim.startTime) {
const localDateTime = DateTime.fromISO(
this.fullClaim.startTime as string,
@@ -623,6 +675,14 @@ export default class NewEditProjectView extends Vue {
} else {
delete vcClaim.agent;
}
+ if (this.parentProjectHandleId) {
+ vcClaim.fulfills = {
+ "@type": "PlanAction",
+ identifier: this.parentProjectHandleId,
+ };
+ } else {
+ delete vcClaim.fulfills;
+ }
if (this.imageUrl) {
vcClaim.image = this.imageUrl;
} else {
@@ -1075,5 +1135,33 @@ export default class NewEditProjectView extends Vue {
unsetRepresentative(): void {
this.agentDid = "";
}
+
+ openParentProjectDialog(): void {
+ (this.$refs.parentProjectDialog as ProjectSelectionDialog).open();
+ }
+
+ handleParentProjectSelected(project: PlanData): void {
+ this.parentProjectHandleId = project.handleId;
+ this.parentProjectName = project.name;
+ }
+
+ unsetParentProject(): void {
+ this.parentProjectHandleId = "";
+ this.parentProjectName = "";
+ }
+
+ private async loadParentProjectName(handleId: string): Promise