All changes i made

This commit is contained in:
Eudes Inácio
2023-02-27 09:34:36 +01:00
77 changed files with 8025 additions and 6717 deletions
@@ -96,7 +96,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class flex-grow-1">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção*"></ion-textarea>
</div>
</div>
</div>
@@ -4,6 +4,7 @@ import * as moment from 'moment';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-edit-action',
@@ -40,6 +41,7 @@ export class EditActionPage implements OnInit {
constructor(
private publicationsService: PublicationsService,
private toastService: ToastService,
private httpErrorHandle: HttpErrorHandle,
) {
this.folder = new PublicationFolder();
}
@@ -107,15 +109,11 @@ export class EditActionPage implements OnInit {
await this.publicationsService.UpdatePresidentialAction(body).toPromise()
this.close();
this.updateDesktopComponent.emit();
this.toastService._successMessage('Acção presidencial atualizada')
this.httpErrorHandle.httpsSucessMessagge('Editar Acção')
this.getActions.emit()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -101,7 +101,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class flex-grow-1" [class.input-error]="Form?.get('Detail')?.invalid && validateFrom ">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção*"></ion-textarea>
</div>
</div>
</div>
@@ -4,6 +4,7 @@ import * as moment from 'moment';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -36,7 +37,8 @@ export class NewActionPage implements OnInit {
constructor(
private publication: PublicationsService,
private toastService: ToastService
private toastService: ToastService,
private httpErrorHandle: HttpErrorHandle,
) {
this.folder = new PublicationFolder();
@@ -121,16 +123,11 @@ export class NewActionPage implements OnInit {
try {
await this.publication.CreatePublicationFolder(this.folder).toPromise()
this.close();
this.toastService._successMessage('Acção presidencial criada')
this.httpErrorHandle.httpsSucessMessagge('Acção criada')
this.getActions.emit()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel criar a acção presidencial')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -23,7 +23,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto..."></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto*"></ion-textarea>
</div>
</div>
</div>
@@ -8,6 +8,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ThemeService } from 'src/app/services/theme.service';
import { Camera, CameraResultType, CameraSource} from '@capacitor/camera';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-new-publication',
templateUrl: './new-publication.page.html',
@@ -48,7 +49,8 @@ export class NewPublicationPage implements OnInit {
public photoService: PhotoService,
private publications: PublicationsService,
private toastService: ToastService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErroHandle: HttpErrorHandle
) {
this.publicationTitle = 'Nova Publicação';
}
@@ -115,11 +117,11 @@ export class NewPublicationPage implements OnInit {
this.Form = new FormGroup({
Subject: new FormControl(this.pub.Title, [
// Validators.required,
Validators.required,
// Validators.minLength(4)
]),
Message: new FormControl(this.pub.Message, [
// Validators.required
Validators.required,
Validators.maxLength(1000)
])
})
@@ -131,7 +133,11 @@ export class NewPublicationPage implements OnInit {
this.injectValidation()
this.runValidation()
if(this.Form.invalid) return false
if(this.Form.invalid) {
return false
} else {
}
if(this.publicationType == '3') {
@@ -155,15 +161,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -188,15 +190,11 @@ export class NewPublicationPage implements OnInit {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -220,15 +218,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -255,15 +249,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.CreatePublication(this.folderId, this.publication).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
this.goBackToViewPublications.emit();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}