Edit event show attachment

This commit is contained in:
Peter Maquiran
2021-04-19 18:03:41 +01:00
parent 8b26ffd9a5
commit e794c12872
5 changed files with 69 additions and 17 deletions
@@ -187,30 +187,35 @@
</div>
</div>
<div hidden class="ion-item-container-no-border">
<div class="d-flex container-div width-100 ion-item-container-no-border" >
<ion-label>
<div class="attach-icon">
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Anexar Documentos</ion-label>
<ion-label>Adicionar documentos</ion-label>
</div>
</ion-label>
</div>
<div hidden>
<ion-item>
<ion-label>Documentos Anexados</ion-label>
</ion-item>
<ion-list>
<ion-item>
<ion-label>
<h4 class="attach-title-item">Text</h4>
<p><span class="span-left">Text</span><span class="span-right"> Text </span></p>
<div class="d-flex container-div width-100" *ngFor="let document of loadedEventAttachments" >
<ion-list class="width-100">
<ion-item class="width-100">
<ion-label class="width-100">
<p class="d-flex ion-justify-content-between">
<span class="attach-title-item">{{document.SourceName}}</span>
<span class="app-name" *ngIf="document.Source == 1"> webTRIX</span>
<span class="app-name" *ngIf="document.Source == 2"> K2</span>
<span class="app-name" *ngIf="document.Source == 3"> Exchange</span>
<span class="app-name" *ngIf="document.Source == 4"> File</span>
</p>
<p><span class="span-left">{{document.Stakeholders}}</span><span class="span-right"> {{document.CreateDate}} </span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</ion-content>
<ion-footer class="ion-no-border">
@@ -167,4 +167,22 @@ ion-content{
color:red;
}
}
}
.app-name{
background: #42b9f2;
border-radius: 18px;
text-align: center;
display: flex;
align-items: center;
padding: 0px 5px;
color: white;
font-size: 9pt;
font-weight: 500;
height: 19px;
-webkit-border-radius: 18px;
-moz-border-radius: 18px;
-ms-border-radius: 18px;
-o-border-radius: 18px;
}
@@ -7,6 +7,8 @@ import { Event } from 'src/app/models/event.model';
import { AlertController } from '@ionic/angular';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { SearchPage } from 'src/app/pages/search/search.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { Attachment } from 'src/app/models/attachment.model';
@Component({
selector: 'app-edit-event',
templateUrl: './edit-event.component.html',
@@ -22,6 +24,7 @@ export class EditEventComponent implements OnInit {
segment:string = "true";
eventAttendees: EventPerson[];
minDate: string;
loadedEventAttachments: Attachment[];
@Input() taskParticipants: EventPerson[];
@Input() taskParticipantsCc: EventPerson[];
@@ -41,8 +44,11 @@ export class EditEventComponent implements OnInit {
private modalController: ModalController,
private eventsService: EventsService,
public alertController: AlertController,
private attachmentsService: AttachmentsService,
) {
}
ngOnInit() {
@@ -50,8 +56,14 @@ export class EditEventComponent implements OnInit {
if(!this.restoreTemporaryData()){
if(this.postEvent){
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
if( this.postEvent.Body){
if(typeof(this.postEvent.Body.Text) == 'string'){
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
}
}
}
// attendees list
if(this.postEvent.Attendees != null) {
@@ -79,6 +91,10 @@ export class EditEventComponent implements OnInit {
this.isRecurring = "Repete";
}
}
this.getAttachments(this.postEvent.EventId);
}
@@ -155,15 +171,22 @@ export class EditEventComponent implements OnInit {
this.eventBody = restoredData.eventBody
this.segment = restoredData.segment
return true;
return true;
} else {
return false;
}
}
deleteTemporaryData(){
window['temp.path:/home/agenda/edit-event.component.ts'] = {}
}
getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
});
}
}