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