web/satellite: editing of project description bug fixed (#3145)

This commit is contained in:
Vitalii Shpital 2019-10-01 13:10:18 +03:00 committed by GitHub
parent 755cbd4dce
commit c7d05ebbf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@
<div class="project-details-info-container__description-container" v-if="!isEditing">
<div class="project-details-info-container__description-container__text">
<h2 class="project-details-info-container__description-container__text__title">Description</h2>
<h3 class="project-details-info-container__description-container__text__project-description">{{description}}</h3>
<h3 class="project-details-info-container__description-container__text__project-description">{{displayedDescription}}</h3>
</div>
<div title="Edit">
<svg class="project-details-svg" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" @click="toggleEditing">
@ -31,6 +31,7 @@
width="205%"
height="10vh"
is-multiline="true"
:init-value="storedDescription"
@setData="setNewDescription" />
<div class="project-details-info-container__description-container__buttons-area">
<VButton
@ -98,7 +99,11 @@ export default class ProjectDetailsArea extends Vue {
return this.$store.getters.selectedProject.name;
}
public get description(): string {
public get storedDescription(): string {
return this.$store.getters.selectedProject.description;
}
public get displayedDescription(): string {
return this.$store.getters.selectedProject.description ?
this.$store.getters.selectedProject.description :
'No description yet. Please enter some information about the project if any.';
@ -134,10 +139,9 @@ export default class ProjectDetailsArea extends Vue {
this.$router.push(RouteConfig.UsageReport.path);
}
private toggleEditing(): void {
public toggleEditing(): void {
this.isEditing = !this.isEditing;
// TODO: cache this value in future
this.newDescription = '';
this.newDescription = this.storedDescription;
}
}
</script>
@ -227,7 +231,7 @@ export default class ProjectDetailsArea extends Vue {
line-height: 21px;
color: #354049;
width: 100%;
word-wrap: break-word;
word-break: break-word;
}
}