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
+25 -60
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": { "ngx-socket-io": {
"version": "3.4.0", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/ngx-socket-io/-/ngx-socket-io-3.4.0.tgz", "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==", "integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==",
"dev": true "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": { "nopt": {
"version": "4.0.3", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
@@ -21186,43 +21189,29 @@
} }
}, },
"sharp": { "sharp": {
"version": "0.25.4", "version": "0.29.1",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.25.4.tgz", "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.29.1.tgz",
"integrity": "sha512-umSzJJ1oBwIOfwFFt/fJ7JgCva9FvrEU2cbbm7u/3hSDZhXvkME8WE5qpaJqLIe2Har5msF5UG4CzYlEg5o3BQ==", "integrity": "sha512-DpgdAny9TuS+oWCQ7MRS8XyY9x6q1+yW3a5wNx0J3HrGuB/Jot/8WcT+lElHY9iJu2pwtegSGxqMaqFiMhs4rQ==",
"requires": { "requires": {
"color": "^3.1.2", "color": "^4.0.1",
"detect-libc": "^1.0.3", "detect-libc": "^1.0.3",
"node-addon-api": "^3.0.0", "node-addon-api": "^4.1.0",
"npmlog": "^4.1.2", "prebuild-install": "^6.1.4",
"prebuild-install": "^5.3.4", "semver": "^7.3.5",
"semver": "^7.3.2", "simple-get": "^3.1.0",
"simple-get": "^4.0.0", "tar-fs": "^2.1.1",
"tar": "^6.0.2",
"tunnel-agent": "^0.6.0" "tunnel-agent": "^0.6.0"
}, },
"dependencies": { "dependencies": {
"color": { "color": {
"version": "3.2.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", "resolved": "https://registry.npmjs.org/color/-/color-4.0.1.tgz",
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "integrity": "sha512-rpZjOKN5O7naJxkH2Rx1sZzzBgaiWECc6BYXjeCE6kF0kcASJYbUq02u7JqIHwCb/j3NhV+QhRL2683aICeGZA==",
"requires": { "requires": {
"color-convert": "^1.9.3", "color-convert": "^2.0.1",
"color-string": "^1.6.0" "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": { "decompress-response": {
"version": "4.2.1", "version": "4.2.1",
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz",
@@ -21236,28 +21225,11 @@
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",
"integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==" "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA=="
}, },
"prebuild-install": { "node-addon-api": {
"version": "5.3.6", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.2.0.tgz",
"integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", "integrity": "sha512-eazsqzwG2lskuzBqCGPi7Ac2UgOoMz8JVOXVhTvvPDYhthvNpefx8jWD8Np7Gv+2Sz0FlPWZk0nJV0z598Wn8Q=="
"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": { "simple-get": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz",
@@ -21269,8 +21241,6 @@
} }
} }
} }
}
}
}, },
"shebang-command": { "shebang-command": {
"version": "2.0.0", "version": "2.0.0",
@@ -25065,11 +25035,6 @@
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" "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": { "wide-align": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "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", "lite-server": "^2.6.1",
"moment": "^2.29.1", "moment": "^2.29.1",
"ng2-pdf-viewer": "^7.0.1", "ng2-pdf-viewer": "^7.0.1",
"ngx-cookie-service": "^12.0.3",
"ngx-socket-io": "^3.2.0", "ngx-socket-io": "^3.2.0",
"pdfjs": "^2.4.6", "pdfjs": "^2.4.6",
"pdfjs-dist": "^2.9.359", "pdfjs-dist": "^2.9.359",
"puppeteer": "^10.1.0", "puppeteer": "^10.1.0",
"rxjs": "~6.6.3", "rxjs": "~6.6.3",
"rxjs-compat": "^6.6.7", "rxjs-compat": "^6.6.7",
"sharp": "^0.25.4", "sharp": "^0.29.1",
"socket.io-client": "^2.3.0", "socket.io-client": "^2.3.0",
"ts-jest": "^27.0.3", "ts-jest": "^27.0.3",
"tslib": "^2.0.0", "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 { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { PdfViewerModule } from 'ng2-pdf-viewer'; import { PdfViewerModule } from 'ng2-pdf-viewer';
import { SQLite } from '@ionic-native/sqlite/ngx'; import { SQLite } from '@ionic-native/sqlite/ngx';
import { CookieService } from 'ngx-cookie-service';
@NgModule({ @NgModule({
declarations: [AppComponent], declarations: [AppComponent],
@@ -111,7 +111,8 @@ import { SQLite } from '@ionic-native/sqlite/ngx';
ScreenOrientation, ScreenOrientation,
Network, Network,
File, File,
SQLite SQLite,
CookieService
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA] schemas: [CUSTOM_ELEMENTS_SCHEMA]
@@ -13,7 +13,7 @@
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div> </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> <ion-textarea class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
</div> </div>
</div> </div>
@@ -73,7 +73,8 @@ export class CreateProcessPage implements OnInit {
profile: string; profile: string;
Form: FormGroup; Form: FormGroup;
validateFrom = false validateFrom = false;
validateField = false;
emptyTextDescription = "Sem intervenientes selecionados"; emptyTextDescription = "Sem intervenientes selecionados";
showEmptyContainer = true; showEmptyContainer = true;
@@ -380,6 +381,7 @@ export class CreateProcessPage implements OnInit {
} }
} }
else{ else{
this.validateField = true;
this.toastService.badRequest('Por favor adicione uma nota'); this.toastService.badRequest('Por favor adicione uma nota');
} }
loader.remove(); loader.remove();
@@ -50,7 +50,7 @@
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon> <ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon>
</div> </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 <ion-select
placeholder="Prazo*" placeholder="Prazo*"
[(ngModel)]="postData.Priority" [(ngModel)]="postData.Priority"
@@ -88,7 +88,8 @@ export class ExpedientTaskModalPage implements OnInit {
toppings = new FormControl(); toppings = new FormControl();
Form: FormGroup; Form: FormGroup;
validateFrom = false validateFrom = false;
validateField = false;
get toppingsValues() { get toppingsValues() {
return this.toppings.value; return this.toppings.value;
@@ -184,7 +185,7 @@ export class ExpedientTaskModalPage implements OnInit {
} }
runValidation() { runValidation() {
this.validateFrom = true this.validateFrom = true;
} }
injectValidation() { injectValidation() {
@@ -426,17 +427,23 @@ export class ExpedientTaskModalPage implements OnInit {
} }
} }
if(this.postData.DispatchFolder.Message){
try { try {
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise(); this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado'); await this.toastService.successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr); this.modalController.dismiss(action_despacho_pr);
} catch (error) { } catch (error) {
await this.toastService.badRequest('Processo não efetuado') await this.toastService.badRequest('Processo não efetuado')
} finally { } finally {
loader.remove() //loader.remove()
} }
}
console.log('this.taskResult', this.taskResult); else{
this.validateField = true;
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break; break;
case '1': // parecer case '1': // parecer
@@ -459,9 +466,7 @@ export class ExpedientTaskModalPage implements OnInit {
} }
} }
if(this.postData.DispatchFolder.Message){
try { try {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise(); this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado'); await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr); this.modalController.dismiss(action_parecer_pr);
@@ -469,14 +474,8 @@ export class ExpedientTaskModalPage implements OnInit {
await this.toastService.badRequest('Processo não efetuado') await this.toastService.badRequest('Processo não efetuado')
} finally { } finally {
//loader.remove() loader.remove()
} }
}
else{
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break; break;
} }
+7 -2
View File
@@ -9,6 +9,7 @@ import { AuthConnstants } from '../config/auth-constants';
import { AlertController } from '@ionic/angular'; import { AlertController } from '@ionic/angular';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { AESEncrypt } from '../services/aesencrypt.service'; import { AESEncrypt } from '../services/aesencrypt.service';
import { CookieService } from 'ngx-cookie-service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -27,6 +28,7 @@ export class AuthService {
private storageService:StorageService, private storageService:StorageService,
public alertController: AlertController, public alertController: AlertController,
private aesencrypt: AESEncrypt, private aesencrypt: AESEncrypt,
private cookieService: CookieService,
) { ) {
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
@@ -102,8 +104,11 @@ export class AuthService {
console.log('Login to Rocket chat OK'); console.log('Login to Rocket chat OK');
this.ValidatedUserChat = responseChat; this.ValidatedUserChat = responseChat;
localStorage.setItem('userChat', JSON.stringify(responseChat)); localStorage.setItem('userChat', JSON.stringify(responseChat));
localStorage.setItem('Meteor.loginToken', JSON.stringify(responseChat['data'].authToken)); localStorage.setItem('Meteor.loginToken', responseChat['data'].authToken);
localStorage.setItem('Meteor.userId', JSON.stringify(responseChat['data'].userId)); 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); this.storageService.store(AuthConnstants.AUTH, responseChat);
return true; return true;
} }