mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
dateLabel added to chat web
This commit is contained in:
@@ -1,17 +1,30 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<manifest package="com.gpr.gabinetedigital" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
|
||||
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:exported="true" android:label="@string/title_activity_main" android:launchMode="singleTask" android:name="com.gpr.gabinetedigital.MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
|
||||
<manifest package="com.gpr.gabinetedigital"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true" android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
||||
android:exported="true" android:label="@string/title_activity_main"
|
||||
android:launchMode="singleTask" android:name="com.gpr.gabinetedigital.MainActivity"
|
||||
android:theme="@style/AppTheme.NoActionBarLaunch">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<provider android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
|
||||
<provider android:authorities="${applicationId}.fileprovider" android:exported="false"
|
||||
android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
</manifest>
|
||||
</manifest>
|
||||
@@ -66,6 +66,7 @@ export class MessageService {
|
||||
|
||||
messageModelInstance: MessageModel
|
||||
attachmentsModelData: any
|
||||
dateLabel = false;
|
||||
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -707,8 +707,18 @@ export class RoomService {
|
||||
return JSON.parse(str);
|
||||
}
|
||||
|
||||
formatDateToDDMMYYYY(dateStamp) {
|
||||
const date = new Date(dateStamp);
|
||||
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // Month is zero-based
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day}-${month}-${year}`;
|
||||
}
|
||||
|
||||
restoreOnce = false
|
||||
dateLabel: any = [];
|
||||
async restoreMessageFromDB() {
|
||||
if(environment.chatOffline && this.restoreOnce == false) {
|
||||
this.restoreOnce = true
|
||||
@@ -716,10 +726,24 @@ export class RoomService {
|
||||
const messages = await MessageModel.filter({rid:this.id}).execute()
|
||||
|
||||
|
||||
console.log('MessageModel', messages)
|
||||
|
||||
console.log('MessageModel', messages)
|
||||
|
||||
for (let ChatMessage of messages) {
|
||||
|
||||
|
||||
const wewMessage = await this.simplePrepareMessage(ChatMessage)
|
||||
console.log('MessageModel 22', wewMessage)
|
||||
|
||||
const currentMessageDate = this.formatDateToDDMMYYYY(ChatMessage._updatedAt)
|
||||
if(!this.dateLabel.includes(currentMessageDate) ) {
|
||||
this.dateLabel.push(currentMessageDate);
|
||||
|
||||
wewMessage.msg = currentMessageDate
|
||||
wewMessage.dateLabel = true;
|
||||
this.messages.push(wewMessage)
|
||||
}
|
||||
|
||||
wewMessage.from = 'Offline'
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
wewMessage.messageModelInstance = ChatMessage
|
||||
@@ -727,6 +751,9 @@ export class RoomService {
|
||||
if(wewMessage.offline == false) {
|
||||
|
||||
const message = await this.prepareCreate({message:ChatMessage})
|
||||
|
||||
console.log('MessageModel 33', messages)
|
||||
|
||||
message.from = 'Offline'
|
||||
message.loadHistory = this.hasLoadHistory
|
||||
wewMessage.messageModelInstance = ChatMessage
|
||||
@@ -736,6 +763,8 @@ export class RoomService {
|
||||
|
||||
const offlineMessage = await this.prepareCreate({message:ChatMessage})
|
||||
|
||||
console.log('MessageModel 44', offlineMessage)
|
||||
|
||||
offlineMessage.from = 'Offline'
|
||||
offlineMessage.loadHistory = this.hasLoadHistory
|
||||
wewMessage.messageModelInstance = ChatMessage
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<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 incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg !=''" [class.dateLabel] = "msg.dateLabel">
|
||||
<div class="message-item-options d-flex justify-content-end">
|
||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
|
||||
</fa-icon>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '~src/function.scss';
|
||||
@import "~src/function.scss";
|
||||
|
||||
.header-toolbar {
|
||||
--background: transparent;
|
||||
@@ -29,7 +29,6 @@
|
||||
margin: 2px 0 0 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
@@ -45,13 +44,11 @@
|
||||
width: 95%;
|
||||
overflow: auto;
|
||||
|
||||
|
||||
.header-bottom-icon {
|
||||
width: rem(30);
|
||||
font-size: rem(25);
|
||||
float: left;
|
||||
padding: 2px;
|
||||
|
||||
}
|
||||
|
||||
.header-bottom-contacts {
|
||||
@@ -164,7 +161,6 @@ ion-content {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
.incoming-true,
|
||||
.incoming-false {
|
||||
padding: 15px 20px;
|
||||
@@ -267,7 +263,6 @@ ion-footer {
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.text-color-blue {
|
||||
@@ -319,6 +314,11 @@ ion-footer {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.dateLabel {
|
||||
background: #000 !important;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.float-status {
|
||||
position: relative !important;
|
||||
float: right;
|
||||
@@ -357,7 +357,6 @@ ion-footer {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.typing ngx-letters-avatar {
|
||||
padding-right: 5px;
|
||||
}
|
||||
@@ -390,23 +389,22 @@ ion-footer {
|
||||
right: 50%;
|
||||
}
|
||||
|
||||
|
||||
.try {
|
||||
color: red;
|
||||
background: #f3414159;
|
||||
padding: 6px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
background: #f3414159;
|
||||
padding: 6px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.red-top {
|
||||
border-top: 1px solid red !important;
|
||||
}
|
||||
.red {
|
||||
color: red !important;
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
|
||||
.lido, .enviado {
|
||||
.lido,
|
||||
.enviado {
|
||||
font-size: rem(11);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { AnimationController, GestureController, IonRange, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -100,6 +100,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
roomName: any;
|
||||
isAdmin = false;
|
||||
roomCountDownDate: string;
|
||||
groupedMessages: { date: string; messages: any[] }[] = [];
|
||||
msgArray: any = new Array();
|
||||
|
||||
|
||||
constructor(
|
||||
public popoverController: PopoverController,
|
||||
@@ -121,6 +124,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
private platform: Platform,
|
||||
private fileOpener: FileOpener,
|
||||
public p: PermissionService,
|
||||
private cdr: ChangeDetectorRef
|
||||
) {
|
||||
// update
|
||||
this.checkAudioPermission()
|
||||
@@ -137,6 +141,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
this.showAvatar = false
|
||||
|
||||
this.msgArray = this.ChatSystemService.getDmRoom(this.roomId).messages;
|
||||
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
this.showAvatar = true
|
||||
@@ -144,7 +153,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
this.deleteRecording()
|
||||
|
||||
|
||||
// this.ChatSystemService.getDmRoom(this.roomId).deleteAll()
|
||||
|
||||
}
|
||||
@@ -183,6 +191,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
this.deleteRecording();
|
||||
this.loadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "fb1bd07ad",
|
||||
"SHA": "fb1bd07ad0a5ba460b84408f87a08f72604cb41f",
|
||||
"shortSHA": "42c2fc92f",
|
||||
"SHA": "42c2fc92ffbe3543abe904e1d8ba6a53fb47e462",
|
||||
"branch": "developer-prod",
|
||||
"lastCommitAuthor": "'Eudes Inácio'",
|
||||
"lastCommitTime": "'Wed Sep 6 21:23:21 2023 +0100'",
|
||||
"lastCommitMessage": "a lot of changes",
|
||||
"lastCommitNumber": "5257",
|
||||
"lastCommitTime": "'Sat Sep 9 14:40:08 2023 +0100'",
|
||||
"lastCommitMessage": "upload profile picture",
|
||||
"lastCommitNumber": "5258",
|
||||
"change": "",
|
||||
"changeStatus": "On branch developer-prod\nYour branch is up to date with 'origin/developer-prod'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/modals/create-process/create-process.page.html\n\tmodified: src/app/modals/profile/edit-profile/edit-profile.page.ts\n\tmodified: src/app/modals/profile/profile.page.ts\n\tmodified: src/app/shared/header/header.page.ts",
|
||||
"changeStatus": "On branch developer-prod\nYour branch is up to date with 'origin/developer-prod'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: android/app/src/main/AndroidManifest.xml\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/chat/room.service.ts\n\tmodified: src/app/shared/chat/messages/messages.page.html\n\tmodified: src/app/shared/chat/messages/messages.page.scss\n\tmodified: src/app/shared/chat/messages/messages.page.ts",
|
||||
"changeAuthor": "eudes.inacio"
|
||||
}
|
||||
Reference in New Issue
Block a user