aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.html2
-rw-r--r--src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.ts2
-rw-r--r--src/DevHive.Angular/src/app/components/post-page/post-page.component.ts4
3 files changed, 7 insertions, 1 deletions
diff --git a/src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.html b/src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.html
index e7889f0..a8ebce7 100644
--- a/src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.html
+++ b/src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.html
@@ -1,7 +1,7 @@
<div class="attachment">
<div class="clickable" (click)="toggleShowFull()">
<div class="attachment-name">
- Attachment
+ {{ fileName }}
</div>
<div class="attachment-type">
{{ fileType }}
diff --git a/src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.ts b/src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.ts
index d2aa636..6c468b0 100644
--- a/src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.ts
+++ b/src/DevHive.Angular/src/app/components/post-attachment/post-attachment.component.ts
@@ -8,6 +8,7 @@ import { Component, Input, OnInit } from '@angular/core';
export class PostAttachmentComponent implements OnInit {
@Input() paramURL: string;
public showFull = false;
+ public fileName: string;
public fileType: string;
constructor()
@@ -15,6 +16,7 @@ export class PostAttachmentComponent implements OnInit {
ngOnInit(): void {
this.fileType = this.paramURL.includes('image') ? 'img' : 'raw';
+ this.fileName = this.paramURL.match('(?<=\/)(?:.(?!\/))+$')?.pop() ?? 'Attachment';
}
toggleShowFull(): void {
diff --git a/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts b/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts
index 21a5e50..39365d7 100644
--- a/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts
+++ b/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts
@@ -66,6 +66,10 @@ export class PostPageComponent implements OnInit {
this._cloudinaryService.getFileRequest(fileURL).subscribe(
(result: object) => {
const file = result as File;
+ const tmp = {
+ name: fileURL.match('(?<=\/)(?:.(?!\/))+$')?.pop() ?? 'Attachment'
+ };
+ Object.assign(file, tmp);
this.files.push(file);
}
);