mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix message
This commit is contained in:
@@ -5,7 +5,6 @@ import { IMemberRemoteRepository } from 'src/app/core/chat/repository/member/mem
|
||||
|
||||
// Define the schema for the entire response
|
||||
const MemberSetAdminDTOSchema = z.object({
|
||||
senderId: z.number(),
|
||||
roomId: z.string(),
|
||||
memberId: z.string()
|
||||
});
|
||||
|
||||
+14
-1
@@ -32,7 +32,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Location')?.invalid && validateFrom || validateField ">
|
||||
<ion-textarea autoGrow="true" autocomplete="on" autocorrect="on" spellcheck="true" class="add-border heigh-200" placeholder="Descrição*" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
|
||||
<ion-textarea autoGrow="true" autocomplete="on" autocorrect="on" spellcheck="true" class="add-border heigh-200" [placeholder]="getDescricaoPlaceholder()" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -190,6 +190,19 @@
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<!-- <div class="ion-item-container-no-border cursor-pointer" (click)="getDoc1()">
|
||||
<ion-label class="d-flex align-center">
|
||||
<div class="attach-icon d-flex align-center">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-attach-doc.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-attach-doc.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-attach-doc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document pl-10">
|
||||
<ion-label>Anexar Documentos</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div> -->
|
||||
|
||||
<div class="list " *ngFor="let document of documents; let i = index" >
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
+28
-2
@@ -28,6 +28,9 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { z } from 'zod';
|
||||
import { FilePickerWebService } from 'src/app/infra/file-picker/web/file-picker-web.service'
|
||||
import { allowedDocExtension } from 'src/app/utils/allowedDocExtension';
|
||||
import { JSFileToDataUrl } from 'src/app/utils/ToBase64';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -124,7 +127,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
public p: PermissionService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
private RouteService: RouteService,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private FilePickerWebService: FilePickerWebService,
|
||||
) {
|
||||
|
||||
this.loggeduser = SessionStore.user;
|
||||
@@ -221,6 +225,12 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.getSubjectType();
|
||||
}
|
||||
|
||||
getDescricaoPlaceholder() {
|
||||
let title = this.modalTitle[this.taskType];
|
||||
title = title.replace(/Efectuar|Solicitar/g, '');
|
||||
return SessionStore.user.Profile == 'PR'? `Escreva aqui o conteúdo do ${title}` : 'Descrição*';
|
||||
}
|
||||
|
||||
onSelectedTypesChanged(ev:any) {
|
||||
|
||||
if(ev.length > 1){
|
||||
@@ -664,7 +674,23 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async getDoc(){
|
||||
async getDoc1() {
|
||||
const file = await this.FilePickerWebService.getAnyFileFromDevice();
|
||||
if(file.isOk()) {
|
||||
|
||||
//const fileExtension = await allowedDocExtension(file.value.type)
|
||||
|
||||
console.log('FILE rigth?', file)
|
||||
|
||||
let fileBase64 = await JSFileToDataUrl(file.value);
|
||||
|
||||
if(fileBase64.isOk()) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async getDoc() {
|
||||
const modal = await this.modalController.create({
|
||||
component: SearchPage,
|
||||
cssClass: 'modal-width-100-width-background modal',
|
||||
|
||||
@@ -90,7 +90,8 @@
|
||||
<!-- -->
|
||||
<!-- <div *ngIf="room?.messages?.[0]?.message" class="item-description d-flex align-items-center" [class.item-description-active]="room.$id ==selectedRoomId"> -->
|
||||
<!-- <div class="item-message" *ngIf="group.otherUserType == false">{{room?.messages?.[0]?.message.u.name}}: {{room?.messages?.[0]?.message.msg}} </div> -->
|
||||
<div class="item-message font-13-em add-ellipsis white-space-nowrap"> {{room.messages[0].message}} </div>
|
||||
<div class="item-message font-13-em add-ellipsis white-space-nowrap" *ngIf="room.messages[0].oneShot == false"> {{room.messages[0].message}} </div>
|
||||
<div class="item-message font-13-em add-ellipsis white-space-nowrap" *ngIf="room.messages[0].oneShot == true"> Visualização única </div>
|
||||
<!-- <div *ngIf="group.otherUserType == true">{{group.userThatIsTyping}} está escrever ...</div> -->
|
||||
|
||||
<div class="item-files add-ellipsis" *ngIf="room.messages[0]?.attachments?.length >= 1">
|
||||
@@ -106,8 +107,8 @@
|
||||
<div *ngIf="room?.messages?.length >= 1 && room.messages[0]._isDeleted==true && room.messages[0].oneShot == false">
|
||||
<div class="item-message font-13-em add-ellipsis white-space-nowrap"> Mensagem foi eliminada </div>
|
||||
</div>
|
||||
<div *ngIf="room?.messages?.length >= 1 && room.messages[0]._isDeleted==true && room.messages[0].oneShot == true">
|
||||
<div class="item-message font-13-em add-ellipsis white-space-nowrap"> Mensagem visualizada </div>
|
||||
<div *ngIf="room?.messages?.length >= 1 && room.messages[0].oneShotIsViewed">
|
||||
<div class="item-message font-13-em add-ellipsis white-space-nowrap"> Mensagem de visualização única </div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="message-container rotate-div" *ngIf="message.showMessage">
|
||||
<div class="message-container rotate-div" *ngIf="message.showMessage && !message.meSendOneShot">
|
||||
<div *ngIf="message.sender.wxUserId != SessionStore.user.UserId && roomType == RoomTypeEnum.Group">
|
||||
<b>
|
||||
{{ message.sender.wxFullName }}
|
||||
@@ -66,7 +66,7 @@
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<div style="white-space: pre-line;">
|
||||
<div style="white-space: pre-line;" >
|
||||
{{ message.message }}
|
||||
</div>
|
||||
|
||||
@@ -89,10 +89,6 @@
|
||||
(error)="onImageError()"
|
||||
>
|
||||
|
||||
<div *ngIf="SessionStore.user.UserId == message.sender.wxUserId && message.oneShot == true">
|
||||
Mandou uma mensagen com visualização única
|
||||
</div>
|
||||
|
||||
<div *ngIf="SessionStore.user.UserId != message.sender.wxUserId && message.oneShot == true">
|
||||
<!-- <div *ngIf="message.oneShot == true" class="cursor-pointer"> -->
|
||||
<div (click)="viewOnce($event, message, i)">
|
||||
@@ -152,6 +148,11 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="message-container rotate-div" *ngIf="message.meSendOneShot">
|
||||
Mandou uma mensagen com visualização única
|
||||
</div>
|
||||
|
||||
<div class="message-container rotate-div" *ngIf="message._isDeleted == true && message.id != '' && message.oneShot == false">
|
||||
Mensagem foi eliminada
|
||||
</div>
|
||||
@@ -237,7 +238,7 @@
|
||||
|
||||
<div class="width-100">
|
||||
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
||||
<ion-textarea *ngIf="allowTyping" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="textField" (ionChange)="sendTyping()"></ion-textarea>
|
||||
<ion-textarea autoGrow="true" *ngIf="allowTyping" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="textField" (ionChange)="sendTyping()"></ion-textarea>
|
||||
</div>
|
||||
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
||||
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
||||
|
||||
@@ -257,7 +257,7 @@ ion-footer {
|
||||
.container {
|
||||
justify-content: center;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
align-items: bottom;
|
||||
}
|
||||
|
||||
.chat-icon-options {
|
||||
@@ -551,3 +551,9 @@ ion-footer {
|
||||
max-height: 400px;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
|
||||
.message-input {
|
||||
max-height: 150px; /* limit expansion */
|
||||
overflow-y: auto; /* allow scroll once max height is hit */
|
||||
}
|
||||
|
||||
@@ -150,6 +150,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
date: {[key: string]: Object} = {}
|
||||
handleClickActive = true
|
||||
onShot = false;
|
||||
|
||||
|
||||
constructor(
|
||||
@@ -455,14 +456,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
if(!me) {
|
||||
|
||||
if(message.oneShot == false) {
|
||||
//if(message.oneShot == false) {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -501,14 +502,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
}
|
||||
|
||||
if(message.oneShot == false) {
|
||||
//if(message.oneShot == false) {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: '',
|
||||
roomId: this.room.id
|
||||
})
|
||||
}
|
||||
//}
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
@@ -830,6 +831,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
message.receiverId = this.room.receiverId
|
||||
}
|
||||
|
||||
message.oneShot = this.onShot;
|
||||
|
||||
return message
|
||||
}
|
||||
|
||||
@@ -877,7 +880,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
this.messages1[this.room.$id].push(message)
|
||||
let sendMessage = this.chatServiceService.sendMessage(message, this.roomType)
|
||||
//this.messageResult(sendMessage)
|
||||
this.onShot = false;
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
@@ -902,6 +905,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const message = this.createMessage();
|
||||
message.message = this.textField
|
||||
|
||||
this.onShot = false;
|
||||
this.textField = ''
|
||||
|
||||
const date = whatsappDate(message.sentAt, false)
|
||||
@@ -916,7 +920,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.scrollToBottomClicked()
|
||||
}, 100)
|
||||
let sendMessage = this.chatServiceService.sendMessage(message, this.roomType)
|
||||
//this.messageResult(sendMessage)
|
||||
this.onShot = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -1078,7 +1082,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
const message = this.createMessage();
|
||||
|
||||
message.oneShot = oneShot
|
||||
|
||||
|
||||
message.attachments = [{
|
||||
file: compressedImage.value.split(',')[1],
|
||||
@@ -1088,7 +1092,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
mimeType: 'image/'+picture.value.format
|
||||
}]
|
||||
|
||||
|
||||
const date = whatsappDate(message.sentAt, false)
|
||||
if(!this.date[date]) {
|
||||
this.date[date] = true
|
||||
@@ -1100,8 +1103,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
}, 100)
|
||||
|
||||
let sendMessage = this.chatServiceService.sendMessage(message, this.roomType)
|
||||
//this.messageResult(sendMessage)
|
||||
this.onShot = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -1159,7 +1163,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.scrollToBottomClicked()
|
||||
}, 100)
|
||||
let sendMessage = this.chatServiceService.sendMessage(message, this.roomType)
|
||||
//this.messageResult(sendMessage)
|
||||
this.onShot = false;
|
||||
this.textField = ''
|
||||
|
||||
}
|
||||
@@ -1204,7 +1208,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
async pickPicture() {
|
||||
|
||||
const oneShot = await this.askIfOneShot()
|
||||
|
||||
const file = await this.FilePickerService.getPicture({
|
||||
cameraResultType: CameraResultType.Base64
|
||||
})
|
||||
@@ -1247,7 +1250,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.scrollToBottomClicked()
|
||||
}, 100)
|
||||
let sendMessage = this.chatServiceService.sendMessage(message, this.roomType)
|
||||
//this.messageResult(sendMessage)
|
||||
//this.onShot = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1301,13 +1305,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
}, 100)
|
||||
let sendMessage = this.chatServiceService.sendMessage(message, this.roomType)
|
||||
//this.messageResult(sendMessage)
|
||||
}
|
||||
|
||||
//} else {
|
||||
//this.toastService._badRequest("Ficheiro inválido")
|
||||
//}
|
||||
let sendMessage = this.chatServiceService.sendMessage(message, this.roomType)
|
||||
this.onShot = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1480,6 +1481,16 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
closeModal(a: any) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
forceShowOneShot(message: MessageViewModal) {
|
||||
message.forceShowOneShot()
|
||||
|
||||
this.chatServiceService.messageDelete({
|
||||
messageId: message.id,
|
||||
roomId: this.room.id,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ export class MessageViewModal {
|
||||
showReaction = false
|
||||
showMessage = false
|
||||
ballon = false
|
||||
showOneShot = false
|
||||
hour = ''
|
||||
|
||||
constructor(model?: IMessage) {
|
||||
@@ -119,7 +120,27 @@ export class MessageViewModal {
|
||||
return this.sender.wxUserId == SessionStore.user.UserId
|
||||
}
|
||||
|
||||
get meSendOneShot() {
|
||||
return this.meSender() && this.oneShot == true
|
||||
}
|
||||
|
||||
get _isDeleted() {
|
||||
return this.isDeleted || this.info.filter(e =>e.memberId == SessionStore.user.UserId && e.isDeleted).length == 1
|
||||
}
|
||||
|
||||
get oneShotAlreadyViewsByMe() {
|
||||
return this._isDeleted == true && this.oneShot == true
|
||||
}
|
||||
|
||||
get openByOther() {
|
||||
return this.isDeleted || this.info.filter(e =>e.memberId != SessionStore.user.UserId && e.isDeleted).length >= 1
|
||||
}
|
||||
|
||||
get oneShotIsViewed() {
|
||||
return this.oneShot == true && this.info.filter(e =>e.memberId == SessionStore.user.UserId && e.isDeleted == true).length == 1
|
||||
}
|
||||
|
||||
forceShowOneShot() {
|
||||
this.showOneShot = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,14 +224,14 @@ export class RoomStore {
|
||||
}
|
||||
}
|
||||
|
||||
if(message.oneShot == false) {
|
||||
//if(message.oneShot == false) {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -351,14 +351,14 @@ export class RoomStore {
|
||||
if(!me) {
|
||||
// Logger.info('send read at, sender '+ message.sender.wxFullName+ ' '+ message.message +'message id'+ message.id)
|
||||
|
||||
if(message.oneShot == false) {
|
||||
//if(message.oneShot == false) {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
}
|
||||
//}
|
||||
|
||||
} else {
|
||||
// console.log('no need', message )
|
||||
|
||||
@@ -2,4 +2,4 @@ import { Environment } from './../app/models/envarioment'
|
||||
import { environment as oaprDev } from './suport/oapr'
|
||||
import { DevDev } from './suport/dev'
|
||||
|
||||
export const environment: Environment = oaprDev
|
||||
export const environment: Environment = DevDev
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "3eecedb23",
|
||||
"SHA": "3eecedb23fae5e23cf158df3f253a1fdbb16ed05",
|
||||
"shortSHA": "4870a0cd6",
|
||||
"SHA": "4870a0cd695183670f21f5e4d3e614ac2e170284",
|
||||
"branch": "developer",
|
||||
"lastCommitAuthor": "'peter.maquiran'",
|
||||
"lastCommitTime": "'Wed Sep 17 18:37:35 2025 +0100'",
|
||||
"lastCommitMessage": "fix publication",
|
||||
"lastCommitNumber": "6149",
|
||||
"changeStatus": "On branch developer\nYour branch is ahead of 'origin/developer' by 6 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: package-lock.json\n\tmodified: package.json\n\tmodified: src/app/app.module.ts\n\tmodified: src/app/core/chat/usecase/message/message-create-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/message/messages-send-offline-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/room/room-update-name-sync.service.ts\n\tmodified: src/app/infra/socket/signalR/signalR.ts\n\tmodified: src/app/pages/events/events.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.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts\n\tmodified: src/app/ui/agenda/agenda.page.ts\n\tmodified: src/app/ui/chat/chat.page.html\n\tmodified: src/app/ui/chat/chat.page.ts\n\tmodified: src/app/ui/chat/component/messages/messages.page.html\n\tmodified: src/environments/environment.ts",
|
||||
"lastCommitTime": "'Wed Sep 24 16:21:52 2025 +0100'",
|
||||
"lastCommitMessage": "fix messsage",
|
||||
"lastCommitNumber": "6150",
|
||||
"changeStatus": "On branch developer\nYour branch is ahead of 'origin/developer' by 7 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/core/chat/usecase/member/member-admin-use-case.service.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts\n\tmodified: src/app/ui/chat/chat.page.html\n\tmodified: src/app/ui/chat/component/messages/messages.page.html\n\tmodified: src/app/ui/chat/component/messages/messages.page.scss\n\tmodified: src/app/ui/chat/component/messages/messages.page.ts\n\tmodified: src/app/ui/chat/store/model/message.ts\n\tmodified: src/app/ui/chat/store/roomStore.ts\n\tmodified: src/environments/environment.ts\n\tmodified: version/git-version.ts",
|
||||
"changeAuthor": "peter.maquiran"
|
||||
}
|
||||
Reference in New Issue
Block a user