mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Removed synchro services
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<name>gabinete digital</name>
|
<name>gabinete digital</name>
|
||||||
<description>An awesome Ionic/Cordova app.</description>
|
<description>An awesome Ionic/Cordova app.</description>
|
||||||
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
|
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
|
||||||
<content original-src="index.html" src="http://localhost:8100" />
|
<content src="index.html" />
|
||||||
<access origin="*" />
|
<access origin="*" />
|
||||||
<allow-navigation href="*" />
|
<allow-navigation href="*" />
|
||||||
<allow-navigation href="*" />
|
<allow-navigation href="*" />
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { AuthService } from 'src/app/services/auth.service';
|
|||||||
import { ChatService } from 'src/app/services/chat.service';
|
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 { synchro } from 'src/app/services/socket/synchro.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 { 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';
|
||||||
@@ -45,7 +44,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
members:any;
|
members:any;
|
||||||
scrollingOnce:boolean = true;
|
scrollingOnce:boolean = true;
|
||||||
|
|
||||||
synchro = synchro;
|
|
||||||
chatMessageStore = ChatMessageStore
|
chatMessageStore = ChatMessageStore
|
||||||
chatUserStorage = ChatUserStorage
|
chatUserStorage = ChatUserStorage
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
|||||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { synchro } from '../../services/socket/synchro.service';
|
|
||||||
import { NetworkConnectionService } from 'src/app/services/network-connection.service'
|
import { NetworkConnectionService } from 'src/app/services/network-connection.service'
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
@@ -79,7 +78,6 @@ export class EventsPage implements OnInit {
|
|||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
|
|
||||||
existingScreenOrientation: string;
|
existingScreenOrientation: string;
|
||||||
synch = synchro
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private eventService: EventsService,
|
private eventService: EventsService,
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import { DespachoService } from 'src/app/Rules/despacho.service';
|
|||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
|
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import { AttachmentList } from 'src/app/models/Excludetask';
|
|||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
|
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { Platform } from '@ionic/angular';
|
import { Platform } from '@ionic/angular';
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
@@ -47,8 +46,6 @@ export class DespachoPage implements OnInit {
|
|||||||
intervenientes: any;
|
intervenientes: any;
|
||||||
cc: any = [];
|
cc: any = [];
|
||||||
|
|
||||||
synch = synchro;
|
|
||||||
|
|
||||||
constructor(private activateRoute: ActivatedRoute,
|
constructor(private activateRoute: ActivatedRoute,
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { DespachoService } from 'src/app/Rules/despacho.service';
|
|||||||
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
||||||
|
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
|
||||||
import { Platform } from '@ionic/angular';
|
import { Platform } from '@ionic/angular';
|
||||||
import { isThisHour } from 'date-fns';
|
import { isThisHour } from 'date-fns';
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
@@ -18,7 +17,6 @@ import { BackgroundService } from 'src/app/services/background.service';
|
|||||||
export class DespachosPage implements OnInit {
|
export class DespachosPage implements OnInit {
|
||||||
|
|
||||||
despachoStore = DespachoStore;
|
despachoStore = DespachoStore;
|
||||||
synch = synchro;
|
|
||||||
listToPresent = [];
|
listToPresent = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { Location } from '@angular/common';
|
|||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
|
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import { PermissionService } from 'src/app/services/worker/permission.service';
|
|||||||
|
|
||||||
|
|
||||||
import { SqliteService } from '../../services/sqlite.service';
|
import { SqliteService } from '../../services/sqlite.service';
|
||||||
import { synchro } from '../../services/socket/synchro.service';
|
|
||||||
import { Platform } from '@ionic/angular';
|
import { Platform } from '@ionic/angular';
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
@@ -110,9 +109,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
//
|
//
|
||||||
// pipe
|
// pipe
|
||||||
|
|
||||||
synch = synchro;
|
|
||||||
|
|
||||||
|
|
||||||
customTaskPipe = new CustomTaskPipe()
|
customTaskPipe = new CustomTaskPipe()
|
||||||
|
|
||||||
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { ImageModalPage } from '../gallery/image-modal/image-modal.page';
|
|||||||
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -28,7 +28,8 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private sqliteservice: SqliteService ) {
|
private sqliteservice: SqliteService,
|
||||||
|
private backgroundservice: BackgroundService ) {
|
||||||
|
|
||||||
this.publicationId = this.navParams.get('publicationId');
|
this.publicationId = this.navParams.get('publicationId');
|
||||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||||
@@ -81,11 +82,7 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getFromDB() {
|
getFromDB() {
|
||||||
if(synchro.connected === true) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
|
import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
|
||||||
import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
|
import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publications',
|
selector: 'app-publications',
|
||||||
@@ -64,14 +64,28 @@ export class PublicationsPage implements OnInit {
|
|||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
private publications: PublicationsService,
|
private publications: PublicationsService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private sqliteservice: SqliteService
|
private sqliteservice: SqliteService,
|
||||||
|
private backgroundservice: BackgroundService
|
||||||
) {
|
) {
|
||||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.getFromDB();
|
|
||||||
|
const pathname = window.location.pathname
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
if (event instanceof NavigationEnd && event.url == pathname) {
|
||||||
|
this.getActions();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.hideRefreshButton();
|
||||||
|
|
||||||
|
this.backgroundservice.registerBackService('Online', () => {
|
||||||
|
this.getActions();
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hideRefreshButton() {
|
hideRefreshButton() {
|
||||||
@@ -153,22 +167,13 @@ export class PublicationsPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
this.getFromDB();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getFromDB() {
|
getFromDB() {
|
||||||
|
|
||||||
if (synchro.connected === true) {
|
|
||||||
const pathname = window.location.pathname
|
|
||||||
|
|
||||||
this.router.events.forEach((event) => {
|
|
||||||
if (event instanceof NavigationEnd && event.url == pathname) {
|
|
||||||
this.getActions();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.hideRefreshButton();
|
|
||||||
} else {
|
|
||||||
this.sqliteservice.getAllActions().then((actions: any[]) => {
|
this.sqliteservice.getAllActions().then((actions: any[]) => {
|
||||||
|
|
||||||
console.log('offline publi', actions)
|
console.log('offline publi', actions)
|
||||||
@@ -197,7 +202,6 @@ export class PublicationsPage implements OnInit {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async editAction(folderId?: string) {
|
async editAction(folderId?: string) {
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-f
|
|||||||
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||||
import { PublicationDetailPage } from './publication-detail/publication-detail.page';
|
import { PublicationDetailPage } from './publication-detail/publication-detail.page';
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-publications',
|
selector: 'app-view-publications',
|
||||||
@@ -42,7 +42,8 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
private publications: PublicationsService,
|
private publications: PublicationsService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private sqliteservice: SqliteService) {
|
private sqliteservice: SqliteService,
|
||||||
|
private backgroundservice: BackgroundService) {
|
||||||
|
|
||||||
this.item = new PublicationFolder();
|
this.item = new PublicationFolder();
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
@@ -63,7 +64,16 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
this.folderId = this.folderId['ProcessId']
|
this.folderId = this.folderId['ProcessId']
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getFromDB();
|
this.getPublicationDetail();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getPublications();
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
this.backgroundservice.registerBackService('Online',() => {
|
||||||
|
this.getPublicationDetail();
|
||||||
|
this.getPublications();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,6 +139,9 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
|
if(error.status == '0') {
|
||||||
|
this.getFromDB();
|
||||||
|
}
|
||||||
if (error.status == '404') {
|
if (error.status == '404') {
|
||||||
this.error = 'Sem publicações disponíveis!';
|
this.error = 'Sem publicações disponíveis!';
|
||||||
this.publicationList = [];
|
this.publicationList = [];
|
||||||
@@ -142,13 +155,6 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getFromDB() {
|
getFromDB() {
|
||||||
if (synchro.connected === true) {
|
|
||||||
this.getPublicationDetail();
|
|
||||||
setTimeout(() => {
|
|
||||||
this.getPublications();
|
|
||||||
}, 5000);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
this.sqliteservice.getActionById(this.folderId).then((publications) => {
|
this.sqliteservice.getActionById(this.folderId).then((publications) => {
|
||||||
console.log('publications', publications)
|
console.log('publications', publications)
|
||||||
@@ -181,8 +187,6 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
this.getpublication = publicationArray;
|
this.getpublication = publicationArray;
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async AddPublication(publicationType: any, folderId: any) {
|
async AddPublication(publicationType: any, folderId: any) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { Injectable } from '@angular/core';
|
|||||||
export class BackgroundService {
|
export class BackgroundService {
|
||||||
|
|
||||||
callBacks: {
|
callBacks: {
|
||||||
type: 'Offline' | 'Online',
|
type: 'Offline' | 'Online' | 'Notification',
|
||||||
object?: string
|
object?: string
|
||||||
funx: Function
|
funx: Function
|
||||||
}[] = []
|
}[] = []
|
||||||
@@ -39,7 +39,7 @@ export class BackgroundService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
registerBackService(type: 'Offline' | 'Online', funx: Function, object = '') {
|
registerBackService(type: 'Offline' | 'Online' | 'Notification', funx: Function, object = '') {
|
||||||
this.callBacks.push({
|
this.callBacks.push({
|
||||||
type,
|
type,
|
||||||
funx,
|
funx,
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ 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';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
|
||||||
import { catchError } from "rxjs/operators";
|
import { catchError } from "rxjs/operators";
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -36,8 +36,8 @@ export class EventsService {
|
|||||||
public user: AuthService,
|
public user: AuthService,
|
||||||
private changeProfileService: ChangeProfileService,
|
private changeProfileService: ChangeProfileService,
|
||||||
private offlinemanager: OfflineManagerService,
|
private offlinemanager: OfflineManagerService,
|
||||||
private storage: Storage)
|
private storage: Storage,
|
||||||
{
|
private backgroundservice: BackgroundService) {
|
||||||
|
|
||||||
this.loggeduser = this.user.ValidatedUser;
|
this.loggeduser = this.user.ValidatedUser;
|
||||||
|
|
||||||
@@ -293,8 +293,7 @@ export class EventsService {
|
|||||||
return this.http.get<Event>(`${geturl}`, options);
|
return this.http.get<Event>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
putEvent(event: Event, conflictResolutionMode:number, sendInvitationsOrCancellationsMode:number, sharedagenda:string): Observable<Event>
|
putEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, sharedagenda: string): Observable<Event> {
|
||||||
{
|
|
||||||
const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PutEvent');
|
const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PutEvent');
|
||||||
|
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
@@ -310,14 +309,10 @@ export class EventsService {
|
|||||||
return this.http.put<Event>(`${puturl}`, event, options)
|
return this.http.put<Event>(`${puturl}`, event, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
editEvent(event: Event, conflictResolutionMode:number, sendInvitationsOrCancellationsMode:number): Observable<Event>
|
editEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number): Observable<Event> {
|
||||||
{
|
|
||||||
let arrayReq = [];
|
let arrayReq = [];
|
||||||
|
arrayReq.push(event);
|
||||||
const puturl = environment.apiURL + 'calendar/PutEvent';
|
const puturl = environment.apiURL + 'calendar/PutEvent';
|
||||||
if(synchro.connected === false) {
|
|
||||||
arrayReq.push(event)
|
|
||||||
return from(this.storage.set('storedreq', arrayReq))
|
|
||||||
} else {
|
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
params = params.set("conflictResolutionMode", conflictResolutionMode.toString());
|
params = params.set("conflictResolutionMode", conflictResolutionMode.toString());
|
||||||
@@ -351,12 +346,11 @@ export class EventsService {
|
|||||||
|
|
||||||
return this.http.put<Event>(`${puturl}`, event, options).pipe(
|
return this.http.put<Event>(`${puturl}`, event, options).pipe(
|
||||||
catchError(err => {
|
catchError(err => {
|
||||||
this.offlinemanager.storeRequest(puturl, 'PUT', event);
|
this.offlinemanager.storeRequest(puturl, 'PUT', arrayReq);
|
||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
changeAgenda(body: any) {
|
changeAgenda(body: any) {
|
||||||
const puturl = environment.apiURL + 'Calendar/MoveEvent';
|
const puturl = environment.apiURL + 'Calendar/MoveEvent';
|
||||||
@@ -381,8 +375,7 @@ export class EventsService {
|
|||||||
return this.http.post<Event>(`${puturl}`, event, options)
|
return this.http.post<Event>(`${puturl}`, event, options)
|
||||||
} */
|
} */
|
||||||
|
|
||||||
postEventMd(event:Event, calendarName:string)
|
postEventMd(event: Event, calendarName: string) {
|
||||||
{
|
|
||||||
const puturl = environment.apiURL + 'calendar/md';
|
const puturl = environment.apiURL + 'calendar/md';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -410,8 +403,7 @@ export class EventsService {
|
|||||||
return this.http.post<string>(`${puturl}`, event, options)
|
return this.http.post<string>(`${puturl}`, event, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
postEventPr(event:Event, calendarName:string)
|
postEventPr(event: Event, calendarName: string) {
|
||||||
{
|
|
||||||
const puturl = environment.apiURL + 'calendar/pr';
|
const puturl = environment.apiURL + 'calendar/pr';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -439,8 +431,7 @@ export class EventsService {
|
|||||||
return this.http.post<string>(`${puturl}`, event, options)
|
return this.http.post<string>(`${puturl}`, event, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteEvent(eventid:string, eventDeleteType:number, calendarName:string)
|
deleteEvent(eventid: string, eventDeleteType: number, calendarName: string) {
|
||||||
{
|
|
||||||
const puturl = environment.apiURL + 'calendar/DeleteEvent';
|
const puturl = environment.apiURL + 'calendar/DeleteEvent';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { ModalController, AlertController, AnimationController, Platform } from
|
|||||||
import { NavigationExtras,Router } from '@angular/router';
|
import { NavigationExtras,Router } from '@angular/router';
|
||||||
import { ToastService } from '../services/toast.service';
|
import { ToastService } from '../services/toast.service';
|
||||||
import { JsonStore } from './jsonStore.service';
|
import { JsonStore } from './jsonStore.service';
|
||||||
import { synchro } from './socket/synchro.service';
|
import { BackgroundService } from './background.service';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
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';
|
||||||
@@ -44,7 +44,8 @@ export class NotificationsService {
|
|||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
private activeroute: ActivatedRoute,
|
private activeroute: ActivatedRoute,
|
||||||
private jsonstore: JsonStore,
|
private jsonstore: JsonStore,
|
||||||
private eventtrigger: EventTrigger) {
|
private eventtrigger: EventTrigger,
|
||||||
|
private backgroundservice: BackgroundService) {
|
||||||
|
|
||||||
this.storageService.get("Notifications").then((value) => {
|
this.storageService.get("Notifications").then((value) => {
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ export class NotificationsService {
|
|||||||
const id = uuidv4()
|
const id = uuidv4()
|
||||||
this.callbacks.push({type, funx, id})
|
this.callbacks.push({type, funx, id})
|
||||||
if(!object.hasOwnProperty('desktop') && object['desktop'] != false) {
|
if(!object.hasOwnProperty('desktop') && object['desktop'] != false) {
|
||||||
synchro.registerCallback('Notification',funx, type)
|
this.backgroundservice.registerBackService('Notification',funx, type)
|
||||||
}
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
@@ -178,7 +179,7 @@ export class NotificationsService {
|
|||||||
})
|
})
|
||||||
var data = JSON.parse(message.payload);
|
var data = JSON.parse(message.payload);
|
||||||
|
|
||||||
synchro.$send(data)
|
//synchro.$send(data)
|
||||||
|
|
||||||
console.log('data.Service', data.Service); // module
|
console.log('data.Service', data.Service); // module
|
||||||
console.log('data.IdObject', data.IdObject); // Object id
|
console.log('data.IdObject', data.IdObject); // Object id
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export interface wss {
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
class SynchroService {
|
class SynchroService {
|
||||||
[x: string]: any;
|
/* [x: string]: any;
|
||||||
|
|
||||||
private connection!: WebSocket;
|
private connection!: WebSocket;
|
||||||
private id: string = uuidv4();
|
private id: string = uuidv4();
|
||||||
@@ -204,12 +204,12 @@ class SynchroService {
|
|||||||
|
|
||||||
private onerror = (event: any) => {
|
private onerror = (event: any) => {
|
||||||
console.log(`[error] ${event.message}`);
|
console.log(`[error] ${event.message}`);
|
||||||
}
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const synchro = new SynchroService()
|
/* export const synchro = new SynchroService()
|
||||||
synchro.setUrl()
|
synchro.setUrl()
|
||||||
synchro.connect()
|
synchro.connect()
|
||||||
|
|
||||||
window['synchro'] = synchro
|
window['synchro'] = synchro */
|
||||||
@@ -8,7 +8,6 @@ import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popo
|
|||||||
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 { ContactsPage } from '../new-group/contacts/contacts.page';
|
import { ContactsPage } from '../new-group/contacts/contacts.page';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
|
||||||
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
||||||
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
||||||
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||||
@@ -45,7 +44,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
@Output() getDirectMessages:EventEmitter<any> = new EventEmitter<any>();
|
@Output() getDirectMessages:EventEmitter<any> = new EventEmitter<any>();
|
||||||
|
|
||||||
|
|
||||||
synchro = synchro;
|
|
||||||
chatMessageStore = ChatMessageStore
|
chatMessageStore = ChatMessageStore
|
||||||
chatUserStorage = ChatUserStorage
|
chatUserStorage = ChatUserStorage
|
||||||
|
|
||||||
@@ -198,7 +196,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
sendMessage() {
|
sendMessage() {
|
||||||
|
|
||||||
this.synchro.$send({})
|
//this.synchro.$send({})
|
||||||
|
|
||||||
let body = {
|
let body = {
|
||||||
"message":
|
"message":
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { AuthService } from 'src/app/services/auth.service';
|
|||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js';
|
import { removeDuplicate } from 'src/plugin/removeDuplicate.js';
|
||||||
import { SqliteService } from '../../../services/sqlite.service';
|
import { SqliteService } from '../../../services/sqlite.service';
|
||||||
import { synchro } from '../../../services/socket/synchro.service';
|
|
||||||
import { Platform } from '@ionic/angular';
|
import { Platform } from '@ionic/angular';
|
||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
|
|
||||||
@@ -20,8 +19,6 @@ export class AllProcessesPage implements OnInit {
|
|||||||
allProcessesList: any[] = [];
|
allProcessesList: any[] = [];
|
||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
|
|
||||||
synch = synchro;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private processesService: ProcessesService,
|
private processesService: ProcessesService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
|||||||
Reference in New Issue
Block a user