mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
teste/route
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
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.list || []
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get list() {
|
||||
return this._list || []
|
||||
}
|
||||
|
||||
reset(list: PublicationFolder[]) {
|
||||
this._list = list || []
|
||||
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save() {
|
||||
setTimeout(()=> {
|
||||
localstoreService.set(this.keyName, {
|
||||
list: this._list || []
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
|
||||
export const PublicationEventFolderStorage = new PublicationEventFolderService()
|
||||
@@ -1,16 +0,0 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
@@ -1,50 +0,0 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { localstoreService } from './localstore.service'
|
||||
import { SHA1 } from 'crypto-js'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PublicationListService {
|
||||
|
||||
// main data
|
||||
private _document = {}
|
||||
// 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.document || {}
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get documents() {
|
||||
return this._document
|
||||
}
|
||||
|
||||
getDocument(folderId) {
|
||||
return this._document[folderId]
|
||||
}
|
||||
|
||||
|
||||
add(folderId, document = []) {
|
||||
this._document[folderId] = document
|
||||
|
||||
|
||||
|
||||
setTimeout(()=> {
|
||||
localstoreService.set(this.keyName, {
|
||||
document: this._document
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
export const PublicationListStorage = new PublicationListService()
|
||||
@@ -1,16 +0,0 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
@@ -1,48 +0,0 @@
|
||||
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.list
|
||||
}, 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: this._list
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const PublicationTravelFolderStore = new PublicationTravelFolderService()
|
||||
Reference in New Issue
Block a user