This commit is contained in:
ivan gomes
2021-11-30 09:26:36 +01:00
49 changed files with 472 additions and 238 deletions
+6 -8
View File
@@ -12,7 +12,7 @@ export class ListBoxService {
){}
filterProfile(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all') {
filterProfile(eventSource: EventListStore[] = [], profile: 'md' | 'pr' | 'all') {
return eventSource.filter((e) => e.profile == profile)
}
@@ -160,14 +160,12 @@ export class ListBoxService {
}
push(event: any, selectedDate: Date) {
console.log(new Date(event.start).getDate(), selectedDate.getDate(), new Date(event.start).getDate() >= selectedDate.getDate())
push(event: any, selectedDate: Date) {
return new Date(event.start).getMonth() == selectedDate.getMonth() &&
new Date(event.start).getFullYear() == selectedDate.getFullYear() &&
new Date(event.start).getDate() >= selectedDate.getDate()
}
return new Date(event.start).getMonth() == selectedDate.getMonth() &&
new Date(event.start).getFullYear() == selectedDate.getFullYear() &&
new Date(event.start).getDate() >= selectedDate.getDate()
}
encapsulation(eventsList:EventListStore[], profile): CustomCalendarEvent[] {
+6 -1
View File
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { ThemeService } from 'src/app/services/theme.service';
import { StorageService} from 'src/app/services/storage.service';
@Injectable({
providedIn: 'root'
@@ -13,7 +14,8 @@ export class BackgroundService {
}[] = []
constructor(
private themeservice: ThemeService
private themeservice: ThemeService,
private storageservice: StorageService
) { }
online() {
@@ -24,6 +26,7 @@ export class BackgroundService {
document.body.style.setProperty(`--color3`, "#d9d9d9");
document.body.style.setProperty(`--color4`, "#d9d9d9ee");
document.body.style.setProperty(`--color5`, "#ececec");
this.storageservice.store('networkCheckStore','online');
} else {
document.body.style.setProperty(`--color`, "#0782C9");
@@ -31,6 +34,7 @@ export class BackgroundService {
document.body.style.setProperty(`--color3`, "#0782C9");
document.body.style.setProperty(`--color4`, "#0782c9f0");
document.body.style.setProperty(`--color5`, "#45BAFF");
this.storageservice.store('networkCheckStore','online');
}
this.callBacks.forEach((e) => {
@@ -46,6 +50,7 @@ export class BackgroundService {
document.body.style.setProperty(`--color3`, "#ffb703");
document.body.style.setProperty(`--color4`, "#ffb703");
document.body.style.setProperty(`--color5`, "#ffb703");
this.storageservice.store('networkCheckStore','offline');
this.callBacks.forEach((e) => {
if (e.type == 'Offline') {
e.funx()
-1
View File
@@ -7,7 +7,6 @@ export class DateService {
constructor() { }
deferenceBetweenDays(start: any, end: any) {
const diffTime = Math.abs(end - start);
return Math.ceil(diffTime / (1000 * 60 * 60 * 24));
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ObjectService } from './object.service';
describe('ObjectService', () => {
let service: ObjectService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ObjectService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ObjectService {
constructor() { }
deepFind(obj, path) {
var paths = path.split('.')
, current = obj
, i;
for (i = 0; i < paths.length; ++i) {
if (current[paths[i]] == undefined) {
return undefined;
} else {
current = current[paths[i]];
}
}
return current;
}
}
+14 -1
View File
@@ -1,11 +1,12 @@
import { Injectable } from '@angular/core';
import { ObjectService } from './object.service';
@Injectable({
providedIn: 'root'
})
export class SortService {
constructor() { }
constructor(private ObjectService: ObjectService) { }
sortArrayISODate(myArray: any) {
if(myArray.length > 0){
@@ -14,6 +15,7 @@ export class SortService {
});
}
}
sortArrayByDate(myArray: any) {
console.log(myArray[0].taskStartDate);
if(myArray.length > 0){
@@ -22,4 +24,15 @@ export class SortService {
});
}
}
sortDate(array = [], path: string) {
return array.sort( (a,b)=> {
return new Date(this.ObjectService.deepFind(b, path)).getTime() -
new Date(this.ObjectService.deepFind(a, path)).getTime()
})
}
}
+19 -2
View File
@@ -84,7 +84,24 @@ export class PublicationsService {
return this.http.delete<any>(`${geturl}`, options);
}
<<<<<<< HEAD
//this worker obervable goes to ForkJoin as a second api call
=======
GetPublicationsID(folder:any) {
const geturl = environment.apiURL + 'presidentialActions/'+ folder +'/posts/ids';
let params = new HttpParams();
params = params.set("folderId", folder);
let options = {
headers: this.headers,
params: params
};
return this.http.get<Publication[]>(`${geturl}`, options)
}
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
GetPublications(id:any){
const geturl = environment.apiURL + 'presidentialActions/'+ id +'/posts';
let params = new HttpParams();
@@ -117,11 +134,11 @@ export class PublicationsService {
const geturl = environment.apiURL + 'presidentialActions/posts/'+ publicationId;
let params = new HttpParams();
/* params = params.set("id", publicationId); */
params = params.set("id", publicationId);
let options = {
headers: this.headers,
/* params: params */
params: params
};
return this.http.get<any>(`${geturl}`, options);
}
+1 -2
View File
@@ -24,8 +24,7 @@ export class WebNotificationsService {
private animationController: AnimationController,
private platform: Platform,
private router: Router,
private toastService: ToastService,
private zone: NgZone) { }
private toastService: ToastService) { }
webconnection() {