Commit 432cabb8 by GD-A-150752

attachment-css

parent bbe136c9
...@@ -96,9 +96,17 @@ ...@@ -96,9 +96,17 @@
id="File" url="{{apiUrl}}uploadFile" auto="true" id="File" url="{{apiUrl}}uploadFile" auto="true"
(onUpload)="onUpload($event)" [disabled]="showLoader" (onUpload)="onUpload($event)" [disabled]="showLoader"
chooseLabel="Browse" #uploader multiple="multiple"> chooseLabel="Browse" #uploader multiple="multiple">
<ng-template let-file pTemplate="file">
<div>Uploading...</div>
</ng-template>
<ng-template pTemplate="content"> <ng-template pTemplate="content">
<ul *ngIf="Message.Attachments.length"> <ul *ngIf="Message.Attachments.length">
<li *ngFor="let file of Message.Attachments">{{file.File.Name}}</li> <li *ngFor="let file of Message.Attachments" class="attachment-content">
<div [title]="file.File.Name">Attachment {{file.File.Index + 1}} </div>
<a (click)="removeAttachment(file)">
<span class="ui-icon-close" title="Remove"></span>
</a>
</li>
</ul> </ul>
</ng-template> </ng-template>
</p-fileUpload> </p-fileUpload>
......
...@@ -45,6 +45,32 @@ a { ...@@ -45,6 +45,32 @@ a {
flex-direction: column; flex-direction: column;
} }
.attachment-content {
display: flex;
div {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1 1 auto;
font-size: 12px;
margin-top: 2px;
}
a {
height: 17px;
width: 17px;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
span {
font-size: 15px;
color: red;
}
}
}
.message-block { .message-block {
background-color: white; background-color: white;
border-radius: 20px; border-radius: 20px;
......
...@@ -119,7 +119,7 @@ export class MessageEngineApplicantViewComponent extends BaseComponent implement ...@@ -119,7 +119,7 @@ export class MessageEngineApplicantViewComponent extends BaseComponent implement
const assocs = const assocs =
[ASSOCS.JOB, [ASSOCS.JOB, ASSOCS.HIRING_TEAM].join('.'), ASSOCS.MESSAGES, [ASSOCS.MESSAGES, ASSOCS.SENT_BY].join('.'), [ASSOCS.JOB, [ASSOCS.JOB, ASSOCS.HIRING_TEAM].join('.'), ASSOCS.MESSAGES, [ASSOCS.MESSAGES, ASSOCS.SENT_BY].join('.'),
[ASSOCS.MESSAGES, ASSOCS.ATTACHMENTS].join('.'), [ASSOCS.CANDIDATE, ASSOCS.USER].join('.')]; [ASSOCS.MESSAGES, ASSOCS.ATTACHMENTS].join('.'), [ASSOCS.CANDIDATE, ASSOCS.USER].join('.')];
this.subscriptions.push(this.messageEngineApplicantViewService.getEngineApplicantViewByID(this.jobId, assocs) this.subscriptions.push(this.messageEngineApplicantViewService.getEngineApplicantViewByID(this.jobId, assocs)
.subscribe( .subscribe(
...@@ -203,12 +203,18 @@ export class MessageEngineApplicantViewComponent extends BaseComponent implement ...@@ -203,12 +203,18 @@ export class MessageEngineApplicantViewComponent extends BaseComponent implement
this.utilsService.createObject(chatAttachment, this.createdObjs); this.utilsService.createObject(chatAttachment, this.createdObjs);
chatAttachment.File = { chatAttachment.File = {
FileToken: JSON.parse(event.xhr.response).files[0].token, FileToken: JSON.parse(event.xhr.response).files[0].token,
Name: JSON.parse(event.xhr.response).files[0].fileName Name: JSON.parse(event.xhr.response).files[0].fileName,
Index: this.Message.Attachments.length
}; };
chatAttachment.Message = this.Message; chatAttachment.Message = this.Message;
this.Message.Attachments.push(chatAttachment); this.Message.Attachments.push(chatAttachment);
} }
removeAttachment(file): void {
this.utilsService.removeMultiRefObject(file, this.Message, 'Attachments', this.createdObjs,
this.updatedObjs, this.deletedObjs);
}
/** /**
* It simply creates a new object and assigns the default values to it. * It simply creates a new object and assigns the default values to it.
*/ */
......
...@@ -12,4 +12,5 @@ export class FileContent { ...@@ -12,4 +12,5 @@ export class FileContent {
URI?: string; URI?: string;
Name: string; Name: string;
FileToken?: string; FileToken?: string;
Index: number
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment