+ *ngFor="let publication of publicationListStorage.documents[folderId]"
+ (click)="goToPublicationDetail(publication.DocumentId)"
+ >
30" class="post-img">
diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts
index 1f5df530a..d523f38c3 100644
--- a/src/app/pages/publications/view-publications/view-publications.page.ts
+++ b/src/app/pages/publications/view-publications/view-publications.page.ts
@@ -5,6 +5,9 @@ import { Publication } from 'src/app/models/publication';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { LoadingService } from 'src/app/services/loading.service';
import { PublicationsService } from 'src/app/services/publications.service';
+import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
+import { PublicationListStorage } from 'src/app/store/publication-list.service';
+import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
import { NewPublicationPage } from '../new-publication/new-publication.page';
import { PublicationDetailPage } from './publication-detail/publication-detail.page';
@@ -22,24 +25,29 @@ export class ViewPublicationsPage implements OnInit {
folderId:string;
error: any;
+ publicationListStorage = PublicationListStorage
+ //
+ publicationEventFolderStorage = PublicationEventFolderStorage
+ publicationTravelFolderService = PublicationTravelFolderStore
+
constructor( private loadingController: LoadingService,
private modalController: ModalController,
private publications: PublicationsService,
private activatedRoute: ActivatedRoute,
private router: Router )
{
- this.item = new PublicationFolder();
- this.activatedRoute.paramMap.subscribe(params => {
- console.log(params);
-
- if(params["params"]) {
- this.folderId = params["params"].folderId;
- console.log(params["params"]);
- }
-
- });
- }
+ this.item = new PublicationFolder();
+ this.activatedRoute.paramMap.subscribe(params => {
+ console.log(params);
+
+ if(params["params"]) {
+ this.folderId = params["params"].folderId;
+ console.log(params["params"]);
+ }
+
+ });
+ }
ngOnInit() {
@@ -66,7 +74,6 @@ export class ViewPublicationsPage implements OnInit {
this.getPublications();
setTimeout(() => {
- this.getPublications();
this.getPublicationDetail();
event.target.complete();
}, 3000);
@@ -84,18 +91,18 @@ export class ViewPublicationsPage implements OnInit {
}
getPublicationDetail() {
- this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
- console.log(res);
- this.item = res;
- });
+ let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
+ this.item = allActions.find((e)=> e.ProcessId == this.folderId)
}
getPublications() {
this.showLoader = true;
-
+ const folderId = this.folderId
this.publications.GetPublications(this.folderId).subscribe(res=>{
- this.publicationList = new Array();
console.log(res);
+
+ let data = [];
+
res.forEach(element => {
let itemImage = {
title: 'Title',
@@ -114,15 +121,20 @@ export class ViewPublicationsPage implements OnInit {
"OriginalFileName": '',
"FileExtension": '',
}
- this.publicationList.push(item);
+
+ // this.publicationList.push(item);
+ data.push(item)
+
});
- console.log(this.publicationList);
+
+ this.publicationListStorage.add(folderId, this.publicationList)
+
this.showLoader = false;
},
(error)=>{
if(error.status == '404'){
this.error = 'Sem publicações disponíveis!';
- this.publicationList=null;
+ this.publicationList= [];
}
this.showLoader = false;
diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts
index 9b5b4da46..f89044eaf 100644
--- a/src/app/services/publications.service.ts
+++ b/src/app/services/publications.service.ts
@@ -87,7 +87,6 @@ export class PublicationsService {
params: params
};
return this.http.get
(`${geturl}`, options)
- .pipe(catchError(this.handleError));
}
GetPublicationById( publicationId:any){
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts
index 279c9770e..6b3fbd484 100644
--- a/src/app/shared/agenda/edit-event/edit-event.page.ts
+++ b/src/app/shared/agenda/edit-event/edit-event.page.ts
@@ -182,6 +182,11 @@ export class EditEventPage implements OnInit {
injectValidation() {
+ if (typeof(this.postEvent.EventRecurrence.Type) == 'number') {
+ const str: any = this.postEvent.EventRecurrence.Type.toString()
+ this.postEvent.EventRecurrence.Type = str
+ }
+
this.Form = new FormGroup({
Subject: new FormControl(this.postEvent.Subject, [
Validators.required,
diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts
index 6cb7da1b5..7003f7664 100644
--- a/src/app/shared/agenda/new-event/new-event.page.ts
+++ b/src/app/shared/agenda/new-event/new-event.page.ts
@@ -24,6 +24,7 @@ import { ThemePalette } from '@angular/material/core';
import { NgZone, ViewChild } from '@angular/core';
import { FormGroup, Validators } from '@angular/forms';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
+import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
const moment = _rollupMoment || _moment;
@@ -227,6 +228,11 @@ export class NewEventPage implements OnInit {
injectValidation() {
+ if (typeof(this.postEvent.EventRecurrence.Type) == 'number') {
+ const str: any = this.postEvent.EventRecurrence.Type.toString()
+ this.postEvent.EventRecurrence.Type = str
+ }
+
this.Form = new FormGroup({
Subject: new FormControl(this.postEvent.Subject, [
Validators.required,
@@ -340,6 +346,8 @@ export class NewEventPage implements OnInit {
}
}
+
+
async save() {
this.injectValidation()
diff --git a/src/app/shared/agenda/view-event/view-event.page.ts b/src/app/shared/agenda/view-event/view-event.page.ts
index 52b9fa115..d6468e6a8 100644
--- a/src/app/shared/agenda/view-event/view-event.page.ts
+++ b/src/app/shared/agenda/view-event/view-event.page.ts
@@ -13,6 +13,7 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/
import { ChatPopoverPage } from '../../popover/chat-popover/chat-popover.page';
import { OptsExpedientePage } from '../../popover/opts-expediente/opts-expediente.page';
import { ToastService } from 'src/app/services/toast.service';
+import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
@Component({
selector: 'app-view-event',
@@ -109,12 +110,32 @@ export class ViewEventPage implements OnInit {
;
}
- deleteEvent(){
- this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
- {
+ async deleteEvent(){
+
+ if (this.loadedEvent.IsRecurring) {
+
+ } else {
+ this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () => {
this.toastService.successMessage('Evento apagado');
this.close();
});
+ }
+
+ }
+
+ async deleteRecurringEvent() {
+
+ const modal = await this.modalController.create({
+ component: EliminateEventPage,
+ componentProps: {},
+ cssClass: 'discart-expedient-modal',
+
+ });
+ await modal.present();
+ modal.onDidDismiss().then((res) => {
+
+ });
+
}
getAttachments(eventId){
diff --git a/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.scss b/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.scss
index 7b166bc33..d5c9b1208 100644
--- a/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.scss
+++ b/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.scss
@@ -60,7 +60,6 @@ ion-item{
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
- margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
diff --git a/src/app/shared/gabinete-digital/despachos/despachos.page.scss b/src/app/shared/gabinete-digital/despachos/despachos.page.scss
index 233a9605f..d8be65f71 100644
--- a/src/app/shared/gabinete-digital/despachos/despachos.page.scss
+++ b/src/app/shared/gabinete-digital/despachos/despachos.page.scss
@@ -44,7 +44,6 @@ ion-item{
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
- margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
diff --git a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.scss b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.scss
index d9c23a826..69e7608e5 100644
--- a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.scss
+++ b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.scss
@@ -54,7 +54,6 @@ ion-item{
.item {
background-color: var(--white);
margin: 0 auto;
- margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
diff --git a/src/app/shared/gabinete-digital/diplomas/diplomas.page.scss b/src/app/shared/gabinete-digital/diplomas/diplomas.page.scss
index cec62ca66..f93c4bd0f 100644
--- a/src/app/shared/gabinete-digital/diplomas/diplomas.page.scss
+++ b/src/app/shared/gabinete-digital/diplomas/diplomas.page.scss
@@ -43,7 +43,6 @@ ion-item{
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
- margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
diff --git a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.scss b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.scss
index 4f2f62165..706482f8a 100644
--- a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.scss
+++ b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.scss
@@ -43,7 +43,6 @@ ion-item{
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
- margin-bottom: 10px;
overflow: auto;
}
.div-content-expediente{
diff --git a/src/app/shared/gabinete-digital/expedients/expedients.page.scss b/src/app/shared/gabinete-digital/expedients/expedients.page.scss
index 4f2f62165..706482f8a 100644
--- a/src/app/shared/gabinete-digital/expedients/expedients.page.scss
+++ b/src/app/shared/gabinete-digital/expedients/expedients.page.scss
@@ -43,7 +43,6 @@ ion-item{
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
- margin-bottom: 10px;
overflow: auto;
}
.div-content-expediente{
diff --git a/src/app/shared/gabinete-digital/pedidos/pedidos.page.scss b/src/app/shared/gabinete-digital/pedidos/pedidos.page.scss
index 5f7b728e6..a07a05438 100644
--- a/src/app/shared/gabinete-digital/pedidos/pedidos.page.scss
+++ b/src/app/shared/gabinete-digital/pedidos/pedidos.page.scss
@@ -43,7 +43,6 @@ ion-item{
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
- margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
diff --git a/src/app/shared/gabinete-digital/pendentes/pendentes.page.scss b/src/app/shared/gabinete-digital/pendentes/pendentes.page.scss
index 7f5b9496b..6bfd2870a 100644
--- a/src/app/shared/gabinete-digital/pendentes/pendentes.page.scss
+++ b/src/app/shared/gabinete-digital/pendentes/pendentes.page.scss
@@ -43,7 +43,6 @@ ion-item{
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
- margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
diff --git a/src/app/shared/publication/view-publications/view-publications.page.html b/src/app/shared/publication/view-publications/view-publications.page.html
index 4a8950b02..b8b4f2aa0 100644
--- a/src/app/shared/publication/view-publications/view-publications.page.html
+++ b/src/app/shared/publication/view-publications/view-publications.page.html
@@ -34,7 +34,7 @@
30" class="mb-10 post-img width-md-100">

diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts
index 3cb0a5e9a..3b7e8a522 100644
--- a/src/app/shared/publication/view-publications/view-publications.page.ts
+++ b/src/app/shared/publication/view-publications/view-publications.page.ts
@@ -6,7 +6,9 @@ import { LoadingService } from 'src/app/services/loading.service';
import { PublicationsService } from 'src/app/services/publications.service';
import { PublicationDetailPage } from 'src/app/pages/publications/publication-detail/publication-detail.page';
import { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';
-
+import { PublicationListStorage } from 'src/app/store/publication-list.service'
+import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
+import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
@Component({
selector: 'app-view-publications',
templateUrl: './view-publications.page.html',
@@ -28,13 +30,19 @@ export class ViewPublicationsPage implements OnInit {
@Output() closeDesktopComponent = new EventEmitter
();
@Output() goBacktoPublicationDetails = new EventEmitter();
+
+
+ publicationListStorage = PublicationListStorage
+ //
+ publicationEventFolderStorage = PublicationEventFolderStorage
+ publicationTravelFolderService = PublicationTravelFolderStore
+
constructor(
private loadingController: LoadingService,
private modalController: ModalController,
private publications: PublicationsService,
) {
this.item = new PublicationFolder();
-
}
ngOnInit() {
@@ -49,42 +57,47 @@ export class ViewPublicationsPage implements OnInit {
}
ngOnChanges(changes: any): void {
- console.log(this.folderId)
if(typeof(this.folderId) == 'object') {
this.folderId = this.folderId['ProcessId']
}
- this.getPublications();
- this.getPublicationDetail();
+ setTimeout(()=>{
+ this.getPublications();
+ this.getPublicationDetail();
+ }, 100)
+
+
}
doRefresh(event) {
this.getPublications();
setTimeout(() => {
- this.getPublications();
this.getPublicationDetail();
event.target.complete();
}, 3000);
}
- close(){
+
+ close() {
this.closeDesktopComponent.emit();
}
getPublicationDetail() {
- this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
- console.log(res);
- this.item = res;
- });
+
+ let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
+ this.item = allActions.find((e)=> e.ProcessId == this.folderId)
+
}
- getPublications(){
+ getPublications() {
this.showLoader = true;
- this.publications.GetPublications(this.folderId).subscribe(res=>{
+ const folderId = this.folderId
+
+ this.publications.GetPublications(folderId).subscribe(res=> {
this.publicationList = new Array();
- console.log(res);
+
res.forEach(element => {
let itemImage = {
title: 'Title',
@@ -105,19 +118,21 @@ export class ViewPublicationsPage implements OnInit {
}
this.publicationList.push(item);
});
- console.log(this.publicationList);
+
+ this.publicationListStorage.add(folderId, this.publicationList)
+
this.showLoader = false;
},
(error)=>{
- if(error.status == '404'){
+ if(error.status == '404') {
this.error = 'Sem publicações disponíveis!';
- this.publicationList=null;
+ // this.publicationList = null;
}
this.showLoader = false;
- });
-
+ })
+
}
async AddPublication(publicationType:any, folderId:any) {
@@ -145,7 +160,6 @@ export class ViewPublicationsPage implements OnInit {
}
-
async viewPublicationDetail(publicationId:string) {
console.log(publicationId);
@@ -170,5 +184,4 @@ export class ViewPublicationsPage implements OnInit {
}
-
}
diff --git a/src/app/store/calendar.service.ts b/src/app/store/calendar.service.ts
index adb006069..9028b36bf 100644
--- a/src/app/store/calendar.service.ts
+++ b/src/app/store/calendar.service.ts
@@ -37,13 +37,20 @@ export class CalendarService {
}
ResetList(eventSource: eventSource[]) {
- this._eventSource = eventSource
+ this._eventSource = eventSource
+
+ setTimeout(() => {
+ this.localstoreService.set(this.keyName, this._eventSource)
+ }, 10)
+
}
get eventSource() {
return this._eventSource
}
+
+
removeRange(rangeStartDate, rangeEndDate, profile) {
this._eventSource = this._eventSource.filter((e)=> {
if(new Date(rangeStartDate).getTime() <= new Date(e.startTime).getTime() &&
diff --git a/src/app/store/expediente-storage-service.service.spec.ts b/src/app/store/expediente-storage-service.service.spec.ts
new file mode 100644
index 000000000..274cd90d2
--- /dev/null
+++ b/src/app/store/expediente-storage-service.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { ExpedienteStorageServiceService } from './expediente-storage-service.service';
+
+describe('ExpedienteStorageServiceService', () => {
+ let service: ExpedienteStorageServiceService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(ExpedienteStorageServiceService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/store/expediente-storage-service.service.ts b/src/app/store/expediente-storage-service.service.ts
new file mode 100644
index 000000000..759256a8e
--- /dev/null
+++ b/src/app/store/expediente-storage-service.service.ts
@@ -0,0 +1,61 @@
+import { Injectable } from '@angular/core';
+import { Event } from '../models/event.model';
+import { localstoreService } from './localstore.service'
+import { AES, enc, SHA1 } from 'crypto-js'
+
+@Injectable({
+ providedIn: 'root'
+})
+
+// shared data used in home and gabinete
+class ExpedienteStorageServiceService {
+
+ // main data
+ private _list: Event[]
+ private _count = 0
+ // local storage keyName
+ private keyName: string;
+
+ constructor() {
+
+ this.keyName = (SHA1(this.constructor.name+ 'ExpedienteStorage/forAll')).toString()
+
+ setTimeout(()=>{
+ let restore = localstoreService.get(this.keyName, [])
+ this._list = restore.list || []
+ this._count = restore.count || 0
+ }, 10)
+
+ }
+
+ get list() {
+ return this._list
+ }
+
+ get count() {
+ return this._count
+ }
+ set count(value) {
+ this._count = value
+ }
+
+ reset(list: any) {
+ this._list = list
+
+ this.count = this._list.length
+ this.save(this._list)
+ }
+
+ private save(list: any) {
+ setTimeout(()=>{
+ localstoreService.set(this.keyName, {
+ list: list,
+ count: this.count
+ })
+ }, 10)
+ }
+
+}
+
+
+export const ExpedienteStorage = new ExpedienteStorageServiceService()
\ No newline at end of file
diff --git a/src/app/store/localstore.service.ts b/src/app/store/localstore.service.ts
index 9bdb572d1..b51e0115a 100644
--- a/src/app/store/localstore.service.ts
+++ b/src/app/store/localstore.service.ts
@@ -56,3 +56,5 @@ export class LocalstoreService {
}
}
+
+export const localstoreService = new LocalstoreService()
diff --git a/src/app/store/presidential-actions-store.service.spec.ts b/src/app/store/presidential-actions-store.service.spec.ts
new file mode 100644
index 000000000..eade32cff
--- /dev/null
+++ b/src/app/store/presidential-actions-store.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { PresidentialActionsStoreService } from './presidential-actions-store.service';
+
+describe('PresidentialActionsStoreService', () => {
+ let service: PresidentialActionsStoreService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(PresidentialActionsStoreService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/store/presidential-actions-store.service.ts b/src/app/store/presidential-actions-store.service.ts
new file mode 100644
index 000000000..9e48b54f5
--- /dev/null
+++ b/src/app/store/presidential-actions-store.service.ts
@@ -0,0 +1,46 @@
+import { Injectable } from '@angular/core';
+import { localstoreService } from './localstore.service'
+import { AES, enc, SHA1 } from 'crypto-js'
+import { Publication } from 'src/app/models/publication';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class PresidentialActionsStoreService {
+
+ // main data
+ private _list: Publication[] = []
+ // local storage keyName
+ private keyName: string;
+
+ constructor() {
+
+ this.keyName = (SHA1(this.constructor.name+ 'presidentialActions/local')).toString()
+
+ setTimeout(()=>{
+ let restore = localstoreService.get(this.keyName, [])
+ this._list = restore
+ }, 10)
+
+ }
+
+ get list() {
+ return this._list
+ }
+
+ reset(list: Publication[]) {
+ this._list = list
+
+ this.save(this._list)
+ }
+
+ private save(list: Publication[]) {
+ setTimeout(()=> {
+ localstoreService.set(this.keyName, list)
+ }, 10)
+ }
+
+}
+
+
+export const PresidentialActionsStore = new PresidentialActionsStoreService()
\ No newline at end of file
diff --git a/src/app/store/publication-event-folder.service.spec.ts b/src/app/store/publication-event-folder.service.spec.ts
new file mode 100644
index 000000000..61516ad83
--- /dev/null
+++ b/src/app/store/publication-event-folder.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { PublicationEventFolderService } from './publication-event-folder.service';
+
+describe('PublicationEventFolderService', () => {
+ let service: PublicationEventFolderService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(PublicationEventFolderService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/store/publication-event-folder.service.ts b/src/app/store/publication-event-folder.service.ts
new file mode 100644
index 000000000..cabdba605
--- /dev/null
+++ b/src/app/store/publication-event-folder.service.ts
@@ -0,0 +1,43 @@
+import { Injectable } from '@angular/core';
+import { localstoreService } from './localstore.service'
+import { SHA1 } from 'crypto-js'
+import { PublicationFolder } from '../models/publicationfolder';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class PublicationEventFolderService {
+ // main data
+ private _list: PublicationFolder[] = []
+ // local storage keyName
+ private keyName: string;
+
+ constructor() {
+
+ this.keyName = (SHA1(this.constructor.name+ 'PublicationEventFolder/local')).toString()
+
+ setTimeout(()=>{
+ let restore = localstoreService.get(this.keyName, [])
+ this._list = restore
+ }, 10)
+
+ }
+
+ get list() {
+ return this._list
+ }
+
+ reset(list: PublicationFolder[]) {
+ this._list = list
+
+ this.save(this._list)
+ }
+
+ private save(list: PublicationFolder[]) {
+ setTimeout(()=> {
+ localstoreService.set(this.keyName, list)
+ }, 10)
+ }
+}
+
+export const PublicationEventFolderStorage = new PublicationEventFolderService()
\ No newline at end of file
diff --git a/src/app/store/publication-list.service.spec.ts b/src/app/store/publication-list.service.spec.ts
new file mode 100644
index 000000000..c87726648
--- /dev/null
+++ b/src/app/store/publication-list.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { PublicationListService } from './publication-list.service';
+
+describe('PublicationListService', () => {
+ let service: PublicationListService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(PublicationListService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/store/publication-list.service.ts b/src/app/store/publication-list.service.ts
new file mode 100644
index 000000000..cd507450b
--- /dev/null
+++ b/src/app/store/publication-list.service.ts
@@ -0,0 +1,46 @@
+import { Injectable } from '@angular/core'
+import { Publication } from 'src/app/models/publication'
+import { localstoreService } from './localstore.service'
+import { SHA1 } from 'crypto-js'
+
+@Injectable({
+ providedIn: 'root'
+})
+export class PublicationListService {
+
+ // main data
+ private _document: Publication[] = []
+ // local storage keyName
+ private keyName: string;
+
+ constructor() {
+
+ this.keyName = (SHA1(this.constructor.name+ 'view-publication-list/local')).toString()
+
+ setTimeout(()=>{
+ let restore = localstoreService.get(this.keyName, [])
+ this._document = restore
+ }, 10)
+
+ }
+
+ get documents() {
+ return this._document
+ }
+
+ getDocument(folderId: string) {
+ return this._document[folderId]
+ }
+
+ add(folderId, document) {
+ this._document[folderId] = document
+
+ setTimeout(()=> {
+ localstoreService.set(this.keyName, this._document)
+ }, 100)
+ }
+
+}
+
+
+export const PublicationListStorage = new PublicationListService()
\ No newline at end of file
diff --git a/src/app/store/publication-travel-folder.service.spec.ts b/src/app/store/publication-travel-folder.service.spec.ts
new file mode 100644
index 000000000..19bfb9971
--- /dev/null
+++ b/src/app/store/publication-travel-folder.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { PublicationTravelFolderService } from './publication-travel-folder.service';
+
+describe('PublicationTravelFolderService', () => {
+ let service: PublicationTravelFolderService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(PublicationTravelFolderService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/store/publication-travel-folder.service.ts b/src/app/store/publication-travel-folder.service.ts
new file mode 100644
index 000000000..7bd4dadaa
--- /dev/null
+++ b/src/app/store/publication-travel-folder.service.ts
@@ -0,0 +1,46 @@
+import { Injectable } from '@angular/core';
+import { localstoreService } from './localstore.service'
+import { SHA1 } from 'crypto-js'
+import { Publication } from 'src/app/models/publication';
+import { PublicationFolder } from '../models/publicationfolder';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class PublicationTravelFolderService {
+
+ // main data
+ private _list: PublicationFolder[] = []
+ // local storage keyName
+ private keyName: string;
+
+ constructor() {
+
+ this.keyName = (SHA1(this.constructor.name+ ' PublicationTravelFolder/local')).toString()
+
+ setTimeout(()=>{
+ let restore = localstoreService.get(this.keyName, [])
+ this._list = restore
+ }, 10)
+
+ }
+
+ get list() {
+ return this._list
+ }
+
+ reset(list: PublicationFolder[]) {
+ this._list = list
+
+ this.save(this._list)
+ }
+
+ private save(list: PublicationFolder[]) {
+ setTimeout(()=> {
+ localstoreService.set(this.keyName, list)
+ }, 10)
+ }
+}
+
+
+export const PublicationTravelFolderStore = new PublicationTravelFolderService()
\ No newline at end of file
diff --git a/src/app/store/to-day-event-storage.service.spec.ts b/src/app/store/to-day-event-storage.service.spec.ts
new file mode 100644
index 000000000..801f71da6
--- /dev/null
+++ b/src/app/store/to-day-event-storage.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { ToDayEventStorageService } from './to-day-event-storage.service';
+
+describe('ToDayEventStorageService', () => {
+ let service: ToDayEventStorageService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(ToDayEventStorageService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/store/to-day-event-storage.service.ts b/src/app/store/to-day-event-storage.service.ts
new file mode 100644
index 000000000..5b44b1537
--- /dev/null
+++ b/src/app/store/to-day-event-storage.service.ts
@@ -0,0 +1,60 @@
+import { Injectable } from '@angular/core';
+import { Event } from '../models/event.model';
+import { localstoreService } from './localstore.service'
+import { AES, enc, SHA1 } from 'crypto-js'
+
+@Injectable({
+ providedIn: 'root'
+})
+
+export class ToDayEventStorageService {
+
+ // main data
+ private _eventsList: Event[]
+ // local storage keyName
+ private keyName: string;
+ private _count = 0
+
+ constructor() {
+
+ this.keyName = (SHA1(this.constructor.name+ 'home/eventSource')).toString()
+
+
+ setTimeout(()=>{
+ let restore = localstoreService.get(this.keyName, {})
+ this._eventsList = restore.eventsList || []
+ this._count = restore.count || 0
+ }, 10)
+
+ }
+
+ get eventsList() {
+ return this._eventsList
+ }
+ get count() {
+ return this._count
+ }
+ set count(value) {
+ this._count = value
+ }
+
+ reset(eventsList: Event[]) {
+ this._eventsList = eventsList
+
+ this.count = this._eventsList.length
+ this.save(this._eventsList)
+ }
+
+ private save(eventsList: Event[]) {
+ setTimeout(()=>{
+ localstoreService.set(this.keyName,{
+ eventsList,
+ count: this._eventsList
+ })
+ }, 10)
+
+ }
+
+}
+
+export const ToDayEventStorage = new ToDayEventStorageService()
\ No newline at end of file