packed installed

This commit is contained in:
Eudes Inácio
2022-04-04 00:37:00 +01:00
69 changed files with 764 additions and 431 deletions
+1
View File
@@ -26,6 +26,7 @@ dependencies {
implementation project(':capacitor-voice-recorder') implementation project(':capacitor-voice-recorder')
implementation project(':capacitor2-file-picker') implementation project(':capacitor2-file-picker')
implementation "com.soundcloud.android:android-crop:1.0.0@aar" implementation "com.soundcloud.android:android-crop:1.0.0@aar"
implementation "com.android.support:support-v4:27.+"
implementation "com.squareup.okhttp:okhttp-urlconnection:2+" implementation "com.squareup.okhttp:okhttp-urlconnection:2+"
} }
apply from: "../../node_modules/com-sarriaroman-photoviewer/src/android/photoviewer.gradle" apply from: "../../node_modules/com-sarriaroman-photoviewer/src/android/photoviewer.gradle"
@@ -1,17 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest package="com.gpr.gabinetedigital" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name=".App" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/title_activity_main" android:launchMode="singleTask" android:name="com.gpr.gabinetedigital.MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
</provider>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
@@ -16,8 +16,5 @@
"sound" "sound"
] ]
} }
},
"server": {
"url": "http://192.168.137.1:8100"
} }
} }
+4
View File
@@ -15,6 +15,10 @@
<param name="onload" value="true"/> <param name="onload" value="true"/>
</feature> </feature>
<feature name="FileOpener2">
<param name="android-package" value="io.github.pwlin.cordova.plugins.fileopener2.FileOpener2"/>
</feature>
<feature name="FilePath"> <feature name="FilePath">
<param name="android-package" value="com.hiddentao.cordova.filepath.FilePath"/> <param name="android-package" value="com.hiddentao.cordova.filepath.FilePath"/>
<param name="onload" value="true"/> <param name="onload" value="true"/>
+5
View File
@@ -25,6 +25,11 @@
"input": "src/assets", "input": "src/assets",
"output": "assets" "output": "assets"
}, },
{
"glob": "**/*",
"input": "node_modules/ngx-extended-pdf-viewer/assets/",
"output": "/assets/"
},
{ {
"glob": "**/*.svg", "glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg", "input": "node_modules/ionicons/dist/ionicons/svg",
+67 -3
View File
@@ -814,6 +814,36 @@
} }
} }
}, },
"@awesome-cordova-plugins/file": {
"version": "5.41.0",
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/file/-/file-5.41.0.tgz",
"integrity": "sha512-1UrtbRdHIDZEFD6UnKFeBpITK+UqrAhr/saJmMsXLjCtsdJFB05abNHzcfdBO+z3mQFK/DnMQ0YdYJtR5x6zYw==",
"requires": {
"@types/cordova": "^0.0.34"
},
"dependencies": {
"@types/cordova": {
"version": "0.0.34",
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
}
}
},
"@awesome-cordova-plugins/file-opener": {
"version": "5.41.0",
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/file-opener/-/file-opener-5.41.0.tgz",
"integrity": "sha512-CFdAum1EOxSdi+yMzEkOribU/joaDiqs1lL/ddxj7I78ryzlU+dj7rg6HZKvAN7aTjbWTX6A3p628eNpQoopgg==",
"requires": {
"@types/cordova": "^0.0.34"
},
"dependencies": {
"@types/cordova": {
"version": "0.0.34",
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
}
}
},
"@awesome-cordova-plugins/multiple-document-picker": { "@awesome-cordova-plugins/multiple-document-picker": {
"version": "5.40.0", "version": "5.40.0",
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/multiple-document-picker/-/multiple-document-picker-5.40.0.tgz", "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/multiple-document-picker/-/multiple-document-picker-5.40.0.tgz",
@@ -3081,6 +3111,21 @@
} }
} }
}, },
"@ionic-native/file-opener": {
"version": "5.36.0",
"resolved": "https://registry.npmjs.org/@ionic-native/file-opener/-/file-opener-5.36.0.tgz",
"integrity": "sha512-UKp3pbqvQXsAtLMJ5JE+KcTMxpjSZMFebf6nvy/KJvwy85JGIaCV4ZVM/H9CFUrHJMWBH6wDbY+WPygnsrl4Yg==",
"requires": {
"@types/cordova": "^0.0.34"
},
"dependencies": {
"@types/cordova": {
"version": "0.0.34",
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
}
}
},
"@ionic-native/file-path": { "@ionic-native/file-path": {
"version": "5.36.0", "version": "5.36.0",
"resolved": "https://registry.npmjs.org/@ionic-native/file-path/-/file-path-5.36.0.tgz", "resolved": "https://registry.npmjs.org/@ionic-native/file-path/-/file-path-5.36.0.tgz",
@@ -3197,9 +3242,9 @@
} }
}, },
"@ionic-native/network": { "@ionic-native/network": {
"version": "5.36.0", "version": "5.22.0-beta-1",
"resolved": "https://registry.npmjs.org/@ionic-native/network/-/network-5.36.0.tgz", "resolved": "https://registry.npmjs.org/@ionic-native/network/-/network-5.22.0-beta-1.tgz",
"integrity": "sha512-gpa7cJqodEK+zmmViYJCqEpXoKSXcaYLaaRKdv5gn5M++bpmiw2pKM9JH8VoqYWaYDcUwD3S0yYeBBkG5DE0Kg==", "integrity": "sha512-reOgFhHkyzCujqoGc1x8U9AZ40SBzdYT4HCFA6L2RwQT1NMyv+sDsp5er64p419Rfxg1k2QVTaDlEh+xPwhEqQ==",
"requires": { "requires": {
"@types/cordova": "^0.0.34" "@types/cordova": "^0.0.34"
}, },
@@ -8509,6 +8554,11 @@
"resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz", "resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz",
"integrity": "sha512-m7cughw327CjONN/qjzsTpSesLaeybksQh420/gRuSXJX5Zt9NfgsSbqqKDon6jnQ9Mm7h7imgyO2uJ34XMBtA==" "integrity": "sha512-m7cughw327CjONN/qjzsTpSesLaeybksQh420/gRuSXJX5Zt9NfgsSbqqKDon6jnQ9Mm7h7imgyO2uJ34XMBtA=="
}, },
"cordova-plugin-file-opener2": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/cordova-plugin-file-opener2/-/cordova-plugin-file-opener2-3.0.5.tgz",
"integrity": "sha512-tjLHDamH5+y0bJZYVe2967L1S4R8tL4Y0rJUzJGoxsyiw3FUlrJNS199POOpzZZ6Xhlntn9a2o7+84r1dMN21A=="
},
"cordova-plugin-filepath": { "cordova-plugin-filepath": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/cordova-plugin-filepath/-/cordova-plugin-filepath-1.6.0.tgz", "resolved": "https://registry.npmjs.org/cordova-plugin-filepath/-/cordova-plugin-filepath-1.6.0.tgz",
@@ -16099,6 +16149,11 @@
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
}, },
"lodash.deburr": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz",
"integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s="
},
"lodash.isfinite": { "lodash.isfinite": {
"version": "3.3.2", "version": "3.3.2",
"resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz",
@@ -16933,6 +16988,15 @@
"tslib": "^2.0.0" "tslib": "^2.0.0"
} }
}, },
"ngx-extended-pdf-viewer": {
"version": "13.0.0-alpha.2",
"resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz",
"integrity": "sha512-/+aTZVW8uubzWHI1KK4eC6QaS2I59IHnJI/0jgyhDkF2bXywB+PR7O/g4aEstRU56lzayh/W8YGSAJbB8tobkw==",
"requires": {
"lodash.deburr": "^4.1.0",
"tslib": "^2.3.0"
}
},
"ngx-image-compress": { "ngx-image-compress": {
"version": "11.0.3", "version": "11.0.3",
"resolved": "https://registry.npmjs.org/ngx-image-compress/-/ngx-image-compress-11.0.3.tgz", "resolved": "https://registry.npmjs.org/ngx-image-compress/-/ngx-image-compress-11.0.3.tgz",
+6 -1
View File
@@ -32,6 +32,8 @@
"@angular/platform-browser-dynamic": "~12.1.2", "@angular/platform-browser-dynamic": "~12.1.2",
"@angular/router": "~12.1.2", "@angular/router": "~12.1.2",
"@awesome-cordova-plugins/core": "^5.40.0", "@awesome-cordova-plugins/core": "^5.40.0",
"@awesome-cordova-plugins/file": "^5.41.0",
"@awesome-cordova-plugins/file-opener": "^5.41.0",
"@awesome-cordova-plugins/multiple-document-picker": "^5.40.0", "@awesome-cordova-plugins/multiple-document-picker": "^5.40.0",
"@byteowls/capacitor-filesharer": "^3.0.0", "@byteowls/capacitor-filesharer": "^3.0.0",
"@capacitor-community/camera-preview": "^1.2.1", "@capacitor-community/camera-preview": "^1.2.1",
@@ -64,6 +66,7 @@
"@ionic-native/document-viewer": "^5.36.0", "@ionic-native/document-viewer": "^5.36.0",
"@ionic-native/fcm": "^5.36.0", "@ionic-native/fcm": "^5.36.0",
"@ionic-native/file": "^5.36.0", "@ionic-native/file": "^5.36.0",
"@ionic-native/file-opener": "^5.36.0",
"@ionic-native/file-path": "^5.30.0", "@ionic-native/file-path": "^5.30.0",
"@ionic-native/fingerprint-aio": "^4.20.0", "@ionic-native/fingerprint-aio": "^4.20.0",
"@ionic-native/http": "^5.36.0", "@ionic-native/http": "^5.36.0",
@@ -73,7 +76,7 @@
"@ionic-native/local-notifications": "^4.20.0", "@ionic-native/local-notifications": "^4.20.0",
"@ionic-native/media": "^5.36.0", "@ionic-native/media": "^5.36.0",
"@ionic-native/media-capture": "^5.36.0", "@ionic-native/media-capture": "^5.36.0",
"@ionic-native/network": "^5.36.0", "@ionic-native/network": "^5.22.0-beta-1",
"@ionic-native/photo-viewer": "^5.36.0", "@ionic-native/photo-viewer": "^5.36.0",
"@ionic-native/screen-orientation": "^5.35.0", "@ionic-native/screen-orientation": "^5.35.0",
"@ionic-native/social-sharing": "^5.36.0", "@ionic-native/social-sharing": "^5.36.0",
@@ -110,6 +113,7 @@
"cordova-plugin-crop": "^0.4.0", "cordova-plugin-crop": "^0.4.0",
"cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git", "cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git",
"cordova-plugin-file": "^6.0.2", "cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^3.0.5",
"cordova-plugin-filepath": "^1.5.8", "cordova-plugin-filepath": "^1.5.8",
"cordova-plugin-multiple-documents-picker": "^1.0.0", "cordova-plugin-multiple-documents-picker": "^1.0.0",
"cordova-plugin-okhttp": "^2.0.0", "cordova-plugin-okhttp": "^2.0.0",
@@ -142,6 +146,7 @@
"ng-lazyload-image": "^9.1.2", "ng-lazyload-image": "^9.1.2",
"ng2-pdf-viewer": "^3.0.8", "ng2-pdf-viewer": "^3.0.8",
"ngx-cookie-service": "^12.0.3", "ngx-cookie-service": "^12.0.3",
"ngx-extended-pdf-viewer": "^13.0.0-alpha.2",
"ngx-image-compress": "^11.0.3", "ngx-image-compress": "^11.0.3",
"ngx-image-cropper": "^5.0.1", "ngx-image-cropper": "^5.0.1",
"ngx-letters-avatar": "^1.0.2", "ngx-letters-avatar": "^1.0.2",
+2
View File
@@ -66,6 +66,7 @@ import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
import {NgxImageCompressService} from 'ngx-image-compress'; import {NgxImageCompressService} from 'ngx-image-compress';
import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module'; import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
import { IonicImageLoaderComponent, IonicImageLoaderModule } from 'ionic-image-loader-v5'; import { IonicImageLoaderComponent, IonicImageLoaderModule } from 'ionic-image-loader-v5';
import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';
/* import { FCM } from '@ionic-native/fcm/ngx'; /* import { FCM } from '@ionic-native/fcm/ngx';
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
@@ -140,6 +141,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
PhotoViewer, PhotoViewer,
NgxImageCompressService, NgxImageCompressService,
MultipleDocumentsPicker, MultipleDocumentsPicker,
NgxExtendedPdfViewerModule
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],
+8 -7
View File
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { AlertController, Platform } from '@ionic/angular'; import { AlertController, Platform } from '@ionic/angular';
import { PermissionService } from '../services/permission.service'; import { PermissionService } from '../services/permission.service';
import { PermissionList } from '../models/permissionList'; import { PermissionList } from '../models/permission/permissionList';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -24,13 +24,14 @@ export class InactivityGuard implements CanActivate {
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
if(this.permissionService.userPermission(this.permissionList.Agenda) || this.permissionService.userPermission(this.permissionList.Gabinete)){ console.log(this.permissionList);
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']); this.router.navigate(['/home/events']);
} }
else if(this.permissionService.userPermission(this.permissionList.Chat)){ else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){
this.router.navigate(['/home/chat']); this.router.navigate(['/home/chat']);
} }
else if(this.permissionService.userPermission(this.permissionList.Actions)){ else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
this.router.navigate(['/home/publications']); this.router.navigate(['/home/publications']);
} }
return false return false
@@ -40,13 +41,13 @@ export class InactivityGuard implements CanActivate {
return true return true
}//Mobile or Tablet without session }//Mobile or Tablet without session
else { else {
if(this.permissionService.userPermission(this.permissionList.Agenda) || this.permissionService.userPermission(this.permissionList.Gabinete)){ if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']); this.router.navigate(['/home/events']);
} }
else if(this.permissionService.userPermission(this.permissionList.Chat)){ else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){
this.router.navigate(['/home/chat']); this.router.navigate(['/home/chat']);
} }
else if(this.permissionService.userPermission(this.permissionList.Actions)){ else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
this.router.navigate(['/home/publications']); this.router.navigate(['/home/publications']);
} }
return false return false
+5 -5
View File
@@ -2,7 +2,7 @@
<ion-tabs class="tab"> <ion-tabs class="tab">
<ion-tab-bar class="bottoms" slot="bottom"> <ion-tab-bar class="bottoms" slot="bottom">
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda]) || p.userPermission([permissionList.Gabinete])" tab="events" [class.active]="pathname === '/home/events'"> <ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
<!-- <ion-icon name="home"></ion-icon> --> <!-- <ion-icon name="home"></ion-icon> -->
<ion-icon *ngIf="pathname != '/home/events'" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon> <ion-icon *ngIf="pathname != '/home/events'" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
<ion-icon *ngIf="pathname == '/home/events'" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon> <ion-icon *ngIf="pathname == '/home/events'" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon>
@@ -10,14 +10,14 @@
<ion-label>Início</ion-label> <ion-label>Início</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda])" tab="agenda" [class.active]="pathname === '/home/agenda' "> <ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access])" tab="agenda" [class.active]="pathname === '/home/agenda' ">
<!-- <ion-icon name="calendar"></ion-icon> --> <!-- <ion-icon name="calendar"></ion-icon> -->
<ion-icon *ngIf="pathname != '/home/agenda'" class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon> <ion-icon *ngIf="pathname != '/home/agenda'" class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
<ion-icon *ngIf="pathname == '/home/agenda'" class="nav-icon" src="assets/images/nav-hover/icons-nav-agenda-active.svg"></ion-icon> <ion-icon *ngIf="pathname == '/home/agenda'" class="nav-icon" src="assets/images/nav-hover/icons-nav-agenda-active.svg"></ion-icon>
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Agenda</ion-label> <ion-label style="margin-bottom: 2px;" class="overflow-visible">Agenda</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button *ngIf="p.userPermission([permissionList.Gabinete])" (click)="goto('/home/gabinete-digital')" [class.active]="pathname === '/home/gabinete-digital' "> <ion-tab-button *ngIf="p.userPermission([permissionList.Gabinete.access])" (click)="goto('/home/gabinete-digital')" [class.active]="pathname === '/home/gabinete-digital' ">
<!-- <ion-icon name="file-tray-stacked"></ion-icon> --> <!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
<ion-icon *ngIf="pathname != '/home/gabinete-digital'" class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon> <ion-icon *ngIf="pathname != '/home/gabinete-digital'" class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
<ion-icon *ngIf="pathname == '/home/gabinete-digital'" class="nav-icon" src="assets/images/nav-hover/icons-nav-gabinete-active.svg"></ion-icon> <ion-icon *ngIf="pathname == '/home/gabinete-digital'" class="nav-icon" src="assets/images/nav-hover/icons-nav-gabinete-active.svg"></ion-icon>
@@ -26,13 +26,13 @@
<ion-label>Gabinete</ion-label> <ion-label>Gabinete</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button *ngIf="p.userPermission([permissionList.Actions])" tab="publications" [class.active]="pathname === '/home/publications' "> <ion-tab-button *ngIf="p.userPermission([permissionList.Actions.access])" tab="publications" [class.active]="pathname === '/home/publications' ">
<ion-icon *ngIf="pathname != '/home/publications'" class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon> <ion-icon *ngIf="pathname != '/home/publications'" class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
<ion-icon *ngIf="pathname == '/home/publications'" class="nav-icon" src="assets/images/nav-hover/icons-nav-actions-active.svg"></ion-icon> <ion-icon *ngIf="pathname == '/home/publications'" class="nav-icon" src="assets/images/nav-hover/icons-nav-actions-active.svg"></ion-icon>
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Ações</ion-label> <ion-label style="margin-bottom: 2px;" class="overflow-visible">Ações</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button *ngIf="p.userPermission([permissionList.Actions])" tab="chat" [class.active]="pathname === '/home/chat' "> <ion-tab-button *ngIf="p.userPermission([permissionList.Chat.access])" tab="chat" [class.active]="pathname === '/home/chat' ">
<ion-icon *ngIf="pathname != '/home/chat'" class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon> <ion-icon *ngIf="pathname != '/home/chat'" class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
<ion-icon *ngIf="pathname == '/home/chat'" class="nav-icon" src="assets/images/nav-hover/icons-nav-chat-active.svg"></ion-icon> <ion-icon *ngIf="pathname == '/home/chat'" class="nav-icon" src="assets/images/nav-hover/icons-nav-chat-active.svg"></ion-icon>
<ion-label>Chat</ion-label> <ion-label>Chat</ion-label>
+2 -1
View File
@@ -31,7 +31,7 @@ import { environment } from 'src/environments/environment';
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
import { NativeNotificationService } from 'src/app/services/native-notification.service'; import { NativeNotificationService } from 'src/app/services/native-notification.service';
import { UserSession } from '../models/user.model'; import { UserSession } from '../models/user.model';
import { PermissionList } from '../models/permissionList'; import { PermissionList } from '../models/permission/permissionList';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@@ -180,6 +180,7 @@ export class HomePage implements OnInit {
myWorker.postMessage('ali'); */ myWorker.postMessage('ali'); */
this.clearTabButtonSelection(); this.clearTabButtonSelection();
} }
clearTabButtonSelection(){ clearTabButtonSelection(){
+1 -1
View File
@@ -50,7 +50,7 @@ export class AddNotePage implements OnInit {
component: SearchPage, component: SearchPage,
cssClass: 'modal-width-100-width-background modal', cssClass: 'modal-width-100-width-background modal',
componentProps: { componentProps: {
type: 'AccoesPresidenciais & ArquivoDespachoElect', typety: 'AccoesPresidenciais & ArquivoDespachoElect',
showSearchInput: true, showSearchInput: true,
select: true select: true
} }
@@ -9,6 +9,7 @@ import { ViewMediaPageRoutingModule } from './view-media-routing.module';
import { ViewMediaPage } from './view-media.page'; import { ViewMediaPage } from './view-media.page';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { PdfViewerModule } from 'ng2-pdf-viewer'; import { PdfViewerModule } from 'ng2-pdf-viewer';
import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';
@NgModule({ @NgModule({
imports: [ imports: [
@@ -17,7 +18,8 @@ import { PdfViewerModule } from 'ng2-pdf-viewer';
IonicModule, IonicModule,
FontAwesomeModule, FontAwesomeModule,
ViewMediaPageRoutingModule, ViewMediaPageRoutingModule,
PdfViewerModule PdfViewerModule,
NgxExtendedPdfViewerModule,
], ],
declarations: [ViewMediaPage] declarations: [ViewMediaPage]
}) })
@@ -24,12 +24,12 @@
<img src="{{image}}"> <img src="{{image}}">
</div> </div>
<div *ngIf="type == 'application/pdf'"> <div *ngIf="type == 'application/pdf'">
<object [data]="image|safehtml" type="application/pdf" style="width: 400px; height: 500px"></object>
<!-- <pdf-viewer [src]="image" <pdf-viewer [src]="base64Sanitize"
[render-text]="true" [render-text]="true"
[original-size]="false" [original-size]="false"
style="width: 400px; height: 500px" style="width: 400px; height: 500px"
></pdf-viewer> --> ></pdf-viewer>
</div> </div>
</div> </div>
</ion-slide> </ion-slide>
+32 -5
View File
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular'; import { ModalController, NavParams } from '@ionic/angular';
import { DomSanitizer} from '@angular/platform-browser'; import { DomSanitizer} from '@angular/platform-browser';
import { pdfDefaultOptions } from 'ngx-extended-pdf-viewer';
@Component({ @Component({
selector: 'app-view-media', selector: 'app-view-media',
@@ -19,29 +20,55 @@ export class ViewMediaPage implements OnInit {
maxRation: 2 maxRation: 2
}; };
base64Sanitize:any = ""; base64Sanitize = "";
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
private navParams:NavParams, private navParams:NavParams,
public sanitizer: DomSanitizer, public sanitizer: DomSanitizer,
) { ) {
this.image = this.navParams.get('image') this.image = this.navParams.get('image')
this.type = this.navParams.get('type') this.type = this.navParams.get('type')
this.name = this.navParams.get('username') this.name = this.navParams.get('username')
this._updatedAt = this.navParams.get('_updatedAt') this._updatedAt = this.navParams.get('_updatedAt')
pdfDefaultOptions.assetsFolder = 'bleeding-edge';
} }
ngOnInit() { ngOnInit() {
console.log(this.image) console.log(this.image)
this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(eval(this.image));
const encodedData = btoa(this.image);
const blob = new Blob([this.b64toBlob(encodedData)], { type: 'application/pdf' });
this.base64Sanitize = URL.createObjectURL(blob);
//this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(this.base64Sanitize);
this.base64Sanitize;
console.log(this.base64Sanitize) console.log(this.base64Sanitize)
} }
sanitizeBase64() { b64toBlob = (b64Data, contentType = '', sliceSize = 512) => {
return this.sanitizer.bypassSecurityTrustResourceUrl(this.image); const byteCharacters = atob(b64Data);
} const byteArrays = [];
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
const slice = byteCharacters.slice(offset, offset + sliceSize);
const byteNumbers = new Array(slice.length);
for (let i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
}
const blob = new Blob(byteArrays, { type: contentType });
return blob;
};
@@ -0,0 +1,9 @@
export class ActionsPermission{
access = 534;
create = 535;
delete = 536;
edit = 537;
createPost = 538;
deletePost = 539;
editPost = 540;
}
@@ -0,0 +1,3 @@
export class AgendaPermission{
access = 530
}
@@ -0,0 +1,3 @@
export class ChatPermission{
access = 541;
}
@@ -0,0 +1,5 @@
export class GabinetePermission{
access = 531;
pr_tasks = 532;
md_tasks = 533;
}
@@ -0,0 +1,11 @@
import { ActionsPermission } from "./actions.permission";
import { AgendaPermission } from "./agenda-permission";
import { ChatPermission } from "./chat-permission";
import { GabinetePermission } from "./gabinete-permission";
export class PermissionList{
Agenda = new AgendaPermission();
Gabinete = new GabinetePermission();
Actions = new ActionsPermission();
Chat = new ChatPermission();
}
-6
View File
@@ -1,6 +0,0 @@
export class PermissionList{
Agenda = 530;
Gabinete = 531;
Actions = 534;
Chat = 541;
}
@@ -31,8 +31,12 @@ const routes: Routes = [
{ {
path: 'view-event', path: 'view-event',
loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule) loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule)
},
{
path: 'evandre',
loadChildren: () => import('./evandre/evandre.module').then( m => m.EvandrePageModule) loadChildren: () => import('./evandre/evandre.module').then( m => m.EvandrePageModule)
} }
]; ];
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EvandrePage } from './evandre.page';
const routes: Routes = [
{
path: '',
component: EvandrePage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class EvandrePageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { EvandrePageRoutingModule } from './evandre-routing.module';
import { EvandrePage } from './evandre.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
EvandrePageRoutingModule
],
declarations: [EvandrePage]
})
export class EvandrePageModule {}
@@ -0,0 +1,9 @@
<ion-header>
<ion-toolbar>
<ion-title>evandre</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
</ion-content>
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { EvandrePage } from './evandre.page';
describe('EvandrePage', () => {
let component: EvandrePage;
let fixture: ComponentFixture<EvandrePage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ EvandrePage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(EvandrePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-evandre',
templateUrl: './evandre.page.html',
styleUrls: ['./evandre.page.scss'],
})
export class EvandrePage implements OnInit {
constructor() { }
ngOnInit() {
}
}
+145 -114
View File
@@ -42,9 +42,10 @@ import { FileToBase64Service } from 'src/app/services/file/file-to-base64.servic
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera'; import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
import { Plugins, Capacitor } from '@capacitor/core'; import { Plugins, Capacitor } from '@capacitor/core';
import { MultipleDocumentsPicker } from '@awesome-cordova-plugins/multiple-document-picker/ngx'; import { MultipleDocumentsPicker } from '@awesome-cordova-plugins/multiple-document-picker/ngx';
import { DomSanitizer} from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { StringDecoder } from 'string_decoder'; import { StringDecoder } from 'string_decoder';
import { File } from '@ionic-native/file/ngx'; import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
const IMAGE_DIR = 'stored-images'; const IMAGE_DIR = 'stored-images';
@@ -91,8 +92,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
allowTyping = true; allowTyping = true;
storedFileNames = []; storedFileNames = [];
lastAudioRecorded = ''; lastAudioRecorded = '';
audioRecorded:any = ""; audioRecorded: any = "";
audioDownloaded:any = ""; audioDownloaded: any = "";
durationDisplay = ''; durationDisplay = '';
duration = 0; duration = 0;
@ViewChild('recordbtn', { read: ElementRef }) recordBtn: ElementRef; @ViewChild('recordbtn', { read: ElementRef }) recordBtn: ElementRef;
@@ -103,7 +104,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
@ViewChild('filechooser') fileChooserElementRef: ElementRef; @ViewChild('filechooser') fileChooserElementRef: ElementRef;
//items: File[] = []; //items: File[] = [];
fileSelected?: Blob; fileSelected?: Blob;
pdfUrl?:string; pdfUrl?: string;
base64File: string; base64File: string;
downloadProgess: number; downloadProgess: number;
@@ -134,7 +135,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private multipleDocumentsPicker: MultipleDocumentsPicker, private multipleDocumentsPicker: MultipleDocumentsPicker,
private sant: DomSanitizer, private sant: DomSanitizer,
private file: File, private file: File,
//private fileOpener: FileOpener, private fileOpener: FileOpener,
private sanitiser: DomSanitizer, private sanitiser: DomSanitizer,
) { ) {
this.loggedUser = authService.ValidatedUserChat['data']; this.loggedUser = authService.ValidatedUserChat['data'];
@@ -222,14 +223,14 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
try { try {
this.storage.get('recordData').then((recordData) => { this.storage.get('recordData').then((recordData) => {
console.log(recordData); console.log(recordData);
if(recordData?.value?.recordDataBase64.includes('data:audio')){ if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64); this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
} }
else{ else {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`); this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
} }
}); });
} catch (error) {} } catch (error) { }
} }
@@ -242,8 +243,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
this.recording = true; this.recording = true;
VoiceRecorder.startRecording() VoiceRecorder.startRecording()
.then((result: GenericResponse) => console.log(result.value)) .then((result: GenericResponse) => console.log(result.value))
.catch(error => console.log(error)); .catch(error => console.log(error));
this.calculateDuration(); this.calculateDuration();
} }
@@ -263,8 +264,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
//console.log(recordData); //console.log(recordData);
const fileName = new Date().getTime() + ".mp3"; const fileName = new Date().getTime() + ".mp3";
//Save file //Save file
this.storage.set('fileName',fileName); this.storage.set('fileName', fileName);
this.storage.set('recordData',result).then(() => { this.storage.set('recordData', result).then(() => {
console.log('Audio recorded saved'); console.log('Audio recorded saved');
}) })
} }
@@ -274,7 +275,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}, 1000); }, 1000);
} }
async deleteRecording(){ async deleteRecording() {
this.storage.remove('fileName'); this.storage.remove('fileName');
this.storage.remove('recordData'); this.storage.remove('recordData');
@@ -393,17 +394,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
var byteArrays = new Array(slicesCount); var byteArrays = new Array(slicesCount);
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) { for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
var begin = sliceIndex * sliceSize; var begin = sliceIndex * sliceSize;
var end = Math.min(begin + sliceSize, bytesLength); var end = Math.min(begin + sliceSize, bytesLength);
var bytes = new Array(end - begin); var bytes = new Array(end - begin);
for (var offset = begin, i = 0; offset < end; ++i, ++offset) { for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
bytes[i] = byteCharacters[offset].charCodeAt(0); bytes[i] = byteCharacters[offset].charCodeAt(0);
} }
byteArrays[sliceIndex] = new Uint8Array(bytes); byteArrays[sliceIndex] = new Uint8Array(bytes);
} }
return new Blob(byteArrays, { type: contentType }); return new Blob(byteArrays, { type: contentType });
} }
async sendAudio(fileName) { async sendAudio(fileName) {
const roomId = this.roomId const roomId = this.roomId
@@ -411,37 +412,37 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.storage.get('recordData').then((recordData) => { this.storage.get('recordData').then((recordData) => {
audioFile = recordData; audioFile = recordData;
if(recordData?.value?.recordDataBase64.includes('data:audio')){ if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = recordData?.value?.recordDataBase64; this.audioRecorded = recordData?.value?.recordDataBase64;
} }
else{ else {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`; this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
} }
console.log(this.audioRecorded); console.log(this.audioRecorded);
//Converting base64 to blob //Converting base64 to blob
const encodedData = btoa(this.audioRecorded); const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType) const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
console.log(blob) console.log(blob)
const formData = new FormData(); const formData = new FormData();
formData.append("blobFile", blob); formData.append("blobFile", blob);
this.wsChatMethodsService.getDmRoom(roomId).send({ this.wsChatMethodsService.getDmRoom(roomId).send({
file: { file: {
"type": "application/audio", "type": "application/audio",
"msDuration":audioFile.value.msDuration, "msDuration": audioFile.value.msDuration,
"mimeType":audioFile.value.mimeType, "mimeType": audioFile.value.mimeType,
}, },
attachments: [{ attachments: [{
"title": fileName , "title": fileName,
"title_link_download": true, "title_link_download": true,
"type": "audio" "type": "audio"
}], }],
temporaryData: formData temporaryData: formData
}) })
}); });
this.deleteRecording(); this.deleteRecording();
} }
@@ -767,63 +768,63 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const fileReader = new FileReader(); const fileReader = new FileReader();
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"]; const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
return zoneOriginalInstance || fileReader; return zoneOriginalInstance || fileReader;
} }
async addFileToChat(types: typeof FileType[]) { async addFileToChat(types: typeof FileType[]) {
/* this.multipleDocumentsPicker.pick(2) /* this.multipleDocumentsPicker.pick(2)
.then(async (res: any) => { .then(async (res: any) => {
this.files = JSON.parse(res) this.files = JSON.parse(res)
console.log('1 Add file', this.files[0].uri) console.log('1 Add file', this.files[0].uri)
console.log('1 Add file', JSON.stringify(this.files[0].uri)) console.log('1 Add file', JSON.stringify(this.files[0].uri))
const downloadPath = ( const downloadPath = (
this.platform.is('android') this.platform.is('android')
) ? this.file.externalDataDirectory : this.file.documentsDirectory; ) ? this.file.externalDataDirectory : this.file.documentsDirectory;
this.file.writeFile(downloadPath, 'YHaaa2.pdf', 'Eudes Inácio').then((fil)=> { this.file.writeFile(downloadPath, 'YHaaa2.pdf', 'Eudes Inácio').then((fil)=> {
console.log('write file', fil) console.log('write file', fil)
}) })
this.fileToBase64('GS_FOLHETO_AUTOMOVEL_AC.pdf',this.files[0].uri).then( this.fileToBase64('GS_FOLHETO_AUTOMOVEL_AC.pdf',this.files[0].uri).then(
(data) => console.log(data) (data) => console.log(data)
); );
const blob = new Blob([res]) const blob = new Blob([res])
console.log('Add Blob file', blob) console.log('Add Blob file', blob)
const formData = new FormData(); const formData = new FormData();
formData.append("blobFile", blob); formData.append("blobFile", blob);
console.log(formData) console.log(formData)
this.wsChatMethodsService.getDmRoom(this.roomId).send({ this.wsChatMethodsService.getDmRoom(this.roomId).send({
file: { file: {
"type": 'application/pdf', "type": 'application/pdf',
"guid": '', "guid": '',
}, },
attachments: [{ attachments: [{
"title": 'pdf1', "title": 'pdf1',
"name": 'pdf1', "name": 'pdf1',
// "text": "description", // "text": "description",
"title_link_download": false, "title_link_download": false,
}], }],
temporaryData: formData temporaryData: formData
}) })
}) })
.catch((error: any) => console.error(error)); */ .catch((error: any) => console.error(error)); */
const roomId = this.roomId const roomId = this.roomId
const file: any = await this.fileService.getFileFromDevice(types); const file: any = await this.fileService.getFileFromDevice(types);
console.log('Add file', JSON.stringify(await this.getBase64(file))) console.log('Add file', JSON.stringify(await this.getBase64(file)))
const encodedData = btoa(JSON.stringify( await this.getBase64(file))); const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, 'application/pdf') const blob = this.base64toBlob(encodedData, 'application/pdf')
console.log('Add Blob file', blob) console.log('Add Blob file', blob)
//console.log('Add Blob file', await this.blobToBase64(blob)) //console.log('Add Blob file', await this.blobToBase64(blob))
//console.log('Add Blob file', await this.fileToByteArray(file)) //console.log('Add Blob file', await this.fileToByteArray(file))
@@ -864,25 +865,25 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}; };
}); });
} }
fileToByteArray(file) { fileToByteArray(file) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
let reader = this.getFileReader(); let reader = this.getFileReader();
//var file = new File([filepath], filename); //var file = new File([filepath], filename);
reader.readAsBinaryString(file); reader.readAsBinaryString(file);
reader.onloadend = (evt) => { reader.onloadend = (evt) => {
console.log(evt.target.result) console.log(evt.target.result)
resolve(evt.target.result); // Convert data to base64 resolve(evt.target.result); // Convert data to base64
reader.readAsDataURL(file); reader.readAsDataURL(file);
}
}
catch (e) {
reject(e);
} }
}
catch (e) {
reject(e);
}
}) })
} }
blobToBase64 = blob => { blobToBase64 = blob => {
const reader = this.getFileReader(); const reader = this.getFileReader();
@@ -1008,10 +1009,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
/* testeDownload(msg: MessageService) { /* testeDownload(msg: MessageService) {
this.downloadFile = ""; this.downloadFile = "";
this.AttachmentsService.downloadFileAndStore(msg.file.guid); this.AttachmentsService.downloadFileAndStore(msg.file.guid);
} */ } */
downloadFileMsg(msg: MessageService) { downloadFileMsg(msg: MessageService) {
@@ -1062,6 +1063,46 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
return window.btoa(binary); return window.btoa(binary);
} }
b64toBlob(b64Data, contentType, sliceSize) {
contentType = contentType || '';
sliceSize = sliceSize || 512;
var byteCharacters = atob(b64Data);
var byteArrays = [];
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
var slice = byteCharacters.slice(offset, offset + sliceSize);
var byteNumbers = new Array(slice.length);
for (var i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i);
}
var byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
}
var blob = new Blob(byteArrays, { type: contentType });
return blob;
}
getUserDataSheet(pdfString) {
const blob = this.b64toBlob(pdfString, 'application/pdf', 512)
let pathFile = ''
const fileName = 'myPdf.pdf'
const contentFile = blob
if (this.platform.is('ios')) {
pathFile = this.file.documentsDirectory
} else {
pathFile = this.file.externalRootDirectory
}
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
this.fileOpener
.open(pathFile + fileName, 'application/pdf')
.then(() => console.log('File is opened'))
.catch(e => console.log('Error opening file', e));
})
.catch(e => console.log('Error writing file', e))
}
async openPreview(msg) { async openPreview(msg) {
console.log(msg); console.log(msg);
@@ -1070,20 +1111,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
//this.testDownlod(msg) //this.testDownlod(msg)
} else { } else {
/* var str = msg.attachments[0].image_url; var str = msg.attachments[0].image_url;
str = str.substring(1, ((str.length) - 1)); */ str = str.substring(1, ((str.length) - 1));
const modal = await this.modalController.create({ this.getUserDataSheet(str);
component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: {
image: msg.attachments[0].image_url,
type: msg.file.type,
username: msg.u.name,
_updatedAt: msg._updatedAt
}
});
modal.present();
} }
} }
@@ -1092,7 +1123,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
console.log(msg); console.log(msg);
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') { if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg) this.downloadFileMsg(msg)
} else {} } else { }
} }
+2 -2
View File
@@ -26,7 +26,7 @@
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)"> <div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
<div class="schedule height-100"> <div *ngIf="p.userPermission([permissionList.Agenda.access])" class="schedule height-100">
<div class="schedule-header"> <div class="schedule-header">
<div class="title"> <div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon> <ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
@@ -94,7 +94,7 @@
</div> </div>
</div> </div>
<div class="schedule height-100"> <div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="schedule height-100">
<div class="schedule-header"> <div class="schedule-header">
<div class="title"> <div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon> <ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
+6 -1
View File
@@ -22,6 +22,8 @@ import { BackgroundService } from 'src/app/services/background.service';
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
import { PermissionList } from 'src/app/models/permission/permissionList';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-events', selector: 'app-events',
templateUrl: './events.page.html', templateUrl: './events.page.html',
@@ -81,6 +83,8 @@ export class EventsPage implements OnInit {
/* existingScreenOrientation: string; */ /* existingScreenOrientation: string; */
permissionList = new PermissionList();
constructor( constructor(
private eventService: EventsService, private eventService: EventsService,
private router: Router, private router: Router,
@@ -97,7 +101,8 @@ export class EventsPage implements OnInit {
private networkconnection: NetworkConnectionService, private networkconnection: NetworkConnectionService,
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private storage: Storage private storage: Storage,
public p: PermissionService,
) { ) {
/* this.existingScreenOrientation = this.screenOrientation.type; /* this.existingScreenOrientation = this.screenOrientation.type;
console.log(this.existingScreenOrientation); */ console.log(this.existingScreenOrientation); */
@@ -79,25 +79,25 @@
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto"> <div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'"> <div class="buttons px-20" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
<div class="option-desc"> <div>Responder ao PR</div> </div> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Responder ao PR</div> </div>
<button (click)="openAddNoteModal('Executado')" class="btn-cancel mb-0" style="margin-bottom: 0px !important;" shape="round" >Executado</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Executado')" class="btn-cancel mb-0" style="margin-bottom: 0px !important;" shape="round" >Executado</button>
<!-- <div class="solid"></div> --> <!-- <div class="solid"></div> -->
<div class="option-desc">Reencaminhar para Área jurídica</div> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc">Reencaminhar para Área jurídica</div>
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
<!-- <div class="solid"></div> --> <!-- <div class="solid"></div> -->
<div class="option-desc">Outras opções</div> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc">Outras opções</div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<!-- <div class="solid"></div> --> <!-- <div class="solid"></div> -->
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'"> <div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
</div> </div>
@@ -24,6 +24,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service'; import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-despacho-pr', selector: 'app-despacho-pr',
@@ -45,7 +46,8 @@ export class DespachoPrPage implements OnInit {
intervenientes: any; intervenientes: any;
cc: any = []; cc: any = [];
constructor(private activateRoute: ActivatedRoute, constructor(
private activateRoute: ActivatedRoute,
private processes: ProcessesService, private processes: ProcessesService,
private iab: InAppBrowser, private iab: InAppBrowser,
private attachmentsService: AttachmentsService, private attachmentsService: AttachmentsService,
@@ -62,7 +64,8 @@ export class DespachoPrPage implements OnInit {
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
private platform: Platform, private platform: Platform,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private RouteService: RouteService private RouteService: RouteService,
public p: PermissionService,
) { ) {
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
if (params["params"].SerialNumber) { if (params["params"].SerialNumber) {
@@ -14,7 +14,7 @@
<div class="middle d-flex align-center flex-grow-1"> <div class="middle d-flex align-center flex-grow-1">
<ion-label class="title">{{ task.Folio}}</ion-label> <ion-label class="title">{{ task.Folio}}</ion-label>
</div> </div>
<div class="div-icon" (click)="openOptions()"> <div class="div-icon" (click)="openOptions()" *ngIf="p.userPermission([p.permissionList.Agenda.access])">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</div> </div>
@@ -96,7 +96,7 @@
<div class="solid"></div> <div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
@@ -106,7 +106,7 @@
<div class="solid"></div> <div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
@@ -115,7 +115,7 @@
<div class="solid"></div> <div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button> <button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
@@ -63,7 +63,7 @@ export class DespachoPage implements OnInit {
private sqliteservice: SqliteService, private sqliteservice: SqliteService,
private platform: Platform, private platform: Platform,
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
public ThemeService: ThemeService public ThemeService: ThemeService,
) { ) {
@@ -90,26 +90,26 @@
</div> </div>
</div> </div>
<div *ngIf="task && !p.userRole(['PR'])" class="aside-right flex-column height-100 overflow-y-auto"> <div class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons"> <div class="buttons">
<div class="option-desc"> <div>Enviar para o PR</div> </div> <div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Enviar para o PR</div> </div>
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button> <button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<div class="option-desc"> <div>Solicitar revisão</div> </div> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Solicitar revisão</div> </div>
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
<div class="option-desc"> <div>Outras opções</div> </div> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) || p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Outras opções</div> </div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button> <button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button> <button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
<div class="solid"></div> <div class="solid"></div>
</div> </div>
</div> </div>
<div *ngIf="task && p.userRole(['PR'])" class="aside-right flex-column height-100 overflow-y-auto"> <!-- <div *ngIf="task && p.userRole(['PR'])" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons"> <div class="buttons">
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
@@ -123,7 +123,7 @@
<button hidden class="btn-cancel" shape="round" >Delegar</button> <button hidden class="btn-cancel" shape="round" >Delegar</button>
</div> </div>
</div> </div> -->
</div> </div>
</ion-content> </ion-content>
@@ -101,7 +101,7 @@
<p class="text-center exp-card-content">{{ allProcessesList.length }} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content">{{ allProcessesList.length }} <span class="title1">Documentos</span></p>
</div> </div>
<div (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column" *ngIf="loggeduser.Profile == 'MDGPR'" > <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column">
<div class="d-flex justify-center"> <div class="d-flex justify-center">
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon> <ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
</div> </div>
@@ -128,24 +128,24 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente-hover.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente.svg"></ion-icon>
</div> </div>
<p *ngIf="loggeduser.Profile == 'MDGPR'" class="text-center exp-card-title ">Pendentes</p> <p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pendentes</p>
<p *ngIf="loggeduser.Profile == 'PR'" class="text-center exp-card-title ">Meus Pendentes</p> <p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Meus Pendentes</p>
<p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
</div> </div>
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDespachosPrPage(); selectedElement='DispatchesPr'" [class.active]="selectedElement == 'DispatchesPr'" class="box-hover exp-card d-md-flex flex-column justify-center" > <div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) || p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDespachosPrPage(); selectedElement='DispatchesPr'" [class.active]="selectedElement == 'DispatchesPr'" class="box-hover exp-card d-md-flex flex-column justify-center" >
<div class="d-flex justify-center"> <div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente-hover.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
</div> </div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Despacho do Presidente da República</p> <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Despachos criados por mim</p> <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Despachos criados por mim</p>
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p> <p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
</div> </div>
<div [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'" *ngIf="loggeduser.Profile == 'MDGPR'"> <div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'">
<div class="d-flex justify-center"> <div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Dispatches'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Dispatches'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
@@ -163,8 +163,8 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'RequestsForOpinion'" src="assets/images/theme/gov/icons-expediente-parecer-hover.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'RequestsForOpinion'" src="assets/images/theme/gov/icons-expediente-parecer-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'RequestsForOpinion' " src="assets/images/theme/gov/icons-expediente-parecer.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'RequestsForOpinion' " src="assets/images/theme/gov/icons-expediente-parecer.svg"></ion-icon>
</div> </div>
<p *ngIf="loggeduser.Profile == 'MDGPR'" class="text-center exp-card-title ">Pedidos de Parecer</p> <p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer</p>
<p *ngIf="loggeduser.Profile == 'PR'" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p> <p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p>
<p class="text-center exp-card-content">{{pedidosstore.countparecer}} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content">{{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
</div> </div>
@@ -193,7 +193,7 @@
</div> </div>
</div> --> </div> -->
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center"> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
<div class="center-div"> <div class="center-div">
<div class="exp-card-icon"> <div class="exp-card-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
@@ -208,31 +208,31 @@
</div> </div>
</div> </div>
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center"> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center"> <div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
</div> </div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR' ">Diplomas por Validar</p> <p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Validar</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Diplomas por Assinar</p> <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Assinar</p>
<p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p> <p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
</div> </div>
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center"> <div (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center"> <div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente-hover.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
</div> </div>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Diplomas assinados PR</p> <p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas assinados PR</p>
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'" >Diplomas</p> <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" >Diplomas</p>
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
</div> </div>
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="box-hover exp-card d-flex flex-column justify-center"> <div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center"> <div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
@@ -128,7 +128,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private router: Router, private router: Router,
authService: AuthService, authService: AuthService,
public p: PermissionService,
public waitForDomService: WaitForDomService, public waitForDomService: WaitForDomService,
//private notificationsService: NotificationsService, //private notificationsService: NotificationsService,
private despachoRule: DespachoService, private despachoRule: DespachoService,
@@ -139,7 +138,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
public ThemeService: ThemeService, public ThemeService: ThemeService,
private sortService: SortService, private sortService: SortService,
private dataService: DataService, private dataService: DataService,
private storage: Storage private storage: Storage,
public p: PermissionService,
) { ) {
this.loggeduser = authService.ValidatedUser; this.loggeduser = authService.ValidatedUser;
@@ -89,7 +89,7 @@
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
<div class="buttons" *ngIf="task.activityInstanceName == 'Reapreciar Deferimento'"> <div class="buttons" *ngIf="task.activityInstanceName == 'Reapreciar Deferimento'">
@@ -99,7 +99,7 @@
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Deferimento'"> <div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Deferimento'">
@@ -110,14 +110,14 @@
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button hidden (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button hidden (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button> <button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
</div> </div>
<div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente'"> <div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente'">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'"> <div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
<button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button> <button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" (click)="openForwardModal(task)" class="btn-cancel" shape="round" >Reencaminhar</button> <button *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" (click)="openForwardModal(task)" class="btn-cancel" shape="round" >Reencaminhar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
@@ -127,7 +127,7 @@
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
<div *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" class="buttons"> <div *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" class="buttons">
+5 -4
View File
@@ -13,7 +13,7 @@ import { ThemeService } from 'src/app/services/theme.service';
import { StorageService } from 'src/app/services/storage.service'; import { StorageService } from 'src/app/services/storage.service';
import { ChatService } from 'src/app/services/chat.service'; import { ChatService } from 'src/app/services/chat.service';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { PermissionList } from 'src/app/models/permissionList'; import { PermissionList } from 'src/app/models/permission/permissionList';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
@@ -148,13 +148,14 @@ export class LoginPage implements OnInit {
if(pathName) { if(pathName) {
this.router.navigate([pathName]); this.router.navigate([pathName]);
} else { } else {
if(this.permissionService.userPermission(this.permissionList.Agenda) || this.permissionService.userPermission(this.permissionList.Gabinete)){ if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']); this.router.navigate(['/home/events']);
} }
else if(this.permissionService.userPermission(this.permissionList.Chat)){ else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){
this.router.navigate(['/home/chat']); this.router.navigate(['/home/chat']);
} }
else if(this.permissionService.userPermission(this.permissionList.Actions)){ else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
alert('here')
this.router.navigate(['/home/publications']); this.router.navigate(['/home/publications']);
} }
} }
@@ -56,12 +56,12 @@
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<ion-toolbar class="footer-toolbar"> <ion-toolbar class="footer-toolbar">
<ion-buttons slot="start"> <ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.deletePost])" slot="start">
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()"> <button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
<ion-label>Eliminar</ion-label> <ion-label>Eliminar</ion-label>
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons slot="end"> <ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.editPost])" slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')"> <button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
<ion-label>Editar</ion-label> <ion-label>Editar</ion-label>
</button> </button>
@@ -10,6 +10,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service'; import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-publication-detail', selector: 'app-publication-detail',
@@ -31,7 +32,8 @@ export class PublicationDetailPage implements OnInit {
private RouteService: RouteService, private RouteService: RouteService,
private sqliteservice: SqliteService, private sqliteservice: SqliteService,
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
public ThemeService: ThemeService ) { public ThemeService: ThemeService,
public p:PermissionService ) {
this.publicationId = this.navParams.get('publicationId'); this.publicationId = this.navParams.get('publicationId');
/* this.folderId = this.navParams.get('folderIdId'); */ /* this.folderId = this.navParams.get('folderIdId'); */
@@ -25,7 +25,7 @@
<ion-label class="title ">Acções Presidenciais</ion-label> <ion-label class="title ">Acções Presidenciais</ion-label>
</div> </div>
<div class="div-icon"> <div class="div-icon">
<button title="Adicionar nova ação presidencial" class="btn-no-color" (click)="AddPublicationFolder()"> <button *ngIf="p.userPermission([p.permissionList.Actions.create])" title="Adicionar nova ação presidencial" class="btn-no-color" (click)="AddPublicationFolder()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src='assets/images/icons-add.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="icon-only" src='assets/images/theme/gov/icons-add.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="icon-only" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
</button> </button>
@@ -92,14 +92,14 @@
</div> </div>
</ion-item> </ion-item>
<ion-item-options class="members-options" side="end"> <ion-item-options class="members-options" side="end">
<ion-item-option class="edit-option" (click)="editAction(evento.ProcessId)"> <ion-item-option *ngIf="p.userPermission([p.permissionList.Actions.edit])" class="edit-option" (click)="editAction(evento.ProcessId)">
<button class="btn-no-color"> <button class="btn-no-color">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
</button> </button>
</ion-item-option> </ion-item-option>
<ion-item-option class="delete-option" (click)="deleteAction(evento.ProcessId)"> <ion-item-option *ngIf="p.userPermission([p.permissionList.Actions.delete])" class="delete-option" (click)="deleteAction(evento.ProcessId)">
<button class="btn-no-color"> <button class="btn-no-color">
<ion-icon class="delete" name="trash-sharp"></ion-icon> <ion-icon class="delete" name="trash-sharp"></ion-icon>
</button> </button>
@@ -15,6 +15,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service'; import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
@@ -68,7 +69,8 @@ export class PublicationsPage implements OnInit {
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
private platform: Platform, private platform: Platform,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private storage: Storage private storage: Storage,
public p: PermissionService,
) { ) {
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]; this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
@@ -61,12 +61,12 @@
<ion-footer> <ion-footer>
<ion-toolbar class="footer-toolbar"> <ion-toolbar class="footer-toolbar">
<ion-buttons slot="start"> <ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.deletePost])" slot="start">
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()"> <button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
<ion-label>Eliminar</ion-label> <ion-label>Eliminar</ion-label>
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons slot="end"> <ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.editPost])" slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')"> <button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
<ion-label>Editar</ion-label> <ion-label>Editar</ion-label>
</button> </button>
@@ -10,6 +10,7 @@ import { Location } from '@angular/common';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-publication-detail', selector: 'app-publication-detail',
@@ -31,7 +32,8 @@ export class PublicationDetailPage implements OnInit {
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private router: Router, private router: Router,
private RouteService: RouteService, private RouteService: RouteService,
public ThemeService: ThemeService public ThemeService: ThemeService,
public p:PermissionService,
) { ) {
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
@@ -15,7 +15,7 @@
<p class="item-content-detail">{{item.Detail}}</p> <p class="item-content-detail">{{item.Detail}}</p>
<p class="item-content-date">{{item.DateBegin | date: 'dd-MM-yy | HH:mm'}}</p> <p class="item-content-date">{{item.DateBegin | date: 'dd-MM-yy | HH:mm'}}</p>
</div> </div>
<div class="actions-icon cursor-pointer" (click)="AddPublication('2',item.ProcessId)"> <div *ngIf="p.userPermission([p.permissionList.Actions.createPost])" class="actions-icon cursor-pointer" (click)="AddPublication('2',item.ProcessId)">
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> --> <!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-add.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-add.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-add.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
@@ -12,6 +12,7 @@ import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { forkJoin } from 'rxjs'; import { forkJoin } from 'rxjs';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-view-publications', selector: 'app-view-publications',
@@ -42,7 +43,8 @@ export class ViewPublicationsPage implements OnInit {
private sqliteservice: SqliteService, private sqliteservice: SqliteService,
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private toastService: ToastService,) { private toastService: ToastService,
public p: PermissionService,) {
this.item = new PublicationFolder(); this.item = new PublicationFolder();
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
@@ -47,13 +47,8 @@ export class ChatMethodsService {
return this.chatService.sendMessage(body) return this.chatService.sendMessage(body)
} }
deleteMessage(body) { deleteMessage(body) {
return this.chatService.deleteMessage(body) return this.chatService.deleteMessage(body)
} }
} }
+25 -17
View File
@@ -12,6 +12,7 @@ import { MessageModel, DeleteMessageModel } from '../../models/beast-orm'
import { AESEncrypt } from '../aesencrypt.service' import { AESEncrypt } from '../aesencrypt.service'
import { HttpClient, HttpEventType } from '@angular/common/http'; import { HttpClient, HttpEventType } from '@angular/common/http';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -62,7 +63,8 @@ export class MessageService {
private ChatStorageService: ChatStorageService, private ChatStorageService: ChatStorageService,
private ChatMethodsService: ChatMethodsService, private ChatMethodsService: ChatMethodsService,
private AESEncrypt: AESEncrypt, private AESEncrypt: AESEncrypt,
private AttachmentsService: AttachmentsService,) { private AttachmentsService: AttachmentsService,
private NetworkServiceService: NetworkServiceService) {
} }
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference , viewed = [], received = [], delate = false, delateRequest =false, }:Message) { setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference , viewed = [], received = [], delate = false, delateRequest =false, }:Message) {
@@ -184,24 +186,30 @@ export class MessageService {
delete params?.attachments?.image_url delete params?.attachments?.image_url
} }
this.ChatMethodsService.send(params).subscribe(
(response: any) => {
const ChatMessage = response.message
this.messageSend = true
this.redefinedMessage(ChatMessage)
},
(error) => {
this.WsChatService.registerCallback({
type: 'reConnect',
funx: async ()=> {
this.send() if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
return true
} this.WsChatService.send(params).then(
}) (ChatMessage: any) => {
} ChatMessage = ChatMessage.message.result
)
this.messageSend = true
this.redefinedMessage(ChatMessage)
}
)
} else {
this.WsChatService.registerCallback({
type: 'reConnect',
funx: async ()=> {
this.send()
return true
}
})
}
} }
async redefinedMessage(ChatMessage , update = true) { async redefinedMessage(ChatMessage , update = true) {
+25 -43
View File
@@ -22,6 +22,7 @@ import { DeleteMessageModel, MessageModel } from '../../models/beast-orm'
import { AESEncrypt } from '../aesencrypt.service' import { AESEncrypt } from '../aesencrypt.service'
import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'src/app/models/message.model'; import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'src/app/models/message.model';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { ConnectionStatus, NetworkServiceService} from 'src/app/services/network-service.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -77,18 +78,16 @@ export class RoomService {
private ChatStorageService: ChatStorageService, private ChatStorageService: ChatStorageService,
private ChatMethodsService: ChatMethodsService, private ChatMethodsService: ChatMethodsService,
private AESEncrypt: AESEncrypt, private AESEncrypt: AESEncrypt,
private AttachmentsService: AttachmentsService private AttachmentsService: AttachmentsService,
private NetworkServiceService: NetworkServiceService
) { ) {
this.NativeNotificationService.askForPermission() this.NativeNotificationService.askForPermission()
// this.restoreMessageFromDB()
this.WsChatService.getUserStatus((d) => { this.WsChatService.getUserStatus((d) => {
const userId = d.fields.args[0][0] const userId = d.fields.args[0][0]
const statusNum = d.fields.args[0][2] const statusNum = d.fields.args[0][2]
const statusText = this.statusNumberToText(statusNum) const statusText = this.statusNumberToText(statusNum)
//
if(this.members?.map) { if(this.members?.map) {
const membersIds = this.members.map((user)=> user._id) const membersIds = this.members.map((user)=> user._id)
@@ -145,7 +144,7 @@ export class RoomService {
} }
} }
setData({members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService), _updatedAt }) { setData({members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), _updatedAt }) {
this.customFields = customFields this.customFields = customFields
this.id = id this.id = id
this.name = name this.name = name
@@ -343,7 +342,6 @@ export class RoomService {
} }
async receiveMessageDelete() { async receiveMessageDelete() {
this.WsChatService.updateRoomEventss( this.WsChatService.updateRoomEventss(
@@ -372,14 +370,6 @@ export class RoomService {
if(this.messages[i]?._id == id ) { if(this.messages[i]?._id == id ) {
//Get previous last message from room
const previousLastMessage = this.messages.slice(-1)[0];
this.lastMessage = previousLastMessage;
this.calDateDuration(previousLastMessage._updatedAt)
this.sortRoomList()
if (SessionStore.user.RochetChatUser == this.messages[i]?.u?.username) { if (SessionStore.user.RochetChatUser == this.messages[i]?.u?.username) {
const allMemberThatIsOffline = this.getAllMemberThatIsOffline() const allMemberThatIsOffline = this.getAllMemberThatIsOffline()
@@ -393,10 +383,14 @@ export class RoomService {
} }
this.messages[i]?.delateDB() this.messages[i]?.delateDB()
// console.log(_id,'==',this.messages[i]?._id, true)
this.messages.splice(i, 1) this.messages.splice(i, 1)
//Get previous last message from room
const previousLastMessage = this.messages.slice(-1)[0];
this.lastMessage = previousLastMessage;
this.calDateDuration(previousLastMessage._updatedAt)
this.sortRoomList()
return true return true
} else { } else {
@@ -429,40 +423,28 @@ export class RoomService {
const message = this.messages.find((e)=>e._id == msgId) const message = this.messages.find((e)=>e._id == msgId)
await message.delateStatusFalse() await message.delateStatusFalse()
this.ChatMethodsService.deleteMessage({_id:msgId, msgId:msgId, roomId:message.rid}).subscribe( if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
async (response: any) => {
this.WsChatService.deleteMessage(msgId).then(async() => {
message.delateRequest = true message.delateRequest = true
await message.save() await message.save()
this.deleteMessage(msgId) this.deleteMessage(msgId)
})
}, } else {
async (response) => { this.WsChatService.registerCallback({
type: 'reConnect',
funx: async ()=> {
if (response?.error?.error.startsWith('No message found with the id of')) { this.sendDeleteRequest(msgId)
return true
this.deleteMessage(msgId)
message.delateRequest = true
await message.save()
} else {
this.WsChatService.registerCallback({
type: 'reConnect',
funx: async ()=> {
this.sendDeleteRequest(msgId)
return true
}
})
} }
})
} }
)
} }
/** /**
* @description sen text message * @description sen text message
*/ */
@@ -629,7 +611,7 @@ export class RoomService {
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => { await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
console.log('load chatHistory', JSON.stringify(chatHistory)) // console.log('load chatHistory', JSON.stringify(chatHistory))
const messagesId = this.messages.map((message)=> message._id) const messagesId = this.messages.map((message)=> message._id)
@@ -685,7 +667,7 @@ export class RoomService {
message = this.fix_updatedAt(message) message = this.fix_updatedAt(message)
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService) const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
wewMessage.setData(message) wewMessage.setData(message)
wewMessage.loadHistory = this.hasLoadHistory wewMessage.loadHistory = this.hasLoadHistory
@@ -742,7 +724,7 @@ export class RoomService {
async prepareCreate({message, save = true}): Promise<MessageService> { async prepareCreate({message, save = true}): Promise<MessageService> {
message = this.fix_updatedAt(message) message = this.fix_updatedAt(message)
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService) const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
wewMessage.setData(message) wewMessage.setData(message)
wewMessage.loadHistory = this.hasLoadHistory wewMessage.loadHistory = this.hasLoadHistory
@@ -754,7 +736,7 @@ export class RoomService {
simplePrepareMessage(message) { simplePrepareMessage(message) {
message = this.fix_updatedAt(message) message = this.fix_updatedAt(message)
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService) const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
wewMessage.setData(message) wewMessage.setData(message)
wewMessage.loadHistory = this.hasLoadHistory wewMessage.loadHistory = this.hasLoadHistory
@@ -20,6 +20,7 @@ import { ChatStorageService } from './chat-storage.service'
import { ChatMethodsService } from './chat-methods.service' import { ChatMethodsService } from './chat-methods.service'
import { AESEncrypt } from '../aesencrypt.service' import { AESEncrypt } from '../aesencrypt.service'
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { NetworkServiceService} from 'src/app/services/network-service.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -57,7 +58,8 @@ export class WsChatMethodsService {
private ChatStorageService: ChatStorageService, private ChatStorageService: ChatStorageService,
private ChatMethodsService:ChatMethodsService, private ChatMethodsService:ChatMethodsService,
private AESEncrypt: AESEncrypt, private AESEncrypt: AESEncrypt,
private AttachmentsService:AttachmentsService private AttachmentsService:AttachmentsService,
private NetworkServiceService: NetworkServiceService
) { ) {
this.loggedUser = authService.ValidatedUserChat['data']; this.loggedUser = authService.ValidatedUserChat['data'];
@@ -314,7 +316,7 @@ export class WsChatMethodsService {
// create room // create room
if(!this.roomExist(roomId)) { if(!this.roomExist(roomId)) {
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService) let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
room.setData(setData) room.setData(setData)
room.receiveMessage() room.receiveMessage()
room.getAllUsers = this.getUsers room.getAllUsers = this.getUsers
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { NetworkServiceService } from './network-service.service';
describe('NetworkServiceService', () => {
let service: NetworkServiceService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(NetworkServiceService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,62 @@
import { Injectable } from '@angular/core';
import { ToastController, Platform } from '@ionic/angular';
import { BehaviorSubject, Observable } from 'rxjs';
import { Network } from '@ionic-native/network/ngx'
export enum ConnectionStatus {
Online,
Offline
}
@Injectable({
providedIn: 'root'
})
export class NetworkServiceService {
private status: BehaviorSubject<ConnectionStatus> = new BehaviorSubject(ConnectionStatus.Offline);
constructor(private network: Network, private toastController: ToastController, private plt: Platform) {
this.plt.ready().then(() => {
this.initializeNetworkEvents();
let status = this.network.type !== 'none' ? ConnectionStatus.Online : ConnectionStatus.Offline;
this.status.next(status);
});
}
public initializeNetworkEvents() {
this.network.onDisconnect().subscribe(() => {
if (this.status.getValue() === ConnectionStatus.Online) {
this.updateNetworkStatus(ConnectionStatus.Offline);
}
});
this.network.onConnect().subscribe(() => {
if (this.status.getValue() === ConnectionStatus.Offline) {
this.updateNetworkStatus(ConnectionStatus.Online);
}
});
}
private async updateNetworkStatus(status: ConnectionStatus) {
this.status.next(status);
let connection = status == ConnectionStatus.Offline ? 'Offline' : 'Online';
let toast = this.toastController.create({
message: `You are now ${connection}`,
duration: 3000,
position: 'bottom'
});
toast.then(toast => toast.present());
}
public onNetworkChange(): Observable<ConnectionStatus> {
return this.status.asObservable();
}
public getCurrentNetworkStatus(): ConnectionStatus {
return this.status.getValue();
}
}
+5 -5
View File
@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { PermissionList } from '../models/permission/permissionList';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
@Injectable({ @Injectable({
@@ -6,6 +7,7 @@ import { SessionStore } from '../store/session.service';
}) })
export class PermissionService { export class PermissionService {
permissionList = new PermissionList();
SessionStore = SessionStore SessionStore = SessionStore
constructor() { } constructor() { }
@@ -20,19 +22,17 @@ export class PermissionService {
} }
userPermission(args) { userPermission(args) {
if(!Array.isArray(args)) { if(!Array.isArray(args)) {
args = [args] args = [args]
} }
for(let permission of (this.SessionStore.user.UserPermissions || [])){ for(let permission of (this.SessionStore.user.UserPermissions || [])) {
if (args.includes(permission)){ if (args.includes(permission)) {
return true; return true;
} }
} }
return false; return false;
} }
role(args: any) { role(args: any) {
@@ -46,7 +46,7 @@ export class PermissionService {
role = [role] role = [role]
} }
if(!UserRoleIsValid) {return false } if(!UserRoleIsValid) { return false }
return true return true
@@ -152,9 +152,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
} }
ngOnInit() { ngOnInit() {
console.log(this.roomId);
this.loggedUser = this.loggedUserChat;
this.loggedUser=this.loggedUserChat; this.loggedUser=this.loggedUserChat;
setTimeout(() => { setTimeout(() => {
this.getRoomInfo(); this.getRoomInfo();
+13 -5
View File
@@ -66,7 +66,7 @@
<div class="d-flex flex-1 pr-20 pl-50"> <div class="d-flex flex-1 pr-20 pl-50">
<div *ngIf="p.userPermission([permissionList.Agenda]) || p.userPermission([permissionList.Gabinete])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')" <div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
[class.active]="locationPathname() == '/home/events'"> [class.active]="locationPathname() == '/home/events'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-active-black.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-active-black.svg'></ion-icon>
@@ -76,7 +76,9 @@
<span>Início</span> <span>Início</span>
</div> </div>
<div *ngIf="p.userPermission([permissionList.Agenda])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')" <!-- *ngIf="p.userPermission([permissionList.Agenda])" -->
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')"
[class.active]="locationPathname() == '/home/agenda'"> [class.active]="locationPathname() == '/home/agenda'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-agenda-inactive.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-agenda-inactive.svg'></ion-icon>
@@ -85,7 +87,9 @@
<span>Agenda</span> <span>Agenda</span>
</div> </div>
<div *ngIf="p.userPermission([permissionList.Gabinete])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')" <!-- *ngIf="p.userPermission([permissionList.Gabinete])" -->
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')"
[class.active]="locationPathname() == '/home/gabinete-digital'"> [class.active]="locationPathname() == '/home/gabinete-digital'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon>
@@ -94,7 +98,9 @@
<span>Gabinete</span> <span>Gabinete</span>
</div> </div>
<div *ngIf="p.userPermission([permissionList.Actions])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')" <!-- *ngIf="p.userPermission([permissionList.Actions])" -->
<div *ngIf="p.userPermission([permissionList.Actions.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')"
[class.active]="locationPathname() == '/home/publications'"> [class.active]="locationPathname() == '/home/publications'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-a-es-inactive.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-a-es-inactive.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-a-es-inactive.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-a-es-inactive.svg'></ion-icon>
@@ -102,7 +108,9 @@
<span>Acções</span> <span>Acções</span>
</div> </div>
<div *ngIf="p.userPermission([permissionList.Chat])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')" <!-- *ngIf="p.userPermission([permissionList.Chat])" -->
<div *ngIf="p.userPermission([permissionList.Chat.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')"
[class.active]="locationPathname() == '/home/chat'"> [class.active]="locationPathname() == '/home/chat'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-grupos-inactive-dk-white.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-grupos-inactive-dk-white.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
+1 -1
View File
@@ -11,7 +11,7 @@ import { EventTrigger } from '../../services/eventTrigger.service';
import { ThemeService } from '../../services/theme.service'; import { ThemeService } from '../../services/theme.service';
import { interval } from 'rxjs'; import { interval } from 'rxjs';
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { PermissionList } from 'src/app/models/permissionList'; import { PermissionList } from 'src/app/models/permission/permissionList';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
@@ -8,6 +8,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-deploma-options', selector: 'app-deploma-options',
@@ -23,7 +24,8 @@ export class DeplomaOptionsPage implements OnInit {
fulltask: any fulltask: any
constructor(public popoverController: PopoverController, constructor(
public popoverController: PopoverController,
private modalController: ModalController, private modalController: ModalController,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private processes: ProcessesService, private processes: ProcessesService,
@@ -31,7 +33,8 @@ export class DeplomaOptionsPage implements OnInit {
private toastService: ToastService, private toastService: ToastService,
private router: Router, private router: Router,
private deplomaService: DeplomaService, private deplomaService: DeplomaService,
private RouteService: RouteService) { private RouteService: RouteService,
public p: PermissionService,) {
this.serialNumber = this.navParams.get('serialNumber'); this.serialNumber = this.navParams.get('serialNumber');
this.task = this.navParams.get('task'); this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask'); this.fulltask = this.navParams.get('fulltask');
@@ -28,7 +28,7 @@
<div class="flex-grow-1"> <div class="flex-grow-1">
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button> <button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button> <button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
</div> </div>
@@ -40,7 +40,7 @@
<div class="solid"></div> <div class="solid"></div>
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
@@ -51,7 +51,7 @@
<div class="solid"></div> <div class="solid"></div>
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
@@ -60,7 +60,7 @@
<div class="solid"></div> <div class="solid"></div>
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button> <button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
@@ -9,27 +9,27 @@
<div class="width-100"> <div class="width-100">
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100"> <div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
<div class="flex-grow-1 width-50 pr-10"> <div class="flex-grow-1 width-50 pr-10">
<button class="btn-cancel desk" shape="round"> Responder ao PR </button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Responder ao PR </button>
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
<button class="btn-cancel desk" shape="round"> Reencaminhar para Área jurídica </button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Reencaminhar para Área jurídica </button>
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" shape="round" >Gerar Diploma</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" shape="round" >Gerar Diploma</button>
<button class="btn-cancel desk" shape="round"> Outras opções </button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Outras opções </button>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
</div> </div>
<div class="flex-grow-1 width-50 pl-10"> <div class="flex-grow-1 width-50 pl-10">
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<!-- <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> --> <!-- <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> -->
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button> <button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
</div> </div>
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100"> <div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
<div class="flex-grow-1"> <div class="flex-grow-1">
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button> <button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
</div> </div>
@@ -8,7 +8,7 @@
</div> </div>
<div *ngIf="task"> <div *ngIf="task">
<div *ngIf="loggeduser.Profile =='MDGPR' " class="buttons"> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" " class="buttons">
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button> <button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button> <button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
<div class="solid"></div> <div class="solid"></div>
@@ -17,7 +17,7 @@
<button hidden class="btn-cancel" shape="round" >Delegar</button> <button hidden class="btn-cancel" shape="round" >Delegar</button>
<button (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento</button> <button (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento</button>
</div> </div>
<div *ngIf="loggeduser.Profile =='PR' " class="buttons"> <div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" " class="buttons">
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="distartExpedientModal('descartar')" full class="btn-cancel" shape="round" >Descartar</button> <button (click)="distartExpedientModal('descartar')" full class="btn-cancel" shape="round" >Descartar</button>
<div class="solid"></div> <div class="solid"></div>
@@ -15,6 +15,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common' import { Location } from '@angular/common'
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-opts-expediente-pr', selector: 'app-opts-expediente-pr',
@@ -51,7 +52,8 @@ export class OptsExpedientePrPage implements OnInit {
private animationController: AnimationController, private animationController: AnimationController,
private toastService: ToastService, private toastService: ToastService,
private RouteService: RouteService, private RouteService: RouteService,
public ThemeService: ThemeService public ThemeService: ThemeService,
public p: PermissionService,
) { ) {
@@ -6,27 +6,27 @@
</button> </button>
</div> </div>
<div class="width-100"> <div class="width-100">
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100"> <div class="d-flex width-100">
<div class="flex-grow-1"> <div class="flex-grow-1">
<button class="btn-cancel desk" shape="round"> Enviar para o PR </button> <button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="btn-cancel desk" shape="round"> Enviar para o PR </button>
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button> <button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<button class="btn-cancel desk" shape="round"> Solicitar revisão </button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Solicitar revisão </button>
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
<button class="btn-cancel desk" shape="round">Outras opções </button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) || p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="btn-cancel desk" shape="round">Outras opções </button>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button> <button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
<div class="flex-grow-1"> <div class="flex-grow-1">
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button> <button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button> <button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
</div> </div>
</div> </div>
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100"> <!-- <div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
<div class="flex-grow-1"> <div class="flex-grow-1">
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button> <button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
@@ -38,7 +38,7 @@
<button hidden class="btn-cancel" shape="round" >Delegar</button> <button hidden class="btn-cancel" shape="round" >Delegar</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button> <button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
</div> </div>
</div> </div> -->
<div class="solid"></div> <div class="solid"></div>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button> <button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
@@ -7,7 +7,7 @@
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button> <button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
@@ -18,7 +18,7 @@
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button> <button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
@@ -30,7 +30,7 @@
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<!-- <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> --> <!-- <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> -->
<button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button> <button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button> <button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
@@ -39,8 +39,8 @@
<div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente' "> <div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente' ">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'"> <div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
<button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button> <button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'">Iniciar Conversa</button> <button (click)="openNewGroupPage()" class="btn-cancel" shape="round" *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'">Iniciar Conversa</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button> <button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
@@ -51,7 +51,7 @@
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button> <button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
@@ -56,12 +56,12 @@
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<ion-toolbar class="footer-toolbar width-md-100 px-md-20"> <ion-toolbar class="footer-toolbar width-md-100 px-md-20">
<ion-buttons slot="start"> <ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.deletePost])" slot="start">
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()"> <button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
<ion-label>Eliminar</ion-label> <ion-label>Eliminar</ion-label>
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons slot="end"> <ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.editPost])" slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')"> <button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
<ion-label>Editar</ion-label> <ion-label>Editar</ion-label>
</button> </button>
@@ -9,6 +9,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-publication-detail-shared', selector: 'app-publication-detail-shared',
@@ -31,7 +32,8 @@ export class PublicationDetailPage implements OnInit {
private publications:PublicationsService, private publications:PublicationsService,
private animationController: AnimationController, private animationController: AnimationController,
private toastService: ToastService, private toastService: ToastService,
public ThemeService: ThemeService public ThemeService: ThemeService,
public p:PermissionService,
) { ) {
/* this.folderId = this.navParams.get('folderIdId'); */ /* this.folderId = this.navParams.get('folderIdId'); */
@@ -11,11 +11,11 @@
<div class="actions-icon"> <div class="actions-icon">
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> --> <!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
<button class="btn-no-color" (click)="openEditPublication(item.ProcessId)"> <button *ngIf="p.userPermission([p.permissionList.Actions.editPost])" class="btn-no-color" (click)="openEditPublication(item.ProcessId)">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
</button> </button>
<button class="btn-no-color" (click)="deletePublication(item.ProcessId)"> <button *ngIf="p.userPermission([p.permissionList.Actions.deletePost])" class="btn-no-color" (click)="deletePublication(item.ProcessId)">
<ion-icon class="delete" src='assets/images/theme/gov/icons-delete.svg'></ion-icon> <ion-icon class="delete" src='assets/images/theme/gov/icons-delete.svg'></ion-icon>
</button> </button>
<button class="btn-no-color cursor-pointer" (click)="doRefresh($event)"> <button class="btn-no-color cursor-pointer" (click)="doRefresh($event)">
@@ -89,7 +89,7 @@
</ion-list> --> </ion-list> -->
</div> </div>
<!-- fab placed to the bottom end --> <!-- fab placed to the bottom end -->
<ion-fab vertical="bottom" horizontal="end"> <ion-fab *ngIf="p.userPermission([p.permissionList.Actions.create])" vertical="bottom" horizontal="end">
<ion-fab-button title="Nova Publicação" (click)="AddPublication('2',item.ProcessId)"> <ion-fab-button title="Nova Publicação" (click)="AddPublication('2',item.ProcessId)">
<ion-icon name="add"></ion-icon> <ion-icon name="add"></ion-icon>
</ion-fab-button> </ion-fab-button>
@@ -11,6 +11,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-action.page'; import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-action.page';
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-view-publications', selector: 'app-view-publications',
@@ -43,7 +44,8 @@ export class ViewPublicationsPage implements OnInit {
private publications: PublicationsService, private publications: PublicationsService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private toastService: ToastService, private toastService: ToastService,
private storage: Storage private storage: Storage,
public p:PermissionService,
) { ) {
this.item = new PublicationFolder(); this.item = new PublicationFolder();
} }