mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
pull made
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { models } from 'src/plugin/src';
|
||||
const { ArrayField, JsonField} = models.indexedDB.fields;
|
||||
|
||||
export class CalendarEventModel extends models.Model {
|
||||
startTime = models.CharField()
|
||||
endTime = models.CharField()
|
||||
allDay = models.BooleanField()
|
||||
event = JsonField({blank:true})
|
||||
calendarName = models.CharField()
|
||||
profile = models.CharField()
|
||||
id = models.CharField()
|
||||
CalendarId = models.CharField()
|
||||
}
|
||||
|
||||
export class EventForToday extends models.Model {
|
||||
|
||||
}
|
||||
|
||||
|
||||
models.register({
|
||||
databaseName: 'agenda'+environment.version.lastCommitNumber + environment.id,
|
||||
type: 'indexedDB',
|
||||
version: 14,
|
||||
models: [CalendarEventModel, EventForToday]
|
||||
})
|
||||
@@ -26,7 +26,10 @@ export function GET({key, localStorage, instance}) {
|
||||
}
|
||||
|
||||
} else {
|
||||
return JSON.parse(localStorage.getItem(prefix() + key))
|
||||
const restoredData = JSON.parse(localStorage.getItem(prefix() + key))
|
||||
Object.assign(instance, restoredData);
|
||||
|
||||
return restoredData
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,14 @@ export class ActionModel extends models.Model{
|
||||
ActionType = models.CharField()
|
||||
}
|
||||
|
||||
export class PublicationModel extends models.Model{
|
||||
|
||||
export class PublicationFolderModel extends models.Model{
|
||||
DateBegin = models.CharField()
|
||||
Description = models.CharField()
|
||||
Detail = models.CharField()
|
||||
}
|
||||
|
||||
export class PublicationDetailsModel extends models.Model{
|
||||
DateIndex = models.CharField()
|
||||
DocumentId = models.IntegerField({unique: true})
|
||||
ProcessId = models.CharField()
|
||||
@@ -74,12 +81,6 @@ export class PublicationModel extends models.Model{
|
||||
OrganicEntityId = models.IntegerField()
|
||||
}
|
||||
|
||||
models.register({
|
||||
databaseName: 'actions'+environment.version.lastCommitNumber + environment.id,
|
||||
type: 'indexedDB',
|
||||
version: 14,
|
||||
models: [PublicationModel, ActionModel]
|
||||
})
|
||||
|
||||
export class WebtrixUserModel extends models.Model {
|
||||
FullName = models.CharField()
|
||||
@@ -98,5 +99,5 @@ models.register({
|
||||
databaseName: 'actions'+environment.version.lastCommitNumber + environment.id,
|
||||
type: 'indexedDB',
|
||||
version: 14,
|
||||
models: [PublicationModel, ActionModel]
|
||||
models: [PublicationDetailsModel, ActionModel, PublicationFolderModel]
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TaskService } from 'src/app/services/task.service';
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
templateUrl: './events.page.html',
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { ModalController, PopoverController } from '@ionic/angular';
|
||||
@@ -23,9 +21,6 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { EventTrigger } from 'src/app/services/eventTrigger.service';
|
||||
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { ModalController, Platform } from '@ionic/angular';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { NewActionPage } from './new-action/new-action.page';
|
||||
@@ -11,12 +11,9 @@ import { Publication } from 'src/app/models/publication';
|
||||
import { ActionsOptionsPage } from 'src/app/shared/popover/actions-options/actions-options.page';
|
||||
import { EditActionPage } from './edit-action/edit-action.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ActionModel, PublicationModel } from 'src/app/models/beast-orm';
|
||||
import { ActionModel } from 'src/app/models/beast-orm';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -65,11 +62,7 @@ export class PublicationsPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private publications: PublicationsService,
|
||||
private toastService: ToastService,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService,
|
||||
private storage: Storage,
|
||||
public p: PermissionService,
|
||||
|
||||
) {
|
||||
@@ -146,18 +139,29 @@ export class PublicationsPage implements OnInit {
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
this.showLoader = false;
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
|
||||
|
||||
|
||||
|
||||
this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
|
||||
this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento')
|
||||
|
||||
ActionModel.create(folders)
|
||||
|
||||
await this.storage.set('actionsEvents', this.publicationsEventFolderList);
|
||||
await this.storage.set('actionsViagens', this.publicationsTravelFolderList);
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
(async ()=> {
|
||||
|
||||
const created = await ActionModel.create(folders)
|
||||
const stored = await ActionModel.all()
|
||||
|
||||
const notPresentOnTheRequest: ActionModel[] = stored.filter(e => {
|
||||
return !folders.find(b => e.ProcessId == b.ProcessId)
|
||||
})
|
||||
|
||||
for (let ActionModelToDelete of notPresentOnTheRequest) {
|
||||
ActionModelToDelete.delete()
|
||||
}
|
||||
|
||||
// console.log({created, stored, folders, toDeletes})
|
||||
|
||||
})()
|
||||
|
||||
|
||||
}, (error) => {
|
||||
this.showLoader = false;
|
||||
this.getFromDB()
|
||||
@@ -165,14 +169,6 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
// addActionToDB(folder) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.addactions(folder);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
getPublicationFolderMap(events: any):PublicationFolder[] {
|
||||
return events.map((data) : PublicationFolder => {
|
||||
return {
|
||||
@@ -186,27 +182,12 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
this.storage.get('actionsEvents').then((events = []) => {
|
||||
|
||||
if(Array.isArray(events)) {
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(events)
|
||||
async getFromDB() {
|
||||
|
||||
const folders: PublicationFolder[] = await ActionModel.all()
|
||||
this.showLoader = false;
|
||||
this.publicationsEventFolderList = folders
|
||||
|
||||
this.showLoader = false;
|
||||
this.publicationsEventFolderList = folders
|
||||
}
|
||||
|
||||
});
|
||||
this.storage.get('actionsViagens').then((viagens = []) => {
|
||||
|
||||
if(Array.isArray(viagens)) {
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(viagens)
|
||||
|
||||
this.publicationsTravelFolderList = folders
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async editAction(folderId?: string) {
|
||||
|
||||
@@ -15,8 +15,6 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PublicationModel } from 'src/app/models/beast-orm';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
templateUrl: './view-publications.page.html',
|
||||
@@ -44,7 +42,6 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private publications: PublicationsService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private toastService: ToastService,
|
||||
|
||||
@@ -10,7 +10,7 @@ export class CustomTaskPipe implements PipeTransform {
|
||||
|
||||
let date = new Date(fullTask.taskStartDate);
|
||||
let month = date.getMonth() + 1;
|
||||
let taskDate = date.getFullYear() + "-" + month +"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let taskDate = date.getFullYear() + "-" + month +"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
|
||||
return {
|
||||
"SerialNumber": fullTask.serialNumber,
|
||||
|
||||
@@ -10,7 +10,6 @@ import { GetTasksListType } from '../models/GetTasksListType';
|
||||
import { fullTaskList } from '../models/dailyworktask.model';
|
||||
import { ChangeProfileService } from './change-profile.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { CPSession } from '../store/documentManagement';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -26,8 +25,7 @@ export class ProcessesService {
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private changeProfileService: ChangeProfileService,
|
||||
private storageSevice: StorageService,
|
||||
private changeProfileService: ChangeProfileService
|
||||
) {
|
||||
|
||||
this.loggeduser = SessionStore.user;
|
||||
@@ -44,7 +42,8 @@ export class ProcessesService {
|
||||
|
||||
|
||||
setHeader() {
|
||||
|
||||
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
|
||||
@@ -12,7 +12,7 @@ import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-acti
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { PublicationModel } from 'src/app/models/beast-orm';
|
||||
import { PublicationDetailsModel } from 'src/app/models/beast-orm';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -107,6 +107,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
getPublicationDetail() {
|
||||
const folderId = this.folderId
|
||||
this.publications.GetPresidentialAction(folderId).subscribe(res=>{
|
||||
|
||||
// PublicationDetailsModel.create(res)
|
||||
this.publicationItem[folderId] = res
|
||||
this.storage.set(folderId+"name", res)
|
||||
}, (error) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { models } from 'src/plugin/src'
|
||||
import { models } from 'src/plugin/src';
|
||||
import { DELETE, GET, SAVE } from '../models/beast-orm-function';
|
||||
const { rewriteSave, rewriteGet, rewriteDelete } = models.core.localStorage.rewrite
|
||||
const { rewriteSave, rewriteGet, rewriteDelete } = models.core.localStorage.rewrite;
|
||||
|
||||
export class CPSession extends models.LocalStorage {
|
||||
static UserId: number = models.preset()
|
||||
@@ -23,9 +23,9 @@ models.migrate({
|
||||
version: 1,
|
||||
models: [CPSession],
|
||||
})
|
||||
|
||||
|
||||
// rewrite
|
||||
rewriteGet.connect(GET, [CPSession])
|
||||
rewriteSave.connect(SAVE, [CPSession])
|
||||
rewriteDelete.connect(DELETE, [CPSession])
|
||||
// get function
|
||||
CPSession.get()
|
||||
@@ -400,7 +400,7 @@ Model.object = ({ queryId, DBconfig, TableSchema, some = null }) => {
|
||||
methods[queryId] = [];
|
||||
const result = await ModelAPIRequest.obj(DBconfig, TableSchema).execute(_methods, queryId);
|
||||
resolve(result);
|
||||
for (let i of result) {
|
||||
for (let i in result) {
|
||||
result[i] = _a.newInstance({ TableSchema, DBconfig, dataToMerge: result[i] });
|
||||
}
|
||||
});
|
||||
@@ -424,7 +424,7 @@ Model.object = ({ queryId, DBconfig, TableSchema, some = null }) => {
|
||||
methods[queryId] = [];
|
||||
const result = await ModelAPIRequest.obj(DBconfig, TableSchema).all(_methods, queryId);
|
||||
resolve(result);
|
||||
for (let i of result) {
|
||||
for (let i in result) {
|
||||
result[i] = _a.newInstance({ TableSchema, DBconfig, dataToMerge: result[i] });
|
||||
}
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,12 +1,12 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "65ef1f575",
|
||||
"SHA": "65ef1f5757388ce1235f48997937792168a16f72",
|
||||
"shortSHA": "590ca792a",
|
||||
"SHA": "590ca792aca654b9e75cc3d1d9198a1062e8686e",
|
||||
"branch": "feature/gabinete-search",
|
||||
"lastCommitAuthor": "'Eudes Inácio'",
|
||||
"lastCommitTime": "'Mon Jul 10 14:43:15 2023 +0100'",
|
||||
"lastCommitMessage": "added missing code on set header",
|
||||
"lastCommitNumber": "5046",
|
||||
"lastCommitTime": "'Wed Jul 12 09:55:17 2023 +0100'",
|
||||
"lastCommitMessage": "draft added to diploma",
|
||||
"lastCommitNumber": "5048",
|
||||
"change": "",
|
||||
"changeStatus": "On branch feature/gabinete-search\nYour branch and 'origin/feature/gabinete-search' have diverged,\nand have 3 and 3 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/models/beast-orm-function.ts\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts\n\tmodified: src/app/store/documentManagement.ts\n\tmodified: src/app/tiny-mce/tiny-mce.page.html\n\tmodified: src/app/tiny-mce/tiny-mce.page.ts\n\tmodified: src/global.scss",
|
||||
"changeStatus": "On branch feature/gabinete-search\nYour branch and 'origin/feature/gabinete-search' have diverged,\nand have 4 and 2 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tnew file: src/app/models/agenda/AgendaModels.ts\n\tmodified: src/app/models/beast-orm-function.ts\n\tmodified: src/app/models/beast-orm.ts\n\tmodified: src/app/pages/events/events.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts\n\tmodified: src/app/pages/publications/publications.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/pipes/custom-task.pipe.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts\n\tmodified: src/app/store/documentManagement.ts\n\tmodified: src/plugin/src/models/model.js\n\tmodified: src/plugin/src/tsconfig.tsbuildinfo",
|
||||
"changeAuthor": "eudes.inacio"
|
||||
}
|
||||
Reference in New Issue
Block a user