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); }