update badge das notificações

This commit is contained in:
Eudes Inácio
2023-08-20 18:09:10 +01:00
31 changed files with 464 additions and 237 deletions
+1
View File
@@ -23,6 +23,7 @@ export class MessageModel extends models.Model {
localReference = models.CharField({blank:true, unique: true})
attachments = ArrayField({blank:true})
file = JsonField({blank:true})
UploadAttachmentsTemp = models.IntegerField()
async getAttachments() {
console.log('this[id]', this['id'])
+1
View File
@@ -94,6 +94,7 @@ export interface Message {
fileBase64: string
}
hasFile: boolean
UploadAttachmentsTemp: number
}
@@ -396,6 +396,7 @@ export class NewEventPage implements OnInit {
try {
const CalendarId = this.selectedCalendarId()
this.postEvent.CalendarId = CalendarId
if(this.loggeduser.Profile == 'MDGPR') {
@@ -406,12 +407,16 @@ export class NewEventPage implements OnInit {
else if(this.loggeduser.Profile == 'PR') {
const CalendarId = this.selectedCalendarId()
this.postEvent.CalendarId = CalendarId
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
this.hhtpErrorHandle.httpsSucessMessagge('new event')
} else {
const CalendarId = this.selectedCalendarId()
this.postEvent.CalendarId = CalendarId
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
this.hhtpErrorHandle.httpsSucessMessagge('new event')
@@ -47,19 +47,19 @@
</ion-list>
</div>
<ion-virtual-scroll [items]="users" approxItemHeight="70px" [headerFn]="separateLetter">
<div *ngFor="let userContainer of userContainer | keyvalue;" >
<div class="item-divider" *virtualHeader="let header">
<ion-label>{{header}}</ion-label>
<div class="item-divider">
<ion-label>{{ userContainer.key }}</ion-label>
</div>
<div *virtualItem="let user" class="item-checkbox">
<ion-checkbox (ionChange)="selectedContact(user)" color="primary"></ion-checkbox>
<p>{{user.name}}</p>
<ion-icon class="{{user.status}}" name="ellipse"></ion-icon>
<div *ngFor="let user of userContainer.value" class="d-flex px-20 align-center">
<ion-checkbox [(ngModel)]="user.isChecked" color="primary" (click)="selectedContact(user)"></ion-checkbox>
<ion-label class="flex-grow-1 px-10">{{user.name}}</ion-label>
<div class="icon"><ion-icon class="{{user.status}}" name="ellipse"></ion-icon></div>
</div>
</ion-virtual-scroll>
</div>
</div>
</ion-content>
@@ -32,6 +32,10 @@ export class GroupContactsPage implements OnInit {
groupName:string;
selectedUserList:any;
sessionStore = SessionStore
objectUserSingleStone = []
userContainer = {}
constructor(
private modalController: ModalController,
@@ -81,6 +85,30 @@ export class GroupContactsPage implements OnInit {
}
return 0;
});
for( const user of this.users) {
const foundUser = this.objectUserSingleStone.find( e => e.name == user.name)
if(!foundUser) {
this.objectUserSingleStone.push(user)
}
}
for(const user of this.objectUserSingleStone) {
const firstLetter = user.name.charAt(0)
if(!this.userContainer[firstLetter]) {
this.userContainer[firstLetter] = [user]
} else {
this.userContainer[firstLetter].push(user)
}
}
this.showLoader = false;
@@ -178,6 +206,26 @@ export class GroupContactsPage implements OnInit {
})
this.users = users
let a = this.objectUserSingleStone.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase()))
let b = {}
for(const user of a) {
const firstLetter = user.name.charAt(0)
if(!b[firstLetter]) {
b[firstLetter] = [user]
} else {
b[firstLetter].push(user)
}
}
this.userContainer = b
}
@@ -185,9 +233,16 @@ export class GroupContactsPage implements OnInit {
}
selectedContact(user:any){
/* this.groupName = this.room.name; */
user.isChecked = !user.isChecked;
selectedContact(user:any) {
/* this.groupName = this.room.name; */
if(user.isChecked != true ) {
user.isChecked = false
} else {
user.isChecked = true
}
const userIndex = this.objectUserSingleStone.findIndex((e) => e._id == user._id)
this.objectUserSingleStone[userIndex].isChecked = user.isChecked
}
@@ -32,7 +32,7 @@
</ion-refresher>
<div class="main-content">
<ion-progress-bar class="position-absolute" type="indeterminate" *ngIf="loading"></ion-progress-bar>
<ion-virtual-scroll [items]="userList" approxItemHeight="70px" [headerFn]="separateLetter">
<ion-virtual-scroll [items]="ChatSystemService.users | filter:textSearch: 'name' " approxItemHeight="70px" [headerFn]="separateLetter">
<div class="item-divider" *virtualHeader="let header">
<ion-label>{{header}}</ion-label>
+2 -1
View File
@@ -1003,6 +1003,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
openFile(pdfString, filename, type) {
const blob = this.b64toBlob(pdfString, type)
console.log(blob)
let pathFile = ''
const fileName = filename
const contentFile = blob
@@ -1012,7 +1013,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
pathFile = this.file.externalRootDirectory
}
console.log(pathFile)
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
@@ -7,7 +7,7 @@
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header" style="overflow: unset !important;">
<div class="title-content width-100 d-flex justify-between">
<div class="font-30-rem cursor-pointer d-flex align-center" (click)="goBack()" defaultHref="#">
<div class="font-30-rem cursor-pointer d-flex align-base" (click)="goBack()" defaultHref="#">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
@@ -19,6 +19,8 @@ import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera
import { Filesystem, Directory } from '@capacitor/filesystem';
import { NgxImageCompressService } from "ngx-image-compress";
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
const IMAGE_DIR = 'stored-images';
@@ -87,14 +89,15 @@ export class NewPublicationPage implements OnInit {
private platform: Platform,
private loadingCtrl: LoadingController,
public imageCompress: NgxImageCompressService,
private httpErrorHandle: HttpErrorHandle
private httpErrorHandle: HttpErrorHandle,
public PublicationFolderService: PublicationFolderService
) {
this.publicationType = this.navParams.get('publicationType');
this.folderId = this.navParams.get('folderId');
this.publication = this.navParams.get('publication');
this.publicationTitle = 'Nova Publicação';
this.convertBlobToBase64Worker = new Worker(new URL('./convertBlobToBase64.worker.js', import.meta.url));
}
@@ -151,27 +154,6 @@ export class NewPublicationPage implements OnInit {
});
/* async laodPicture() {
const capturedImage = await Camera.getPhoto({
resultType: CameraResultType.Uri,
source: CameraSource.Photos,
quality: 90,
width: 1080,
height: 720,
});
const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
});
this.capturedImage = await this.convertBlobToBase64(blob);
this.capturedImageTitle = new Date().getTime() + '.jpeg';
} */
async laodPicture() {
const capturedImage = await Camera.getPhoto({
@@ -295,8 +277,6 @@ export class NewPublicationPage implements OnInit {
FileBase64: this.capturedImage,
FileExtension: 'jpeg',
}
const loader = this.toastService.loading()
@@ -312,6 +292,8 @@ export class NewPublicationPage implements OnInit {
}
}
this.PublicationFolderService.loadPublication(this.publication.DocumentId, this.publication.ProcessId)
}
else {
@@ -76,33 +76,54 @@ export class PublicationDetailPage implements OnInit {
}
getPublicationDetail() {
this.showLoader = true;
this.publications.GetPublicationById(this.publicationId).subscribe(res => {
/* this.publication = res; */
const folderId = this.folderId
const localPublication = this.publicationFolderService.getLocalPublication(folderId, this.publicationId);
if(localPublication?.DocumentId) {
this.publication = {
DateIndex: res.DateIndex,
DocumentId: res.DocumentId,
ProcessId:res.ProcessId,
Title:res.Title,
Message: res.Message,
DatePublication: res.DatePublication,
FileBase64: "data:image/jpg;base64," + res.FileBase64,
OriginalFileName: res.OriginalFileName,
DateIndex: localPublication.DateIndex,
DocumentId: localPublication.DocumentId,
ProcessId:localPublication.ProcessId,
Title:localPublication.Title,
Message: localPublication.Message,
DatePublication: localPublication.DatePublication,
FileBase64: localPublication.FileBase64,
OriginalFileName: localPublication.OriginalFileName,
FileExtension: 'jpeg',
}
console.log('PUBLICATIO ImG',this.publication.FileBase64)
this.showLoader = false;
}, (error) => {
} else {
if(error.status == 404) {
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
}
this.showLoader = true;
this.publications.GetPublicationById(this.publicationId).subscribe(res => {
/* this.publication = res; */
this.publication = {
DateIndex: res.DateIndex,
DocumentId: res.DocumentId,
ProcessId:res.ProcessId,
Title:res.Title,
Message: res.Message,
DatePublication: res.DatePublication,
FileBase64: "data:image/jpg;base64," + res.FileBase64,
OriginalFileName: res.OriginalFileName,
FileExtension: 'jpeg',
}
this.showLoader = false;
}, (error) => {
this.showLoader = false;
if(error.status == 404) {
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
}
this.goBack();
this.httpErrorHandle.httpStatusHandle(error)
});
}
this.goBack();
this.httpErrorHandle.httpStatusHandle(error)
});
}
close() {
@@ -110,7 +131,7 @@ export class PublicationDetailPage implements OnInit {
}
goBack() {
if(!window.location.href.includes('/home/publications/view-publications')) {
if(this.isModal) {
this.close()
} else {
this.RouteService.goBack();
@@ -179,9 +200,4 @@ export class PublicationDetailPage implements OnInit {
modal.present();
}
}
@@ -7,9 +7,8 @@
<ion-icon class="font-35-em" *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
<ion-icon class="font-35-em" *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
</div>
<div *ngIf="publicationFolderService.FolderDetails[folderId]?.DateBegin != null" class="div-title flex-grow-1">
<div *ngIf="publicationFolderService.FolderDetails[folderId]?.DateBegin != null" class="div-title flex-grow-1">
<p class="title font-25-em mb-10-em">{{publicationFolderService.FolderDetails[folderId].Description}}</p>
<p class="item-content-detail font-14-em">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
<p class="item-content-date font-13-em" >{{publicationFolderService.FolderDetails[folderId].DateBegin | date: 'dd-MM-yyyy HH:mm'}}</p>
</div>
<div *ngIf="p.userPermission([p.permissionList.Actions.createPost]) && publicationFolderService.FolderDetails[folderId]" class="cursor-pointer font-35-em" (click)="AddPublication('2',publicationFolderService.FolderDetails[folderId].ProcessId)">
@@ -30,6 +29,9 @@
</ion-refresher>
<div class="main-container background-white height-100 overflow-y-auto viewport-font-size">
<ion-content *ngIf="publicationFolderService.FolderDetails[folderId]">
<p class="px-20 item-content-detail font-14-em">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index"
(click)="goToPublicationDetail(publication.DocumentId)"
>
@@ -51,65 +53,6 @@
</ion-card-content>
</ion-card>
</ion-content>
<!-- <ion-list>
<div class="post-item cursor-pointer"
*ngFor="let publication of getpublication"
(click)="goToPublicationDetail(publication.DocumentId)"
>
<div class="post-img">
<img [defaultImage]=defaultImage [lazyLoad]="publication.FileBase64">
<ng-template #imageLoaded>
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
<img [defaultImage]=defaultImage [lazyLoad]="publication.FileBase64">
</div>
</ng-template>
</div>
<div class="post-content px-20">
<div class="post-title-time">
<div class="post-title">
<ion-label>{{publication.Title}}</ion-label>
</div>
<div class="post-data">{{publication.DatePublication | date: 'dd-MM-yyyy HH:mm'}}</div>
</div>
<div class="post-description">
<p>{{publication.Message}}</p>
</div>
</div>
</div>
<div *ngIf="showLoader" class="post-item">
<div class="post-img">
<img src="/assets/icon/icon-no-image.svg" alt="image">
</div>
<div class="post-content px-20">
<div class="post-title-time">
<div class="post-title">
<ion-label><ion-skeleton-text animated animated style="width: 60%;"></ion-skeleton-text></ion-label>
</div>
<div class="post-data"><ion-skeleton-text animated style="width: 25%; float: right;"></ion-skeleton-text></div>
</div>
<div class="post-description">
<p><ion-skeleton-text animated></ion-skeleton-text></p>
<p><ion-skeleton-text animated></ion-skeleton-text></p>
</div>
</div>
<div class="post-img">
<img src="/assets/icon/icon-no-image.svg" alt="image">
</div>
<div class="post-content px-20">
<div class="post-title-time">
<div class="post-title">
<ion-label><ion-skeleton-text animated animated style="width: 60%;"></ion-skeleton-text></ion-label>
</div>
<div class="post-data"><ion-skeleton-text animated style="width: 25%; float: right;"></ion-skeleton-text></div>
</div>
<div class="post-description">
<p><ion-skeleton-text animated></ion-skeleton-text></p>
<p><ion-skeleton-text animated></ion-skeleton-text></p>
</div>
</div>
</div>
</ion-list> -->
</div>
</ion-content>
@@ -100,6 +100,7 @@ export class ViewPublicationsPage implements OnInit {
createPublicationList(folderId = this.folderId) {
console.log('create')
if(!this.publicationFolderService.publicationList[folderId]) {
this.publicationFolderService.publicationList[folderId] = []
}
@@ -132,7 +133,6 @@ export class ViewPublicationsPage implements OnInit {
getPublicationDetail() {
const folderId = this.folderId
this.publications.GetPresidentialAction(folderId).subscribe(res =>{
this.publicationFolderService.FolderDetails[folderId] = res
this.storage.set(folderId+"name", res)
}, (error) => {
+3 -1
View File
@@ -7,13 +7,15 @@ export class FilterPipe implements PipeTransform {
transform(array: any[], text:string, column:string): any {
console.log(array, text, column);
if(text === ''){
return array;
}
text = text.toLowerCase();
if(Array.isArray(array)) {
if(!Array.isArray(array)) {
array = []
}
@@ -65,6 +65,23 @@ export class ChatSystemService {
private notificationService: NotificationsService
) {
const user = this.users
const alfa = {}
const sortedUserList = user.sort((a, b) => {
if(a.name < b.name) {
return -1;
}
if(a.name > b.name) {
return 1;
}
return 0;
})
console.log({sortedUserList})
this.RochetChatConnectorService.registerCallback({
type: 'reConnect',
funx: async () => {
+10 -3
View File
@@ -79,7 +79,7 @@ export class MessageService {
private notificationService: NotificationsService) {
}
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference = 'out-'+uuidv4() , viewed = [], received = [], delate = false, delateRequest =false, from, sendAttempt = 0, origin, attachmentsModelData, hasFile = false }:Message) {
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference = 'out-'+uuidv4() , viewed = [], received = [], delate = false, delateRequest =false, from, sendAttempt = 0, origin, attachmentsModelData, hasFile = false, UploadAttachmentsTemp = 0 }:Message) {
this.channels = channels || []
this.mentions = mentions || []
@@ -99,6 +99,7 @@ export class MessageService {
this.sendAttempt = 0
this.origin = origin
this.attachmentsModelData = attachmentsModelData
this.UploadAttachmentsTemp = UploadAttachmentsTemp
if(this.attachments?.length >= 1 && attachments?.length >= 1) {
this.attachments[0] = Object.assign(this.attachments[0], attachments[0])
@@ -268,15 +269,20 @@ export class MessageService {
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
this.UploadAttachmentsTemp++
this.uploadingFile = false
this.manualRetry = false
this.errorUploadingAttachment = false
this.hasSendAttachment = true
this.saveChanges()
} catch (error) {
this.uploadingFile = false
this.errorUploadingAttachment = true
this.UploadAttachmentsTemp++
this.saveChanges()
}
}
@@ -513,7 +519,8 @@ export class MessageService {
localReference: this.localReference,
attachments: this.attachments,
file: this.file,
delate: this.delate
delate: this.delate,
UploadAttachmentsTemp: this.UploadAttachmentsTemp
}
}
+4
View File
@@ -939,6 +939,7 @@ export class EventsService {
event.TimeZone = now.toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1]
params = params.set("CalendarName", calendarName);
params = params.set("notifyUsers", true)
let options: any;
switch (calendarName) {
@@ -973,6 +974,7 @@ export class EventsService {
event.TimeZone = now.toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1];
params = params.set("CalendarName", calendarName);
params = params.set("notifyUsers", true)
let options: any;
@@ -1139,6 +1141,7 @@ export class EventsService {
params = params.set("DocId", docId);
params = params.set("SerialNumber", serialNumber);
params = params.set("applicationID", applicationID);
params = params.set("notifyUsers", true)
switch (SessionStore.user.Profile) {
case 'MDGPR':
@@ -1245,6 +1248,7 @@ export class EventsService {
params = params.set("FolderId", folderId);
params = params.set("SerialNumber", serialNumber);
params = params.set("applicationID", applicationID);
params = params.set("notifyUsers", true)
const calendar = this.DetectCalendars(CalendarId)
const header = this.makeHeader(calendar)
+7
View File
@@ -18,6 +18,7 @@ import { SortService } from './functions/sort.service';
import { customTask } from '../models/dailyworktask.model';
import { Router } from '@angular/router';
import { v4 as uuidv4 } from 'uuid'
import { ChangeProfileService } from './change-profile.service';
@Injectable({
providedIn: 'root'
@@ -64,8 +65,14 @@ export class TaskService {
private despachoRule: DespachoService,
public eventService: EventsService,
private router: Router,
private changeProfileService: ChangeProfileService,
) {
this.changeProfileService.registerCallback(() => {
this.updateCount()
this.runCallback();
})
window['all-process-gabinete'] = () => {
this.updateAllProcess();
this.updateCount();
@@ -487,6 +487,7 @@ export class NewEventPage implements OnInit {
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
if(this.documents.length >= 0) {
this.postEvent.HasAttachments = true;
}
@@ -495,9 +496,11 @@ export class NewEventPage implements OnInit {
this.postEvent.EventRecurrence.Type = '-1'
}
if(this.loggeduser.Profile == 'MDGPR') {
const CalendarId = this.selectedCalendarId()
this.showLoader = true;
this.postEvent.CalendarId = CalendarId
let loader = this.toastService.loading();
@@ -554,6 +557,7 @@ export class NewEventPage implements OnInit {
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
this.postEvent.CalendarId = CalendarId
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
@@ -609,11 +613,13 @@ export class NewEventPage implements OnInit {
});
} else {
this.postEvent.CalendarName
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
this.postEvent.CalendarId = CalendarId
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
@@ -40,7 +40,7 @@
<ion-list class="members-list" *ngFor="let user of members">
<div class="members-checkbox">
<ion-checkbox disabled checked color="primary"></ion-checkbox>
<p>{{user.name}}</p>
<p class="ma-0">{{user.name}}</p>
<ion-icon class="{{user.status}}" name="ellipse"></ion-icon>
<button (click)="deleteMember(user)" class="btn-no-color detele-item-icon">
<ion-icon color="danger" name="close"></ion-icon>
@@ -49,19 +49,19 @@
</ion-list>
</div>
<ion-virtual-scroll [items]="users " approxItemHeight="70px" [headerFn]="separateLetter">
<div class="item-divider" *virtualHeader="let header">
<ion-label>{{header}}</ion-label>
<div *ngFor="let userContainer of userContainer | keyvalue;" >
<div class="item-divider">
<ion-label>{{ userContainer.key }}</ion-label>
</div>
<div *virtualItem="let user" class="item-checkbox">
<ion-checkbox (ionChange)="selectedContact(user)" color="primary"></ion-checkbox>
<ion-label>{{user.name}}</ion-label>
<div *ngFor="let user of userContainer.value" class="d-flex px-20 align-center">
<ion-checkbox [(ngModel)]="user.isChecked" color="primary" (click)="selectedContact(user)"></ion-checkbox>
<ion-label class="flex-grow-1 px-10">{{user.name}}</ion-label>
<div class="icon"><ion-icon class="{{user.status}}" name="ellipse"></ion-icon></div>
</div>
</ion-virtual-scroll>
</div>
</div>
</ion-content>
@@ -36,6 +36,10 @@ export class GroupContactsPage implements OnInit {
@Input() roomId:string;
@Output() openGroupMessage:EventEmitter<any> = new EventEmitter<any>();
objectUserSingleStone = []
userContainer = {}
constructor(
private modalController: ModalController,
private chatService: ChatService,
@@ -168,7 +172,7 @@ export class GroupContactsPage implements OnInit {
});
}
loadUsers(){
loadUsers() {
this.chatService.getAllUsers().subscribe((res:any)=>{
@@ -192,24 +196,31 @@ export class GroupContactsPage implements OnInit {
});
for( const user of this.users) {
const foundUser = this.objectUserSingleStone.find( e => e.name == user.name)
if(!foundUser) {
this.objectUserSingleStone.push(user)
}
}
for(const user of this.objectUserSingleStone) {
const firstLetter = user.name.charAt(0)
if(!this.userContainer[firstLetter]) {
this.userContainer[firstLetter] = [user]
} else {
this.userContainer[firstLetter].push(user)
}
}
this.showLoader = false;
});
}
separateLetter(record, recordIndex, records){
if(recordIndex == 0){
return record.name[0];
}
let first_prev = records[recordIndex - 1].name[0];
let first_current = record.name[0];
if(first_prev != first_current){
return first_current;
}
return null;
}
doRefresh(ev){
ev.target.complete();
}
@@ -267,6 +278,24 @@ export class GroupContactsPage implements OnInit {
this.users = users
let a = this.objectUserSingleStone.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase()))
let b = {}
for(const user of a) {
const firstLetter = user.name.charAt(0)
if(!b[firstLetter]) {
b[firstLetter] = [user]
} else {
b[firstLetter].push(user)
}
}
this.userContainer = b
// console.log('this.users', this.users)
}
@@ -274,18 +303,22 @@ export class GroupContactsPage implements OnInit {
}
selectedContact(user:any){
/* this.groupName = this.room.name; */
user.isChecked = !user.isChecked;
const userIndex = this.users.findIndex((e) => e._id == user._id)
this.users[userIndex] = user
selectedContact(user:any) {
/* this.groupName = this.room.name; */
if(user.isChecked != true ) {
user.isChecked = false
} else {
user.isChecked = true
}
const userIndex = this.objectUserSingleStone.findIndex((e) => e._id == user._id)
this.objectUserSingleStone[userIndex].isChecked = user.isChecked
}
addContacts(roomId:any){
addContacts(roomId:any) {
this.selectedUserList = this.users.filter(function(contact) {
this.selectedUserList = this.objectUserSingleStone.filter(function(contact) {
return contact.isChecked == true;
});
@@ -39,7 +39,6 @@
<div class="messages-list-item-wrapper container-width-100"
*ngFor="let msg of ChatSystemService.getDmRoom(roomId).messages; index as i; let last = last">
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg !=''">
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
+6 -2
View File
@@ -54,8 +54,10 @@
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
src='assets/images/secretaria_geral.png'>
<ion-icon *ngIf="loggeduser.RoleDescription != 'Presidente da República'&& loggeduser.RoleDescription != 'Ministro e Director do Gabinete do PR' && loggeduser.RoleDescription != 'Secretário Geral' " class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
<div class="profile-text">
<div *ngIf="this.notificationLength > 0" class="icon-badge" style="right: -18px;top: -29px;">
<div *ngIf="notificationLength > 0" class="icon-badge" style="right: -18px;top: -29px;">
{{notificationLength}} </div>
</div>
</div>
@@ -206,9 +208,11 @@
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
src='assets/images/secretaria_geral.png'>
<ion-icon *ngIf="loggeduser.RoleDescription != 'Presidente da República'&& loggeduser.RoleDescription != 'Ministro e Director do Gabinete do PR' && loggeduser.RoleDescription != 'Secretário Geral' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
<div class="profile-text">
<div *ngIf="this.notificationLength > 0" class="icon-badge" style="right: -18px;top: -29px;">
<div *ngIf="notificationLength > 0" class="icon-badge" style="right: -18px;top: -29px;">
{{notificationLength}} </div>
</div>
@@ -7,7 +7,7 @@
</div>
<div class="width-100">
<div class="d-flex width-100">
<div class="flex-grow-1">
<div class="flex-grow-1 flex-wrap d-flex">
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Enviar para o {{ environment.PR}} </button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Solicitar consideração superior</button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Solicitar revisão </button>
@@ -22,23 +22,9 @@
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="sendExpedienteToPending()" *ngIf="(task.Status || '') != 'Pending'" full class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</div>
</div>
<!-- <div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
<div class="flex-grow-1">
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Arquivar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<div hidden class="solid"></div>
<button hidden class="btn-cancel" shape="round" >Delegar</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
</div>
</div> -->
<div class="solid"></div>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</div>
</ion-content>
@@ -35,7 +35,7 @@
}
@media only screen and (max-width: 800px) {
.btn-ok, .btn-cancel, .btn-delete{
width: 100% !important;
width: 47% !important;
}
}
@media only screen and (min-width: 1024px) {
@@ -45,11 +45,11 @@
}
.btn-cancel{
display: none;
width: 100% !important;
width: 47% !important;
margin-bottom: 10px !important;
}
.btn-delete, .btn-ok{
width: 100% !important;
width: 47% !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
@@ -9,6 +9,8 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ThemeService } from 'src/app/services/theme.service';
import { Camera, CameraResultType, CameraSource} from '@capacitor/camera';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
@Component({
selector: 'app-new-publication',
templateUrl: './new-publication.page.html',
@@ -50,7 +52,8 @@ export class NewPublicationPage implements OnInit {
private publications: PublicationsService,
private toastService: ToastService,
public ThemeService: ThemeService,
private httpErroHandle: HttpErrorHandle
private httpErroHandle: HttpErrorHandle,
public PublicationFolderService: PublicationFolderService
) {
this.publicationTitle = 'Nova Publicação';
}
@@ -65,22 +68,43 @@ export class NewPublicationPage implements OnInit {
}
getPublicationDetail() {
this.showLoader = true;
this.publications.GetPublicationById(this.publicationId).subscribe( res => {
const folderId = this.folderId
const localPublication = this.PublicationFolderService.getLocalPublication(folderId, this.publicationId);
if(localPublication?.DocumentId) {
this.publication = {
DateIndex: res.DateIndex,
DocumentId: res.DocumentId,
ProcessId:res.ProcessId,
Title:res.Title,
Message: res.Message,
DatePublication: res.DatePublication,
FileBase64: "data:image/jpg;base64," + res.FileBase64,
OriginalFileName: res.OriginalFileName,
DateIndex: localPublication.DateIndex,
DocumentId: localPublication.DocumentId,
ProcessId:localPublication.ProcessId,
Title:localPublication.Title,
Message: localPublication.Message,
DatePublication: localPublication.DatePublication,
FileBase64: localPublication.FileBase64,
OriginalFileName: localPublication.OriginalFileName,
FileExtension: 'jpeg',
}
this.pub = this.publication;
this.showLoader = false;
});
} else {
this.showLoader = true;
this.publications.GetPublicationById(this.publicationId).subscribe( res => {
this.publication = {
DateIndex: res.DateIndex,
DocumentId: res.DocumentId,
ProcessId:res.ProcessId,
Title:res.Title,
Message: res.Message,
DatePublication: res.DatePublication,
FileBase64: "data:image/jpg;base64," + res.FileBase64,
OriginalFileName: res.OriginalFileName,
FileExtension: 'jpeg',
}
this.pub = this.publication;
this.showLoader = false;
});
}
}
@@ -228,6 +252,9 @@ export class NewPublicationPage implements OnInit {
}
}
this.PublicationFolderService.loadPublication(this.publication.DocumentId, this.publication.ProcessId)
}
else {
@@ -19,6 +19,7 @@
<p class="post-data"><ion-skeleton-text animated style="width: 20%;"></ion-skeleton-text></p>
</div>
</div>
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
</ion-header>
<ion-content>
@@ -18,7 +18,6 @@ export class PublicationDetailPage implements OnInit {
showLoader: boolean;
/* folderId: string; */
publication: Publication;
@Input() publicationId: string;
@Input() folderId: string;
@Output() addNewPublication = new EventEmitter<any>();
@@ -64,30 +63,52 @@ export class PublicationDetailPage implements OnInit {
}
getPublicationDetail() {
this.showLoader = true;
this.publications.GetPublicationById(this.publicationId).subscribe(res => {
const folderId = this.folderId
const localPublication = this.publicationFolderService.getLocalPublication(folderId, this.publicationId);
if(localPublication?.DocumentId) {
this.publication = {
DateIndex: res.DateIndex,
DocumentId: res.DocumentId,
ProcessId:res.ProcessId,
Title:res.Title,
Message: res.Message,
DatePublication: res.DatePublication,
FileBase64: "data:image/jpg;base64," + res.FileBase64,
OriginalFileName: res.OriginalFileName,
DateIndex: localPublication.DateIndex,
DocumentId: localPublication.DocumentId,
ProcessId:localPublication.ProcessId,
Title:localPublication.Title,
Message: localPublication.Message,
DatePublication: localPublication.DatePublication,
FileBase64: localPublication.FileBase64,
OriginalFileName: localPublication.OriginalFileName,
FileExtension: 'jpeg',
}
this.showLoader = false;
}, (error) => {
} else {
this.showLoader = true;
this.publications.GetPublicationById(this.publicationId).subscribe(res => {
this.publication = {
DateIndex: res.DateIndex,
DocumentId: res.DocumentId,
ProcessId:res.ProcessId,
Title:res.Title,
Message: res.Message,
DatePublication: res.DatePublication,
FileBase64: "data:image/jpg;base64," + res.FileBase64,
OriginalFileName: res.OriginalFileName,
FileExtension: 'jpeg',
}
this.showLoader = false;
}, (error) => {
this.showLoader = false;
if(error.status == 404) {
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
}
this.goBack();
this.httpErrorHandle.httpStatusHandle(error)
});
if(error.status == 404) {
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
}
this.goBack();
this.httpErrorHandle.httpStatusHandle(error)
});
}
}
close() {
@@ -1,12 +1,12 @@
<ion-header class="ion-no-border">
<div class="main-header">
<div class="title-content">
<div *ngIf="publicationFolderService.FolderDetails[folderId]" class="div-title width-100 flex-grow-1">
<div *ngIf="publicationFolderService.FolderDetails[folderId]" class="div-title d-flex width-100 flex-grow-1 justify-content-between">
<div class="title">
<ion-label>{{publicationFolderService.FolderDetails[folderId].Description}}</ion-label>
</div>
<div class="actions-icon">
<div class="actions-icon align-baseline">
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
<button *ngIf="p.userPermission([p.permissionList.Actions.editPost])" class="btn-no-color" (click)="openEditPublication(publicationFolderService.FolderDetails[folderId].ProcessId)">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
@@ -21,7 +21,6 @@
</div>
</div>
<div class="div-body width-100" *ngIf="publicationFolderService.FolderDetails[folderId]?.DateBegin != null">
<p class="item-content-detail">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
<p class="item-content-date">{{ publicationFolderService.FolderDetails[folderId].DateBegin | date: 'dd-MM-yyyy HH:mm'}}</p>
</div>
@@ -36,6 +35,8 @@
</ion-refresher-content>
</ion-refresher>
<div class="main-container px-20" *ngIf="publicationFolderService.FolderDetails[folderId]">
<p class="item-content-detail">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index"
(click)="viewPublicationDetail(publication.DocumentId)">
<ion-card-content>
+111 -3
View File
@@ -2,6 +2,8 @@ import { Injectable } from '@angular/core';
import { PublicationFolder } from '../models/publicationfolder';
import { Storage } from '@ionic/storage';
import { Publication } from '../models/publication';
import { PublicationsService } from '../services/publications.service';
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
@Injectable({
providedIn: 'root'
@@ -14,9 +16,15 @@ export class PublicationFolderService {
restoreFolder: {} = {}
keyName: string
showLoader = true
publicationPipe = new PublicationPipe()
getpublication = [];
constructor(
private storage: Storage,
private publications: PublicationsService,
) {}
@@ -31,6 +39,7 @@ export class PublicationFolderService {
getFromDB(folderId: any) {
if(!this.restoreFolder[folderId]) {
this.storage.get(folderId).then((viewPublications) => {
@@ -69,11 +78,8 @@ export class PublicationFolderService {
const findIndex = this.publicationFindIndex(publicationId, folderId)
const found = this.publicationIsPresent(publicationId, folderId)
if(!found) {
console.log('push',folderId, Publication)
this.publicationList[folderId].push(Publication)
} else {
console.log('update',folderId, Publication)
this.publicationList[folderId][findIndex] = Publication
}
}
@@ -88,6 +94,108 @@ export class PublicationFolderService {
}
}
getPublicationDetail(folderId) {
this.publications.GetPresidentialAction(folderId).subscribe(res => {
this.FolderDetails[folderId] = res
this.storage.set(folderId+"name", res)
}, (error) => {
this.showLoader = false;
// this.httpErroHandle.httpStatusHandle(error)
});
}
async getPublicationsIds(folderId) {
this.showLoader = true;
try {
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
this.createPublicationList(folderId)
let loadLater = []
for (let publicationId of publicationIds) {
if(!this.publicationIsPresent(publicationId, folderId)) {
await this.loadPublication(publicationId, folderId)
} else {
loadLater.push(publicationId)
}
}
for( let publicationId of loadLater) {
await this.loadPublication(publicationId, folderId)
}
this.showLoader = false;
this.storage.set(folderId, this.publicationList[folderId]);
this.getpublication = this.publicationList[folderId];
} catch(error) {
this.showLoader = false;
}
}
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 setPublication(publicationId, folderId, publicationDetails: 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 getPublication(publicationId, folderId, publicationDetails: Publication) {
const findIndex = this.publicationFindIndex(publicationId, folderId)
const found = this.publicationIsPresent(publicationId, folderId)
if(!found) {
this.publicationList[folderId].push(publicationDetails)
} else {
return this.publicationList[folderId][findIndex]
}
}
getLocalPublication (folderId, publicationId) {
if(this.publicationList[folderId]) {
this.publicationList[folderId].filter( e=> e.ProcessId == publicationId || e.DocumentId == publicationId);
return this.publicationList[folderId].filter( e => e.ProcessId == publicationId || e.DocumentId == publicationId)?.[0]
} else {
}
}
}
+1 -1
View File
@@ -779,7 +779,7 @@ body {
--login-background: linear-gradient(180deg, #c63527 60%, #000 100%) !important;
--button-hover: #c63527;
--button-color: #ffb81c;
--button-text-color: white;
--button-text-color: black;
--inicio-open-page-from-box: #c63527;
--PinBackground: #e1e7eb;
--background-mobile: var(--color);
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "eb82f5a43",
"SHA": "eb82f5a4302404f86edd52f0a64de252949d83ba",
"shortSHA": "1e4321d29",
"SHA": "1e4321d2946ee8ef98f0547f002ea74402b95c3a",
"branch": "developer",
"lastCommitAuthor": "'Eudes Inácio'",
"lastCommitTime": "'Fri Aug 18 21:17:57 2023 +0100'",
"lastCommitMessage": "merge with developer_prod",
"lastCommitNumber": "5174",
"lastCommitTime": "'Sat Aug 19 22:25:12 2023 +0100'",
"lastCommitMessage": "mock profile picture added",
"lastCommitNumber": "5175",
"change": "",
"changeStatus": "On branch developer\nYour branch and 'origin/developer' have diverged,\nand have 5 and 5 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/modals/profile/edit-profile/edit-profile.page.html\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/shared/header/header.page.scss\n\tnew file: src/assets/images/ministro.png\n\tdeleted: src/assets/images/presidente.jpeg\n\tnew file: src/assets/images/presidente.png\n\tnew file: src/assets/images/secretaria_geral.png",
"changeStatus": "On branch developer\nYour branch and 'origin/developer' have diverged,\nand have 6 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/models/beast-orm.ts\n\tmodified: src/app/models/chatMethod.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html\n\tmodified: src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts\n\tmodified: src/app/pages/chat/messages/contacts/contacts.page.html\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.html\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/pipes/filter.pipe.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html\n\tmodified: src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts\n\tmodified: src/app/shared/chat/messages/messages.page.html\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.scss\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.ts\n\tmodified: src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html\n\tmodified: src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.html\n\tmodified: src/app/store/publication-folder.service.ts\n\tmodified: src/theme/variables.scss",
"changeAuthor": "eudes.inacio"
}