From 64bd9a103d5339ad82c110e658063b839f53bd3b Mon Sep 17 00:00:00 2001 From: Matthew Aaron Raymer Date: Mon, 16 Jan 2023 16:37:57 +0800 Subject: [PATCH] Name and description added to Project View --- src/views/NewEditProjectView.vue | 17 -------- src/views/ProjectViewView.vue | 71 ++++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 39 deletions(-) diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index 92d4b39..ffd116d 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -17,23 +17,6 @@ - -
-
- - -
- -
-
  • - + >
  • -
  • - + + >
  • -
  • - + + >
  • - + >
  • @@ -62,13 +66,8 @@
    - -
    - -
    -
    -

    Canyon cleanup

    +

    {{ name }}

    Rotary
    - Sed ut perspiciatis unde omnis iste natus error sit voluptatem - accusantium doloremque laudantium… - Read More +
    + {{ truncatedDesc }} + Read More +
    +
    + {{ description }} + Read Less +
    @@ -135,12 +143,25 @@ import { AppString } from "@/constants/app"; components: {}, }) export default class ProjectViewView extends Vue { + expanded = false; + name = ""; + description = ""; + truncatedDesc = ""; + truncateLength = 40; projectId = localStorage.getItem("projectId") === null ? "" : localStorage.getItem("projectId"); + + expandText() { + this.expanded = true; + } + + collapseText() { + this.expanded = false; + } + async LoadProject(identity: IIdentifier) { - console.log("LoadProject", this.projectId); const endorserApiServer = AppString.DEFAULT_ENDORSER_API_SERVER; const url = endorserApiServer + "/api/claim/" + this.projectId; const token = await accessToken(identity); @@ -152,6 +173,12 @@ export default class ProjectViewView extends Vue { try { const resp = await this.axios.get(url, { headers }); console.log(resp.status, resp.data); + if (resp.status === 200) { + const claim = resp.data.claim; + this.name = claim.name; + this.description = claim.description; + this.truncatedDesc = this.description.slice(0, this.truncateLength); + } } catch (error) { console.log(error); }