This commit is contained in:
Peter Maquiran
2023-01-24 15:56:47 +01:00
parent 0748612054
commit fbd50137f3
153 changed files with 5997 additions and 953 deletions
+465
View File
@@ -0,0 +1,465 @@
{
"header": {
"reportVersion": 1,
"event": "Allocation failed - JavaScript heap out of memory",
"trigger": "FatalError",
"filename": "report.20230116.142547.31280.0.001.json",
"dumpEventTime": "2023-01-16T14:25:47Z",
"dumpEventTimeStamp": "1673875547220",
"processId": 31280,
"cwd": "C:\\Users\\peter.maquiran\\Documents\\project\\gabinete-digital-fo",
"commandLine": [
"node",
"C:\\Users\\peter.maquiran\\Documents\\project\\gabinete-digital-fo\\node_modules\\.bin\\\\..\\@angular\\cli\\bin\\ng",
"run",
"app:serve:production",
"--host=localhost",
"--port=8101"
],
"nodejsVersion": "v12.14.1",
"wordSize": 64,
"arch": "x64",
"platform": "win32",
"componentVersions": {
"node": "12.14.1",
"v8": "7.7.299.13-node.16",
"uv": "1.33.1",
"zlib": "1.2.11",
"brotli": "1.0.7",
"ares": "1.15.0",
"modules": "72",
"nghttp2": "1.40.0",
"napi": "5",
"llhttp": "2.0.1",
"http_parser": "2.8.0",
"openssl": "1.1.1d",
"cldr": "35.1",
"icu": "64.2",
"tz": "2019c",
"unicode": "12.1"
},
"release": {
"name": "node",
"lts": "Erbium",
"headersUrl": "https://nodejs.org/download/release/v12.14.1/node-v12.14.1-headers.tar.gz",
"sourceUrl": "https://nodejs.org/download/release/v12.14.1/node-v12.14.1.tar.gz",
"libUrl": "https://nodejs.org/download/release/v12.14.1/win-x64/node.lib"
},
"osName": "Windows_NT",
"osRelease": "10.0.18363",
"osVersion": "Windows 10 Pro",
"osMachine": "x86_64",
"cpus": [
{
"model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
"speed": 1992,
"user": 11330625,
"nice": 0,
"sys": 14678953,
"idle": 150967375,
"irq": 5472781
},
{
"model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
"speed": 1992,
"user": 7800796,
"nice": 0,
"sys": 5484906,
"idle": 163690671,
"irq": 306109
},
{
"model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
"speed": 1992,
"user": 12714203,
"nice": 0,
"sys": 8063375,
"idle": 156198781,
"irq": 161593
},
{
"model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
"speed": 1992,
"user": 9228578,
"nice": 0,
"sys": 5652046,
"idle": 162095734,
"irq": 117578
},
{
"model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
"speed": 1992,
"user": 11003906,
"nice": 0,
"sys": 7387171,
"idle": 158585281,
"irq": 182406
},
{
"model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
"speed": 1992,
"user": 7991453,
"nice": 0,
"sys": 5380921,
"idle": 163603984,
"irq": 125500
},
{
"model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
"speed": 1992,
"user": 11477265,
"nice": 0,
"sys": 7271046,
"idle": 158228046,
"irq": 171921
},
{
"model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
"speed": 1992,
"user": 8419921,
"nice": 0,
"sys": 5617531,
"idle": 162938906,
"irq": 116265
}
],
"networkInterfaces": [
{
"name": "vEthernet (Wifi)",
"internal": false,
"mac": "74:d8:3e:d0:3c:bb",
"address": "fe80::2c4a:fffd:f4ea:f439",
"netmask": "ffff:ffff:ffff:ffff::",
"family": "IPv6",
"scopeid": 23
},
{
"name": "vEthernet (Wifi)",
"internal": false,
"mac": "74:d8:3e:d0:3c:bb",
"address": "192.168.0.58",
"netmask": "255.255.255.0",
"family": "IPv4"
},
{
"name": "Loopback Pseudo-Interface 1",
"internal": true,
"mac": "00:00:00:00:00:00",
"address": "::1",
"netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"family": "IPv6",
"scopeid": 0
},
{
"name": "Loopback Pseudo-Interface 1",
"internal": true,
"mac": "00:00:00:00:00:00",
"address": "127.0.0.1",
"netmask": "255.0.0.0",
"family": "IPv4"
},
{
"name": "vEthernet (Default Switch)",
"internal": false,
"mac": "00:15:5d:0a:6a:e5",
"address": "fe80::a5a5:d9f3:9284:7c1c",
"netmask": "ffff:ffff:ffff:ffff::",
"family": "IPv6",
"scopeid": 36
},
{
"name": "vEthernet (Default Switch)",
"internal": false,
"mac": "00:15:5d:0a:6a:e5",
"address": "192.168.188.97",
"netmask": "255.255.255.240",
"family": "IPv4"
}
],
"host": "LAPTOP-66"
},
"javascriptStack": {
"message": "No stack.",
"stack": [
"Unavailable."
]
},
"nativeStack": [
{
"pc": "0x00007ff6d4561759",
"symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+10873"
},
{
"pc": "0x00007ff6d4565b7c",
"symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+28316"
},
{
"pc": "0x00007ff6d4564b38",
"symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+24152"
},
{
"pc": "0x00007ff6d465433b",
"symbol": "v8::base::CPU::has_sse+37723"
},
{
"pc": "0x00007ff6d4e58c5e",
"symbol": "v8::Isolate::ReportExternalAllocationLimitReached+94"
},
{
"pc": "0x00007ff6d4e40ca1",
"symbol": "v8::SharedArrayBuffer::Externalize+833"
},
{
"pc": "0x00007ff6d4d0e56c",
"symbol": "v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1436"
},
{
"pc": "0x00007ff6d4d19910",
"symbol": "v8::internal::Heap::ProtectUnprotectedMemoryChunks+1312"
},
{
"pc": "0x00007ff6d4d16444",
"symbol": "v8::internal::Heap::PageFlagsAreConsistent+3204"
},
{
"pc": "0x00007ff6d4d0bcd3",
"symbol": "v8::internal::Heap::CollectGarbage+1283"
},
{
"pc": "0x00007ff6d4d0a4a4",
"symbol": "v8::internal::Heap::AddRetainedMap+2356"
},
{
"pc": "0x00007ff6d4d2b775",
"symbol": "v8::internal::Factory::NewFillerObject+53"
},
{
"pc": "0x00007ff6d4a97a49",
"symbol": "v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+4057"
},
{
"pc": "0x00007ff6d528463d",
"symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+567949"
},
{
"pc": "0x000002be85bcfe95",
"symbol": ""
}
],
"javascriptHeap": {
"totalMemory": 2167566336,
"totalCommittedMemory": 2167566336,
"usedMemory": 2064602904,
"availableMemory": 72200776,
"memoryLimit": 2197815296,
"heapSpaces": {
"read_only_space": {
"memorySize": 262144,
"committedMemory": 262144,
"capacity": 261872,
"used": 32296,
"available": 229576
},
"new_space": {
"memorySize": 33554432,
"committedMemory": 33554432,
"capacity": 16759808,
"used": 3605840,
"available": 13153968
},
"old_space": {
"memorySize": 1884401664,
"committedMemory": 1884401664,
"capacity": 1839520176,
"used": 1829345824,
"available": 10174352
},
"code_space": {
"memorySize": 15892480,
"committedMemory": 15892480,
"capacity": 15142912,
"used": 13508800,
"available": 1634112
},
"map_space": {
"memorySize": 19402752,
"committedMemory": 19402752,
"capacity": 5107360,
"used": 5107360,
"available": 0
},
"large_object_space": {
"memorySize": 213430272,
"committedMemory": 213430272,
"capacity": 212452384,
"used": 212452384,
"available": 0
},
"code_large_object_space": {
"memorySize": 622592,
"committedMemory": 622592,
"capacity": 550400,
"used": 550400,
"available": 0
},
"new_large_object_space": {
"memorySize": 0,
"committedMemory": 0,
"capacity": 16759808,
"used": 0,
"available": 16759808
}
}
},
"resourceUsage": {
"userCpuSeconds": 1784.05,
"kernelCpuSeconds": 125.39,
"cpuConsumptionPercent": 29.3579,
"maxRss": 2669527040,
"pageFaults": {
"IORequired": 3606280,
"IONotRequired": 0
},
"fsActivity": {
"reads": 48626,
"writes": 7136
}
},
"libuv": [
],
"environmentVariables": {
" c:\\program files\\nodejs\\node_modules\\npm": "npm",
"=C:": "C:\\Users\\peter.maquiran\\Documents\\project\\gabinete-digital-fo",
"allusersprofile": "C:\\ProgramData",
"android_sdk_root": "C:\\Users\\peter.maquiran\\Documents\\android-sdk",
"appdata": "C:\\Users\\peter.maquiran\\AppData\\Roaming",
"asl.log": "Destination=file",
"brb": "C:\\Program Files\\HP\\Sure Click\\bin",
"BROWSERSLIST_IGNORE_OLD_DATA": "1",
"brs": "C:\\Program Files\\HP\\Sure Click\\servers",
"chocolateyinstall": "C:\\ProgramData\\chocolatey",
"chocolateylastpathupdate": "132689116989769711",
"chrome_crashpad_pipe_name": "\\\\.\\pipe\\LOCAL\\crashpad_456_JCFUHUHYVFNGTFZP",
"colorterm": "truecolor",
"commonprogramfiles": "C:\\Program Files\\Common Files",
"commonprogramfiles(x86)": "C:\\Program Files (x86)\\Common Files",
"commonprogramw6432": "C:\\Program Files\\Common Files",
"computername": "LAPTOP-66",
"comspec": "C:\\windows\\system32\\cmd.exe",
"dp0": "C:\\Users\\peter.maquiran\\Documents\\project\\gabinete-digital-fo\\node_modules\\.bin\\",
"driverdata": "C:\\Windows\\System32\\Drivers\\DriverData",
"exepath": "C:\\Program Files\\Git\\bin",
"force_color": "1",
"fps_browser_app_profile_string": "Internet Explorer",
"fps_browser_user_profile_string": "Default",
"grandle_home": "C:\\Gradle\\gradle-7.6\\bin",
"home": "C:\\Users\\peter.maquiran",
"homedrive": "C:",
"homepath": "\\Users\\peter.maquiran",
"ionic_cli_bin": "C:\\Users\\peter.maquiran\\AppData\\Roaming\\npm\\node_modules\\@ionic\\cli\\bin\\ionic",
"ionic_cli_lib": "C:\\Users\\peter.maquiran\\AppData\\Roaming\\npm\\node_modules\\@ionic\\cli",
"ionic_cli_local_error": "LOCAL_CLI_NOT_FOUND",
"java_home": "C:\\Program Files\\Java\\jdk-11.0.8",
"jre_home": "C:\\Program Files\\Java\\jre-11.0.8.10-hotspot",
"lang": "en_US.UTF-8",
"localappdata": "C:\\Users\\peter.maquiran\\AppData\\Local",
"logonserver": "\\\\VM-SRV-01",
"msystem": "MINGW64",
"number_of_processors": "8",
"nvm_home": "C:\\Users\\peter.maquiran\\AppData\\Roaming\\nvm",
"nvm_symlink": "C:\\Program Files\\nodejs",
"onedrive": "C:\\Users\\peter.maquiran\\OneDrive",
"onlineservices": "Online Services",
"original_xdg_current_desktop": "undefined",
"os": "Windows_NT",
"path": "C:\\Users\\peter.maquiran\\Documents\\project\\gabinete-digital-fo\\node_modules\\.bin;C:\\Program Files\\Git\\mingw64\\bin;C:\\Program Files\\Git\\usr\\bin;C:\\Users\\peter.maquiran\\bin;C:\\Program Files\\java\\jre-11.0.8.10-hotspot\\bin;C:\\Users\\peter.maquiran\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Users\\peter.maquiran\\AppData\\Local\\Programs\\Python\\Python39\\Scripts;C:\\Users\\peter.maquiran\\AppData\\Local\\Programs\\Python\\Python39;C:\\Users\\peter.maquiran\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\peter.maquiran\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files\\wkhtmltopdf\\bin;C:\\Program Files\\heroku\\bin;C:\\Program Files\\TestProject Agent;C:\\Program Files (x86)\\Android\\android-sdk;C:\\Users\\peter.maquiran\\Documents\\flutter_windows_2.2.3-stable\\flutter\\bin;C:\\Program Files\\php-7.3.33;C:\\Users\\peter.maquiran\\AppData\\Local\\ComposerSetup\\bin;C:\\Users\\peter.maquiran\\AppData\\Roaming\\Composer\\vendor\\bin;C:\\Users\\peter.maquiran\\.dotnet\\tools;C:\\Program Files\\Azure Data Studio\\bin;C:\\Gradle\\gradle-7.6\\bin;C:\\Users\\peter.maquiran\\AppData\\Roaming\\npm;C:\\Users\\peter.maquiran\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Program Files\\Java\\jdk-11.0.8\\bin",
"pathext": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JSE;.WSF;.WSH;.MSC;.PY;.PYW",
"platformcode": "AN",
"plink_protocol": "ssh",
"processor_architecture": "AMD64",
"processor_identifier": "Intel64 Family 6 Model 142 Stepping 12, GenuineIntel",
"processor_level": "6",
"processor_revision": "8e0c",
"programdata": "C:\\ProgramData",
"programfiles": "C:\\Program Files",
"programfiles(x86)": "C:\\Program Files (x86)",
"programw6432": "C:\\Program Files",
"PROMPT": "$P$G",
"psmodulepath": "C:\\Program Files\\WindowsPowerShell\\Modules;C:\\windows\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files (x86)\\Microsoft SQL Server\\150\\Tools\\PowerShell\\Modules\\;C:\\Program Files\\Veeam\\Backup and Replication\\Explorers\\Exchange\\;C:\\Program Files\\Veeam\\Backup and Replication\\Explorers\\SQL\\;C:\\Program Files\\Veeam\\Backup and Replication\\Explorers\\ActiveDirectory\\;C:\\Program Files\\Veeam\\Backup and Replication\\Explorers\\Oracle\\;C:\\Program Files\\Veeam\\Backup and Replication\\Explorers\\SharePoint\\",
"ptsminstallpath": "c:\\Program Files\\HP\\HP ProtectTools Security Manager\\Bin\\",
"ptsminstallpath_x86": "c:\\Program Files (x86)\\HP\\HP ProtectTools Security Manager\\Bin\\",
"public": "C:\\Users\\Public",
"pwd": "C:/Users/peter.maquiran/Documents/project/gabinete-digital-fo",
"regioncode": "EMEA",
"sessionname": "Console",
"shlvl": "1",
"systemdrive": "C:",
"systemroot": "C:\\windows",
"temp": "C:\\Users\\PETER~1.MAQ\\AppData\\Local\\Temp",
"term": "xterm-256color",
"term_program": "vscode",
"term_program_version": "1.74.3",
"tmp": "C:\\Users\\PETER~1.MAQ\\AppData\\Local\\Temp",
"userdnsdomain": "EQUILIBRIUM.LOCAL",
"userdomain": "EQUILIBRIUM",
"userdomain_roamingprofile": "EQUILIBRIUM",
"username": "peter.maquiran",
"userprofile": "C:\\Users\\peter.maquiran",
"vs110comntools": "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\",
"vs120comntools": "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\",
"vs140comntools": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\",
"vscode_git_ipc_handle": "\\\\.\\pipe\\vscode-git-763e312aff-sock",
"WEBPACK_DEV_SERVER": "true",
"windir": "C:\\windows",
"_prog": "node"
},
"sharedObjects": [
"C:\\Program Files\\nodejs\\node.exe",
"C:\\windows\\SYSTEM32\\ntdll.dll",
"C:\\windows\\System32\\KERNEL32.DLL",
"C:\\windows\\System32\\KERNELBASE.dll",
"C:\\windows\\System32\\WS2_32.dll",
"C:\\windows\\System32\\RPCRT4.dll",
"C:\\windows\\SYSTEM32\\dbghelp.dll",
"C:\\windows\\System32\\ADVAPI32.dll",
"C:\\windows\\System32\\msvcrt.dll",
"C:\\windows\\System32\\ucrtbase.dll",
"C:\\windows\\System32\\sechost.dll",
"C:\\windows\\System32\\USER32.dll",
"C:\\windows\\System32\\win32u.dll",
"C:\\windows\\System32\\GDI32.dll",
"C:\\windows\\System32\\gdi32full.dll",
"C:\\windows\\System32\\msvcp_win.dll",
"C:\\windows\\System32\\PSAPI.DLL",
"C:\\windows\\System32\\CRYPT32.dll",
"C:\\windows\\System32\\MSASN1.dll",
"C:\\windows\\System32\\bcrypt.dll",
"C:\\windows\\SYSTEM32\\IPHLPAPI.DLL",
"C:\\windows\\SYSTEM32\\USERENV.dll",
"C:\\windows\\System32\\profapi.dll",
"C:\\windows\\SYSTEM32\\WINMM.dll",
"C:\\windows\\SYSTEM32\\winmmbase.dll",
"C:\\windows\\System32\\cfgmgr32.dll",
"C:\\windows\\System32\\bcryptPrimitives.dll",
"C:\\windows\\System32\\IMM32.DLL",
"C:\\windows\\System32\\powrprof.dll",
"C:\\windows\\System32\\UMPDC.dll",
"C:\\windows\\SYSTEM32\\CRYPTBASE.DLL",
"C:\\windows\\system32\\uxtheme.dll",
"C:\\windows\\System32\\combase.dll",
"C:\\windows\\system32\\mswsock.dll",
"C:\\windows\\System32\\kernel.appcore.dll",
"C:\\windows\\System32\\NSI.dll",
"C:\\windows\\SYSTEM32\\dhcpcsvc6.DLL",
"C:\\windows\\SYSTEM32\\dhcpcsvc.DLL",
"C:\\windows\\SYSTEM32\\DNSAPI.dll",
"C:\\Windows\\System32\\rasadhlp.dll",
"C:\\windows\\System32\\fwpuclnt.dll",
"C:\\windows\\system32\\napinsp.dll",
"C:\\windows\\system32\\pnrpnsp.dll",
"C:\\windows\\System32\\winrnr.dll",
"C:\\windows\\system32\\NLAapi.dll",
"C:\\windows\\system32\\wshbth.dll"
]
}
+6 -1
View File
@@ -249,7 +249,8 @@ const routes = [
{ {
path: 'chat-debugging', path: 'chat-debugging',
loadChildren: () => import('./shared/popover/chat-debugging/chat-debugging.module').then( m => m.ChatDebuggingPageModule) loadChildren: () => import('./shared/popover/chat-debugging/chat-debugging.module').then( m => m.ChatDebuggingPageModule)
}, },
{
path: 'chat-message-debugging', path: 'chat-message-debugging',
loadChildren: () => import('./shared/popover/chat-message-debugging/chat-message-debugging.module').then( m => m.ChatMessageDebuggingPageModule) loadChildren: () => import('./shared/popover/chat-message-debugging/chat-message-debugging.module').then( m => m.ChatMessageDebuggingPageModule)
}, },
@@ -260,6 +261,10 @@ const routes = [
{ {
path: 'information', path: 'information',
loadChildren: () => import('./modals/information/information.module').then( m => m.InformationPageModule) loadChildren: () => import('./modals/information/information.module').then( m => m.InformationPageModule)
},
{
path: 'chat-options-popover',
loadChildren:() => import('./shared/popover/chat-options-popover/chat-options-popover.module').then( m => m.ChatOptionsPopoverPageModule)
} }
+4 -2
View File
@@ -4,6 +4,7 @@ import { Observable } from 'rxjs';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { Platform } from '@ionic/angular'; import { Platform } from '@ionic/angular';
import { RouteService } from 'src/app/services/route.service' import { RouteService } from 'src/app/services/route.service'
import { FirstEnterService } from 'src/app/services/first-enter.service'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -12,7 +13,8 @@ export class LoginGuard implements CanActivate {
constructor( constructor(
private router:Router, private router:Router,
private platform: Platform, private platform: Platform,
private RouteService: RouteService ) { private RouteService: RouteService,
private FirstEnterService: FirstEnterService ) {
} }
canActivate( canActivate(
@@ -24,7 +26,7 @@ export class LoginGuard implements CanActivate {
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) { if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
// enter app // enter app
this.router.navigate(['/home/events']); this.FirstEnterService.enter()
return false return false
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && SessionStore.forceToLoginWithForceToLogInWithPassword && this.platform.is('mobile')) { } else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && SessionStore.forceToLoginWithForceToLogInWithPassword && this.platform.is('mobile')) {
// login with password while has pin // login with password while has pin
+1 -1
View File
@@ -27,7 +27,7 @@
<ion-tab-button *ngIf="p.userPermission([permissionList.Actions.access])" 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">Acções</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button *ngIf="p.userPermission([permissionList.Chat.access])" tab="chat" [class.active]="pathname === '/home/chat' "> <ion-tab-button *ngIf="p.userPermission([permissionList.Chat.access])" tab="chat" [class.active]="pathname === '/home/chat' ">
-1
View File
@@ -39,7 +39,6 @@ export class HomePage implements OnInit {
toDayEventStorage = ToDayEventStorage toDayEventStorage = ToDayEventStorage
totalDocumentStore = TotalDocumentStore totalDocumentStore = TotalDocumentStore
expedienteGdStore = ExpedienteGdStore expedienteGdStore = ExpedienteGdStore
adding: "intervenient" | "CC" = "intervenient"; adding: "intervenient" | "CC" = "intervenient";
mobileComponent = { mobileComponent = {
showAddNewEvent: false, showAddNewEvent: false,
@@ -171,7 +171,7 @@
[(ngModel)]="postData.StartDate" [(ngModel)]="postData.StartDate"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" (click)="setStartDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1 <ngx-mat-datetime-picker #picker1
[showSpinners]="showSpinners" [showSpinners]="showSpinners"
[showSeconds]="showSeconds" [showSeconds]="showSeconds"
@@ -207,7 +207,7 @@
[(ngModel)]="postData.EndDate" [(ngModel)]="postData.EndDate"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" (click)="setEndDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim <ngx-mat-datetime-picker #fim
[showSpinners]="showSpinners" [showSpinners]="showSpinners"
[showSeconds]="showSeconds" [showSeconds]="showSeconds"
@@ -52,7 +52,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
public minDate = new Date(); public minDate = new Date();
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
p: any = {} p: any = {}
@@ -117,6 +117,24 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.postData.CalendarName = "Oficial"; this.postData.CalendarName = "Oficial";
this.postData.Category = 'Reunião' this.postData.Category = 'Reunião'
if(!this.CalendarName) {
if(this._eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario';
console.log(this._eventService.calendarNamesAry)
} else {
this.CalendarName = this._eventService.calendarNamesAry[0]
}
}
if(this.taskParticipants.length == 0) {
this.taskParticipants = [{
EmailAddress: SessionStore.user.Email,
IsRequired: true,
Name: SessionStore.user.UserName
}]
}
} }
ngOnInit() { ngOnInit() {
@@ -132,8 +150,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
setDefaultTime() { setDefaultTime() {
this.postData.StartDate = new Date() // this.postData.StartDate = new Date()
this.postData.EndDate = (new Date(new Date().getTime() + 15 * 60000)) // this.postData.EndDate = (new Date(new Date().getTime() + 15 * 60000))
} }
close() { close() {
@@ -384,4 +402,46 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.taskParticipantsCc = data; this.taskParticipantsCc = data;
} }
roundTimeQuarterHour() {
var timeToReturn = new Date();
var minutes = timeToReturn.getMinutes();
var hours = timeToReturn.getHours();
var m = (Math.round(minutes/15) * 15) % 60;
var h = minutes > 52 ? (hours === 23 ? 0 : ++hours) : hours;
if (m == 0) {
if(minutes > m){
m = m + 15;
}
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else{
if(minutes > m){
m = m + 15;
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else {
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}
}
// console.log("AFTER IF MINUTES: " +m);
// console.log("AFTER HOURS: " +h);
return timeToReturn;
}
setStartDate(){
this.postData.StartDate = this.roundTimeQuarterHour();
}
setEndDate(){
this.postData.EndDate = this.postData.StartDate;
}
} }
@@ -3,14 +3,14 @@
<div class="profile-header width-100"> <div class="profile-header width-100">
<div class="div-logo width-40"> <div class="div-logo width-40">
<div class="logo-icon"> <div class="logo-icon">
<!-- <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A1.png' alt='logo'> --> <img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A1.png' alt='logo'>
</div> </div>
<div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center"> <div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content"> <div class="logo-description-content">
<!-- <p class="logo-description-text">Calendário Partilhado</p> --> <!-- <p class="logo-description-text">Calendário Partilhado</p> -->
<p class="logo-description-text tp-5">Presidente da República</p> <p class="logo-description-text tp-5">doneIT</p>
<div class="add-line"></div> <div class="add-line"></div>
<p class="logo-description-text tp-5">GABINETE DIGITAL</p> <p class="logo-description-text tp-5">GABINETE DIGITAL</p>
</div> </div>
@@ -18,7 +18,7 @@
<div *ngIf="ThemeService.currentTheme == 'default'" class="logo-description d-flex align-center justify-content-center"> <div *ngIf="ThemeService.currentTheme == 'default'" class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content"> <div class="logo-description-content">
<!-- <p class="logo-description-text color-white">Calendário Partilhado</p> --> <!-- <p class="logo-description-text color-white">Calendário Partilhado</p> -->
<p class="logo-description-text tp-5 color-white">Presidente da República</p> <p class="logo-description-text tp-5 color-white">doneIT</p>
<div class="add-line-white"></div> <div class="add-line-white"></div>
<p class="logo-description-text tp-5 color-white">GABINETE DIGITAL</p> <p class="logo-description-text tp-5 color-white">GABINETE DIGITAL</p>
</div> </div>
+4 -5
View File
@@ -2,14 +2,13 @@
<div class="profile-header width-100"> <div class="profile-header width-100">
<div class="div-logo d-md-none width-40"> <div class="div-logo d-md-none width-40">
<div class="logo-icon" *ngIf="hideImage"> <div class="logo-icon" *ngIf="hideImage">
<!-- <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A.png' alt='logo'> --> <img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A.png' alt='logo'>
</div> </div>
<div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center"> <div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content"> <div class="logo-description-content">
<!-- <p class="logo-description-text">Calendário Partilhado</p> --> <p class="logo-description-text tp-5">doneIT</p>
<p class="logo-description-text tp-5">Presidente da República</p>
<div class="add-line"></div> <div class="add-line"></div>
<p class="logo-description-text tp-5">GABINETE DIGITAL</p> <p class="logo-description-text tp-5">GABINETE DIGITAL</p>
</div> </div>
@@ -17,7 +16,7 @@
<div *ngIf="ThemeService.currentTheme == 'default'" class="logo-description d-flex align-center justify-content-center"> <div *ngIf="ThemeService.currentTheme == 'default'" class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content"> <div class="logo-description-content">
<!-- <p class="logo-description-text color-white">Calendário Partilhado</p> --> <!-- <p class="logo-description-text color-white">Calendário Partilhado</p> -->
<p class="logo-description-text tp-5 color-white">Presidente da República</p> <p class="logo-description-text tp-5 color-white">doneIT</p>
<div class="add-line-white"></div> <div class="add-line-white"></div>
<p class="logo-description-text tp-5 color-white">GABINETE DIGITAL</p> <p class="logo-description-text tp-5 color-white">GABINETE DIGITAL</p>
</div> </div>
+5 -3
View File
@@ -9,6 +9,7 @@ import { NotificationsService } from '../../services/notifications.service';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { EventTrigger } from '../../services/eventTrigger.service'; import { EventTrigger } from '../../services/eventTrigger.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { environment } from 'src/environments/environment';
@Component({ @Component({
selector: 'app-profile', selector: 'app-profile',
@@ -218,8 +219,9 @@ export class ProfilePage implements OnInit {
SessionStore.setUrlBeforeInactivity(this.router.url); SessionStore.setUrlBeforeInactivity(this.router.url);
this.logoutOut == false this.logoutOut == false
setTimeout(() => { if(environment.production) {
window.location.pathname = '/auth'
} else {
const pathBeforeGoOut = window.location.pathname const pathBeforeGoOut = window.location.pathname
this.router.navigateByUrl('/auth', { replaceUrl: true }); this.router.navigateByUrl('/auth', { replaceUrl: true });
@@ -230,8 +232,8 @@ export class ProfilePage implements OnInit {
console.log('refresh') console.log('refresh')
} }
}, 500) }, 500)
}
}, 100)
} }
async editProfile() { async editProfile() {
@@ -1,13 +1,13 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { ModalController, NavParams } from '@ionic/angular'; import { NavParams } from '@ionic/angular';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage'; import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page'; import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page';
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page'; import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
import { AlertService } from 'src/app/services/alert.service';
import { AlertController, ModalController } from '@ionic/angular';
@Component({ @Component({
selector: 'app-view-document', selector: 'app-view-document',
templateUrl: './view-document.page.html', templateUrl: './view-document.page.html',
@@ -27,6 +27,7 @@ export class ViewDocumentPage implements OnInit {
private navParams: NavParams, private navParams: NavParams,
private sanitazer: DomSanitizer, private sanitazer: DomSanitizer,
private processes: ProcessesService, private processes: ProcessesService,
private alertController: AlertController,
) { ) {
this.file = this.navParams.get('file'); this.file = this.navParams.get('file');
this.applicationId = this.navParams.get('applicationId'); this.applicationId = this.navParams.get('applicationId');
@@ -44,9 +45,27 @@ export class ViewDocumentPage implements OnInit {
ngOnInit() { ngOnInit() {
this.processes.GetViewer(this.docId, this.applicationId).subscribe(res=> { this.processes.GetViewer(this.docId, this.applicationId).subscribe(async(res)=> {
const link: string = res;
const link: string = res.replace('//pdfjs/web/', '/pdfjs/web/')
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link); this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
if(res == "") {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
//header: 'Apagar evento!',
message: 'Sem imagem',
buttons: [
{
text: 'Sim',
handler: () => {
this.close();
}
}
]
});
}
}, ()=>{ }, ()=>{
this.close(); this.close();
}); });
+3 -1
View File
@@ -153,8 +153,8 @@ export class ViewEventPage implements OnInit {
}); });
} else { } else {
if(this.CalendarId) { if(this.CalendarId) {
console.log('calendar id')
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => { this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
this.loadedEvent = res; this.loadedEvent = res;
this.addEventToDb(res); this.addEventToDb(res);
@@ -172,6 +172,8 @@ export class ViewEventPage implements OnInit {
} }
loader.remove() loader.remove()
}); });
} else {
console.log('no calendar id')
} }
} }
+2 -1
View File
@@ -11,6 +11,7 @@ export class MessageModel extends models.Model {
ts = JsonField({blank:true}) ts = JsonField({blank:true})
u = JsonField() u = JsonField()
_id = models.CharField({blank:true}) _id = models.CharField({blank:true})
origin = models.CharField({blank:true})
_updatedAt = models.IntegerField() _updatedAt = models.IntegerField()
messageSend = models.BooleanField() messageSend = models.BooleanField()
offline = models.BooleanField() offline = models.BooleanField()
@@ -41,7 +42,7 @@ export class DeleteMessageModel extends models.Model {
models.register({ models.register({
databaseName: 'chat-storage'+environment.version.lastCommitNumber, databaseName: 'chat-storage'+environment.version.lastCommitNumber,
type: 'indexedDB', type: 'indexedDB',
version: 10, version: 11,
models: [MessageModel, DeleteMessageModel, attachments] models: [MessageModel, DeleteMessageModel, attachments]
}) })
+1
View File
@@ -75,6 +75,7 @@ export interface Message {
u: U; u: U;
from: 'Offline'|'History'|'stream'| 'send' from: 'Offline'|'History'|'stream'| 'send'
t: string; t: string;
origin: 'history' | 'stream' | 'local'
_updatedAt: ''; _updatedAt: '';
mentions: any[]; mentions: any[];
channels: any[]; channels: any[];
+1
View File
@@ -43,6 +43,7 @@ export interface ChatMessageInterface {
_updatedAt: number; _updatedAt: number;
mentions: any[]; mentions: any[];
channels: any[]; channels: any[];
origin?: 'history' | 'stream' | 'local'
}; };
+2 -1
View File
@@ -13,6 +13,7 @@ const object = [
'diplomas', 'diplomas',
'expedientes-pr', 'expedientes-pr',
'despachos', 'despachos',
'*',
] as const; ] as const;
export type IdObject = typeof object[number]; export type notificationObject = typeof object[number];
+12 -13
View File
@@ -93,7 +93,6 @@
</div> </div>
<!-- Move forward one screen of the slides -->
<div (click)="next()" class="arrow cursor-pointer resize"> <div (click)="next()" class="arrow cursor-pointer resize">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src="assets/images/icons-calendar-arrow-right.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src="assets/images/icons-calendar-arrow-right.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="icon-only" src="assets/images/theme/gov/icons-calendar-arrow-right.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="icon-only" src="assets/images/theme/gov/icons-calendar-arrow-right.svg"></ion-icon>
@@ -103,7 +102,7 @@
</ion-row> </ion-row>
<ion-row class="ion-align-items-center"> <ion-row class="ion-align-items-center">
<div class="calendar-letters cal-reverse" *ngIf="SessionStore.user.Profile != 'PR' && SessionStore.user.Profile != 'MDGPR' && eventService.calendarIds.length >= 2" class="calendar-letters" [class.cal-reverse]="profile == 'mdgpr' " (click)="changeProfile()"> <div class="calendar-letters cal-reverse" *ngIf="SessionStore.user.Profile != 'PR' && SessionStore.user.Profile != 'MDGPR' && eventService.hasSharedCalendar && eventService.hasOwnCalendar" class="calendar-letters" [class.cal-reverse]="profile == 'mdgpr' " (click)="changeProfile()">
<div class="text" *ngIf="profile == 'mdgpr'"> <div class="text" *ngIf="profile == 'mdgpr'">
MC MC
</div> </div>
@@ -114,11 +113,11 @@
</div> </div>
<button *ngIf="profile == 'mdgpr' && ( SessionStore.user.Profile == 'PR' || SessionStore.user.Profile == 'MDGPR') " (click)="changeProfile()" class="d-md-none btn-no-color resize"> <button *ngIf="profile == 'mdgpr' && ( SessionStore.user.Profile == 'PR' || SessionStore.user.Profile == 'MDGPR') && eventService.hasSharedCalendar " (click)="changeProfile()" class="d-md-none btn-no-color resize">
<ion-icon class="right-icons" src="assets/images/icons-profile-calendar-md.svg"></ion-icon> <ion-icon class="right-icons" src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
</button> </button>
<button title="Mudar de Agenda" *ngIf="profile == 'pr'&& ( SessionStore.user.Profile == 'PR' || SessionStore.user.Profile == 'MDGPR')" (click)="changeProfile()" class="btn-no-color resize"> <button title="Mudar de Agenda" *ngIf="profile == 'pr'&& ( SessionStore.user.Profile == 'PR' || SessionStore.user.Profile == 'MDGPR') && eventService.hasSharedCalendar" (click)="changeProfile()" class="btn-no-color resize">
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon> <ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
</button> </button>
@@ -279,12 +278,11 @@
<div class="time-end text-center">o dia</div> <div class="time-end text-center">o dia</div>
</div> </div>
<div class="schedule-details"> <div class="schedule-details">
{{ event.event.CalendarName }}
<div class="location">{{event.event.Location}}</div>
<div class="description"> <div class="description">
<p class="m-0">{{event.event.Subject}}</p> <p class="m-0">{{event.event.Subject}}</p>
</div> </div>
<div class="font-13"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'">{{SessionStore.user.FullName}} </div> <div class="location">{{event.event.Location}}</div>
<div class="font-13 calendar-owner"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'">{{SessionStore.user.FullName}} </div>
<ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template> <ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template>
</div> </div>
</div> </div>
@@ -322,11 +320,11 @@
<div class="time-end">o dia</div> <div class="time-end">o dia</div>
</div> </div>
<div class="schedule-details"> <div class="schedule-details">
<div class="location">{{event.event.Location}}</div>
<div class="description"> <div class="description">
<p class="m-0">{{event.event.Subject}}</p> <p class="m-0">{{event.event.Subject}}</p>
</div> </div>
<div class="font-13"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'">{{SessionStore.user.FullName}} </div> <div class="location">{{event.event.Location}}</div>
<div class="font-13 calendar-owner"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'">{{SessionStore.user.FullName}} </div>
<ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template> <ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template>
</div> </div>
</div> </div>
@@ -366,11 +364,12 @@
<div class="time-end">o dia</div> <div class="time-end">o dia</div>
</div> </div>
<div class="schedule-details"> <div class="schedule-details">
<div class="location">{{event.event.Location}}</div>
<div class="description"> <div class="description">
<p class="m-0">{{event.event.Subject}}</p> <p class="m-0">{{event.event.Subject}} ....</p>
</div> </div>
<div class="font-13"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'"> {{SessionStore.user.FullName}} </div> <div class="location">{{event.event.Location}}</div>
<div class="font-13 calendar-owner"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'"> {{SessionStore.user.FullName}} </div>
<ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template> <ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template>
</div> </div>
</div> </div>
@@ -417,7 +416,7 @@
[eventAttendees]="contacts" [eventAttendees]="contacts"
(clearContact)="clearContact()" (clearContact)="clearContact()"
(setContact)="setContact($event)" (setContact)="setContact($event)"
[CalendarDate]="viewDate"
(setIntervenient)="setIntervenient($event)" (setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)" (setIntervenientCC)="setIntervenientCC($event)"
></app-new-event> ></app-new-event>
+7 -2
View File
@@ -512,14 +512,18 @@ td.monthview-primary-with-event {
.location { .location {
width: 100%; width: 100%;
font-family: Roboto; font-family: Roboto;
font-size: 13px;
color: black; color: black;
font-size: 14px;
} }
.calendar-owner {
font-size: 14px;
}
.description{ .description{
width: 100%; width: 100%;
font-family: Roboto; font-family: Roboto;
font-size: 15px;
font-weight: bold; font-weight: bold;
color: var(--title-text-color); color: var(--title-text-color);
} }
@@ -528,6 +532,7 @@ td.monthview-primary-with-event {
white-space: nowrap; white-space: nowrap;
overflow: hidden !important; overflow: hidden !important;
text-overflow: ellipsis !important; text-overflow: ellipsis !important;
font-size: 17px;
} }
} }
+15 -3
View File
@@ -108,8 +108,8 @@ export class AgendaPage implements OnInit {
postEvent: any; postEvent: any;
// temporary data // temporary data
taskParticipants: any[] = []; taskParticipants: EventPerson[] = [];
taskParticipantsCc: any[] = []; taskParticipantsCc: EventPerson[] = [];
adding: "intervenient" | "CC" = "intervenient"; adding: "intervenient" | "CC" = "intervenient";
@ViewChild(CalendarComponent) myCal: CalendarComponent; @ViewChild(CalendarComponent) myCal: CalendarComponent;
@@ -1225,12 +1225,19 @@ export class AgendaPage implements OnInit {
this.IsEvent = 'add'; this.IsEvent = 'add';
if (window.innerWidth <= 1024) { if (window.innerWidth <= 1024) {
let taskParticipants = [{
EmailAddress: SessionStore.user.Email,
IsRequired: true,
Name: SessionStore.user.UserName
}]
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: NewEventPage, component: NewEventPage,
componentProps: { componentProps: {
segment: this.segment, segment: this.segment,
profile: this.profile, profile: this.profile,
eventSelectedDate: this.eventSelectedDate eventSelectedDate: this.eventSelectedDate,
attendees: taskParticipants,
CalendarDate: this.viewDate
}, },
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop',
backdropDismiss: false backdropDismiss: false
@@ -1244,6 +1251,11 @@ export class AgendaPage implements OnInit {
}); });
} else { } else {
this.mobileComponent.showAddNewEvent = true; this.mobileComponent.showAddNewEvent = true;
this.taskParticipants = [{
EmailAddress: SessionStore.user.Email,
IsRequired: true,
Name: SessionStore.user.UserName
}]
} }
} }
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular'; import { ModalController, NavParams, Platform } from '@ionic/angular';
import { EventAttachment } from 'src/app/models/attachment.model'; import { EventAttachment } from 'src/app/models/attachment.model';
import { EventBody } from 'src/app/models/eventbody.model'; import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
@@ -17,6 +17,7 @@ import { ThemeService } from 'src/app/services/theme.service';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: { parse: {
@@ -62,6 +63,7 @@ export class NewEventPage implements OnInit {
eventAttendees: EventPerson[]; eventAttendees: EventPerson[];
selectedSegment: string; selectedSegment: string;
selectedDate: Date; selectedDate: Date;
CalendarDate: Date;
recurringTypes: any; recurringTypes: any;
selectedRecurringType: any; selectedRecurringType: any;
@@ -84,6 +86,7 @@ export class NewEventPage implements OnInit {
autoStartTime; autoStartTime;
autoEndTime; autoEndTime;
CalendarNamesOptions = ['Oficial', 'Pessoal'] CalendarNamesOptions = ['Oficial', 'Pessoal']
roomId:string;
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
@@ -91,7 +94,9 @@ export class NewEventPage implements OnInit {
public eventService: EventsService, public eventService: EventsService,
private attachmentsService: AttachmentsService, private attachmentsService: AttachmentsService,
private toastService: ToastService, private toastService: ToastService,
public ThemeService: ThemeService public ThemeService: ThemeService,
private platform: Platform,
private chatMethodService: ChatMethodsService,
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.postEvent = new Event(); this.postEvent = new Event();
@@ -99,28 +104,30 @@ export class NewEventPage implements OnInit {
this.eventBody = { BodyType : "1", Text : ""}; this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody; this.postEvent.Body = this.eventBody;
this.roomId = this.navParams.get('roomId');
this.selectedSegment = this.navParams.get('segment'); this.selectedSegment = this.navParams.get('segment');
this.selectedDate = this.navParams.get('eventSelectedDate'); this.selectedDate = this.navParams.get('eventSelectedDate');
this.taskParticipants = this.navParams.get('attendees'); this.taskParticipants = this.navParams.get('attendees');
this.CalendarDate = this.navParams.get('CalendarDate')
}
ngOnInit() {
if (this.platform.is('desktop')) {
// this.taskParticipants = [];
}
if(!this.CalendarName) { if(!this.CalendarName) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) { if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario'; this.CalendarName = 'Meu calendario';
} else if(this.eventService.calendarNamesAry.length == 1 ) { console.log(this.eventService.calendarNamesAry)
} else {
this.CalendarName = this.eventService.calendarNamesAry[0] this.CalendarName = this.eventService.calendarNamesAry[0]
} }
} }
}
ngOnInit() {
this.CalendarName = this.loggeduser.Profile;
this.selectedRecurringType = "-1"; this.selectedRecurringType = "-1";
this.getRecurrenceTypes(); this.getRecurrenceTypes();
if(this.selectedSegment != "Combinada"){ if(this.selectedSegment != "Combinada"){
@@ -174,14 +181,23 @@ export class NewEventPage implements OnInit {
} }
}; };
this.setDefaultTime()
}
setDefaultTime() {
console.log(this.CalendarDate)
this.postEvent.StartDate = this.roundTimeQuarterHour(this.CalendarDate);
this.postEvent.EndDate = this.postEvent.StartDate;
} }
close() { close() {
this.modalController.dismiss(); this.modalController.dismiss();
} }
roundTimeQuarterHour() { roundTimeQuarterHour(timeToReturn?) {
var timeToReturn = new Date(); var timeToReturn = timeToReturn || new Date();
var minutes = timeToReturn.getMinutes(); var minutes = timeToReturn.getMinutes();
var hours = timeToReturn.getHours(); var hours = timeToReturn.getHours();
@@ -412,8 +428,22 @@ export class NewEventPage implements OnInit {
}); });
let data1 = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
"end": this.postEvent.EndDate,
"venue": this.postEvent.Location,
"id": eventId,
"calendarId": CalendarId
}
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId, data1);
}
this.toastService._successMessage() this.toastService._successMessage()
this.modalController.dismiss(this.postEvent); let data = Object.assign(this.postEvent,{id:eventId})
this.modalController.dismiss(data);
} catch (error) { } catch (error) {
this.toastService._badRequest() this.toastService._badRequest()
@@ -485,12 +515,8 @@ export class NewEventPage implements OnInit {
const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendees: EventPerson[] = data['taskParticipants'];
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc']; const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
if(newAttendees.length) {
this.setIntervenient(newAttendees); this.setIntervenient(newAttendees);
}
if(newAttendeesCC) {
this.setIntervenientCC(newAttendeesCC); this.setIntervenientCC(newAttendeesCC);
}
} }
@@ -499,11 +525,13 @@ export class NewEventPage implements OnInit {
} }
setIntervenient(data) { setIntervenient(data) {
this.taskParticipants = [];
this.taskParticipants = data; this.taskParticipants = data;
this.postEvent.Attendees = data; this.postEvent.Attendees = data;
} }
setIntervenientCC(data){ setIntervenientCC(data){
this.taskParticipantsCc = [];
this.taskParticipantsCc = data; this.taskParticipantsCc = data;
} }
+3 -9
View File
@@ -1,4 +1,4 @@
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http'; import { HttpHeaders, HttpParams } from '@angular/common/http';
import { import {
Component, Component,
OnInit, OnInit,
@@ -115,7 +115,6 @@ export class ChatPage implements OnInit {
public ChatSystemService: ChatSystemService, public ChatSystemService: ChatSystemService,
) { ) {
this.loggedUserChat = SessionStore.user.ChatData?.data;
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
window.onresize = (event) => { window.onresize = (event) => {
if (window.innerWidth > 701) { if (window.innerWidth > 701) {
@@ -187,6 +186,8 @@ export class ChatPage implements OnInit {
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
this.idSelected = ''; this.idSelected = '';
this.hideRefreshBtn = false; this.hideRefreshBtn = false;
this.closeAllDesktopComponents()
this.ChatSystemService.getRoomById(this.roomId).roomLeave()
} }
else { else {
this.hideRefreshBtn = true; this.hideRefreshBtn = true;
@@ -352,8 +353,6 @@ export class ChatPage implements OnInit {
async closeNewEventComponentAndOpenChat({roomId}) { async closeNewEventComponentAndOpenChat({roomId}) {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
console.log(roomId)
this.ChatSystemService._group.forEach((room)=>{ this.ChatSystemService._group.forEach((room)=>{
if(room.id == roomId) { if(room.id == roomId) {
@@ -591,11 +590,8 @@ export class ChatPage implements OnInit {
return dateB - dateA; return dateB - dateA;
}); });
// //
}) })
} }
} }
@@ -617,7 +613,6 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt _updatedAt: element._updatedAt
} }
groupsArray.push(roomList) groupsArray.push(roomList)
}); });
@@ -636,7 +631,6 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt updatedat: element._updatedAt
} }
this.sqlservice.addChatListRoom(roomList); this.sqlservice.addChatListRoom(roomList);
}); });
} }
@@ -62,11 +62,12 @@
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label> <ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
{{last ? scrollToBottom() : ''}} {{last ? scrollToBottom() : ''}}
@@ -102,10 +103,12 @@
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" > <img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" >
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon> <ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
</div> </div>
@@ -156,10 +159,12 @@
</ion-label> </ion-label>
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()"> Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()"> Tentar</div>
</ion-label> </ion-label>
</div> </div>
+18 -32
View File
@@ -60,10 +60,12 @@
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
</div> </div>
@@ -97,10 +99,12 @@
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image"> <img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
@@ -161,12 +165,12 @@
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
@@ -194,24 +198,6 @@
</div> </div>
<div *ngIf="msg.file && msg.delate == false">
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
<button (click)="goToEvent(msg.file)" class="btn-no-color info-meeting-normal">
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
</button><br />
<ion-label class="info-meeting-medium">
<ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a
{{showDateDuration(msg.file.end_date)}}
</ion-label><br />
<ion-label class="info-meeting-medium">
<ion-icon></ion-icon>
<ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}
</ion-label><br />
</div>
{{last ? scrollToBottom() : ''}}
</div>
<div *ngIf="msg.file && msg.delate == true"> <div *ngIf="msg.file && msg.delate == true">
Apagou a mensagem Apagou a mensagem
</div> </div>
+21 -4
View File
@@ -11,7 +11,6 @@ import { ChatService } from 'src/app/services/chat.service';
import { FileService } from 'src/app/services/functions/file.service'; import { FileService } from 'src/app/services/functions/file.service';
import { ProcessesService } from 'src/app/services/processes.service'; 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 { NewEventPage } from 'src/app/shared/agenda/new-event/new-event.page';
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page'; import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page'; import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service'; import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
@@ -41,6 +40,7 @@ import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { File } from '@awesome-cordova-plugins/file/ngx'; import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { Filesystem, Directory } from '@capacitor/filesystem'; import { Filesystem, Directory } from '@capacitor/filesystem';
import { NewEventPage } from '../../agenda/new-event/new-event.page';
const IMAGE_DIR = 'stored-images'; const IMAGE_DIR = 'stored-images';
@@ -331,6 +331,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async goToEvent(event: any) { async goToEvent(event: any) {
// console.log(event)
let classs; let classs;
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
classs = 'modal modal-desktop' classs = 'modal modal-desktop'
@@ -584,7 +586,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async bookMeeting() { async bookMeeting() {
this.attendees = this.members.map((val) => { let attendees = this.ChatSystemService.getDmRoom(this.roomId).members.map((val) => {
return { return {
Name: val.name, Name: val.name,
EmailAddress: val.username + "@" + environment.domain, EmailAddress: val.username + "@" + environment.domain,
@@ -597,15 +599,30 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: NewEventPage, component: NewEventPage,
componentProps: { componentProps: {
attendees: this.attendees, attendees: attendees,
roomId: this.roomId
}, },
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop',
backdropDismiss: false backdropDismiss: false
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
if (data) { if (data?.data && data.data.id) {
// const roomId = this.roomId
// this.ChatSystemService.getDmRoom(roomId).send({
// file: {
// "type": "application/meeting",
// "subject": data.data.Subject,
// "start_date": data.data.StartDate,
// "end_date": data.data.EndDate,
// "venue": data.data.venue,
// "id": data.data.id,
// "calendarId": data.data.CalendarId
// },
// temporaryData: {}
// })
} }
}); });
} }
@@ -135,10 +135,23 @@ export class AttendeesPageModal implements OnInit {
}); });
} }
this.contacts = result; this.contacts = this.sort(result as any);
this.showLoader = false; this.showLoader = false;
} }
); );
} }
sort(data: []) {
return data.sort(function (a: any, b: any) {
if (a.Name > b.Name) {
return -1;
}
if (b.Name > a.Name) {
return 1;
}
return 0;
}).reverse()
}
} }
+1 -1
View File
@@ -125,7 +125,7 @@
(click)="goToExpediente(task.SerialNumber)"> (click)="goToExpediente(task.SerialNumber)">
<div class="item-exp d-flex"> <div class="item-exp d-flex">
<div class="schedule-date"> <div class="schedule-date">
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yyyy'}}</div> <div class="time-end">{{task.taskStartDate | date: 'dd-MM-yy'}}</div>
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div> <div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
</div> </div>
<div class="schedule-details pointer"> <div class="schedule-details pointer">
@@ -147,7 +147,7 @@
[min]="minDate" [min]="minDate"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" (click)="setStartDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1 <ngx-mat-datetime-picker #picker1
[showSpinners]="showSpinners" [showSpinners]="showSpinners"
[showSeconds]="showSeconds" [showSeconds]="showSeconds"
@@ -186,7 +186,7 @@
[min]="endMinDate" [min]="endMinDate"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" (click)="setEndDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim <ngx-mat-datetime-picker #fim
[showSpinners]="showSpinners" [showSpinners]="showSpinners"
[showSeconds]="showSeconds" [showSeconds]="showSeconds"
@@ -59,7 +59,7 @@ export class BookMeetingModalPage implements OnInit {
public endMinDate = new Date(new Date().getTime() + 15 * 60000); public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
@@ -130,6 +130,8 @@ export class BookMeetingModalPage implements OnInit {
authService: AuthService, authService: AuthService,
private toastService: ToastService, private toastService: ToastService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public eventService: EventsService,
) { ) {
this.taskParticipants = []; this.taskParticipants = [];
@@ -148,6 +150,23 @@ export class BookMeetingModalPage implements OnInit {
this.postData.Category = 'Reunião' this.postData.Category = 'Reunião'
if(!this.CalendarName) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario';
console.log(this.eventService.calendarNamesAry)
} else {
this.CalendarName = this.eventService.calendarNamesAry[0]
}
}
if(this.taskParticipants.length == 0) {
this.taskParticipants = [{
EmailAddress: SessionStore.user.Email,
IsRequired: true,
Name: SessionStore.user.UserName
}]
}
} }
ngOnInit() { ngOnInit() {
@@ -481,4 +500,46 @@ export class BookMeetingModalPage implements OnInit {
this.taskParticipantsCc = data; this.taskParticipantsCc = data;
} }
roundTimeQuarterHour() {
var timeToReturn = new Date();
var minutes = timeToReturn.getMinutes();
var hours = timeToReturn.getHours();
var m = (Math.round(minutes/15) * 15) % 60;
var h = minutes > 52 ? (hours === 23 ? 0 : ++hours) : hours;
if (m == 0) {
if(minutes > m){
m = m + 15;
}
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else{
if(minutes > m){
m = m + 15;
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else {
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}
}
// console.log("AFTER IF MINUTES: " +m);
// console.log("AFTER HOURS: " +h);
return timeToReturn;
}
setStartDate(){
this.postData.StartDate = this.roundTimeQuarterHour();
}
setEndDate(){
this.postData.EndDate = this.postData.StartDate;
}
} }
@@ -71,7 +71,8 @@
<div *ngIf="task.Agenda" class="item-middle-detail-extra"> <div *ngIf="task.Agenda" class="item-middle-detail-extra">
<div class="item-middle-detail-extra-text"> <div class="item-middle-detail-extra-text">
<ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial PR' || task.WorkflowName == 'Agenda Pessoal PR'"> <ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial PR' || task.WorkflowName == 'Agenda Pessoal PR'">
Agenda {{task.Agenda || task.workflowInstanceDataFields.Agenda}} do Presidente da República <!-- Agenda {{task.Agenda || task.workflowInstanceDataFields.Agenda}} do Presidente da República -->
Agenda {{task.Agenda || task.workflowInstanceDataFields.Agenda}} do Titular
</ion-label> </ion-label>
<ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial MDGPR' || task.WorkflowName == 'Agenda Pessoal MDGPR'"> <ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial MDGPR' || task.WorkflowName == 'Agenda Pessoal MDGPR'">
A sua agenda {{task.Agenda || task.workflowInstanceDataFields.Agenda}} A sua agenda {{task.Agenda || task.workflowInstanceDataFields.Agenda}}
@@ -227,14 +228,15 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'showDespachosPr'" src="assets/images/theme/gov/icons-despachos-presidente-hover.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'showDespachosPr'" src="assets/images/theme/gov/icons-despachos-presidente-hover.svg"></ion-icon>
</div> </div>
<div class="exp-card-text"> <div class="exp-card-text">
<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="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p> -->
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Titular</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && !p.userPermission([p.permissionList.Gabinete.md_tasks])">Despachos criados por mim</p> <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && !p.userPermission([p.permissionList.Gabinete.md_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> </div>
</div> </div>
<!-- <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 *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>
@@ -259,7 +261,7 @@
</div> </div>
<div (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center"> <div *ngIf="deplomasStore.countDiplomasAssinadoListCount >= 1" (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>
@@ -280,7 +282,7 @@
</div> </div>
<p class="text-center exp-card-title">Diplomas para Assinar</p> <p class="text-center exp-card-title">Diplomas para Assinar</p>
<p class="text-center exp-card-content">{{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content">{{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
</div> --> </div>
</div> </div>
<div *ngIf="!loadCount" class="width-100"> <div *ngIf="!loadCount" class="width-100">
@@ -372,7 +374,6 @@
</div> </div>
</div> </div>
</div> </div>
@@ -106,6 +106,8 @@ export class GabineteDigitalPage implements OnInit {
AllProcess = [] AllProcess = []
// workerList : Worker
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage; @ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
@ViewChild(PendentesPage) pendentesListPage: PendentesPage; @ViewChild(PendentesPage) pendentesListPage: PendentesPage;
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage; @ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
@@ -126,6 +128,12 @@ export class GabineteDigitalPage implements OnInit {
public NotificationsService: NotificationsService public NotificationsService: NotificationsService
) { ) {
// this.workerList = new Worker(new URL('./list.worker.js', import.meta.url));
// this.workerList.onmessage = (oEvent) => {
// this.AllProcess = oEvent.data
// }
window.onresize = (event) => { window.onresize = (event) => {
// if not mobile remove all component // if not mobile remove all component
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
@@ -157,8 +165,8 @@ export class GabineteDigitalPage implements OnInit {
} }
const pathname = window.location.pathname const pathname = window.location.pathname
this.router.events.forEach((event) => { //this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url == pathname) { //if (event instanceof NavigationEnd && event.url == pathname) {
this.waitForDomService.selector({ this.waitForDomService.selector({
selector: 'app-gabinete-digital ion-content .aside-wrapper', selector: 'app-gabinete-digital ion-content .aside-wrapper',
callback: () => { callback: () => {
@@ -171,88 +179,96 @@ export class GabineteDigitalPage implements OnInit {
} }
} }
}) })
} //}
}); //});
this.hideRefreshButton(); this.hideRefreshButton();
this.waitForDomService.selector({ // this.waitForDomService.selector({
selector: 'app-gabinete-digital ion-content .aside-wrapper', // selector: 'app-gabinete-digital ion-content .aside-wrapper',
callback: () => { // callback: () => {
// console.log('SECOND CALL') // // console.log('SECOND CALL')
this.loadAllProcesses(); // this.loadAllProcesses();
} // }
}) // })
this.backgroundservice.registerBackService('Online', () => { this.backgroundservice.registerBackService('Online', () => {
// this.loadAllProcesses(); // this.loadAllProcesses();
}); });
this.NotificationsService.registerCallback( // this.NotificationsService.registerCallback({
'despachos', // type:'despachos',
() => { // funx:() => {
this.LoadCounts(); // // this.loadCount();
console.log('refresh with notification') // console.log('refresh with notification')
} // }
) // })
this.NotificationsService.registerCallback(
'despachos-pr',
() => {
this.LoadCounts();
console.log('refresh with notification')
}
)
this.NotificationsService.registerCallback(
'expediente',
() => {
this.LoadCounts();
console.log('refresh with notification')
}
)
this.NotificationsService.registerCallback(
'gabinete-digital',
() => {
this.LoadCounts();
console.log('refresh with notification')
}
)
this.NotificationsService.registerCallback(
'parecer',
() => {
this.LoadCounts();
console.log('refresh with notification')
}
)
this.NotificationsService.registerCallback(
'deferimento',
() => {
this.LoadCounts();
console.log('refresh with notification')
}
)
this.NotificationsService.registerCallback(
'diplomas-assinar',
() => {
this.LoadCounts();
console.log('refresh with notification')
}
)
this.NotificationsService.registerCallback(
'diplomas',
() => {
this.LoadCounts();
console.log('refresh with notification')
}
)
this.NotificationsService.registerCallback(
'expedientes-pr',
() => {
this.LoadCounts();
console.log('refresh with notification')
}
)
// this.NotificationsService.registerCallback({
// type:'*',
// funx:() => {
// // this.LoadCounts();
// console.log('refresh with notification *')
// }
// })
// this.NotificationsService.registerCallback({
// type:'despachos-pr',
// funx:() => {
// // this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'expediente',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'gabinete-digital',
// funx:() => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type:'parecer',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'deferimento',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'diplomas-assinar',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'diplomas',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
// this.NotificationsService.registerCallback({
// type: 'expedientes-pr',
// funx: () => {
// this.LoadCounts();
// console.log('refresh with notification')
// }
// })
} }
@@ -570,7 +586,19 @@ export class GabineteDigitalPage implements OnInit {
updateAllProcess() { updateAllProcess() {
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento) this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list) .concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList).concat(this.pendentesstore.list)
// try{
// this.workerList.postMessage([
// this.expedientegbstore.list,this.pedidosstore.listparecer,this.pedidosstore.listdeferimento,
// this.despachoprstore.list, this.eventoaprovacaostore.listmd, this.eventoaprovacaostore.listpr, this.despachoStore.list,
// this.deplomasStore.diplomasParaAssinarList, this.deplomasStore.diplomasAssinadoList, this.deplomasStore.DiplomaGerarList
// ])
// } catch (e) {
// this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
// .concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
// .concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList) // .concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
// }
} }
get getAllProcessCount() { get getAllProcessCount() {
@@ -0,0 +1,10 @@
onmessage = function(oEvent) {
const list = Event.data
var a = []
postMessage(
a.concat.apply([], [list])
);
};
@@ -7,8 +7,8 @@
<div class="div-top-header"> <div class="div-top-header">
<div class="div-logo"> <div class="div-logo">
<!-- <img style="max-width: 90px;" *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-bg-removebg-preview.png' alt='logo'> <img style="max-width: 90px;" *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-bg-removebg-preview.png' alt='logo'>
<img style="max-width: 80px;" *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'> --> <img style="max-width: 80px;" *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
</div> </div>
</div> </div>
+2 -2
View File
@@ -7,9 +7,9 @@
<div class="bg-4 d-flex justify-center align-center"> <div class="bg-4 d-flex justify-center align-center">
<div class="div-logo"> <div class="div-logo">
<!-- <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/fullLogo-no-g.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/fullLogo-no-g.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A.png' alt='logo'> --> <img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A.png' alt='logo'>
</div> </div>
</div> </div>
+1
View File
@@ -123,6 +123,7 @@ export class LoginPage implements OnInit {
if (attempt.UserId == SessionStore.user.UserId) { if (attempt.UserId == SessionStore.user.UserId) {
await this.authService.SetSession(attempt, this.userattempt); await this.authService.SetSession(attempt, this.userattempt);
this.changeProfileService.run();
if(attempt.ChatData) { if(attempt.ChatData) {
@@ -25,7 +25,7 @@ export class EditActionPage implements OnInit {
public minDate = new Date().toISOString() public minDate = new Date().toISOString()
public maxDate: any; public maxDate: any;
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
@@ -44,7 +44,7 @@
[formControl]="dateControlStart" [formControl]="dateControlStart"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" (click)="setStartDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1 <ngx-mat-datetime-picker #picker1
[showSpinners]="showSpinners" [showSpinners]="showSpinners"
[showSeconds]="showSeconds" [showSeconds]="showSeconds"
@@ -83,7 +83,7 @@
[min]="endMinDate" [min]="endMinDate"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" (click)="setEndDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim <ngx-mat-datetime-picker #fim
[showSpinners]="showSpinners" [showSpinners]="showSpinners"
[showSeconds]="showSeconds" [showSeconds]="showSeconds"
@@ -46,7 +46,7 @@ export class NewActionPage implements OnInit {
public minDate = new Date().toISOString() public minDate = new Date().toISOString()
public endMinDate = new Date(new Date().getTime() + 15 * 60000); public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
@@ -98,7 +98,7 @@ export class NewActionPage implements OnInit {
var validado: boolean; var validado: boolean;
if (window.innerWidth <= 800) { if (window.innerWidth <= 800) {
if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) { if ((this.folder.DateBegin < this.folder.DateEnd)) {
validado = true; validado = true;
} else { } else {
validado = false; validado = false;
@@ -111,8 +111,8 @@ export class NewActionPage implements OnInit {
runValidation() { runValidation() {
this.validateFrom = true; this.validateFrom = true;
if(new Date(this.folder.DateBegin).toISOString() > new Date(this.folder.DateEnd).toISOString()){ if(new Date(this.folder.DateBegin).getTime() > new Date(this.folder.DateEnd).getTime()){
this.toastService.badRequest("A data de início não pode ser superior a data de fim"); this.toastService._badRequest("A data de início não pode ser superior a data de fim");
} }
} }
@@ -171,4 +171,42 @@ export class NewActionPage implements OnInit {
this.modalController.dismiss(); this.modalController.dismiss();
} }
roundTimeQuarterHour() {
var timeToReturn = new Date();
var minutes = timeToReturn.getMinutes();
var hours = timeToReturn.getHours();
var m = (Math.round(minutes/15) * 15) % 60;
var h = minutes > 52 ? (hours === 23 ? 0 : ++hours) : hours;
if (m == 0) {
if(minutes > m){
m = m + 15;
}
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else{
if(minutes > m) {
m = m + 15;
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else {
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}
}
return timeToReturn;
}
setStartDate(){
this.dateControlStart = new FormControl(moment(this.roundTimeQuarterHour()));
}
setEndDate(){
this.dateControlEnd = this.dateControlStart;
}
} }
@@ -44,7 +44,7 @@ export class NewPublicationPage implements OnInit {
public minDate = new Date().toISOString().slice(0, 10) public minDate = new Date().toISOString().slice(0, 10)
public endMinDate = new Date(new Date().getTime() + 15 * 60000); public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
public color: ThemePalette = 'primary'; public color: ThemePalette = 'primary';
@@ -15,7 +15,7 @@
<!-- Left --> <!-- Left -->
<div class="aside-left app-default-padding d-flex flex-grow-1 flex-column width-30 "> <div class="aside-left app-default-padding d-flex flex-grow-1 flex-column width-30 ">
<!-- Header --> <!-- Header -->
<ion-progress-bar type="indeterminate" *ngIf="showLoader || skeletonLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-toolbar > <ion-toolbar >
<div class="main-header"> <div class="main-header">
@@ -24,7 +24,7 @@ import { PermissionService } from 'src/app/services/permission.service';
styleUrls: ['./publications.page.scss'], styleUrls: ['./publications.page.scss'],
}) })
export class PublicationsPage implements OnInit { export class PublicationsPage implements OnInit {
showLoader: boolean; showLoader: boolean = false
publicationFolder: PublicationFolder; publicationFolder: PublicationFolder;
publication: Publication; publication: Publication;
@@ -57,7 +57,6 @@ export class PublicationsPage implements OnInit {
hideRefreshBtn = true; hideRefreshBtn = true;
showSlidingOptions = true; showSlidingOptions = true;
idSelected: string; idSelected: string;
skeletonLoader: boolean;
constructor( constructor(
private router: Router, private router: Router,
@@ -138,13 +137,10 @@ export class PublicationsPage implements OnInit {
return this.theDate.getDate() + " de " + (this.months[this.theDate.getMonth()]) + " de " + this.theDate.getFullYear() return this.theDate.getDate() + " de " + (this.months[this.theDate.getMonth()]) + " de " + this.theDate.getFullYear()
} }
loadList = false
getActions() { getActions() {
if(this.loadList == false) { if(this.showLoader == false) {
this.loadList = true
this.showLoader = true; this.showLoader = true;
this.skeletonLoader = true;
this.publications.GetPublicationFolderList().subscribe(async res => { this.publications.GetPublicationFolderList().subscribe(async res => {
const folders: PublicationFolder[] = this.getPublicationFolderMap(res) const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
@@ -162,13 +158,9 @@ export class PublicationsPage implements OnInit {
} }
this.showLoader = false; this.showLoader = false;
this.skeletonLoader = false;
this.loadList = false
}, (error) => { }, (error) => {
this.showLoader = false; this.showLoader = false;
this.skeletonLoader = false;
this.loadList = false
}); });
} }
@@ -268,10 +260,11 @@ export class PublicationsPage implements OnInit {
} }
finally { finally {
loader.remove() loader.remove()
}
this.refreshing() this.refreshing()
} }
}
async AddPublicationFolder(item?: any) { async AddPublicationFolder(item?: any) {
this.closeDesktopComponent(); this.closeDesktopComponent();
+21 -8
View File
@@ -27,29 +27,35 @@
<div class="btn-modal-dismiss" *ngIf="showSearchInput"> <div class="btn-modal-dismiss" *ngIf="showSearchInput">
<button class="btn-no-color" (click)="close()"> <button class="btn-no-color" (click)="close()">
<ion-icon c*ngIf="ThemeService.currentTheme == 'default' " lass="icon" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' "class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</button> </button>
</div> </div>
</div> </div>
<!-- Search drop down --> <!-- Search drop down -->
<div class="advance-search pa-0 pt-10 pr-10 flex-md-grow-1" > <div class="advance-search pa-0 pt-10 pr-10 flex-md-grow-1" >
<ion-form [class.d-none]="!showSearchInput"> <ion-form [class.d-none]="!showSearchInput">
<div class="d-flex search-input-container ion-justify-content-between" > <div class="d-flex search-input-container ion-justify-content-between" >
<div class="icon"> <!-- <div class="icon">
<button class="btn-no-color" (click)="basicSearch()"> <button class="btn-no-color" (click)="basicSearch()">
<ion-icon class="icon-z" slot="end" name="search"></ion-icon> <ion-icon class="icon-z" slot="end" src="assets/images/theme/gov/search.svg"></ion-icon>
</button> </button>
</div> </div> -->
<div class="input-text d-flex ion-align-items-center"> <div class="input-text d-flex ion-align-items-center pm-10">
<ion-input (keyup.enter)="basicSearch()" [(ngModel)]='searchSubject' class="search-input" type="search" placeholder="Pesquisar"></ion-input> <ion-input (keyup.enter)="basicSearch()" [(ngModel)]='searchSubject' class="search-input" type="search" placeholder="Pesquisar"></ion-input>
</div> </div>
<div (click)="clearSearchInput()" class="d-flex align-center icon"> <!-- <div (click)="clearSearchInput()" class="d-flex align-center icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-25" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-25" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-25" name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-25" name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</div> -->
<div (click)="basicSearch()" class="d-flex align-center icon">
<ion-icon class="icon-z" slot="end" src="assets/images/theme/gov/search.svg"></ion-icon>
</div> </div>
</div> </div>
</ion-form> </ion-form>
@@ -102,7 +108,14 @@
<div class="container "> <div class="container ">
<div class="d-flex overflow-x-auto"> <div class="d-flex overflow-x-auto">
<!-- SLIDE --> <!-- SLIDE -->
<div *ngFor="let category of searchCategories; index as i;" class="d-flex py-10" style="width:0px" [ngClass]="{'active-category': category.Active}" class="button cursor-pointer" (click)="filterDocList(category.Name)" (click)="activeCategoty(i)">
<div class="d-flex py-10" style="width:0px" [ngClass]="{'active-category': TodosCategory}" class="button cursor-pointer" (click)="noFilter()">
<span>Todos</span>
<ion-label class="label">{{ searchDocuments.length }}</ion-label>
</div>
<div *ngFor="let category of searchCategories; index as i;" class="d-flex py-10" style="width:0px" [ngClass]="{'active-category': category.Active}" class="button cursor-pointer" (click)="activeCategoty(i); filterDocList(category.Name)">
<span>{{ category.Name }}</span> <span>{{ category.Name }}</span>
<ion-label class="label">{{ category.Qtd }}</ion-label> <ion-label class="label">{{ category.Qtd }}</ion-label>
+147 -10
View File
@@ -11,6 +11,7 @@ import { DocumentDetailPage } from 'src/app/modals/document-detail/document-deta
import { SearchCategory, SearchList } from 'src/app/models/search-document'; import { SearchCategory, SearchList } from 'src/app/models/search-document';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { Router } from '@angular/router';
@Component({ @Component({
selector: 'app-search', selector: 'app-search',
@@ -62,7 +63,8 @@ export class SearchPage implements OnInit {
private search: SearchService, private search: SearchService,
private modalCtrl: ModalController, private modalCtrl: ModalController,
private navParams: NavParams, private navParams: NavParams,
public ThemeService: ThemeService) public ThemeService: ThemeService,
private router: Router)
{ {
this.ordinance = "recent"; this.ordinance = "recent";
this.currentPath= window.location.pathname; this.currentPath= window.location.pathname;
@@ -168,8 +170,6 @@ export class SearchPage implements OnInit {
this.search.mostSeachWord("15").subscribe( res => { this.search.mostSeachWord("15").subscribe( res => {
console.log('LOAD LIST');
const highest= res[0].Hits; const highest= res[0].Hits;
const lowest = res[res.length-1].Hits; const lowest = res[res.length-1].Hits;
const range = highest - lowest; const range = highest - lowest;
@@ -191,7 +191,6 @@ export class SearchPage implements OnInit {
}); });
this.list = list this.list = list
console.log('set list')
const elem = document.documentElement.querySelector('.most-searched-word-container'); const elem = document.documentElement.querySelector('.most-searched-word-container');
@@ -563,7 +562,11 @@ export class SearchPage implements OnInit {
else if (this.type == "AccoesPresidenciais") { else if (this.type == "AccoesPresidenciais") {
let counter = 0;
this.showLoader = true; this.showLoader = true;
this.searchCategories = []
this.searchDocuments = []
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{ ,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{
@@ -571,12 +574,18 @@ export class SearchPage implements OnInit {
res.Categories.forEach( e => { res.Categories.forEach( e => {
e['Active'] = false; e['Active'] = false;
e['Name'] = "Publicações"
}); });
// bind respose // bind respose
this.searchCategories = res.Categories; for ( const a of res.Categories) {
this.searchCategories.push(a);
}
this.searchDocuments = this.sortArrayISODate(res.Documents); for ( const a of this.sortArrayISODate(res.Documents)) {
a.DocTypeDesc = "Publicações"
this.searchDocuments.push(a);
}
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
@@ -587,13 +596,71 @@ export class SearchPage implements OnInit {
this.showDocuments = false this.showDocuments = false
} }
counter++;
if(counter ==2){
this.showLoader = false; this.showLoader = false;
}
this.loadWordCloud(); this.loadWordCloud();
},error => { },error => {
counter++;
if(counter ==2){
this.showLoader = false; this.showLoader = false;
}
this.searchResult = "Registo não encontrado" this.searchResult = "Registo não encontrado"
console.log(error) console.log(error)
}); });
this.search.basicSearchPublication(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res => {
res.Categories.forEach( e => {
e['Active'] = false;
e['Name'] = "Acções"
});
// bind respose
for ( const a of res.Categories) {
this.searchCategories.push(a);
}
for ( const a of this.sortArrayISODate(res.Documents)) {
a.DocTypeDesc = "Acções"
this.searchDocuments.push(a);
}
this.reorderList(this.ordinance);
// hide show document
if(this.searchDocuments.length >= 1) {
this.showDocuments = true;
} else {
this.showDocuments = false
}
counter++;
if(counter ==2) {
this.showLoader = false;
}
this.loadWordCloud();
}, error => {
counter++;
if(counter ==2) {
this.showLoader = false;
}
this.searchResult = "Registo não encontrado"
console.log(error)
});
} }
} }
@@ -704,6 +771,7 @@ export class SearchPage implements OnInit {
} }
TodosCategory = true
async filterDocList(categoryName:string){ async filterDocList(categoryName:string){
// show all category // show all category
@@ -716,6 +784,27 @@ export class SearchPage implements OnInit {
} }
this.showCategory = categoryName; this.showCategory = categoryName;
for(let category of this.searchCategories) {
if(category['Active']) {
this.TodosCategory = false
return false
}
}
this.TodosCategory = true
}
noFilter() {
this.TodosCategory = true
let n = 0
for(let category of this.searchCategories) {
this.searchCategories[n]['Active'] = false
n++
}
this.showSearchDocuments = this.searchDocuments;
} }
@@ -735,6 +824,7 @@ export class SearchPage implements OnInit {
const ApplicationType = searchDocument.ApplicationType.toString() const ApplicationType = searchDocument.ApplicationType.toString()
const Id = searchDocument.Id const Id = searchDocument.Id
const CalendarId = searchDocument.ApplicationName.split(':')[1] const CalendarId = searchDocument.ApplicationName.split(':')[1]
const DocTypeDesc = searchDocument.DocTypeDesc
if(this.select == false) { if(this.select == false) {
if(this.type == "Agenda") { if(this.type == "Agenda") {
@@ -754,19 +844,26 @@ export class SearchPage implements OnInit {
} else if(this.type == "AccoesPresidenciais") { } else if(this.type == "AccoesPresidenciais") {
this.viewPublicationDetail(Id); this.viewPublicationDetail(Id, DocTypeDesc);
} }
else if(this.type == "AccoesPresidenciais & ArquivoDespachoElect") { else if(this.type == "AccoesPresidenciais & ArquivoDespachoElect") {
if(ApplicationType == '8' || ApplicationType == '361') { // 361
if(ApplicationType == '8') {
this.viewDocumentDetail(Id, ApplicationType); this.viewDocumentDetail(Id, ApplicationType);
} else if (ApplicationType == '361') {
this.viewDocumentModal(searchDocument)
} }
} }
} }
} }
async viewPublicationDetail(publicationId:string) { async viewPublicationDetail(publicationId:string, DocTypeDesc) {
// validation my friend
if(DocTypeDesc == 'Acções') {
this.router.navigate(['/home/publications', publicationId]);
} else if( DocTypeDesc == 'Publicações') {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: PublicationDetailPage, component: PublicationDetailPage,
componentProps:{ componentProps:{
@@ -779,6 +876,9 @@ export class SearchPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(()=>{}); modal.onDidDismiss().then(()=>{});
}
} }
@@ -805,4 +905,41 @@ export class SearchPage implements OnInit {
} }
async viewDocumentModal(LoadedDocument) {
let task = {
serialNumber: '',
taskStartDate: '',
isEvent: true,
workflowInstanceDataFields: {
FolderID: '',
Subject: LoadedDocument.SourceName || LoadedDocument.Assunto,
SourceSecFsID: LoadedDocument.ApplicationId || LoadedDocument.ApplicationType,
SourceType: 'DOC',
SourceID: LoadedDocument.Id || LoadedDocument.Id,
DispatchNumber: ''
}
}
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
trustedUrl: '',
file: {
title: task.workflowInstanceDataFields.Subject,
url: '',
title_link: '',
},
Document: LoadedDocument,
applicationId: task.workflowInstanceDataFields.SourceSecFsID,
docId: task.workflowInstanceDataFields.SourceID ,
folderId: '',
task: task
},
cssClass: 'modal modal-desktop'
});
await modal.present();
}
} }
+1 -1
View File
@@ -9,7 +9,7 @@ export class ExpedienteTaskPipe implements PipeTransform {
transform(fullTask: ExpedienteFullTask): ExpedienteTask { transform(fullTask: ExpedienteFullTask): ExpedienteTask {
let date = new Date(fullTask.taskStartDate); let date = new Date(fullTask.taskStartDate);
date.setMonth(date.getMonth() + 1); date.setMonth(date.getMonth());
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds(); let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
return { return {
+5 -11
View File
@@ -24,22 +24,16 @@ export class AttachmentsService {
private changeProfileService: ChangeProfileService) { private changeProfileService: ChangeProfileService) {
this.changeProfileService.registerCallback(() => { this.changeProfileService.registerCallback(() => {
this.loggeduser = SessionStore.user this.setHeader()
this.headers = new HttpHeaders(); });
this.setHeader()
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey); }
})
this.changeProfileService.registerLoginCallback(() => {
this.loggeduser = SessionStore.user
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
})
setHeader() {
this.loggeduser = SessionStore.user this.loggeduser = SessionStore.user
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey); this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
} }
uploadFile(formData:any) { uploadFile(formData:any) {
+4 -4
View File
@@ -25,7 +25,7 @@ import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
export class AuthService { export class AuthService {
userData$ = new BehaviorSubject<any>(''); userData$ = new BehaviorSubject<any>('');
userId$ = new BehaviorSubject<any>(''); userId$ = new BehaviorSubject<any>('');
headers: HttpHeaders; headers: HttpHeaders = new HttpHeaders();
public wsValidatedUserChat:any; public wsValidatedUserChat:any;
public isWsAuthenticated: boolean = false; public isWsAuthenticated: boolean = false;
opts:any; opts:any;
@@ -43,9 +43,7 @@ export class AuthService {
private storage: Storage, private storage: Storage,
private initialsService: InitialsService, private initialsService: InitialsService,
public p: PermissionService, public p: PermissionService,
public ChatSystemService: ChatSystemService, ) { public ChatSystemService: ChatSystemService) {
this.headers = new HttpHeaders();
if (SessionStore.exist) { if (SessionStore.exist) {
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) { if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
@@ -82,6 +80,8 @@ export class AuthService {
} }
// async UpdateLogin() {}
SetSession(response: LoginUserRespose, user:UserForm) { SetSession(response: LoginUserRespose, user:UserForm) {
const session: UserSession = Object.assign(SessionStore.user, response) const session: UserSession = Object.assign(SessionStore.user, response)
@@ -25,6 +25,7 @@ export class ChatMethodsService {
"end_date": data.end, "end_date": data.end,
"venue": data.venue, "venue": data.venue,
"id": data.id, "id": data.id,
"calendarId": data.calendarId
} }
} }
} }
+10 -3
View File
@@ -18,7 +18,6 @@ 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'; import { NetworkServiceService} from 'src/app/services/network-service.service';
import { JsonStore } from '../jsonStore.service';
import { ViewedMessageService } from './viewed-message.service' import { ViewedMessageService } from './viewed-message.service'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -97,7 +96,7 @@ export class ChatSystemService {
} }
loadChat() { loadChat() {
if(SessionStore.user.ChatData) { if(SessionStore.user?.ChatData?.data) {
this.ReLoadChat() this.ReLoadChat()
} }
} }
@@ -185,14 +184,18 @@ export class ChatSystemService {
async getAllRooms () { async getAllRooms () {
this.loadingWholeList = true this.loadingWholeList = true
var rooms; var rooms;
if(this.RochetChatConnectorService.isLogin) {
try { try {
rooms = await this.RochetChatConnectorService.getRooms(); rooms = await this.RochetChatConnectorService.getRooms();
} catch (error) { } catch (error) {
this.loadingWholeList = false
console.error('chatgetrooms',error) console.error('chatgetrooms',error)
} }
try { try {
await this.storage.remove('Rooms'); await this.storage.remove('Rooms');
} catch(e) {} } catch(e) {}
}
let index = 0 let index = 0
@@ -318,7 +321,11 @@ export class ChatSystemService {
} }
this.RochetChatConnectorService.streamNotifyLogged().then((subscription => { this.RochetChatConnectorService.streamNotifyLogged().then((subscription => {
console.log(subscription)
}))
this.RochetChatConnectorService.subStreamMessageUser().then((subscription => {
console.log(subscription)
})) }))
} }
@@ -407,7 +414,7 @@ export class ChatSystemService {
let roomId = this.getRoomId(roomData); let roomId = this.getRoomId(roomData);
if (setData.name != 'Rocket Cat') { if (setData.name != 'Rocket Cat' && setData.name != 'general' ) {
// create room // create room
if(!this.roomExist(roomId)) { if(!this.roomExist(roomId)) {
let room:RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.ViewedMessageService) let room:RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.ViewedMessageService)
+34 -8
View File
@@ -61,6 +61,9 @@ export class MessageService {
downloadAttachmentsTemp = 0; downloadAttachmentsTemp = 0;
UploadAttachmentsTemp = 0; UploadAttachmentsTemp = 0;
manualRetry = false manualRetry = false
origin: 'history' | 'stream' | 'local'
rowInstance: MessageModel
constructor( constructor(
private NfService: NfService, private NfService: NfService,
@@ -72,7 +75,7 @@ export class MessageService {
private ChatSystemService: ChatSystemService) { private ChatSystemService: ChatSystemService) {
} }
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference = 'out-'+uuidv4() , viewed = [], received = [], delate = false, delateRequest =false, from, sendAttempt = 0 }:Message) { setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference = 'out-'+uuidv4() , viewed = [], received = [], delate = false, delateRequest =false, from, sendAttempt = 0, origin }:Message) {
this.channels = channels || [] this.channels = channels || []
this.mentions = mentions || [] this.mentions = mentions || []
@@ -90,6 +93,7 @@ export class MessageService {
this.delate = delate this.delate = delate
this.delateRequest = delateRequest this.delateRequest = delateRequest
this.sendAttempt = 0 this.sendAttempt = 0
this.origin = origin
if(this.attachments?.length >= 1 && attachments?.length >= 1) { if(this.attachments?.length >= 1 && attachments?.length >= 1) {
this.attachments[0] = Object.assign(this.attachments[0], attachments[0]) this.attachments[0] = Object.assign(this.attachments[0], attachments[0])
@@ -257,6 +261,7 @@ export class MessageService {
} catch (error) { } catch (error) {
this.uploadingFile = false this.uploadingFile = false
this.errorUploadingAttachment = true this.errorUploadingAttachment = true
this.UploadAttachmentsTemp++
console.error('beforeSendAttachment error:', error) console.error('beforeSendAttachment error:', error)
} }
@@ -441,9 +446,11 @@ export class MessageService {
async delateDB() { async delateDB() {
const message = await MessageModel.get({id: this.id}) if(!this.rowInstance) {
await message.delete() this.rowInstance = await this.getRowInstance()
}
await this.rowInstance.delete()
} }
@@ -467,6 +474,7 @@ export class MessageService {
u: this.u, u: this.u,
_id: this._id, _id: this._id,
id: this.id, id: this.id,
origin: this.origin,
_updatedAt: this._updatedAt, _updatedAt: this._updatedAt,
messageSend: this.messageSend, messageSend: this.messageSend,
offline: this.offline, offline: this.offline,
@@ -489,6 +497,7 @@ export class MessageService {
delete message.id delete message.id
const createdMessage = await MessageModel.create(message) const createdMessage = await MessageModel.create(message)
this.rowInstance = createdMessage
this.id = createdMessage.id this.id = createdMessage.id
if(this.earlySave) { if(this.earlySave) {
@@ -497,8 +506,8 @@ export class MessageService {
} }
} }
async saveChanges() {
async getRowInstance () {
if(this.save) { if(this.save) {
const message = this.getChatObj() const message = this.getChatObj()
@@ -516,13 +525,30 @@ export class MessageService {
a = await MessageModel.get({id: this.id}) a = await MessageModel.get({id: this.id})
} }
if(a) { return a
}
}
async saveChanges() {
if(!this.rowInstance) {
this.rowInstance = await this.getRowInstance()
}
if(this.save && this.rowInstance) {
const message = this.getChatObj()
if(!message.id) {
delete message.id
}
for( const [name, value] of Object.entries(message)) { for( const [name, value] of Object.entries(message)) {
a[name] = value this.rowInstance[name] = value
}
await a.save()
} }
await this.rowInstance.save()
} else { } else {
this.earlySave = true this.earlySave = true
console.log('save change to early') console.log('save change to early')
@@ -437,6 +437,63 @@ export class RochetChatConnectorService {
} }
subStreamNotifyUser(param?: any) {
const requestId = uuidv4()
let message = {
msg: "sub",
id: requestId,
name: "stream-notify-user",
params:[
`${SessionStore.user.ChatData.data.userId}/notification`,
param
]
}
this.ws.send({message, requestId})
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send
resolve(message)
return true
}
}})
});
}
subStreamMessageUser(param?: any) {
const requestId = uuidv4()
let message = {
msg: "sub",
id: requestId,
name: "stream-notify-user",
params:[
`${SessionStore.user.ChatData.data.userId}/message`,
param
]
}
this.ws.send({message, requestId})
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send
resolve(message)
return true
}
}})
});
}
receiveStreamNotifyRoom(funx: Function) { receiveStreamNotifyRoom(funx: Function) {
this.ws.registerCallback({ this.ws.registerCallback({
+19 -3
View File
@@ -281,12 +281,19 @@ export class RoomService {
this.isTyping = args[1] this.isTyping = args[1]
this.otherUserType = args[1] this.otherUserType = args[1]
this.readAllMessage()
const user = args[0]
if(SessionStore.user.UserName != user) {
this.readAllMessage()
}
} else if(args[0]?.method == 'viewMessage' || args[1]?.method == 'viewMessage') { } else if(args[0]?.method == 'viewMessage' || args[1]?.method == 'viewMessage') {
const user = args[0]
if(SessionStore.user.UserName != user) {
this.readAllMessage() this.readAllMessage()
}
} else if(args[0]?.method == 'deleteMessage' || args[1]?.method == 'deleteMessage') { } else if(args[0]?.method == 'deleteMessage' || args[1]?.method == 'deleteMessage') {
this.deleteMessage(args[1]?.method?._id) this.deleteMessage(args[1]?.method?._id)
@@ -295,7 +302,6 @@ export class RoomService {
} }
} else if (message.fields.eventName == this.id+'/'+'deleteMessage') {} } else if (message.fields.eventName == this.id+'/'+'deleteMessage') {}
}) })
@@ -313,6 +319,7 @@ export class RoomService {
if(!found) { if(!found) {
ChatMessage.origin = 'stream'
const message = await this.prepareCreate({message: ChatMessage, save: true}); const message = await this.prepareCreate({message: ChatMessage, save: true});
this.registerSendMessage(message) this.registerSendMessage(message)
@@ -445,8 +452,14 @@ export class RoomService {
"stream-notify-room", "stream-notify-room",
async (ChatMessage) => { async (ChatMessage) => {
const DeletedMessageId = ChatMessage.fields.args[0]._id; const DeletedMessageId = ChatMessage.fields.args[0]._id;
const message = this.messages.find((e) => e._id == DeletedMessageId)
if(message.delate == false) {
this.deleteMessage(DeletedMessageId) this.deleteMessage(DeletedMessageId)
} }
}
) )
} }
@@ -556,7 +569,8 @@ export class RoomService {
attachments, attachments,
file, file,
temporaryData, temporaryData,
localReference localReference,
origin: 'local'
} }
this.message= '' this.message= ''
@@ -657,6 +671,7 @@ export class RoomService {
// this.typing(this.message) // this.typing(this.message)
this.chatOpen = true this.chatOpen = true
this.messageUnread = false this.messageUnread = false
this.sendReadMessage()
} }
@@ -737,6 +752,7 @@ export class RoomService {
for(let message of chatHistory.result.messages.reverse()) { for(let message of chatHistory.result.messages.reverse()) {
if (!messagesId.includes(message._id)) { if (!messagesId.includes(message._id)) {
message.origin = 'history'
const messagesToSave = await this.prepareMessageCreateIfNotExist({message: message}); const messagesToSave = await this.prepareMessageCreateIfNotExist({message: message});
if(messagesToSave != null) { if(messagesToSave != null) {
@@ -27,9 +27,9 @@ export class ViewedMessageService {
for(let id of membersIds) { for(let id of membersIds) {
if(message.addReceived(id)) { if(message.addReceived(id)) {
n++ n++
setTimeout(async() => { // setTimeout(async() => {
await message.saveChanges() await message.saveChanges()
}, 100 * n) // }, 100 * n)
} }
} }
} }
@@ -56,9 +56,9 @@ export class ViewedMessageService {
if(message.addViewed(id)) { if(message.addViewed(id)) {
message.addReceived(id) message.addReceived(id)
n++ n++
setTimeout(async() => { // setTimeout(async() => {
await message.saveChanges() await message.saveChanges()
}, 100 * n) // }, 100 * n)
} }
} }
+13 -1
View File
@@ -6,6 +6,7 @@ import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service'; import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model'; import { LoginUserRespose } from '../models/user.model';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -16,7 +17,18 @@ export class ContactsService {
loggeduser: LoginUserRespose; loggeduser: LoginUserRespose;
headers: HttpHeaders; headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) { constructor(
private http: HttpClient,
user: AuthService,
private changeProfileService: ChangeProfileService) {
this.setHeader()
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader() {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey); this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
+64 -80
View File
@@ -4,7 +4,6 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable, from } from 'rxjs'; import { Observable, from } from 'rxjs';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service'; import { AuthService } from '../services/auth.service';
import { UserSession } from '../models/user.model';
import { EventList } from '../models/agenda/AgendaEventList'; import { EventList } from '../models/agenda/AgendaEventList';
import { ChangeProfileService } from './change-profile.service'; import { ChangeProfileService } from './change-profile.service';
import { OfflineManagerService } from 'src/app/services/offline-manager.service'; import { OfflineManagerService } from 'src/app/services/offline-manager.service';
@@ -20,7 +19,6 @@ import { SessionStore } from '../store/session.service';
export class EventsService { export class EventsService {
authheader = {}; authheader = {};
loggeduser: UserSession;
headers: HttpHeaders; headers: HttpHeaders;
headersPrOficial: HttpHeaders; headersPrOficial: HttpHeaders;
@@ -38,24 +36,16 @@ export class EventsService {
headersSharedOficial: HttpHeaders; headersSharedOficial: HttpHeaders;
headersSharedPessoal: HttpHeaders; headersSharedPessoal: HttpHeaders;
hasSharedCalendar = false
hasOwnCalendar = false
calendarIds = [] calendarIds = []
usersCalendarIds = [] usersCalendarIds = []
hasSharedCalendar = false;
hasSharedOficial: boolean = false; hasSharedOficial: boolean = false;
hasSharedPessoal: boolean = false; hasSharedPessoal: boolean = false;
hasOwnOficial: boolean = false; hasOwnOficial: boolean = false;
hasOwnPessoal: boolean = false; hasOwnPessoal: boolean = false;
hasOwnCalendar = false
userCalendarNameSharedOficial = '';
userCalendarNameSharedPessoal = '';
userCalendarNameOwnOficial = '';
userCalendarNameOwnPessoal = '';
calendarNames = {} calendarNames = {}
@@ -73,7 +63,14 @@ export class EventsService {
private storage: Storage, private storage: Storage,
private backgroundservice: BackgroundService) { private backgroundservice: BackgroundService) {
this.loggeduser = SessionStore.user; this.setHeader()
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
async setHeader () {
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
this.headersMdOficial = new HttpHeaders(); this.headersMdOficial = new HttpHeaders();
@@ -92,16 +89,14 @@ export class EventsService {
this.headerSharedOficial= new HttpHeaders(); this.headerSharedOficial= new HttpHeaders();
this.headerSharedPessoal= new HttpHeaders(); this.headerSharedPessoal= new HttpHeaders();
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
this.setHeader() this.usersCalendarIds = [];
this.changeProfileService.registerCallback(() => { this.calendarNames = {}
this.loggeduser = SessionStore.user; this.calendarIds = []
this.setHeader()
})
} this.calendarNamesAry = []
this.calendarNamesType = {}
async setHeader () {
this.hasSharedCalendar = false this.hasSharedCalendar = false
this.hasSharedOficial = false this.hasSharedOficial = false
@@ -111,31 +106,10 @@ export class EventsService {
this.hasOwnOficial = false this.hasOwnOficial = false
this.hasOwnPessoal = false this.hasOwnPessoal = false
this.headers = new HttpHeaders(); if (SessionStore.user) {
if (SessionStore.user.Profile == 'MDGPR') {
this.headerOwnOficial= new HttpHeaders(); for (let calendar of SessionStore.user.OwnerCalendars) {
this.headerOwnPessoal= new HttpHeaders();
this.headerSharedOficial= new HttpHeaders();
this.headerSharedPessoal= new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
this.userCalendarNameSharedOficial = '';
this.userCalendarNameSharedPessoal = '';
this.userCalendarNameOwnOficial = '';
this.userCalendarNameOwnPessoal = '';
this.usersCalendarIds = [];
this.calendarNames = {}
this.calendarNamesAry = []
this.calendarNamesType = {}
if (this.loggeduser) {
if (this.loggeduser.Profile == 'MDGPR') {
for (let calendar of this.loggeduser.OwnerCalendars) {
this.hasAnyCalendar = false this.hasAnyCalendar = false
if (calendar.CalendarName == 'Oficial') { if (calendar.CalendarName == 'Oficial') {
@@ -143,7 +117,7 @@ export class EventsService {
this.hasOwnOficial = true this.hasOwnOficial = true
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey); this.headersMdOficial = this.headersMdOficial.set('Authorization', SessionStore.user.BasicAuthKey);
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId); this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId); this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
} }
@@ -151,21 +125,21 @@ export class EventsService {
this.hasOwnPessoal = true this.hasOwnPessoal = true
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', this.loggeduser.BasicAuthKey); this.headersMdPessoal = this.headersMdPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId); this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId); this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
} }
} }
for (let sharedCalendar of this.loggeduser.SharedCalendars) { for (let sharedCalendar of SessionStore.user.SharedCalendars) {
this.hasAnyCalendar = false this.hasAnyCalendar = false
if (sharedCalendar.CalendarName == 'Oficial') { if (sharedCalendar.CalendarName == 'Oficial') {
this.hasSharedOficial = true this.hasSharedOficial = true
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey); this.headersSharedOficial = this.headersSharedOficial.set('Authorization', SessionStore.user.BasicAuthKey);
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId); this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId); this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
} }
@@ -173,7 +147,7 @@ export class EventsService {
this.hasSharedPessoal = true this.hasSharedPessoal = true
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', this.loggeduser.BasicAuthKey); this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId); this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId); this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
} }
@@ -181,15 +155,15 @@ export class EventsService {
} }
else if (this.loggeduser.Profile == 'PR') { else if (SessionStore.user.Profile == 'PR') {
for (let calendar of this.loggeduser.OwnerCalendars) { for (let calendar of SessionStore.user.OwnerCalendars) {
this.hasAnyCalendar = false this.hasAnyCalendar = false
if (calendar.CalendarName == 'Oficial') { if (calendar.CalendarName == 'Oficial') {
this.hasOwnOficial = true this.hasOwnOficial = true
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey); this.headersPrOficial = this.headersPrOficial.set('Authorization', SessionStore.user.BasicAuthKey);
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId); this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId); this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
} }
@@ -197,7 +171,7 @@ export class EventsService {
this.hasOwnPessoal = true this.hasOwnPessoal = true
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', this.loggeduser.BasicAuthKey); this.headersPrPessoal = this.headersPrPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId); this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId); this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
@@ -206,7 +180,7 @@ export class EventsService {
} }
for (let calendar of this.loggeduser.OwnerCalendars) { for (let calendar of SessionStore.user.OwnerCalendars) {
this.hasAnyCalendar = false this.hasAnyCalendar = false
if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) { if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) {
this.usersCalendarIds.push(calendar.OwnerUserId) this.usersCalendarIds.push(calendar.OwnerUserId)
@@ -222,7 +196,7 @@ export class EventsService {
this.hasOwnOficial = true this.hasOwnOficial = true
this.headerOwnOficial = this.headerOwnOficial.set('Authorization', this.loggeduser.BasicAuthKey); this.headerOwnOficial = this.headerOwnOficial.set('Authorization', SessionStore.user.BasicAuthKey);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarId', calendar.CalendarId); this.headerOwnOficial = this.headerOwnOficial.set('CalendarId', calendar.CalendarId);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId); this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName); this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
@@ -231,14 +205,14 @@ export class EventsService {
this.hasOwnPessoal = true this.hasOwnPessoal = true
this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', this.loggeduser.BasicAuthKey); this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarId', calendar.CalendarId); this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarId', calendar.CalendarId);
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId); this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName); this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
} }
} }
for (let sharedCalendar of this.loggeduser.SharedCalendars) { for (let sharedCalendar of SessionStore.user.SharedCalendars) {
this.hasAnyCalendar = false this.hasAnyCalendar = false
if(!this.usersCalendarIds.includes(sharedCalendar.OwnerUserId)) { if(!this.usersCalendarIds.includes(sharedCalendar.OwnerUserId)) {
@@ -254,7 +228,7 @@ export class EventsService {
if (sharedCalendar.CalendarName == 'Oficial') { if (sharedCalendar.CalendarName == 'Oficial') {
this.hasSharedOficial = true this.hasSharedOficial = true
this.headerSharedOficial = this.headerSharedOficial.set('Authorization',this.loggeduser.BasicAuthKey); this.headerSharedOficial = this.headerSharedOficial.set('Authorization',SessionStore.user.BasicAuthKey);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarId', sharedCalendar.CalendarId); this.headerSharedOficial = this.headerSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId); this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName); this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
@@ -263,7 +237,7 @@ export class EventsService {
this.hasSharedPessoal = true this.hasSharedPessoal = true
this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization',this.loggeduser.BasicAuthKey); this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization',SessionStore.user.BasicAuthKey);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarId', sharedCalendar.CalendarId); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
@@ -271,7 +245,7 @@ export class EventsService {
} }
for (let sharedCalendar of this.loggeduser.SharedCalendars) { for (let sharedCalendar of SessionStore.user.SharedCalendars) {
this.hasAnyCalendar = false this.hasAnyCalendar = false
if(sharedCalendar?.OwnerUserId) { if(sharedCalendar?.OwnerUserId) {
this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> {
@@ -291,7 +265,7 @@ export class EventsService {
} }
for (let sharedCalendar of this.loggeduser.OwnerCalendars) { for (let sharedCalendar of SessionStore.user.OwnerCalendars) {
this.hasAnyCalendar = false this.hasAnyCalendar = false
this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario' this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario'
@@ -326,13 +300,13 @@ export class EventsService {
isMyEvent(event: any) { isMyEvent(event: any) {
for (let calendar of this.loggeduser.OwnerCalendars) { for (let calendar of SessionStore.user.OwnerCalendars) {
if(event.CalendarId == calendar.CalendarId) { if(event.CalendarId == calendar.CalendarId) {
return true return true
} }
} }
for (let sharedCalendar of this.loggeduser.SharedCalendars) { for (let sharedCalendar of SessionStore.user.SharedCalendars) {
if(event.CalendarId == sharedCalendar.CalendarId) { if(event.CalendarId == sharedCalendar.CalendarId) {
return false return false
} }
@@ -438,12 +412,18 @@ export class EventsService {
let prO = [], prP = []; let prO = [], prP = [];
for (let calendar of this.loggeduser.OwnerCalendars) { for (let calendar of SessionStore.user.OwnerCalendars) {
if (calendar.CalendarName == 'Oficial') { if (calendar.CalendarName == 'Oficial') {
prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise(); prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise();
if(!Array.isArray(prO)) {
prO = []
}
} }
if(calendar.CalendarName == 'Pessoal') { if(calendar.CalendarName == 'Pessoal') {
prP = await this.getAllMdPessoalEvents(startdate, enddate).toPromise(); prP = await this.getAllMdPessoalEvents(startdate, enddate).toPromise();
if(!Array.isArray(prP)) {
prP = []
}
} }
} }
@@ -462,10 +442,16 @@ export class EventsService {
if(this.hasOwnOficial) { if(this.hasOwnOficial) {
ownO = await this.getAllOwnOficialEvents(startdate, enddate).toPromise(); ownO = await this.getAllOwnOficialEvents(startdate, enddate).toPromise();
if(!Array.isArray(ownO)) {
ownO = []
}
} }
if(this.hasOwnPessoal) { if(this.hasOwnPessoal) {
ownP = await this.getAllOwnPessoalEvents(startdate, enddate).toPromise(); ownP = await this.getAllOwnPessoalEvents(startdate, enddate).toPromise();
if(!Array.isArray(ownP)) {
ownP = []
}
} }
const resFinal = ownO.concat(ownP); const resFinal = ownO.concat(ownP);
@@ -509,10 +495,10 @@ export class EventsService {
let result = [] let result = []
for (let sharedCalendar of this.loggeduser.SharedCalendars) { for (let sharedCalendar of SessionStore.user.SharedCalendars) {
var header = new HttpHeaders(); var header = new HttpHeaders();
header = header.set('Authorization', this.loggeduser.BasicAuthKey); header = header.set('Authorization', SessionStore.user.BasicAuthKey);
header = header.set('CalendarId', sharedCalendar.CalendarId); header = header.set('CalendarId', sharedCalendar.CalendarId);
header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId); header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
header = header.set('CalendarName', sharedCalendar.CalendarName); header = header.set('CalendarName', sharedCalendar.CalendarName);
@@ -579,7 +565,7 @@ export class EventsService {
let prO = [], prP = []; let prO = [], prP = [];
for(let calendar of this.loggeduser.SharedCalendars) { for(let calendar of SessionStore.user.SharedCalendars) {
if (calendar.CalendarName == 'Oficial') { if (calendar.CalendarName == 'Oficial') {
prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise(); prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
} }
@@ -596,8 +582,6 @@ export class EventsService {
}); });
} }
getAllSharedOficialEvents(startdate: string, enddate: string): Observable<Event[]> { getAllSharedOficialEvents(startdate: string, enddate: string): Observable<Event[]> {
let geturl = environment.apiURL + 'calendar/pr'; let geturl = environment.apiURL + 'calendar/pr';
geturl = geturl.replace('/V4/', '/V5/') geturl = geturl.replace('/V4/', '/V5/')
@@ -733,10 +717,10 @@ export class EventsService {
this.headers['CalendarName'] = event.CalendarName this.headers['CalendarName'] = event.CalendarName
if (event.CalendarName == 'Oficial') { if (event.CalendarName == 'Oficial') {
if (this.loggeduser.Profile == 'MDGPR') { if (SessionStore.user.Profile == 'MDGPR') {
this.headers = this.headersMdOficial; this.headers = this.headersMdOficial;
} }
else if (this.loggeduser.Profile == 'PR') { else if (SessionStore.user.Profile == 'PR') {
this.headers = this.headersPrOficial; this.headers = this.headersPrOficial;
} else { } else {
@@ -755,10 +739,10 @@ export class EventsService {
} }
} }
else { else {
if (this.loggeduser.Profile == 'MDGPR') { if (SessionStore.user.Profile == 'MDGPR') {
this.headers = this.headersMdPessoal; this.headers = this.headersMdPessoal;
} }
else if (this.loggeduser.Profile == 'PR') { else if (SessionStore.user.Profile == 'PR') {
this.headers = this.headersPrPessoal; this.headers = this.headersPrPessoal;
} }
else { else {
@@ -904,7 +888,7 @@ export class EventsService {
let options; let options;
switch (this.loggeduser.Profile) { switch (SessionStore.user.Profile) {
case 'MDGPR': case 'MDGPR':
if (calendarName == 'Pessoal') { if (calendarName == 'Pessoal') {
options = { options = {
@@ -962,7 +946,7 @@ export class EventsService {
let options; let options;
if(this.loggeduser.Profile == 'MDGPR') { if(SessionStore.user.Profile == 'MDGPR') {
if (calendarName == 'Pessoal') { if (calendarName == 'Pessoal') {
options = { options = {
headers: this.headersMdPessoal, headers: this.headersMdPessoal,
@@ -976,7 +960,7 @@ export class EventsService {
}; };
} }
} }
else if (this.loggeduser.Profile == 'PR') { else if (SessionStore.user.Profile == 'PR') {
if (calendarName == 'Pessoal') { if (calendarName == 'Pessoal') {
options = { options = {
headers: this.headersPrPessoal, headers: this.headersPrPessoal,
@@ -1038,7 +1022,7 @@ export class EventsService {
params = params.set("SerialNumber", serialNumber); params = params.set("SerialNumber", serialNumber);
params = params.set("applicationID", applicationID); params = params.set("applicationID", applicationID);
switch (this.loggeduser.Profile) { switch (SessionStore.user.Profile) {
case 'MDGPR': case 'MDGPR':
if (body.CalendarName == 'Pessoal') { if (body.CalendarName == 'Pessoal') {
options = { options = {
@@ -1109,7 +1093,7 @@ export class EventsService {
params = params.set("SerialNumber", serialNumber); params = params.set("SerialNumber", serialNumber);
params = params.set("applicationID", applicationID); params = params.set("applicationID", applicationID);
switch (this.loggeduser.Profile) { switch (SessionStore.user.Profile) {
case 'MDGPR': case 'MDGPR':
if (body.CalendarName == 'Pessoal') { if (body.CalendarName == 'Pessoal') {
options = { options = {
-1
View File
@@ -11,7 +11,6 @@ import { SessionStore } from '../store/session.service';
export class FirstEnterService { export class FirstEnterService {
constructor(private router:Router, constructor(private router:Router,
private platform: Platform,
public p: PermissionService, public p: PermissionService,
private alertController: AlertController) { } private alertController: AlertController) { }
+103 -110
View File
@@ -1,22 +1,17 @@
/* eslint-disable */ /* eslint-disable */
/* tslint:disable */ /* tslint:disable */
import { Injectable, NgZone } from '@angular/core'; import { Injectable, NgZone } from '@angular/core';
import { ActivatedRoute } from '@angular/router'
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { StorageService } from 'src/app/services/storage.service'; import { StorageService } from 'src/app/services/storage.service';
import { AuthConnstants } from 'src/app/config/auth-constants'; import { AuthConnstants } from 'src/app/config/auth-constants';
import { Tokenn } from '../models/token.model'; import { Tokenn } from '../models/token.model';
import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular'; import { AlertController, Platform } from '@ionic/angular';
import { NavigationExtras, Router } from '@angular/router'; import { Router } from '@angular/router';
import { ToastService } from '../services/toast.service';
import { BackgroundService } from './background.service';
import { v4 as uuidv4 } from 'uuid';
import { EventTrigger } from '../services/eventTrigger.service'; import { EventTrigger } from '../services/eventTrigger.service';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
// import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications'; import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
import { IdObject } from '../models/notifications'; import { notificationObject } from '../models/notifications';
/* import { Events } from 'ionic-angular' */
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -27,52 +22,59 @@ export class NotificationsService {
folderId: string; folderId: string;
DataArray = new Array(); DataArray = new Array();
callbacks: {
type: string, callbacks: {[key: string]: {
type: notificationObject,
funx: Function funx: Function
id: string id: string
}[] = [] }} = {}
active = false active = false
constructor( constructor(
private http: HttpClient, private http: HttpClient,
private storageService: StorageService, private storageService: StorageService,
private modalController: ModalController,
public modalCtrl: AlertController, public modalCtrl: AlertController,
private animationController: AnimationController,
private platform: Platform, private platform: Platform,
private router: Router, private router: Router,
private toastService: ToastService,
private zone: NgZone, private zone: NgZone,
private activeroute: ActivatedRoute, private eventtrigger: EventTrigger,) {
private eventtrigger: EventTrigger,
private backgroundservice: BackgroundService,
/* private eventTriger: Events, */
/* private fcm: FCM */) {
} }
registerCallback(type: IdObject, funx: Function, object: any = {}) {
const id = uuidv4()
this.callbacks.push({ type, funx, id })
if (!object.hasOwnProperty('desktop') && object['desktop'] != false) {
this.backgroundservice.registerBackService('Notification', funx, type)
}
return id; // registerCallback({type, funx, id = uuidv4()} : {
} // type: notificationObject,
// funx: Function
// id?: string
// }) {
// this.callbacks[id] = { funx, id, type}
// return id;
// }
deleteCallback(id) {
this.callbacks.forEach((e, index) => {
if (e.id == id) {
if (index > -1) {
this.callbacks.splice(index, 1);
}
}
})
} // private async runNotificationCallback(notification) {
// for (const [key, value] of Object.entries(this.callbacks)) {
// if(value.type == notification.data.Object) {
// const dontRepeat = await value.funx(notification)
// if(dontRepeat) {
// delete this.callbacks[key]
// }
// } else if (value.type == '*') {
// const dontRepeat = await value.funx(notification)
// if(dontRepeat) {
// delete this.callbacks[key]
// }
// }
// }
// }
getTokenByUserIdAndId(user, userID) { getTokenByUserIdAndId(user, userID) {
// const geturl = environment.apiURL + 'notifications/user/' + userID; // const geturl = environment.apiURL + 'notifications/user/' + userID;
@@ -81,14 +83,14 @@ export class NotificationsService {
} }
requestPermissions() { requestPermissions() {
// PushNotifications.requestPermissions().then(result => { PushNotifications.requestPermissions().then(result => {
// if (result.receive === 'granted') { if (result.receive === 'granted') {
// // Register with Apple / Google to receive push via APNS/FCM // Register with Apple / Google to receive push via APNS/FCM
// PushNotifications.register(); PushNotifications.register();
// } else { } else {
// // Show some error // Show some error
// } }
// }); });
} }
getAndpostToken(username) { getAndpostToken(username) {
@@ -96,86 +98,77 @@ export class NotificationsService {
} else { } else {
const geturl = environment.apiURL + 'notifications/token'; const geturl = environment.apiURL + 'notifications/token';
// PushNotifications.addListener('registration', PushNotifications.addListener('registration',
// (token: Token) => { (token: Token) => {
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
const body = {
UserId: SessionStore.user.UserId,
TokenId: token.value,
Status: 1,
Service: 1
};
// this.active = false this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
// this.storageService.store(username, token.value); this.active = true
// this.storageService.get(username).then(value => { console.log(data)
}, (error) => {
// this.storageService.get(AuthConnstants.USER).then(res => { console.log(error)
})
// const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; }
// const body = { );
// UserId: res.UserId,
// TokenId: token.value,
// Status: 1,
// Service: 1
// };
// this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
// //console.log(data)
// }, (error) => {
// //console.log(error)
// })
// }).catch((error) => {
// console.error('storage authorization', error)
// });;
// }).catch((error) => {
// console.error('storage getAndPostToken', error)
// });
// }
// );
} }
} }
registrationError() { registrationError() {
// PushNotifications.addListener('registrationError', PushNotifications.addListener('registrationError',
// (error: any) => { (error: any) => {
// this.active = false this.active = false
// } }
// ); );
} }
onReciveForeground() { onReciveForeground() {
// PushNotifications.addListener('pushNotificationReceived', PushNotifications.addListener('pushNotificationReceived',
// (notification: PushNotificationSchema) => { (notification: PushNotificationSchema) => {
// console.log(notification) this.active = true
// //this.DataArray.push(notification) console.log(notification)
// //console.log(this.DataArray) //this.DataArray.push(notification)
//console.log(this.DataArray)
// this.storageService.get("Notifications").then((store) => { this.storageService.get("Notifications").then((store) => {
// store.push(notification) store.push(notification)
// this.storageService.store("Notifications", store) this.storageService.store("Notifications", store)
// }).catch((error) => { }).catch((error) => {
// if(!error) { if(!error) {
// this.storageService.store("Notifications", [notification]) this.storageService.store("Notifications", [notification])
// } }
// }) })
// /* this.eventTriger.publish('notificatioRecive') */ // this.runNotificationCallback(notification)
// this.eventtrigger.publishSomeData({ /* this.eventTriger.publish('notificatioRecive') */
// notification: "recive" this.eventtrigger.publishSomeData({
// }) notification: "recive"
// } })
// ); }
);
} }
onReciveBackground() { onReciveBackground() {
// PushNotifications.addListener('pushNotificationActionPerformed', PushNotifications.addListener('pushNotificationActionPerformed',
// (notification: ActionPerformed) => { (notification: ActionPerformed) => {
// console.log(notification) this.active = true
// /* this.DataArray.push(notification.notification) console.log(notification)
/* this.DataArray.push(notification.notification)
// this.storageService.store("Notifications", this.DataArray) this.storageService.store("Notifications", this.DataArray)
// this.eventtrigger.publishSomeData({ this.eventtrigger.publishSomeData({
// notification: "recive" notification: "recive"
// }) */ }) */
// this.notificatinsRoutes(notification) this.notificatinsRoutes(notification)
// } // this.runNotificationCallback(notification)
// ); }
);
} }
tempClearArray(data) { tempClearArray(data) {
+13 -1
View File
@@ -7,6 +7,7 @@ import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model'; import { LoginUserRespose } from '../models/user.model';
import { OrganicEntity } from 'src/app/models/organic-entity.model'; import { OrganicEntity } from 'src/app/models/organic-entity.model';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -17,7 +18,18 @@ export class OrganicEntityService {
loggeduser: LoginUserRespose; loggeduser: LoginUserRespose;
headers: HttpHeaders; headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) { constructor(
private http: HttpClient,
user: AuthService,
private changeProfileService: ChangeProfileService) {
this.setHeader()
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader() {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey); this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
+12 -2
View File
@@ -9,6 +9,7 @@ import { Publication } from '../models/publication';
import { getUrl } from 'ionicons/dist/types/components/icon/utils'; import { getUrl } from 'ionicons/dist/types/components/icon/utils';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -23,11 +24,20 @@ export class PublicationsService {
constructor(private http: HttpClient, user: AuthService, constructor(private http: HttpClient, user: AuthService,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private router: Router) { private router: Router,
private changeProfileService: ChangeProfileService,) {
this.setHeader()
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader () {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey); this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
} }
GetPublicationFolderList(){ GetPublicationFolderList(){
+41 -1
View File
@@ -8,6 +8,7 @@ import { LoginUserRespose } from '../models/user.model';
import { EventSearch } from "src/app/models/event-search"; import { EventSearch } from "src/app/models/event-search";
import { TopSearch } from 'src/app/models/top-search'; import { TopSearch } from 'src/app/models/top-search';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -21,7 +22,20 @@ export class SearchService {
categories= Array; categories= Array;
// setup // setup
constructor(private http: HttpClient, user: AuthService) { constructor(
private http: HttpClient,
user: AuthService,
private changeProfileService: ChangeProfileService) {
this.setHeader();
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader() {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey); this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
@@ -52,6 +66,32 @@ export class SearchService {
return this.http.get<EventSearch>(`${geturl}`, options); return this.http.get<EventSearch>(`${geturl}`, options);
} }
basicSearchPublication(subject:string, date:string = null, sender:string = null, organicEntity:string = null, docTypeId:string = null, applicationType:string): Observable<EventSearch>{
// Endpoint
const geturl = environment.apiURL + 'search';
// store params
let params = new HttpParams();
// set https params
params = params.set("assunto", subject);
params = params.set("data", date);
params = params.set("remetente", sender);
params = params.set("entidadeOrganica", organicEntity);
params = params.set("docTypeId", docTypeId);
params = params.set("applicationType", applicationType);
params = params.set("listOnlyFolders", true)
const options = {
headers: this.headers,
params: params
};
return this.http.get<EventSearch>(`${geturl}`, options);
}
mostSeachWord(size:string):Observable<any>{ mostSeachWord(size:string):Observable<any>{
// Endpoint // Endpoint
@@ -45,7 +45,7 @@ export class EditEventToApprovePage implements OnInit {
public endMinDate = new Date(new Date().getTime() + 15 * 60000); public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public maxDate: any; public maxDate: any;
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
@@ -68,10 +68,12 @@ export class NewEventPage implements OnInit {
recurringTypes = [] recurringTypes = []
selectedRecurringType: any; selectedRecurringType: any;
@Input() attendees: []
@Input() profile:string; @Input() profile:string;
@Input() roomId:string; @Input() roomId:string;
@Input() selectedSegment: string; @Input() selectedSegment: string;
@Input() selectedDate: Date; @Input() selectedDate: Date;
@Input() CalendarDate: Date;
@Input() taskParticipants: EventPerson[] = []; @Input() taskParticipants: EventPerson[] = [];
@Input() taskParticipantsCc: any = []; @Input() taskParticipantsCc: any = [];
@@ -140,7 +142,7 @@ export class NewEventPage implements OnInit {
if(!this.CalendarName) { if(!this.CalendarName) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) { if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario'; this.CalendarName = 'Meu calendario';
} else if(this.eventService.calendarNamesAry.length == 1 ) { } else {
this.CalendarName = this.eventService.calendarNamesAry[0] this.CalendarName = this.eventService.calendarNamesAry[0]
} }
} }
@@ -162,7 +164,7 @@ export class NewEventPage implements OnInit {
StartDate: this.autoStartTime, StartDate: this.autoStartTime,
EndDate: this.autoEndTime, EndDate: this.autoEndTime,
EventType: 'Reunião', EventType: 'Reunião',
Attendees: null, Attendees: this.attendees || null,
IsMeeting: false, IsMeeting: false,
IsRecurring: false, IsRecurring: false,
AppointmentState: 0, AppointmentState: 0,
@@ -184,7 +186,7 @@ export class NewEventPage implements OnInit {
StartDate: this.autoStartTime, StartDate: this.autoStartTime,
EndDate: this.autoEndTime, EndDate: this.autoEndTime,
EventType: 'Reunião', EventType: 'Reunião',
Attendees: null, Attendees: this.attendees || null,
IsMeeting: false, IsMeeting: false,
IsRecurring: false, IsRecurring: false,
AppointmentState: 0, AppointmentState: 0,
@@ -217,11 +219,18 @@ export class NewEventPage implements OnInit {
this.date = new Date(2021,9,4,5,6,7); this.date = new Date(2021,9,4,5,6,7);
this.injectValidation(); this.injectValidation();
this.setDefaultTime();
} }
roundTimeQuarterHour() { setDefaultTime() {
var timeToReturn = new Date(); console.log(this.CalendarDate)
this.postEvent.StartDate = this.roundTimeQuarterHour(this.CalendarDate);
this.postEvent.EndDate = this.postEvent.StartDate;
}
roundTimeQuarterHour(timeToReturn?) {
var timeToReturn = timeToReturn || new Date();
// var minutes = timeToReturn.getMinutes(); // var minutes = timeToReturn.getMinutes();
var minutes = timeToReturn.getMinutes(); var minutes = timeToReturn.getMinutes();
var hours = timeToReturn.getHours(); var hours = timeToReturn.getHours();
@@ -259,11 +268,11 @@ export class NewEventPage implements OnInit {
} }
setStartDate(){ setStartDate(){
this.postEvent.StartDate = this.roundTimeQuarterHour(); // this.postEvent.StartDate = this.roundTimeQuarterHour();
} }
setEndDate(){ setEndDate(){
this.postEvent.EndDate = this.postEvent.StartDate; // this.postEvent.EndDate = this.postEvent.StartDate;
} }
runValidation() { runValidation() {
@@ -585,7 +594,6 @@ export class NewEventPage implements OnInit {
this.postEvent.CalendarName this.postEvent.CalendarName
const CalendarId = this.selectedCalendarId() const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading(); let loader = this.toastService.loading();
@@ -645,13 +653,15 @@ export class NewEventPage implements OnInit {
selectedCalendarId () { selectedCalendarId () {
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') { if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
console.log('1')
return this.eventService.calendarNamesType[this.CalendarName]['OficialId'] return this.eventService.calendarNamesType[this.CalendarName]['OficialId']
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') { } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') {
console.log('2')
return this.eventService.calendarNamesType[this.CalendarName]['PessoalId'] return this.eventService.calendarNamesType[this.CalendarName]['PessoalId']
} else { } else {
console.log('1:1',this.eventService.calendarNamesType,'2', this.CalendarName)
return '11:11' return '11:11'
} }
} }
@@ -59,10 +59,12 @@
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
{{last ? scrollToBottom() : ''}} {{last ? scrollToBottom() : ''}}
@@ -105,10 +107,13 @@
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image"> <img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon> <ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" >Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()"> Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()"> Tentar</div>
</ion-label> </ion-label>
@@ -160,10 +165,12 @@
</ion-label> </ion-label>
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
</div> </div>
@@ -265,7 +272,7 @@
<ion-icon name="add"></ion-icon> <ion-icon name="add"></ion-icon>
</ion-fab-button> </ion-fab-button>
<ion-fab-list side="top"> <ion-fab-list side="top">
<ion-fab-button title="Nova Reunião" (click)="bookMeeting()" color="light"> <ion-fab-button *ngIf="p.userPermission([p.permissionList.Agenda.access])" title="Nova Reunião" (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon> <ion-icon name="calendar"></ion-icon>
</ion-fab-button> </ion-fab-button>
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light"> <ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
@@ -28,6 +28,7 @@ import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.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-group-messages', selector: 'app-group-messages',
@@ -103,6 +104,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
private file: File, private file: File,
private platform: Platform, private platform: Platform,
private fileOpener: FileOpener, private fileOpener: FileOpener,
public p: PermissionService,
) { ) {
this.loggedUserChat = SessionStore.user.ChatData['data']; this.loggedUserChat = SessionStore.user.ChatData['data'];
+21 -16
View File
@@ -60,11 +60,12 @@
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
{{last ? scrollToBottom() : ''}} {{last ? scrollToBottom() : ''}}
@@ -104,11 +105,13 @@
</div> </div>
<img *ngIf="msg.attachments[0].image_url" src={{msg.attachments[0].image_url}} alt="image"> <img *ngIf="msg.attachments[0].image_url" src={{msg.attachments[0].image_url}} alt="image">
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
{{ msg.viewed }}
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
</div> </div>
@@ -170,11 +173,13 @@
</ion-label> </ion-label>
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName"> <ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
{{ msg.viewed }}
<ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> <span *ngIf="msg.online == true && !msg.manualRetry && msg.viewed == 0" class="enviado"> Enviado</span>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == false && !msg.manualRetry" src="assets/images/clock-regular.svg"></ion-icon> -->
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0 && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon> -->
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> <!-- <ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon> -->
<!-- <ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon> -->
<span class="lido" *ngIf="msg.viewed.length >= 1" > Lido</span>
<div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div> <div *ngIf="msg.manualRetry" class="try" (click)="msg.send()">Tentar</div>
</ion-label> </ion-label>
</div> </div>
@@ -248,7 +253,7 @@
<ion-icon name="add"></ion-icon> <ion-icon name="add"></ion-icon>
</ion-fab-button> </ion-fab-button>
<ion-fab-list side="top"> <ion-fab-list side="top">
<ion-fab-button title="Nova Reunião" (click)="bookMeeting()" color="light"> <ion-fab-button *ngIf="p.userPermission([p.permissionList.Agenda.access])" title="Nova Reunião" (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon> <ion-icon name="calendar"></ion-icon>
</ion-fab-button> </ion-fab-button>
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light"> <ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
@@ -405,3 +405,8 @@ ion-footer {
.red { .red {
color: red !important; color: red !important;
} }
.lido, .enviado {
font-size: 11px;
}
@@ -34,6 +34,7 @@ import { SessionStore } from 'src/app/store/session.service';
import { Howl } from 'howler'; import { Howl } from 'howler';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page'; import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
import { PermissionService } from 'src/app/services/permission.service';
const IMAGE_DIR = 'stored-images'; const IMAGE_DIR = 'stored-images';
@@ -121,6 +122,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private file: File, private file: File,
private platform: Platform, private platform: Platform,
private fileOpener: FileOpener, private fileOpener: FileOpener,
public p: PermissionService,
) { ) {
// update // update
this.checkAudioPermission() this.checkAudioPermission()
@@ -385,6 +387,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
} }
async goToEvent(event: any) { async goToEvent(event: any) {
console.log(event.id)
console.log(event.calendarId)
let classs; let classs;
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
classs = 'modal modal-desktop' classs = 'modal modal-desktop'
@@ -2,7 +2,7 @@
<ion-toolbar class="px-10"> <ion-toolbar class="px-10">
<ion-title class="pa-0">Adicionar intervenientes</ion-title> <ion-title class="pa-0">Adicionar intervenientes</ion-title>
</ion-toolbar> </ion-toolbar>
<ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" --> <ion-searchbar #Searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
</ion-header> </ion-header>
@@ -4,6 +4,8 @@ import { ContactsService } from 'src/app/services/contacts.service';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ViewChild } from '@angular/core';
import { Searchbar } from 'ionic-angular';
@Component({ @Component({
selector: 'app-attendee-modal', selector: 'app-attendee-modal',
@@ -31,6 +33,8 @@ export class AttendeePage implements OnInit {
@Input() footer: boolean; @Input() footer: boolean;
@ViewChild('Searchbar') searchbar: Searchbar;
LtaskParticipants: EventPerson[] = []; LtaskParticipants: EventPerson[] = [];
LtaskParticipantsCc: EventPerson[] = []; LtaskParticipantsCc: EventPerson[] = [];
@@ -70,6 +74,7 @@ export class AttendeePage implements OnInit {
this.setIntervenient.emit(removeDuplicate(this.LtaskParticipants)); this.setIntervenient.emit(removeDuplicate(this.LtaskParticipants));
this.setIntervenientCC.emit(removeDuplicate(this.LtaskParticipantsCc)); this.setIntervenientCC.emit(removeDuplicate(this.LtaskParticipantsCc));
this.searchbar.value = null;
this.closeComponent.emit(); this.closeComponent.emit();
} }
@@ -1,5 +1,5 @@
<ion-header class="ion-no-border"> <ion-header class="ion-no-border">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar> <!-- <ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar> -->
<div class="title"> <div class="title">
<div class="thetitle"><ion-label >Todas as tarefas</ion-label></div> <div class="thetitle"><ion-label >Todas as tarefas</ion-label></div>
<div class="theicon"> <div class="theicon">
@@ -61,7 +61,8 @@
<div *ngIf="task.Agenda" class="item-middle-detail-extra"> <div *ngIf="task.Agenda" class="item-middle-detail-extra">
<div class="item-middle-detail-extra-text"> <div class="item-middle-detail-extra-text">
<ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial PR' || task.WorkflowName == 'Agenda Pessoal PR'"> <ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial PR' || task.WorkflowName == 'Agenda Pessoal PR'">
Agenda {{task.Agenda}} do Presidente da República <!-- Agenda {{task.Agenda}} do Presidente da República -->
Agenda {{task.Agenda}} do Titular
</ion-label> </ion-label>
<ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial MDGPR' || task.WorkflowName == 'Agenda Pessoal MDGPR'"> <ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial MDGPR' || task.WorkflowName == 'Agenda Pessoal MDGPR'">
A sua agenda {{task.Agenda}} A sua agenda {{task.Agenda}}
@@ -120,5 +121,3 @@
</ion-content> </ion-content>
@@ -20,7 +20,7 @@ import { SessionStore } from 'src/app/store/session.service';
}) })
export class AllProcessesPage implements OnInit { export class AllProcessesPage implements OnInit {
skeletonLoader = true; skeletonLoader = false;
allProcessesList: any[] = []; allProcessesList: any[] = [];
loggeduser: LoginUserRespose; loggeduser: LoginUserRespose;
@@ -34,6 +34,7 @@ export class AllProcessesPage implements OnInit {
totalDocumentStore = TotalDocumentStore totalDocumentStore = TotalDocumentStore
deplomasStore = DeplomasStore deplomasStore = DeplomasStore
AllProcess = []
constructor( constructor(
private router: Router, private router: Router,
@@ -45,10 +46,11 @@ export class AllProcessesPage implements OnInit {
ngOnInit() { ngOnInit() {
// this.loadAllProcesses(); // this.loadAllProcesses();
this.updateAllProcess()
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital')) { if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { if (window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing(); this.refreshing();
} else { } else {
// this.loadAllProcesses(); // this.loadAllProcesses();
@@ -60,25 +62,21 @@ export class AllProcessesPage implements OnInit {
doRefresh() { doRefresh() {
setTimeout(() => { setTimeout(() => {
this.updateAllProcess();
}, 1000); }, 1000);
} }
refreshing() { refreshing() {
setTimeout(() => { setTimeout(() => {
// this.loadAllProcesses(); this.updateAllProcess();
}, 1000); }, 1000);
} }
updateAllProcess() {
get AllProcess() { this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
setTimeout(() => { .concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
this.skeletonLoader = false; .concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList).concat(this.pendentesstore.list)
}, 5000);
return this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr)
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.despachoStore.list)
} }
get getAllProcessCount() { get getAllProcessCount() {
@@ -47,7 +47,7 @@ export class EditEventToApproveComponent implements OnInit {
public endMinDate = new Date(new Date().getTime() + 15 * 60000); public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public maxDate: any; public maxDate: any;
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
recurringTypes: any; recurringTypes: any;
selectedRecurringType: any; selectedRecurringType: any;
@@ -364,12 +364,8 @@ export class EditEventToApproveComponent implements OnInit {
const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendees: EventPerson[] = data['taskParticipants'];
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc']; const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
if(newAttendees.length) {
this.setIntervenient(newAttendees); this.setIntervenient(newAttendees);
}
if(newAttendeesCC) {
this.setIntervenientCC(newAttendeesCC); this.setIntervenientCC(newAttendeesCC);
}
} }
}); });
+18 -12
View File
@@ -5,28 +5,29 @@
<div title="Pesquisa" *ngIf="!hideSearchBtn" class="div-search"> <div title="Pesquisa" *ngIf="!hideSearchBtn" class="div-search">
<div (click)="openSearch()"> <div (click)="openSearch()">
<!-- <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-45" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-45" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon *ngIf=" ThemeService.currentTheme == 'default' " class="font-45" src='assets/images/icons-search.svg'></ion-icon> <ion-icon *ngIf=" ThemeService.currentTheme == 'default' " class="font-45" src='assets/images/icons-search.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-45" src='assets/images/theme/gov/icons-search.svg'></ion-icon> --> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-45" src='assets/images/theme/gov/icons-search.svg'></ion-icon>
</div> </div>
</div> </div>
<div class="div-logo align-center justify-center"> <div class="div-logo align-center justify-center">
<div class="logo-icon"> <div class="logo-icon">
<!-- <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'doneIt'" src="assets/images/theme/doneIt/governoangola_A1.png" alt='logo'/> --> <img *ngIf="ThemeService.currentTheme == 'doneIt'" src="assets/images/theme/doneIt/governoangola_A1.png" alt='logo'/>
</div> </div>
<div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center"> <div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content"> <div class="logo-description-content">
<p class="logo-description-text tp-5" ></p> <p class="logo-description-text tp-5" >doneIT</p>
<div class="add-line"></div> <div class="add-line"></div>
<p class="logo-description-text tp-5" >GABINETE DIGITAL</p> <p class="logo-description-text tp-5" >GABINETE DIGITAL</p>
</div> </div>
</div> </div>
<div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description d-flex align-center justify-content-center"> <div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content"> <div class="logo-description-content">
<p class="logo-description-text tp-5 color-white" ></p> <p class="logo-description-text tp-5 color-white" >doneIT</p>
<div class="add-line-white"></div> <div class="add-line-white"></div>
<p class="logo-description-text tp-5 color-white" >GABINETE DIGITAL</p> <p class="logo-description-text tp-5 color-white" >GABINETE DIGITAL</p>
</div> </div>
@@ -45,9 +46,9 @@
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<div tab="events" class="div-logo height-fit-content"> <div tab="events" class="div-logo height-fit-content">
<div class="logo-icon"> <div class="logo-icon">
<!-- <img *ngIf="ThemeService.currentTheme == 'default'" src='assets/images/logo-no-bg.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'default'" src='assets/images/logo-no-bg.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A1.png' alt='logo'> --> <img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A1.png' alt='logo'>
</div> </div>
<div class="logo-description d-flex align-center justify-content-center"> <div class="logo-description d-flex align-center justify-content-center">
@@ -55,7 +56,7 @@
<div *ngIf="ThemeService.currentTheme == 'gov' " class="logo-description-content"> <div *ngIf="ThemeService.currentTheme == 'gov' " class="logo-description-content">
<p *ngIf="environment.presidencia" class="logo-description-text">Calendário Partilhado</p> <p *ngIf="environment.presidencia" class="logo-description-text">Calendário Partilhado</p>
<p *ngIf="!environment.presidencia" class="logo-description-text" ></p> <p *ngIf="!environment.presidencia" class="logo-description-text" >doneIT</p>
<div class="add-line"></div> <div class="add-line"></div>
<p *ngIf="!environment.presidencia" class="logo-description-text" >GABINETE DIGITAL</p> <p *ngIf="!environment.presidencia" class="logo-description-text" >GABINETE DIGITAL</p>
</div> </div>
@@ -126,18 +127,23 @@
<div *ngIf="showSearch"> <div *ngIf="showSearch">
<div class="d-flex search-input-container ml-10 justify-between" *ngIf="showSearch"> <div class="d-flex search-input-container ml-10 justify-between" *ngIf="showSearch">
<div class="icon" (click)="basicSearch()"> <!-- <div class="icon" (click)="basicSearch()">
<ion-icon class="icon-z" slot="end" name="search"></ion-icon> <ion-icon class="icon-z" slot="end" name="search"></ion-icon>
</div> </div> -->
<div class="input-text d-flex ion-align-items-center"> <div class="input-text d-flex ion-align-items-center">
<ion-input (keyup.enter)="basicSearch()" [(ngModel)]='searchSubject' (ngModelChange)="dynamicSearch()" <ion-input (keyup.enter)="basicSearch()" [(ngModel)]='searchSubject' (ngModelChange)="dynamicSearch()"
class="search-input text-black" type="search" placeholder="Pesquisar"></ion-input> class="search-input text-black" type="search" placeholder="Pesquisar"></ion-input>
</div> </div>
<div class="icon" (click)="clearSearchInput()"> <!-- <div class="icon" (click)="clearSearchInput()">
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'default' "name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon> <ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'default' "name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'doneIt' "name="restaurant-outline" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon> <ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'doneIt' "name="restaurant-outline" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'gov' " name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon> <ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'gov' " name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</div> -->
<div (click)="basicSearch()" class="d-flex align-center icon">
<ion-icon class="icon-z" slot="end" src="assets/images/theme/gov/search.svg"></ion-icon>
</div> </div>
</div> </div>
</div> </div>
@@ -11,7 +11,8 @@
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button> <button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button> <button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="bookMeeting()" class="btn-ok" shape="round" >Novo Evento</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access]) == true " (click)="bookMeeting()" class="btn-ok" shape="round" >Novo Evento</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>
@@ -6,6 +6,7 @@ import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { PermissionService } from 'src/app/services/permission.service';
@Component({ @Component({
selector: 'app-chat-options-popover', selector: 'app-chat-options-popover',
@@ -22,7 +23,8 @@ export class ChatOptionsPopoverPage implements OnInit {
private popoverController: PopoverController, private popoverController: PopoverController,
private modalController: ModalController, private modalController: ModalController,
private navParams: NavParams, private navParams: NavParams,
public ThemeService: ThemeService public ThemeService: ThemeService,
public p: PermissionService,
) { ) {
this.members = this.navParams.get('members'); this.members = this.navParams.get('members');
@@ -118,22 +120,11 @@ export class ChatOptionsPopoverPage implements OnInit {
async bookMeeting() { async bookMeeting() {
this.popoverController.dismiss(); if( window.innerWidth < 701){
if( window.innerWidth <= 1024){ this.popoverController.dismiss('meeting');
const modal = await this.modalController.create({
component: NewEventPage,
componentProps:{
attendees: this.attendees,
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((data) => {
if(data){
} }
}); else{
this.modalController.dismiss('meeting');
} }
} }
@@ -3,7 +3,7 @@
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button> <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button> <button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button> <button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
@@ -15,8 +15,6 @@
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" 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 (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 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 (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 *ngIf="p.userPermission([p.permissionList.Agenda.access])" (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>
@@ -51,21 +51,11 @@ export class OptsExpedientePage implements OnInit {
private expedienteService: ExpedienteService, private expedienteService: ExpedienteService,
public ThemeService: ThemeService public ThemeService: ThemeService
) { ) {
this.loggeduser = SessionStore.user
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
if(this.task.Status != 'Pending') {
this.showEnviarPendentes = true;
}
} }
ngOnInit() { ngOnInit() {
window.onresize = (event) => {
if( window.innerWidth >= 800){
this.popoverController.dismiss();
}
};
} }
async openNewGroupPage(){ async openNewGroupPage(){
@@ -25,7 +25,7 @@ export class EditActionPage implements OnInit {
public endMinDate = new Date(new Date().getTime() + 15 * 60000); public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public maxDate: any; public maxDate: any;
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
@@ -47,7 +47,7 @@
[(ngModel)]="folder.DateBegin" [(ngModel)]="folder.DateBegin"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" (click)="setStartDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1 <ngx-mat-datetime-picker #picker1
[showSpinners]="showSpinners" [showSpinners]="showSpinners"
[showSeconds]="showSeconds" [showSeconds]="showSeconds"
@@ -83,7 +83,7 @@
[(ngModel)]="folder.DateEnd" [(ngModel)]="folder.DateEnd"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-fim" matSuffix [for]="picker2"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-fim" matSuffix [for]="picker2" (click)="setEndDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker2 <ngx-mat-datetime-picker #picker2
[showSpinners]="showSpinners" [showSpinners]="showSpinners"
[showSeconds]="showSeconds" [showSeconds]="showSeconds"
@@ -23,7 +23,7 @@ export class NewActionPage implements OnInit {
public touchUi = false; public touchUi = false;
public enableMeridian = false; public enableMeridian = false;
public stepHour = 1; public stepHour = 1;
public stepMinute = 5; public stepMinute = 15;
public stepSecond = 5; public stepSecond = 5;
currentDate = new Date(); currentDate = new Date();
public endMinDate = new Date(new Date().getTime() + 15 * 60000); public endMinDate = new Date(new Date().getTime() + 15 * 60000);
@@ -144,4 +144,45 @@ export class NewActionPage implements OnInit {
this.closeDesktopComponent.emit(); this.closeDesktopComponent.emit();
} }
roundTimeQuarterHour() {
var timeToReturn = new Date();
var minutes = timeToReturn.getMinutes();
var hours = timeToReturn.getHours();
var m = (Math.round(minutes/15) * 15) % 60;
var h = minutes > 52 ? (hours === 23 ? 0 : ++hours) : hours;
if (m == 0) {
if(minutes > m){
m = m + 15;
}
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else{
if(minutes > m){
m = m + 15;
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}else {
timeToReturn.setHours(h);
timeToReturn.setMinutes(m);
}
}
// console.log("AFTER IF MINUTES: " +m);
// console.log("AFTER HOURS: " +h);
return timeToReturn;
}
setStartDate(){
this.dateControlStart = new FormControl(moment(this.roundTimeQuarterHour()));
}
setEndDate(){
this.dateControlEnd = this.dateControlStart;
}
} }
+22
View File
@@ -10,6 +10,12 @@ export class LocalstoreService {
private prefix = environment.version.lastCommitNumber+"-"; private prefix = environment.version.lastCommitNumber+"-";
private previewPrefix = 'v17-'; private previewPrefix = 'v17-';
callbacks: {[key: string]: {
path: string,
funx: Function,
id: string
}} = {}
constructor() { constructor() {
const key = SHA1('version').toString() const key = SHA1('version').toString()
@@ -68,6 +74,22 @@ export class LocalstoreService {
localStorage.removeItem(keyName) localStorage.removeItem(keyName)
} }
private async change(changeType: 'set' | 'delete') {
const currentPath = window.location.pathname
for (const [key, value] of Object.entries(this.callbacks)) {
if(currentPath.startsWith(value.path)) {}
const dontRepeat = await value.funx({event:{type: changeType}})
if(dontRepeat) {
delete this.callbacks[key]
}
}
}
listener() {}
} }
export const localstoreService = new LocalstoreService() export const localstoreService = new LocalstoreService()
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon s-ion-icon" viewBox="0 0 512 512"><title>Search</title><path d="M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z"></path></svg>

After

Width:  |  Height:  |  Size: 408 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon s-ion-icon" viewBox="0 0 512 512"><title>Search</title><path d="M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z"></path></svg>

After

Width:  |  Height:  |  Size: 408 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon s-ion-icon" viewBox="0 0 512 512"><title>Search</title><path d="M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z"></path></svg>

After

Width:  |  Height:  |  Size: 408 B

+5 -3
View File
@@ -1,19 +1,21 @@
import { versionData } from '../../version/git-version' import { versionData } from '../../version/git-version'
export const environment = { export const environment = {
// apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', // apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
apiURL: 'https://API.DONEIT.CO.AO/api/', apiURL: 'https://API.DONEIT.CO.AO/api/',
//apiURL: 'https://gd-api.oapr.gov.ao/api/',
//apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/', //apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/',
// apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/', // apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
// apiChatUrl: 'http://192.168.0.29:3000/api/v1/',
// apiWsChatUrl: 'wss://192.168.0.29:3000/websocket',
//apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', //apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
//apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', //apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/', apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket', apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
/* apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', */
//apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', //apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
// apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', // apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
production: true, production: true,
domain: 'evandre.dasilva@equilibrium.co.ao', domain: 'equilibrium.co.ao',
defaultuser: 'evandre.dasilva@equilibrium.co.ao',//paulo.pinto@gabinetedigital.local defaultuser: 'evandre.dasilva@equilibrium.co.ao',//paulo.pinto@gabinetedigital.local
defaultuserpwd: 'Luand@1219', //tabteste@006,06, defaultuserpwd: 'Luand@1219', //tabteste@006,06,
chatOffline: true, chatOffline: true,
+6 -4
View File
@@ -11,10 +11,12 @@ export const environment = {
//apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', //apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/', apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket', apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
production: true, /* apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
domain: 'evandre.dasilva@equilibrium.co.ao', apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', */
defaultuser: 'evandre.dasilva@equilibrium.co.ao',//paulo.pinto@gabinetedigital.local production: false,
defaultuserpwd: 'Luand@1219', //tabteste@006, domain: 'equilibrium.co.ao',
defaultuser: 'evandre.dasilva@equilibrium.co.ao',//evandre.dasilva@equilibrium.co.ao
defaultuserpwd: 'Luand@1219', //Luand@1219,
chatOffline: true, chatOffline: true,
presidencia: false, presidencia: false,
version: versionData, version: versionData,
+8
View File
@@ -1419,3 +1419,11 @@ $font-size: 11pt;
} }
.mat-form-field {
width: 100%;
}
ngx-mat-datetime-content button.mat-stroked-button {
top: -56px;
margin-bottom: -35px;
}
+1 -1
View File
@@ -56,7 +56,7 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<!-- <link rel="icon" type="image/x-icon" href="assets/icon/governoangola_A.png" /> --> <link rel="icon" type="image/x-icon" href="assets/icon/governoangola_A.png" />
<!-- <link rel="manifest" href="assets/json/manifest.json"> --> <!-- <link rel="manifest" href="assets/json/manifest.json"> -->
<!-- add to homescreen for ios --> <!-- add to homescreen for ios -->
-7
View File
@@ -8,13 +8,6 @@ import { defineCustomElements } from '@ionic/pwa-elements/loader';
import "hammerjs"; // HAMMER TIME import "hammerjs"; // HAMMER TIME
/* import * as Sentry from '@sentry/capacitor';
// The example is using Angular, Import '@sentry/vue' or '@sentry/react' when using a Sibling different than Angular.
import * as SentrySibling from '@sentry/angular';
// For automatic instrumentation (highly recommended)
import { Integration } from '@sentry/types';
import { BrowserTracing } from '@sentry/tracing'; */
if (environment.production) { if (environment.production) {
enableProdMode(); enableProdMode();
} }
+5
View File
@@ -0,0 +1,5 @@
import { DatabaseSchema, TableSchema } from '../models/register-modal.interface.js';
import { actionParam, dbType } from './intreface.js';
export declare class DBSwitch {
static requestHandler(TableSchema: TableSchema, DBconfig: DatabaseSchema, dbType: dbType, action: actionParam, arg: any, queryId: any): Promise<any>;
}
+29
View File
@@ -0,0 +1,29 @@
import { indexedDB } from './indexedDb/indexedb.js';
import { IndexedDBWorkerQueue } from './worker.queue.js';
export class DBSwitch {
static async requestHandler(TableSchema, DBconfig, dbType, action, arg, queryId) {
if (typeof (Worker) !== "undefined" && IndexedDBWorkerQueue.webWorkerModuleSupport) {
//great, your browser supports web workers
return new Promise(async (resolve, reject) => {
const request = IndexedDBWorkerQueue.register({
params: { TableSchema, DBconfig, queryId, action, arg, dbType },
method: 'execute',
func: (message) => {
if (message.queryId == queryId) {
resolve(message === null || message === void 0 ? void 0 : message.value);
return true;
}
},
});
if (request == false) {
const result = await indexedDB.requestHandler(TableSchema, DBconfig, queryId)[action](arg);
resolve(result === null || result === void 0 ? void 0 : result.value);
}
});
}
else {
const result = await indexedDB.requestHandler(TableSchema, DBconfig, queryId)[action](arg);
return result === null || result === void 0 ? void 0 : result.value;
}
}
}
+7
View File
@@ -0,0 +1,7 @@
import { DatabaseSchema } from '../../models/register-modal.interface.js';
export declare class IndexedDBConnection {
constructor();
connect(config: DatabaseSchema): Promise<IDBDatabase>;
migrate(config: DatabaseSchema): Promise<boolean>;
private runMigrations;
}
@@ -0,0 +1,57 @@
// inspire by https://github.com/hc-oss/use-indexeddb
export class IndexedDBConnection {
constructor() { }
connect(config) {
return new Promise((resolve, reject) => {
const idbInstance = indexedDB || self.indexedDB || self.mozIndexedDB || self.webkitIndexedDB || self.msIndexedDB;
if (idbInstance) {
const request = idbInstance.open(config.databaseName, config.version);
request.onsuccess = () => {
resolve(request.result);
};
request.onerror = (e) => {
reject(e.target.error.name);
};
request.onupgradeneeded = async (e) => {
throw ('need to migrate first');
};
}
else {
reject("IDBDatabase not supported inside webworker");
}
});
}
migrate(config) {
return new Promise((resolve, reject) => {
const idbInstance = indexedDB || self.indexedDB || self.mozIndexedDB || self.webkitIndexedDB || self.msIndexedDB;
if (idbInstance) {
const request = idbInstance.open(config.databaseName, config.version);
request.onsuccess = () => {
resolve(false);
};
request.onerror = (e) => {
reject(e.target.error.name);
};
request.onupgradeneeded = async (e) => {
const db = e.target.result;
await this.runMigrations(db, config);
db.close();
resolve(true);
};
}
else {
reject("Failed to connect");
}
});
}
async runMigrations(db, config) {
await config.stores.forEach(async (storeSchema) => {
if (!db.objectStoreNames.contains(storeSchema.name)) {
const ObjectStore = db.createObjectStore(storeSchema.name, storeSchema.id);
storeSchema.fields.forEach(c => {
ObjectStore.createIndex(c.name, c.keyPath, c.options);
});
}
});
}
}
@@ -0,0 +1,3 @@
export declare class IndexedDBConnectionDynamicChange {
changeSchema(db: any, schemaChanges: any): void;
}
@@ -0,0 +1,31 @@
import { IndexedDBConnection } from './connector';
export class IndexedDBConnectionDynamicChange {
changeSchema(db, schemaChanges) {
db.close();
const newDb = new IndexedDBConnection().connect({
databaseName: 'databaseName',
type: 'indexedDB',
version: 0
});
// newDb.on('blocked', () => false); // Silence console warning of blocked event.
// Workaround: If DB is empty from tables, it needs to be recreated
// if (db.tables.length === 0) {
// await db.delete();
// newDb.version(1).stores(schemaChanges);
// return await newDb.open();
//}
// Extract current schema in dexie format:
const currentSchema = db.tables.reduce((result, { name, schema }) => {
result[name] = [schema.primKey.src, ...schema.indexes.map((idx) => idx.src)].join(',');
return result;
}, {});
// console.log('Version: ' + db.verno);
// console.log('Current Schema: ', currentSchema);
// Tell Dexie about current schema:
// newDb.version(db.verno).stores(currentSchema);
// Tell Dexie about next schema:
// newDb.version(db.verno + 1).stores(schemaChanges);
// Upgrade it:
// return await newDb.open();
}
}
+39
View File
@@ -0,0 +1,39 @@
import { DatabaseSchema, TableSchema } from "../../models/register-modal.interface.js";
import { Method } from "../../models/model.interface.js";
declare class _indexedDB {
private validateStore;
private validateBeforeTransaction;
private createTransaction;
migrate(config: DatabaseSchema): Promise<boolean>;
getConnection(config: DatabaseSchema): Promise<IDBDatabase>;
getActions: (currentStore: any, config: any) => {
getByID: (id: string | number) => Promise<any>;
getOneByIndex: (keyPath: string, value: string | number) => Promise<any>;
getManyByIndex: (keyPath: string, value: string | number) => Promise<any[]>;
getAll: () => Promise<any[]>;
add: (value: Object, key?: any) => Promise<number>;
update: (value: any, key?: any) => Promise<any>;
deleteByID: (id: any) => Promise<any>;
deleteAll: () => Promise<any>;
openCursor: (cursorCallback: any, keyRange?: IDBKeyRange) => Promise<void | IDBCursorWithValue>;
};
requestHandler: (TableSchema: TableSchema, config: DatabaseSchema, queryId: any) => {
select: (methods: Method[]) => Promise<unknown>;
update: (methods: Method[]) => Promise<{
queryId: any;
}>;
delete: (methods: Method[]) => Promise<{
queryId: any;
value?: undefined;
} | {
queryId: any;
value: any;
}>;
insert: (methods: Method[]) => Promise<{
queryId: any;
value: any;
}>;
};
}
export declare const indexedDB: _indexedDB;
export {};
@@ -0,0 +1,366 @@
import { IndexedDBConnection } from "./connector.js";
import { SqlObject } from "../../sql/sqlObject/sqlObject.js";
// inspire by https://github.com/hc-oss/use-indexeddb
class _indexedDB {
constructor() {
this.getActions = (currentStore, config) => {
return {
getByID: (id) => {
return new Promise((resolve, reject) => {
this.getConnection(config)
.then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readonly", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
let request = objectStore.get(id);
request.onsuccess = (e) => {
resolve(e.target.result);
};
})
.catch(reject);
});
},
getOneByIndex: (keyPath, value) => {
return new Promise((resolve, reject) => {
this.getConnection(config)
.then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readonly", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
let index = objectStore.index(keyPath);
let request = index.get(value);
request.onsuccess = (e) => {
resolve(e.target.result);
};
})
.catch(reject);
});
},
getManyByIndex: (keyPath, value) => {
return new Promise((resolve, reject) => {
this.getConnection(config)
.then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readonly", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
let index = objectStore.index(keyPath);
let request = index.getAll(value);
request.onsuccess = (e) => {
resolve(e.target.result);
};
})
.catch(reject);
});
},
getAll: () => {
return new Promise((resolve, reject) => {
this.getConnection(config).then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readonly", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
let request = objectStore.getAll();
request.onsuccess = (e) => {
resolve(e.target.result);
};
})
.catch(reject);
});
},
add: (value, key) => {
return new Promise((resolve, reject) => {
this.getConnection(config).then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readwrite", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
let request = objectStore.add(value, key);
request.onsuccess = (e) => {
var _a, _b;
(_b = (_a = tx) === null || _a === void 0 ? void 0 : _a.commit) === null || _b === void 0 ? void 0 : _b.call(_a);
resolve(e.target.result);
};
})
.catch(reject);
});
},
update: (value, key) => {
return new Promise((resolve, reject) => {
this.getConnection(config).then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readwrite", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
let request = objectStore.put(value, key);
request.onsuccess = (e) => {
var _a, _b;
(_b = (_a = tx) === null || _a === void 0 ? void 0 : _a.commit) === null || _b === void 0 ? void 0 : _b.call(_a);
resolve(e.target.result);
};
request.onerror = (e) => {
console.log(value, key)
console.log(e)
}
})
.catch(reject);
});
},
deleteByID: (id) => {
return new Promise((resolve, reject) => {
this.getConnection(config).then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readwrite", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
let request = objectStore.delete(id);
request.onsuccess = (e) => {
var _a, _b;
(_b = (_a = tx) === null || _a === void 0 ? void 0 : _a.commit) === null || _b === void 0 ? void 0 : _b.call(_a);
resolve(e);
};
})
.catch(reject);
});
},
deleteAll: () => {
return new Promise((resolve, reject) => {
this.getConnection(config)
.then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readwrite", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
objectStore.clear();
tx.oncomplete = (e) => {
var _a, _b;
try {
(_b = (_a = tx) === null || _a === void 0 ? void 0 : _a.commit) === null || _b === void 0 ? void 0 : _b.call(_a);
resolve(e);
}
catch (error) {
resolve(e);
}
};
})
.catch(reject);
});
},
openCursor: (cursorCallback, keyRange) => {
return new Promise((resolve, reject) => {
this.getConnection(config)
.then(db => {
this.validateBeforeTransaction(db, currentStore, reject);
let tx = this.createTransaction(db, "readonly", currentStore, resolve, reject);
let objectStore = tx.objectStore(currentStore);
let request = objectStore.openCursor(keyRange);
request.onsuccess = e => {
cursorCallback(e);
resolve();
};
})
.catch(reject);
});
},
};
};
this.requestHandler = (TableSchema, config, queryId) => {
return {
select: async (methods) => {
if (methods[0].methodName == 'all') {
return {
queryId: queryId,
value: await this.getActions(TableSchema.name, config).getAll()
};
}
else if (methods[0].methodName == 'get') {
const args = methods[0].arguments;
if (Object.keys(args).length == 1) {
const key = Object.keys(args)[0];
const value = args[key];
if (TableSchema.id.keyPath == key) {
return {
queryId: queryId,
value: await this.getActions(TableSchema.name, config).getByID(value)
};
}
else {
return {
queryId: queryId,
value: await this.getActions(TableSchema.name, config).getOneByIndex(key, value)
};
}
}
}
else if (methods[methods.length - 1].methodName == 'execute') {
return new Promise(async (resolve, reject) => {
const sqlObject = new SqlObject(TableSchema, methods);
await this.getActions(TableSchema.name, config).openCursor(async (event) => {
var cursor = event.target.result;
if (cursor) {
const row = cursor.value;
await sqlObject.runFirstMethod(row);
cursor.continue();
}
else {
sqlObject.doneRunFirstMethod();
sqlObject.run();
resolve({
queryId: queryId,
value: sqlObject.firstMethod.rows
});
}
});
});
}
else if (methods[methods.length - 1].methodName == 'first') {
return new Promise(async (resolve, reject) => {
const sqlObject = new SqlObject(TableSchema, methods);
await this.getActions(TableSchema.name, config).openCursor(async (event) => {
var cursor = event.target.result;
if (cursor) {
const row = cursor.value;
await sqlObject.runFirstMethod(row, resolve, 1);
cursor.continue();
}
else {
sqlObject.doneRunFirstMethod();
sqlObject.run();
resolve({
queryId: queryId,
value: sqlObject.firstMethod.rows
});
}
});
});
}
},
update: async (methods) => {
if (methods[0].methodName == 'save') {
const args = methods[0].arguments;
const idFieldName = TableSchema.id.keyPath;
const idValue = args[idFieldName];
if (idValue) {
await this.getActions(TableSchema.name, config).update(args);
}
else {
await this.getActions(TableSchema.name, config).update(args, idValue);
}
return {
queryId
};
}
else if (methods[0].methodName != 'update' && methods[methods.length - 1].methodName == 'update') {
const argsToUpdate = methods[methods.length - 1].arguments;
const customMethods = Object.create(methods);
customMethods[methods.length - 1].methodName = 'execute';
const result = await this.requestHandler(TableSchema, config, queryId).select(customMethods);
const rows = result.value;
for (let row of rows) {
const updateRow = Object.assign(row, argsToUpdate);
await this.getActions(TableSchema.name, config).update(updateRow);
}
return {
queryId
};
}
else if (methods[0].methodName == 'update') {
const argsToUpdate = methods[0].arguments;
const idFieldName = TableSchema.id.keyPath;
//await this.getActions(TableSchema.name, config).update(argsToUpdate)
const idValue = argsToUpdate[idFieldName];
if (idValue) {
await this.getActions(TableSchema.name, config).update(argsToUpdate);
}
else {
await this.getActions(TableSchema.name, config).update(argsToUpdate, idValue);
}
return {
queryId
};
}
},
delete: async (methods) => {
if (methods[methods.length - 1].methodName == 'delete' &&
methods[methods.length - 1].arguments == null) {
const customMethods = Object.create(methods);
customMethods[methods.length - 1].methodName = 'execute';
const result = await this.requestHandler(TableSchema, config, queryId).select(customMethods);
const rows = result.value;
for (let row of rows) {
const id = row[TableSchema.id.keyPath];
await this.getActions(TableSchema.name, config).deleteByID(id);
}
return {
queryId
};
}
else if (methods[methods.length - 1].methodName == 'delete' &&
typeof methods[methods.length - 1].arguments == 'object') {
const IdInObject = methods[methods.length - 1].arguments;
const idValue = IdInObject[TableSchema.id.keyPath];
const result = await this.getActions(TableSchema.name, config).deleteByID(idValue)
console.log('delete7', IdInObject,idValue, result.type == 'success', result.type)
return {
queryId: queryId,
value: result.type == 'success'
};
}
else if (methods[methods.length - 1].methodName == 'delete' &&
methods[methods.length - 1].arguments == '*') {
return {
queryId: queryId,
value: await this.getActions(TableSchema.name, config).deleteAll()
};
} else {
console.log('delete else')
}
},
insert: async (methods) => {
const createdObjKeys = [];
const rows = methods[0].arguments;
for (let insert of rows) {
const id = await this.getActions(TableSchema.name, config).add(insert);
createdObjKeys.push(id);
}
// return first element
if (rows.length == 1) {
return {
queryId: queryId,
value: await this.getActions(TableSchema.name, config).getByID(createdObjKeys[0])
};
}
else {
return {
queryId: queryId,
value: createdObjKeys
};
}
}
};
};
}
validateStore(db, storeName) {
return db.objectStoreNames.contains(storeName);
}
validateBeforeTransaction(db, storeName, reject) {
if (!db) {
reject("Queried before opening connection");
}
if (!this.validateStore(db, storeName)) {
reject(`Store ${storeName} not found`);
}
}
createTransaction(db, dbMode, currentStore, resolve, reject, abort) {
let tx = db.transaction(currentStore, dbMode);
tx.onerror = reject;
tx.oncomplete = resolve;
tx.onabort = abort;
return tx;
}
migrate(config) {
return new IndexedDBConnection().migrate(config);
}
getConnection(config) {
return new IndexedDBConnection().connect(config);
}
}
export const indexedDB = new _indexedDB();
+2
View File
@@ -0,0 +1,2 @@
export declare type actionParam = 'insert' | 'update' | 'delete' | 'select';
export declare type dbType = 'indexedDB';
+1
View File
@@ -0,0 +1 @@
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+17
View File
@@ -0,0 +1,17 @@
import { indexedDB } from './indexedDb/indexedb.js';
onmessage = async (oEvent) => {
const { TableSchema, DBconfig, queryId, action, arg } = oEvent.data;
const result = await indexedDB.requestHandler(TableSchema, DBconfig, queryId)[action](arg);
console.log('return response', result)
try {
postMessage(result);
}
catch (error) {
postMessage({
queryId: result.queryId,
value: undefined
});
}
};

Some files were not shown because too many files have changed in this diff Show More