From 30499a7afb99570f2147761423f4dec682823543 Mon Sep 17 00:00:00 2001 From: Lukas Kimpel <lukas.kimpel@mni.thm.de> Date: Wed, 14 Mar 2018 20:01:24 +0100 Subject: [PATCH] Refactor content's id to contentId (more unique) --- src/app/content-creation/content-creation.component.ts | 2 +- src/app/content-detail/content-detail.component.html | 4 ++-- src/app/content-list/content-list.component.html | 4 ++-- src/app/content.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/content-creation/content-creation.component.ts b/src/app/content-creation/content-creation.component.ts index 86d7ac224..ccef4b783 100644 --- a/src/app/content-creation/content-creation.component.ts +++ b/src/app/content-creation/content-creation.component.ts @@ -45,7 +45,7 @@ export class ContentCreationComponent implements OnInit { this.contentService.addContent({ subject: subject, body: body, roomId: this.roomId } as Content) .subscribe(content => { this.notification.show(`Content '${content.subject}' successfully created.`); - this.router.navigate([`/creator/room/${content.roomId}/${content.id}`]); + this.router.navigate([`/creator/room/${content.roomId}/${content.contentId}`]); this.dialogRef.close(); }); } diff --git a/src/app/content-detail/content-detail.component.html b/src/app/content-detail/content-detail.component.html index 404cab883..4e68b015b 100644 --- a/src/app/content-detail/content-detail.component.html +++ b/src/app/content-detail/content-detail.component.html @@ -5,7 +5,7 @@ <mat-card-title> <h3 class="subheading-2">{{content.subject}}</h3> </mat-card-title> - <mat-card-subtitle>ID: {{ content.id }} + <mat-card-subtitle>ID: {{ content.contentId }} <br> Round: {{ content.round }}</mat-card-subtitle> </mat-card-header> <mat-divider></mat-divider> @@ -21,7 +21,7 @@ <mat-divider></mat-divider> <!-- answes list here --> <mat-card-actions> - <button mat-button color="primary" matTooltip="Create new content" routerLink="/creator/room/{{content.id}}/content-creation"> + <button mat-button color="primary" matTooltip="Create new content" routerLink="/creator/room/{{content.contentId}}/content-creation"> Create answer </button> <button mat-button color="warn" matTooltip="Delete selected answer"> diff --git a/src/app/content-list/content-list.component.html b/src/app/content-list/content-list.component.html index 4bca2af65..ad9cab2ee 100644 --- a/src/app/content-list/content-list.component.html +++ b/src/app/content-list/content-list.component.html @@ -1,7 +1,7 @@ <mat-list> <mat-list-item *ngFor="let content of contents"> - <button mat-button routerLink="{{content.id}}"> - Content {{content.id}}: {{content.subject}} + <button mat-button routerLink="{{content.contentId}}"> + Content {{content.contentId}}: {{content.subject}} </button> </mat-list-item> </mat-list> diff --git a/src/app/content.ts b/src/app/content.ts index 7a6e26199..27517fe7b 100644 --- a/src/app/content.ts +++ b/src/app/content.ts @@ -1,7 +1,7 @@ import { ContentType } from './content-type'; export class Content { - id: string; + contentId: string; revision: string; roomId: string; subject: string; -- GitLab