diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index 5c3af0d..199931d 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -191,7 +191,7 @@ export interface PlanVerifiableCredential extends GenericVerifiableCredential { * Represents data about a project * * @deprecated - * We should use PlanSummaryRecord instead, adding rowid to it. + * (Maybe we should use PlanSummaryRecord instead, either by adding rowId or by iterating with jwtId.) **/ export interface PlanData { /** @@ -212,9 +212,10 @@ export interface PlanData { **/ name: string; /** - * The identifier of the project -- different from jwtId, needs to be fixed + * The identifier of the project record -- different from jwtId + * (Maybe we should use the jwtId to iterate through the records instead.) **/ - rowid?: string; + rowId?: string; } export interface EndorserRateLimits { diff --git a/src/libs/partnerServer.ts b/src/libs/partnerServer.ts index 08172a4..eef02b2 100644 --- a/src/libs/partnerServer.ts +++ b/src/libs/partnerServer.ts @@ -3,5 +3,5 @@ export interface UserProfile { locLat?: number; locLon?: number; issuerDid: string; - rowid?: string; + rowId?: string; // set on profile retrieved from server } diff --git a/src/router/index.ts b/src/router/index.ts index cf4300a..3f9a3ff 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -258,6 +258,11 @@ const routes: Array = [ name: "test", component: () => import("../views/TestView.vue"), }, + { + path: "/userProfile/:id?", + name: "userProfile", + component: () => import("../views/UserProfileView.vue"), + }, ]; /** @type {*} */ diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index a0c1e40..a11cca1 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -158,7 +158,7 @@ We'll just pop the message in only if we discover that they need it. -->
@@ -175,6 +175,7 @@
@@ -262,7 +263,10 @@
-
+
Loading profile... @@ -321,22 +325,39 @@ />
- +
+
+ + +
+
+
+ Loading... +
+
+ Saving... +
diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue index 791fcf5..fd5043e 100644 --- a/src/views/DiscoverView.vue +++ b/src/views/DiscoverView.vue @@ -184,7 +184,10 @@ >
-
+

None found in the selected area. @@ -224,7 +227,12 @@

{{ - didInfo(project.issuerDid, activeDid, allMyDids, allContacts) + didInfo( + project.issuerDid, + activeDid, + allMyDids, + allContacts, + ) }}
@@ -240,22 +248,38 @@ :key="profile.issuerDid" >
{{ - didInfo(profile.issuerDid, activeDid, allMyDids, allContacts) + didInfo( + profile.issuerDid, + activeDid, + allMyDids, + allContacts, + ) }}
-

+

{{ profile.description }}

-
+
- {{ profile.locLat.toFixed(2) }}, {{ profile.locLon.toFixed(2) }} + {{ + (profile.locLat > 0 ? "North" : "South") + + " in " + + (profile.locLon > 0 ? "Eastern" : "Western") + + " Hemisphere" + }}
@@ -432,17 +456,19 @@ export default class DiscoverView extends Vue { const results = await response.json(); if (this.isProjectsActive) { + this.userProfiles = []; const plans: PlanData[] = results.data; if (plans) { for (const plan of plans) { - const { name, description, handleId, image, issuerDid, rowid } = plan; + const { name, description, handleId, image, issuerDid, rowId } = + plan; this.projects.push({ name, description, handleId, image, issuerDid, - rowid, + rowId, }); } this.remoteCount = this.projects.length; @@ -450,6 +476,7 @@ export default class DiscoverView extends Vue { throw JSON.stringify(results); } } else { + this.projects = []; const profiles: UserProfile[] = results.data; if (profiles) { this.userProfiles.push(...profiles); @@ -468,7 +495,11 @@ export default class DiscoverView extends Vue { group: "alert", type: "danger", title: "Error Searching", - text: e.userMessage || "There was a problem retrieving " + (this.isProjectsActive ? "projects" : "profiles") + ".", + text: + e.userMessage || + "There was a problem retrieving " + + (this.isProjectsActive ? "projects" : "profiles") + + ".", }, 5000, ); @@ -530,17 +561,18 @@ export default class DiscoverView extends Vue { const results = await response.json(); if (this.isProjectsActive) { + this.userProfiles = []; if (results.data) { if (beforeId) { const plans: PlanData[] = results.data; for (const plan of plans) { - const { name, description, handleId, issuerDid, rowid } = plan; + const { name, description, handleId, issuerDid, rowId } = plan; this.projects.push({ name, description, handleId, issuerDid, - rowid, + rowId, }); } } else { @@ -551,6 +583,7 @@ export default class DiscoverView extends Vue { throw JSON.stringify(results); } } else { + this.projects = []; const profiles: UserProfile[] = results.data; if (profiles) { this.userProfiles.push(...profiles); @@ -567,7 +600,11 @@ export default class DiscoverView extends Vue { group: "alert", type: "danger", title: "Error", - text: e.userMessage || "There was a problem retrieving " + (this.isProjectsActive ? "projects" : "profiles") + ".", + text: + e.userMessage || + "There was a problem retrieving " + + (this.isProjectsActive ? "projects" : "profiles") + + ".", }, 5000, ); @@ -585,16 +622,16 @@ export default class DiscoverView extends Vue { if (this.isProjectsActive && this.projects.length > 0) { const latestProject = this.projects[this.projects.length - 1]; if (this.isLocalActive || this.isMappedActive) { - this.searchLocal(latestProject.rowid); + this.searchLocal(latestProject.rowId); } else if (this.isAnywhereActive) { - this.searchAll(latestProject.rowid); + this.searchAll(latestProject.rowId); } } else if (!this.isProjectsActive && this.userProfiles.length > 0) { const latestProfile = this.userProfiles[this.userProfiles.length - 1]; if (this.isLocalActive || this.isMappedActive) { - this.searchLocal(latestProfile.rowid || ""); + this.searchLocal(latestProfile.rowId || ""); } else if (this.isAnywhereActive) { - this.searchAll(latestProfile.rowid || ""); + this.searchAll(latestProfile.rowId || ""); } } } @@ -653,7 +690,7 @@ export default class DiscoverView extends Vue { this.markers = {}; const results = await response.json(); if (results.data?.tiles?.length > 0) { - for (const tile of results.data.tiles) { + for (const tile: Tile of results.data.tiles) { const pinLat = (tile.minFoundLat + tile.maxFoundLat) / 2; const pinLon = (tile.minFoundLon + tile.maxFoundLon) / 2; const numberIcon = L.divIcon({ @@ -711,7 +748,7 @@ export default class DiscoverView extends Vue { **/ onClickLoadItem(id: string) { const route = { - path: this.isProjectsActive + path: this.isProjectsActive ? "/project/" + encodeURIComponent(id) : "/userProfile/" + encodeURIComponent(id), }; diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue index 84836f5..7f41cc9 100644 --- a/src/views/ProjectsView.vue +++ b/src/views/ProjectsView.vue @@ -361,14 +361,14 @@ export default class ProjectsView extends Vue { if (resp.status === 200 && resp.data.data) { const plans: PlanData[] = resp.data.data; for (const plan of plans) { - const { name, description, handleId, image, issuerDid, rowid } = plan; + const { name, description, handleId, image, issuerDid, rowId } = plan; this.projects.push({ name, description, image, handleId, issuerDid, - rowid, + rowId, }); } } else { @@ -395,7 +395,7 @@ export default class ProjectsView extends Vue { async loadMoreProjectData(payload: boolean) { if (this.projects.length > 0 && payload) { const latestProject = this.projects[this.projects.length - 1]; - await this.loadProjects(`beforeId=${latestProject.rowid}`); + await this.loadProjects(`beforeId=${latestProject.rowId}`); } } diff --git a/src/views/UserProfileView.vue b/src/views/UserProfileView.vue new file mode 100644 index 0000000..962a466 --- /dev/null +++ b/src/views/UserProfileView.vue @@ -0,0 +1,151 @@ + + +