This commit is contained in:
Eudes Inácio
2021-10-18 07:44:49 +01:00
9 changed files with 105 additions and 132 deletions
+33 -68
View File
@@ -17028,6 +17028,14 @@
}
}
},
"ngx-cookie-service": {
"version": "12.0.3",
"resolved": "https://registry.npmjs.org/ngx-cookie-service/-/ngx-cookie-service-12.0.3.tgz",
"integrity": "sha512-F5xJBTrrreI2DERGOrO6U+L7s031HxTER+3Z4gDCwxdTl4AXmtWddMxxQVw7KflOLZ4InYEs6FjQsXmKU4HsJg==",
"requires": {
"tslib": "^2.0.0"
}
},
"ngx-socket-io": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/ngx-socket-io/-/ngx-socket-io-3.4.0.tgz",
@@ -17147,11 +17155,6 @@
"integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==",
"dev": true
},
"noop-logger": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz",
"integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI="
},
"nopt": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
@@ -21186,43 +21189,29 @@
}
},
"sharp": {
"version": "0.25.4",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.25.4.tgz",
"integrity": "sha512-umSzJJ1oBwIOfwFFt/fJ7JgCva9FvrEU2cbbm7u/3hSDZhXvkME8WE5qpaJqLIe2Har5msF5UG4CzYlEg5o3BQ==",
"version": "0.29.1",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.29.1.tgz",
"integrity": "sha512-DpgdAny9TuS+oWCQ7MRS8XyY9x6q1+yW3a5wNx0J3HrGuB/Jot/8WcT+lElHY9iJu2pwtegSGxqMaqFiMhs4rQ==",
"requires": {
"color": "^3.1.2",
"color": "^4.0.1",
"detect-libc": "^1.0.3",
"node-addon-api": "^3.0.0",
"npmlog": "^4.1.2",
"prebuild-install": "^5.3.4",
"semver": "^7.3.2",
"simple-get": "^4.0.0",
"tar": "^6.0.2",
"node-addon-api": "^4.1.0",
"prebuild-install": "^6.1.4",
"semver": "^7.3.5",
"simple-get": "^3.1.0",
"tar-fs": "^2.1.1",
"tunnel-agent": "^0.6.0"
},
"dependencies": {
"color": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/color/-/color-4.0.1.tgz",
"integrity": "sha512-rpZjOKN5O7naJxkH2Rx1sZzzBgaiWECc6BYXjeCE6kF0kcASJYbUq02u7JqIHwCb/j3NhV+QhRL2683aICeGZA==",
"requires": {
"color-convert": "^1.9.3",
"color-convert": "^2.0.1",
"color-string": "^1.6.0"
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"decompress-response": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz",
@@ -21236,38 +21225,19 @@
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",
"integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA=="
},
"prebuild-install": {
"version": "5.3.6",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz",
"integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==",
"node-addon-api": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.2.0.tgz",
"integrity": "sha512-eazsqzwG2lskuzBqCGPi7Ac2UgOoMz8JVOXVhTvvPDYhthvNpefx8jWD8Np7Gv+2Sz0FlPWZk0nJV0z598Wn8Q=="
},
"simple-get": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz",
"integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==",
"requires": {
"detect-libc": "^1.0.3",
"expand-template": "^2.0.3",
"github-from-package": "0.0.0",
"minimist": "^1.2.3",
"mkdirp-classic": "^0.5.3",
"napi-build-utils": "^1.0.1",
"node-abi": "^2.7.0",
"noop-logger": "^0.1.1",
"npmlog": "^4.0.1",
"pump": "^3.0.0",
"rc": "^1.2.7",
"simple-get": "^3.0.3",
"tar-fs": "^2.0.0",
"tunnel-agent": "^0.6.0",
"which-pm-runs": "^1.0.0"
},
"dependencies": {
"simple-get": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz",
"integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==",
"requires": {
"decompress-response": "^4.2.0",
"once": "^1.3.1",
"simple-concat": "^1.0.0"
}
}
"decompress-response": "^4.2.0",
"once": "^1.3.1",
"simple-concat": "^1.0.0"
}
}
}
@@ -25065,11 +25035,6 @@
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
},
"which-pm-runs": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz",
"integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs="
},
"wide-align": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
+2 -1
View File
@@ -99,13 +99,14 @@
"lite-server": "^2.6.1",
"moment": "^2.29.1",
"ng2-pdf-viewer": "^7.0.1",
"ngx-cookie-service": "^12.0.3",
"ngx-socket-io": "^3.2.0",
"pdfjs": "^2.4.6",
"pdfjs-dist": "^2.9.359",
"puppeteer": "^10.1.0",
"rxjs": "~6.6.3",
"rxjs-compat": "^6.6.7",
"sharp": "^0.25.4",
"sharp": "^0.29.1",
"socket.io-client": "^2.3.0",
"ts-jest": "^27.0.3",
"tslib": "^2.0.0",
+3 -2
View File
@@ -57,7 +57,7 @@ import { fab } from '@fortawesome/free-brands-svg-icons'
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { SQLite } from '@ionic-native/sqlite/ngx';
import { CookieService } from 'ngx-cookie-service';
@NgModule({
declarations: [AppComponent],
@@ -111,7 +111,8 @@ import { SQLite } from '@ionic-native/sqlite/ngx';
ScreenOrientation,
Network,
File,
SQLite
SQLite,
CookieService
],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
@@ -13,15 +13,15 @@
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom || validateField ">
<ion-textarea class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
</div>
</div>
</div>
<!-- Add scrolls -->
<div class="d-flex flex-column height-100 overflow-y-auto">
<div class="container-div width-100">
<div class="ion-item-class-2 width-100">
<div class="ion-icon-class">
@@ -29,11 +29,11 @@
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom" >
<ion-select
placeholder="Prazo*"
[(ngModel)]="postData.Priority"
interface="action-sheet"
Cancel-text="Cancelar"
<ion-select
placeholder="Prazo*"
[(ngModel)]="postData.Priority"
interface="action-sheet"
Cancel-text="Cancelar"
required
class="d-block d-md-none"
>
@@ -62,19 +62,19 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom ">
<!-- <ion-item
<!-- <ion-item
class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none">
<ion-select
[(ngModel)]="selectedTypes"
(ngModelChange)="onSelectedTypesChanged($event)"
(ngModelChange)="onSelectedTypesChanged($event)"
multiple="true" interface="alert" Cancel-text="Cancelar" required>
<ion-select-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</ion-select-option>
</ion-select>
</ion-item> -->
<mat-form-field
floatLabel="never"
appearance="fill"
appearance="fill"
class="width-100 d-block"
appearance="none">
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
@@ -135,21 +135,21 @@
</div>
<div class="attach-document pl-10">
<ion-label>Anexar Documentos</ion-label>
</div>
</div>
</ion-label>
</div>
<div class="list " *ngFor="let document of documents; let i = index" >
<div class="list " *ngFor="let document of documents; let i = index" >
<ion-list>
<ion-item>
<ion-label>
<p class="d-flex ion-justify-content-between">
<span class="attach-title-item">{{document.Assunto}}</span>
<span class="app-name">{{document.appName}}</span>
<p class="d-flex ion-justify-content-between">
<span class="attach-title-item">{{document.Assunto}}</span>
<span class="app-name">{{document.appName}}</span>
<span class="close-button text-black cursor-pointer" (click)="removeAttachment(i)" >
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
</span>
</p>
</p>
<p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data | date: 'dd-MM-yyyy HH:mm'}} </span></p>
</ion-label>
</ion-item>
@@ -158,11 +158,11 @@
</div>
</div>
<div *ngIf="postData" class="aside-right flex-column height-100">
<app-empty-container
[texto]="emptyTextDescription"
*ngIf="!showAttendees"
<app-empty-container
[texto]="emptyTextDescription"
*ngIf="!showAttendees"
class="d-flex height-100 flex-column">
</app-empty-container>
<app-attendee-modal
@@ -187,4 +187,4 @@
<button class="btn-cancel" shape="round" (click)="cancelTask()">Cancelar</button>
<button class="btn-ok" shape="round" (click)="saveTask()">Gravar</button>
</div>
</ion-footer>
</ion-footer>
@@ -2,7 +2,7 @@
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
.title{
font-family: Roboto;
font-size: 25px;
@@ -61,7 +61,7 @@
.list-people{
width: 256px;
float: left;
}
.add-people{
width: 45px;
@@ -78,7 +78,7 @@
font-size: 15px;
color: #0d89d1;
}
.attach-title-item{
width: 100%;
font-size: 15px;
@@ -127,7 +127,7 @@
}
}
.close-button {
@@ -140,13 +140,13 @@
.app-name {
display: none;
}
.close-button {
display: block !important;
}
}
.app-name{
background: #42b9f2;
border-radius: 18px;
@@ -73,7 +73,8 @@ export class CreateProcessPage implements OnInit {
profile: string;
Form: FormGroup;
validateFrom = false
validateFrom = false;
validateField = false;
emptyTextDescription = "Sem intervenientes selecionados";
showEmptyContainer = true;
@@ -380,6 +381,7 @@ export class CreateProcessPage implements OnInit {
}
}
else{
this.validateField = true;
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
@@ -50,7 +50,7 @@
<div class="ion-icon-class">
<ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom ">
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom || validateField ">
<ion-select
placeholder="Prazo*"
[(ngModel)]="postData.Priority"
@@ -88,7 +88,8 @@ export class ExpedientTaskModalPage implements OnInit {
toppings = new FormControl();
Form: FormGroup;
validateFrom = false
validateFrom = false;
validateField = false;
get toppingsValues() {
return this.toppings.value;
@@ -184,7 +185,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
runValidation() {
this.validateFrom = true
this.validateFrom = true;
}
injectValidation() {
@@ -426,17 +427,23 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
try {
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
} finally {
loader.remove()
}
if(this.postData.DispatchFolder.Message){
try {
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
console.log('this.taskResult', this.taskResult);
await this.toastService.badRequest('Processo não efetuado')
} finally {
//loader.remove()
}
}
else{
this.validateField = true;
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break;
case '1': // parecer
@@ -459,24 +466,16 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
if(this.postData.DispatchFolder.Message){
try {
try {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
} finally {
//loader.remove()
}
await this.toastService.badRequest('Processo não efetuado')
} finally {
loader.remove()
}
else{
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break;
}
+7 -2
View File
@@ -9,6 +9,7 @@ import { AuthConnstants } from '../config/auth-constants';
import { AlertController } from '@ionic/angular';
import { SessionStore } from '../store/session.service';
import { AESEncrypt } from '../services/aesencrypt.service';
import { CookieService } from 'ngx-cookie-service';
@Injectable({
providedIn: 'root'
@@ -27,6 +28,7 @@ export class AuthService {
private storageService:StorageService,
public alertController: AlertController,
private aesencrypt: AESEncrypt,
private cookieService: CookieService,
) {
this.headers = new HttpHeaders();
@@ -102,8 +104,11 @@ export class AuthService {
console.log('Login to Rocket chat OK');
this.ValidatedUserChat = responseChat;
localStorage.setItem('userChat', JSON.stringify(responseChat));
localStorage.setItem('Meteor.loginToken', JSON.stringify(responseChat['data'].authToken));
localStorage.setItem('Meteor.userId', JSON.stringify(responseChat['data'].userId));
localStorage.setItem('Meteor.loginToken', responseChat['data'].authToken);
localStorage.setItem('Meteor.userId',responseChat['data'].userId);
this.cookieService.set('rc_token', responseChat['data'].authToken);
this.cookieService.set('rc_uid', responseChat['data'].userId);
alert(this.cookieService.get('rc_uid'));
this.storageService.store(AuthConnstants.AUTH, responseChat);
return true;
}