|
@ -26,18 +26,18 @@ |
|
|
type="text" |
|
|
type="text" |
|
|
placeholder="Idea Name" |
|
|
placeholder="Idea Name" |
|
|
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2" |
|
|
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2" |
|
|
v-model="projectName" |
|
|
v-model="fullClaim.name" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<textarea |
|
|
<textarea |
|
|
placeholder="Description" |
|
|
placeholder="Description" |
|
|
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2" |
|
|
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2" |
|
|
rows="5" |
|
|
rows="5" |
|
|
v-model="description" |
|
|
v-model="fullClaim.description" |
|
|
maxlength="5000" |
|
|
maxlength="5000" |
|
|
></textarea> |
|
|
></textarea> |
|
|
<div class="text-xs text-slate-500 italic -mt-3 mb-4"> |
|
|
<div class="text-xs text-slate-500 italic -mt-3 mb-4"> |
|
|
{{ description.length }}/5000 max. characters |
|
|
{{ fullClaim.description.length }}/5000 max. characters |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="flex items-center mb-4"> |
|
|
<div class="flex items-center mb-4"> |
|
@ -72,7 +72,7 @@ |
|
|
name="OpenStreetMap" |
|
|
name="OpenStreetMap" |
|
|
/> |
|
|
/> |
|
|
<l-marker |
|
|
<l-marker |
|
|
v-if="latitude || longitude" |
|
|
v-if="latitude && longitude" |
|
|
:lat-lng="[latitude, longitude]" |
|
|
:lat-lng="[latitude, longitude]" |
|
|
@click="maybeEraseLatLong()" |
|
|
@click="maybeEraseLatLong()" |
|
|
/> |
|
|
/> |
|
@ -136,13 +136,17 @@ export default class NewEditProjectView extends Vue { |
|
|
|
|
|
|
|
|
activeDid = ""; |
|
|
activeDid = ""; |
|
|
apiServer = ""; |
|
|
apiServer = ""; |
|
|
description = ""; |
|
|
|
|
|
errorMessage = ""; |
|
|
errorMessage = ""; |
|
|
|
|
|
fullClaim: PlanVerifiableCredential = { |
|
|
|
|
|
"@context": "https://schema.org", |
|
|
|
|
|
"@type": "PlanAction", |
|
|
|
|
|
name: "", |
|
|
|
|
|
description: "", |
|
|
|
|
|
}; |
|
|
includeLocation = false; |
|
|
includeLocation = false; |
|
|
latitude = 0; |
|
|
latitude = 0; |
|
|
longitude = 0; |
|
|
longitude = 0; |
|
|
numAccounts = 0; |
|
|
numAccounts = 0; |
|
|
projectName = ""; |
|
|
|
|
|
zoom = 2; |
|
|
zoom = 2; |
|
|
|
|
|
|
|
|
async beforeCreate() { |
|
|
async beforeCreate() { |
|
@ -214,9 +218,12 @@ export default class NewEditProjectView extends Vue { |
|
|
try { |
|
|
try { |
|
|
const resp = await this.axios.get(url, { headers }); |
|
|
const resp = await this.axios.get(url, { headers }); |
|
|
if (resp.status === 200) { |
|
|
if (resp.status === 200) { |
|
|
const claim = resp.data.claim; |
|
|
this.fullClaim = resp.data.claim; |
|
|
this.projectName = claim.name; |
|
|
if (this.fullClaim?.location) { |
|
|
this.description = claim.description; |
|
|
this.includeLocation = true; |
|
|
|
|
|
this.latitude = this.fullClaim.location.geo.latitude; |
|
|
|
|
|
this.longitude = this.fullClaim.location.geo.longitude; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error("Got error retrieving that project", error); |
|
|
console.error("Got error retrieving that project", error); |
|
@ -225,13 +232,7 @@ export default class NewEditProjectView extends Vue { |
|
|
|
|
|
|
|
|
private async SaveProject(identity: IIdentifier) { |
|
|
private async SaveProject(identity: IIdentifier) { |
|
|
// Make a claim |
|
|
// Make a claim |
|
|
const vcClaim: PlanVerifiableCredential = { |
|
|
const vcClaim: PlanVerifiableCredential = this.fullClaim; |
|
|
"@context": "https://schema.org", |
|
|
|
|
|
"@type": "PlanAction", |
|
|
|
|
|
name: this.projectName, |
|
|
|
|
|
description: this.description, |
|
|
|
|
|
identifier: this.projectId || undefined, |
|
|
|
|
|
}; |
|
|
|
|
|
if (this.projectId) { |
|
|
if (this.projectId) { |
|
|
vcClaim.identifier = this.projectId; |
|
|
vcClaim.identifier = this.projectId; |
|
|
} |
|
|
} |
|
@ -314,8 +315,8 @@ export default class NewEditProjectView extends Vue { |
|
|
error?: { message?: string }; |
|
|
error?: { message?: string }; |
|
|
}>; |
|
|
}>; |
|
|
if (serverError) { |
|
|
if (serverError) { |
|
|
|
|
|
console.log("Got error from server", serverError); |
|
|
if (Object.prototype.hasOwnProperty.call(serverError, "message")) { |
|
|
if (Object.prototype.hasOwnProperty.call(serverError, "message")) { |
|
|
console.log(serverError); |
|
|
|
|
|
userMessage = serverError.response?.data?.error?.message || ""; // This is info for the user. |
|
|
userMessage = serverError.response?.data?.error?.message || ""; // This is info for the user. |
|
|
this.$notify( |
|
|
this.$notify( |
|
|
{ |
|
|
{ |
|
|