mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
publcation moved getfromDB
This commit is contained in:
@@ -816,7 +816,9 @@ export class ChatPage implements OnInit {
|
||||
},
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then(() =>{
|
||||
this.ChatSystemService.currentRoom.roomLeave()
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
async openOptions() {
|
||||
const modal = await this.popoverController.create({
|
||||
component: ChatPopoverPage,
|
||||
cssClass: 'chat-popover',
|
||||
cssClass: 'popover-bottom',
|
||||
componentProps: {
|
||||
roomId: this.roomId,
|
||||
members: this.members,
|
||||
|
||||
@@ -89,7 +89,7 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
this.getFromDB()
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -167,6 +167,8 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}, (error) => {
|
||||
this.showLoader = false;
|
||||
this.getFromDB()
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -52,16 +52,12 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
private storage: Storage,) {
|
||||
|
||||
if(!this.publicationList[this.folderId]) {
|
||||
this.publicationList[this.folderId] = []
|
||||
this.publicationItem[this.folderId] = new PublicationFolder();
|
||||
}
|
||||
this.createPublicationList()
|
||||
|
||||
this.getFromDB();
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
|
||||
|
||||
if (params["params"]) {
|
||||
this.folderId = params["params"].folderId;
|
||||
//
|
||||
@@ -77,11 +73,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
|
||||
if(!this.publicationList[this.folderId]) {
|
||||
this.publicationList[this.folderId] = []
|
||||
this.publicationItem[this.folderId] = new PublicationFolder();
|
||||
}
|
||||
this.createPublicationList()
|
||||
|
||||
this.getFromDB();
|
||||
//this.testForkJoin()
|
||||
@@ -96,7 +88,6 @@ export class ViewPublicationsPage implements OnInit {
|
||||
//this.testForkJoin()
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
@@ -105,14 +96,21 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
if(!this.publicationList[this.folderId]) {
|
||||
this.publicationList[this.folderId] = []
|
||||
this.publicationItem[this.folderId] = new PublicationFolder();
|
||||
}
|
||||
this.createPublicationList()
|
||||
|
||||
this.getFromDB();
|
||||
}
|
||||
|
||||
|
||||
createPublicationList(folderId = this.folderId) {
|
||||
if(!this.publicationList[folderId]) {
|
||||
this.publicationList[folderId] = []
|
||||
}
|
||||
if(!this.publicationItem[folderId]) {
|
||||
this.publicationItem[folderId] = new PublicationFolder();
|
||||
}
|
||||
}
|
||||
|
||||
doRefresh = (event) => {
|
||||
//setTimeout(() => {
|
||||
//this.testForkJoin()
|
||||
@@ -165,18 +163,22 @@ export class ViewPublicationsPage implements OnInit {
|
||||
try {
|
||||
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
|
||||
|
||||
this.createPublicationList(folderId)
|
||||
let loadLater = []
|
||||
for (let publicationId of publicationIds) {
|
||||
let Publication = await this.publications.GetPublicationById(publicationId).toPromise();
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
const found = this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
if(!this.publicationIsPresent(publicationId, folderId)) {
|
||||
await this.loadPublication(publicationId, folderId)
|
||||
|
||||
if(!found) {
|
||||
PublicationModel.create(publicationDetails)
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
} else {
|
||||
loadLater.push(publicationId)
|
||||
}
|
||||
}
|
||||
|
||||
for( let publicationId of loadLater) {
|
||||
await this.loadPublication(publicationId, folderId)
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
this.storage.set(folderId, this.publicationList[folderId]);
|
||||
@@ -187,6 +189,30 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
publicationIsPresent(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
}
|
||||
publicationFind(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
}
|
||||
publicationFindIndex(publicationId, folderId) {
|
||||
return this.publicationList[folderId].findIndex( e => e.DocumentId == publicationId )
|
||||
}
|
||||
|
||||
async loadPublication(publicationId, folderId) {
|
||||
let Publication = await this.publications.GetPublicationById(publicationId).toPromise();
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
} else {
|
||||
this.publicationList[folderId][findIndex] = publicationDetails
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async AddPublication(publicationType: any, folderId: any) {
|
||||
const modal = await this.modalController.create({
|
||||
component: NewPublicationPage,
|
||||
|
||||
@@ -519,7 +519,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: ChatPopoverPage,
|
||||
cssClass: 'model profile-modal search-submodal chat-aside',
|
||||
cssClass: 'model search-submodal chat-option-aside',
|
||||
componentProps: {
|
||||
roomId: this.roomId,
|
||||
members: this.members,
|
||||
|
||||
@@ -43,10 +43,8 @@ export class ChatPopoverPage implements OnInit {
|
||||
close(action:any){
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss(action);
|
||||
this.modalController.dismiss(action)
|
||||
}
|
||||
else{
|
||||
this.popoverController.dismiss(action);
|
||||
this.modalController.dismiss(action)
|
||||
}
|
||||
}
|
||||
@@ -127,25 +125,16 @@ export class ChatPopoverPage implements OnInit {
|
||||
});
|
||||
}
|
||||
});
|
||||
this.popoverController.dismiss('delete');
|
||||
this.modalController.dismiss('delete')
|
||||
this.close('delete');
|
||||
}
|
||||
|
||||
async openChangeGroupName(){
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss('edit');
|
||||
this.modalController.dismiss('edit')
|
||||
}
|
||||
else{
|
||||
this.popoverController.dismiss('edit');
|
||||
this.modalController.dismiss('edit')
|
||||
}
|
||||
this.close('edit');
|
||||
}
|
||||
|
||||
|
||||
async addUser() {
|
||||
this.popoverController.dismiss('addUser');
|
||||
this.modalController.dismiss('addUser')
|
||||
this.close('addUser');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,10 +48,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
public p:PermissionService,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
) {
|
||||
if(!this.publicationList[this.folderId]) {
|
||||
this.publicationList[this.folderId] = []
|
||||
this.publicationItem[this.folderId] = new PublicationFolder();
|
||||
}
|
||||
this.createPublicationList()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -59,10 +56,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
if(!this.publicationList[this.folderId]) {
|
||||
this.publicationList[this.folderId] = []
|
||||
this.publicationItem[this.folderId] = new PublicationFolder();
|
||||
}
|
||||
this.createPublicationList()
|
||||
|
||||
window['app-view-publications-page-doRefresh'] = this.doRefresh
|
||||
|
||||
@@ -76,10 +70,11 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
if(!this.publicationList[this.folderId]) {
|
||||
this.publicationList[this.folderId] = []
|
||||
this.publicationItem[this.folderId] = new PublicationFolder();
|
||||
}
|
||||
|
||||
this.createPublicationList()
|
||||
|
||||
this.getFromDB();
|
||||
|
||||
this.getPublicationDetail();
|
||||
@@ -88,6 +83,17 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
createPublicationList(folderId = this.folderId) {
|
||||
if(!this.publicationList[this.folderId]) {
|
||||
this.publicationList[this.folderId] = []
|
||||
}
|
||||
if(!this.publicationItem[this.folderId]) {
|
||||
this.publicationItem[this.folderId] = new PublicationFolder();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
doRefresh =(event) => {
|
||||
|
||||
this.getPublicationDetail();
|
||||
@@ -119,18 +125,22 @@ export class ViewPublicationsPage implements OnInit {
|
||||
try {
|
||||
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
|
||||
|
||||
this.createPublicationList(folderId)
|
||||
let loadLater = []
|
||||
for (let publicationId of publicationIds) {
|
||||
let Publication = await this.publications.GetPublicationById(publicationId).toPromise();
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
const found = this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
if(!this.publicationIsPresent(publicationId, folderId)) {
|
||||
await this.loadPublication(publicationId, folderId)
|
||||
|
||||
if(!found) {
|
||||
/* PublicationModel.create(publicationDetails) */
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
} else {
|
||||
loadLater.push(publicationId)
|
||||
}
|
||||
}
|
||||
|
||||
for( let publicationId of loadLater) {
|
||||
await this.loadPublication(publicationId, folderId)
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
this.storage.set(folderId, this.publicationList[folderId]);
|
||||
@@ -139,6 +149,29 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
publicationIsPresent(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
}
|
||||
publicationFind(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
}
|
||||
publicationFindIndex(publicationId, folderId) {
|
||||
return this.publicationList[folderId].findIndex( e => e.DocumentId == publicationId )
|
||||
}
|
||||
|
||||
async loadPublication(publicationId, folderId) {
|
||||
let Publication = await this.publications.GetPublicationById(publicationId).toPromise();
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
} else {
|
||||
this.publicationList[folderId][findIndex] = publicationDetails
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@ import { oaprProd } from './suport/oapr'
|
||||
import { doneITProd } from './suport/doneIt'
|
||||
|
||||
|
||||
export const environment: Environment = oaprProd;
|
||||
export const environment: Environment = doneITProd;
|
||||
@@ -3,4 +3,4 @@ import { oaprDev } from './suport/oapr'
|
||||
import { doneITDev } from './suport/doneIt'
|
||||
|
||||
|
||||
export const environment: Environment = oaprDev;
|
||||
export const environment: Environment = doneITDev;
|
||||
@@ -348,6 +348,32 @@ $app-theme: mat-light-theme(
|
||||
right: 0 !important;
|
||||
top: unset !important;
|
||||
}
|
||||
|
||||
.popover-bottom::part(content), .popover-bottom .popover-content {
|
||||
top: unset !important;
|
||||
bottom: 0px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0px !important;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.chat-option-aside::part(content), .chat-option-aside .modal-wrapper{
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
height: 90%;
|
||||
max-width: 100%;
|
||||
top: -40px;
|
||||
border-radius: 0 0 25px 25px;
|
||||
-webkit-border-radius: 0 0 25px 25px;
|
||||
-moz-border-radius: 0 0 25px 25px;
|
||||
-ms-border-radius: 0 0 25px 25px;
|
||||
-o-border-radius: 0 0 25px 25px;
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.exp-options .popover-content {
|
||||
width: 100% !important;
|
||||
left: 0 !important;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "52745817e",
|
||||
"SHA": "52745817ef92023bca3b7e78d8e2090dfca9d9bd",
|
||||
"shortSHA": "2a4a22c1d",
|
||||
"SHA": "2a4a22c1d59ec83d01d2fe500140cbc6dffd5dfc",
|
||||
"branch": "no_bug_movemente",
|
||||
"lastCommitAuthor": "'Eudes Inácio'",
|
||||
"lastCommitTime": "'Fri Mar 10 09:11:13 2023 +0100'",
|
||||
"lastCommitMessage": "pull made 09:11_10/03/23",
|
||||
"lastCommitNumber": "4863",
|
||||
"lastCommitTime": "'Fri Mar 10 14:45:12 2023 +0100'",
|
||||
"lastCommitMessage": "enviroment changed",
|
||||
"lastCommitNumber": "4864",
|
||||
"change": "",
|
||||
"changeStatus": "On branch no_bug_movemente\nYour branch is behind 'origin/no_bug_movemente' by 3 commits, and can be fast-forwarded.\n (use \"git pull\" to update your local branch)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/environments/environment.prod.ts\n\tmodified: src/environments/environment.ts",
|
||||
"changeStatus": "On branch no_bug_movemente\nYour branch and 'origin/no_bug_movemente' have diverged,\nand have 1 and 5 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/pages/chat/chat.page.ts\n\tmodified: src/app/pages/chat/group-messages/group-messages.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/shared/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/popover/chat-popover/chat-popover.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts\n\tmodified: src/environments/environment.prod.ts\n\tmodified: src/environments/environment.ts\n\tmodified: src/theme/variables.scss",
|
||||
"changeAuthor": "eudes.inacio"
|
||||
}
|
||||
Reference in New Issue
Block a user