change button

This commit is contained in:
Peter Maquiran
2024-01-18 17:17:03 +01:00
parent c862ab9ad7
commit 888467f3de
7 changed files with 101 additions and 53 deletions
@@ -8,13 +8,14 @@ import { NewPublicationPageRoutingModule } from './new-publication-routing.modul
import { NewPublicationPage } from './new-publication.page'; import { NewPublicationPage } from './new-publication.page';
import '@teamhive/capacitor-video-recorder'; import '@teamhive/capacitor-video-recorder';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
FormsModule, FormsModule,
IonicModule, IonicModule,
NewPublicationPageRoutingModule NewPublicationPageRoutingModule,
FontAwesomeModule,
], ],
exports: [NewPublicationPage], exports: [NewPublicationPage],
declarations: [NewPublicationPage] declarations: [NewPublicationPage]
@@ -32,21 +32,23 @@
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<div class="d-flex"> <div class="d-flex">
<div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start"> <div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start" class="mr-10">
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)" style="font-weight: 700;color: #c63527;">
X
</div>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage" <ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage"
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.FileBase64" name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.FileBase64"
(click)="imageSize(capturedImage)"></ion-img> (click)="imageSize(capturedImage)" style="height: 69px;"></ion-img>
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70" <video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline"> controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline">
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.FileBase64"> <source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.FileBase64">
</video> </video>
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)">
<ion-icon src="assets/images/theme/gov/icons-delete.svg" class="delete md hydrated"></ion-icon>
</div>
</div> </div>
<!-- Display the blurred image and count if there are more images --> <!-- Display the blurred image and count if there are more images -->
<ion-thumbnail *ngIf="seletedContent.length > displayLimit" lot="start"> <ion-thumbnail *ngIf="seletedContent.length > displayLimit" lot="start">
@@ -80,7 +82,7 @@
</div> </div>
</div> --> </div> -->
<div class="ion-item-container-no-border"> <div class="ion-item-container-no-border pt-10">
<ion-label (click)="chossePhotoOrVideo()"> <ion-label (click)="chossePhotoOrVideo()">
<div class="attach-icon"> <div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " <ion-icon *ngIf="ThemeService.currentTheme == 'default' "
@@ -94,7 +96,7 @@
</div> </div>
</ion-label> </ion-label>
</div> </div>
<div *ngIf="photoOrVideo" class="container-multiselect"> <div *ngIf="photoOrVideo" class="container-multiselect pt-10">
<button id="container-multiselect" class="multiselect-button" (click)="takePicture()">Fotografia</button> <button id="container-multiselect" class="multiselect-button" (click)="takePicture()">Fotografia</button>
<button id="container-multiselect" class="multiselect-button" (click)="startVideoRecording()">Video</button> <button id="container-multiselect" class="multiselect-button" (click)="startVideoRecording()">Video</button>
</div> </div>
+38 -30
View File
@@ -16,7 +16,7 @@ import { ChangeProfileService } from './change-profile.service';
}) })
export class PublicationsService { export class PublicationsService {
authheader = {}; authheader = {};
loggeduser: LoginUserRespose; loggeduser: LoginUserRespose;
@@ -31,7 +31,7 @@ export class PublicationsService {
this.changeProfileService.registerCallback(() => { this.changeProfileService.registerCallback(() => {
this.setHeader() this.setHeader()
}) })
} }
setHeader () { setHeader () {
@@ -42,8 +42,8 @@ export class PublicationsService {
GetPublicationFolderList(){ GetPublicationFolderList(){
const geturl = environment.apiURL + 'presidentialActions'; const geturl = environment.apiURL + 'presidentialActions';
let options = { let options = {
headers: this.headers, headers: this.headers,
}; };
return this.http.get<any>(`${geturl}`, options); return this.http.get<any>(`${geturl}`, options);
} }
@@ -51,7 +51,7 @@ export class PublicationsService {
GetPresidentialAction(id:any){ GetPresidentialAction(id:any){
const geturl = environment.apiURL + 'presidentialActions/'+id; const geturl = environment.apiURL + 'presidentialActions/'+id;
let options = { let options = {
headers: this.headers, headers: this.headers,
}; };
return this.http.get<any>(`${geturl}`, options); return this.http.get<any>(`${geturl}`, options);
@@ -60,7 +60,7 @@ export class PublicationsService {
UpdatePresidentialAction(body:any) { UpdatePresidentialAction(body:any) {
const geturl = environment.apiURL + 'presidentialActions'; const geturl = environment.apiURL + 'presidentialActions';
let options = { let options = {
headers: this.headers, headers: this.headers,
}; };
return this.http.put<any>(`${geturl}`, body, options); return this.http.put<any>(`${geturl}`, body, options);
@@ -68,7 +68,7 @@ export class PublicationsService {
CreatePublicationFolder(body:any){ CreatePublicationFolder(body:any){
const geturl = environment.apiURL + 'presidentialActions'; const geturl = environment.apiURL + 'presidentialActions';
let options = { let options = {
headers: this.headers, headers: this.headers,
}; };
return this.http.post<any>(`${geturl}`, body, options) return this.http.post<any>(`${geturl}`, body, options)
@@ -76,20 +76,20 @@ export class PublicationsService {
UpdatePublicationFolder(body:any) { UpdatePublicationFolder(body:any) {
const geturl = environment.apiURL + 'presidentialActions'; const geturl = environment.apiURL + 'presidentialActions';
let options = { let options = {
headers: this.headers, headers: this.headers,
}; };
return this.http.put<any>(`${geturl}`, body, options).toPromise().then(res =>{ return this.http.put<any>(`${geturl}`, body, options).toPromise().then(res =>{
}); });
} }
DeletePresidentialAction(id:any){ DeletePresidentialAction(id:any){
const geturl = environment.apiURL + 'presidentialActions/'+id; const geturl = environment.apiURL + 'presidentialActions/'+id;
let options = { let options = {
headers: this.headers, headers: this.headers,
}; };
return this.http.delete<any>(`${geturl}`, options); return this.http.delete<any>(`${geturl}`, options);
@@ -101,7 +101,7 @@ export class PublicationsService {
params = params.set("folderId", folder); params = params.set("folderId", folder);
let options = { let options = {
headers: this.headers, headers: this.headers,
params: params params: params
}; };
@@ -115,7 +115,7 @@ export class PublicationsService {
params = params.set("folderId", id); params = params.set("folderId", id);
let options = { let options = {
headers: this.headers, headers: this.headers,
params: params params: params
}; };
@@ -129,13 +129,13 @@ export class PublicationsService {
params = params.set("folderId", id); params = params.set("folderId", id);
let options = { let options = {
headers: this.headers, headers: this.headers,
params: params params: params
}; };
return this.http.get<number[]>(`${geturl}`, options) return this.http.get<number[]>(`${geturl}`, options)
} }
GetPublicationById( publicationId:any){ GetPublicationById( publicationId:any){
const geturl = environment.apiURL + 'presidentialActions/posts/'+ publicationId; const geturl = environment.apiURL + 'presidentialActions/posts/'+ publicationId;
@@ -143,7 +143,7 @@ export class PublicationsService {
params = params.set("id", publicationId); params = params.set("id", publicationId);
let options = { let options = {
headers: this.headers, headers: this.headers,
params: params params: params
}; };
@@ -156,22 +156,22 @@ export class PublicationsService {
params = params.set("id", publicationId); params = params.set("id", publicationId);
let options = { let options = {
headers: this.headers, headers: this.headers,
params: params params: params
}; };
return this.http.get<any>(`${geturl}`, options); return this.http.get<any>(`${geturl}`, options);
} }
// my own tries // my own tries
GetPublicationByIdNext( publicationId:any){ GetPublicationByIdNext( publicationId:any){
let geturl = environment.apiURL + 'presidentialActions/'+ publicationId + '/posts/ids'; let geturl = environment.apiURL + 'presidentialActions/'+ publicationId + '/posts/ids';
let params = new HttpParams(); let params = new HttpParams();
params = params.set("folderId", publicationId); params = params.set("folderId", publicationId);
let options = { let options = {
headers: this.headers, headers: this.headers,
/* params: params */ /* params: params */
}; };
@@ -181,7 +181,7 @@ GetPublicationByIdNext( publicationId:any){
return true return true
}else{ }else{
const navigation = this.router.getCurrentNavigation() const navigation = this.router.getCurrentNavigation()
if(navigation){ if(navigation){
geturl = navigation.extractedUrl.toString() geturl = navigation.extractedUrl.toString()
@@ -198,7 +198,7 @@ GetIdsPublicationNext(id:any){
params = params.set("id", id); params = params.set("id", id);
let options = { let options = {
headers: this.headers, headers: this.headers,
params: params params: params
}; };
@@ -206,13 +206,13 @@ GetIdsPublicationNext(id:any){
var search = this.http.get<any>(`${geturl}`, options).subscribe( var search = this.http.get<any>(`${geturl}`, options).subscribe(
res => { res => {
res.this.activatedRoute.snapshot.queryParams.get('returnto') || '/posts' res.this.activatedRoute.snapshot.queryParams.get('returnto') || '/posts'
} }
) )
return search return search
} }
//my last tries //my last tries
@@ -222,7 +222,7 @@ GetIdsPublicationNext(id:any){
const geturl = environment.apiURL + 'presidentialActions/'+folderId+'/v2/posts'; const geturl = environment.apiURL + 'presidentialActions/'+folderId+'/v2/posts';
let params = new HttpParams(); let params = new HttpParams();
params = params.set("folderId", folderId); params = params.set("folderId", folderId);
let options = { let options = {
headers: this.headers, headers: this.headers,
/* params: params */ /* params: params */
}; };
@@ -233,11 +233,19 @@ GetIdsPublicationNext(id:any){
const geturl = environment.apiURL + 'presidentialActions/'+folderId+'/posts'; const geturl = environment.apiURL + 'presidentialActions/'+folderId+'/posts';
let params = new HttpParams(); let params = new HttpParams();
params = params.set("folderId", folderId); params = params.set("folderId", folderId);
let options = { let options = {
headers: this.headers, headers: this.headers,
/* params: params */ /* params: params */
}; };
body.Files = body.Files.map( e => ({
FileBase64: e.FileBase64,
FileExtension: e.FileExtension,
OriginalFileName: 'foto'
}))
return this.http.put<any>(`${geturl}`, body, options) return this.http.put<any>(`${geturl}`, body, options)
} }
@@ -246,7 +254,7 @@ GetIdsPublicationNext(id:any){
let params = new HttpParams(); let params = new HttpParams();
params = params.set("folderId", folderId); params = params.set("folderId", folderId);
params = params.set("id", publicationId); params = params.set("id", publicationId);
let options = { let options = {
headers: this.headers, headers: this.headers,
/* params: params */ /* params: params */
}; };
@@ -7,13 +7,17 @@ import { IonicModule } from '@ionic/angular';
import { NewPublicationPageRoutingModule } from './new-publication-routing.module'; import { NewPublicationPageRoutingModule } from './new-publication-routing.module';
import { NewPublicationPage } from './new-publication.page'; import { NewPublicationPage } from './new-publication.page';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
FormsModule, FormsModule,
IonicModule, IonicModule,
NewPublicationPageRoutingModule NewPublicationPageRoutingModule,
MatProgressBarModule,
FontAwesomeModule,
], ],
exports: [NewPublicationPage], exports: [NewPublicationPage],
declarations: [NewPublicationPage] declarations: [NewPublicationPage]
@@ -43,22 +43,39 @@
<div *ngIf="seletedContent.length > 0"> <div *ngIf="seletedContent.length > 0">
<ion-label class="attached-title pb-10">Anexos</ion-label> <ion-label class="attached-title pb-10">Anexos</ion-label>
<div> <div>
<div class="d-flex"> <div class="d-flex" >
<div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start" class="mr-10"> <div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start" class="mr-10">
<div> <div>
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)" style="font-weight: 700;color: #c63527;">
X
</div>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" <ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
name="image" ngDefaultControl [src]="seleted.FileBase64" style="width: 50px;"></ion-img> name="image" ngDefaultControl [src]="seleted.FileBase64" style="height: 69px;"></ion-img>
<!-- <div class="progress-container" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'">
<div class="progress-bar" id="myProgressBar"></div>
</div> -->
<!-- <div *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'">
<mat-progress-bar
*ngIf="seleted.chucksManager"
mode="determinate"
style="width: 50%"
></mat-progress-bar>
</div> -->
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70" <video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
preload="metadata" webkit-playsinline="webkit-playsinline"> preload="metadata" webkit-playsinline="webkit-playsinline">
<source type="video/mp4" [src]="seleted.FileBase64"> <source type="video/mp4" [src]="seleted.FileBase64">
</video> </video>
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)">
<ion-icon src="assets/images/theme/gov/icons-delete.svg" class="delete md hydrated"></ion-icon>
</div>
</div> </div>
@@ -156,3 +156,24 @@ font-size: rem(25);
display: block; display: block;
} }
.progress-container {
width: 50%;
background-color: #f1f1f1;
border: 1px solid #ddd;
border-radius: 5px;
overflow: hidden;
}
.progress-bar {
width: 0;
height: 30px;
background-color: #4caf50;
text-align: center;
line-height: 30px;
color: white;
}
@@ -401,12 +401,8 @@ export class NewPublicationPage implements OnInit {
} }
// this.publicationFormMV.setDataToFrom(this.publication)
let a = this.publication // this.publicationFormMV.uploadVideosFiles()
this.publicationFormMV.setDataToFrom(a)
this.publicationFormMV.uploadVideosFiles()
this.publication.Files = this.publication.Files.map( e => ({ this.publication.Files = this.publication.Files.map( e => ({
FileBase64: e.FileBase64, FileBase64: e.FileBase64,
@@ -414,7 +410,6 @@ export class NewPublicationPage implements OnInit {
OriginalFileName: 'foto' OriginalFileName: 'foto'
})) }))
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {