Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer

This commit is contained in:
Peter Maquiran
2021-08-20 17:15:12 +01:00
13 changed files with 269 additions and 24 deletions
+11 -6
View File
@@ -40,17 +40,22 @@
<div class="notification-item">
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'agenda'" src="assets/images/icons-default-agenda.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'gabinete-digital'" src="assets/images/icons-correspondencias.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'accoes'" src="assets/images/icons-nav-actions.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'accoes'" src="assets/images/icons-nav-accoes-active.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'chat'" src="assets/images/icons-nav-agenda-active.svg" >
</div>
<div class="approve-event-time">
<p>{{item.dateInit}}</p>
<p>{{item.dateEnd}}</p>
<p *ngIf = "item.Service == 'agenda'">{{item.dateInit}}</p>
<p *ngIf = "item.Service == 'agenda'">{{item.dateEnd}}</p>
</div>
<div class="approve-event-detail">
<p>{{item.Location}}</p>
<h3>{{item.alert}}</h3>
<p *ngIf = "item.Service == 'agenda'">{{item.Location}}</p>
<h3 id="profile-title">{{item.alert}}</h3>
<p *ngIf = "item.Service != 'agenda'">{{item.desc}}</p>
</div>
<div class="notification-label"></div>
<div class="notification-label-MD-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000011'" ></div>
<div class="notification-label-MD-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000011'" ></div>
<div class="notification-label-PR-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000014'" ></div>
<div class="notification-label-PR-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000014'" ></div>
</div>
</div>
+26 -1
View File
@@ -96,14 +96,39 @@ ion-list{
.approve-event-detail{
width: calc(100% - 115px) !important;
float: left;
#profile-title{
width: 250px;
}
}
.notification-label{
.notification-label-MD-official{
float: right;
width: 5px;
height: 100%;
border-radius: 0% 100% 100% 0%;
background-color: #ffb703;
}
.notification-label-MD-pessoal{
float: right;
width: 5px;
height: 100%;
border-radius: 0% 100% 100% 0%;
background-color: #ff0303;
}
.notification-label-PR-official{
float: right;
width: 5px;
height: 100%;
border-radius: 0% 100% 100% 0%;
background-color: #03d838;
}
.notification-label-PR-pessoal{
float: right;
width: 5px;
height: 100%;
border-radius: 0% 100% 100% 0%;
background-color: #8b0ae0;
}
}
}
+20 -10
View File
@@ -53,7 +53,7 @@ export class ProfilePage implements OnInit {
notImplemented() { }
async getNotificationData(){
this.notificationservice.tempClearArray();
this.storageservice.get("Notifications").then((value) => {
console.log("Init get store", value)
@@ -72,10 +72,11 @@ export class ProfilePage implements OnInit {
IdObject: payload.IdObject,
FolderId: payload.FolderId,
desc: payload.desc,
dateInit: payload.dateInit,
dateEnd: payload.dateEnd,
dateInit: this.getFormatedTime(payload.dateInit),
dateEnd: this.getFormatedTime(payload.dateEnd),
Location: payload.Location,
TypeAgenda: payload.TypeAgenda,
Role: payload.Role,
Status: payload.Status
}
} else {
@@ -87,10 +88,11 @@ export class ProfilePage implements OnInit {
IdObject: element.IdObject,
FolderId: element.FolderId,
desc: element.desc,
dateInit: element.dateInit,
dateEnd: element.dateEnd,
dateInit: this.getFormatedTime(element.dateInit),
dateEnd: this.getFormatedTime(element.dateEnd),
Location: element.Location,
TypeAgenda: element.TypeAgenda,
Role: element.Role,
Status: element.Status
}
}
@@ -107,7 +109,18 @@ export class ProfilePage implements OnInit {
console.log('Timer badge count')
}
getFormatedTime(dateString){
var date = new Date(dateString);
var hours = date.getHours() > 12 ? date.getHours() - 12 : date.getHours();
var am_pm = date.getHours() >= 12 ? "pm" : "am";
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
let time = hours + ":" + minutes /* + " " + am_pm */;
console.log('Formate',time)
return time;
}
notificatinsRoutes = (index, Service, Object, IdObject, FolderId) => {
if (Service === "agenda") {
this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda']));
}
@@ -115,7 +128,8 @@ export class ProfilePage implements OnInit {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', IdObject, 'gabinete-digital']));
}
else if (Service === "gabinete-digital" && Object === "event-list") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event', IdObject, 'gabinete-digital']));
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'gabinete-digital']));
} else if (Service === "gabinete-digital" && Object === "despachos") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', IdObject, 'gabinete-digital'], { replaceUrl: true }));
@@ -162,10 +176,6 @@ export class ProfilePage implements OnInit {
console.log("Delete notification first stata", this.notificationdata)
this.notificationdata = this.notificationdata.filter(item=>item.index !=index );
if(typeof(this.notificationdata) != 'object' ) {
console.log('=_+_+_+_+_+_+_+_+_+_++_+_+_+_+_+_+_+_+_+_+_+_ not an object')
}
this.storageservice.store("Notifications",JSON.stringify(this.notificationdata)).then(() =>{
this.storageservice.get("Notifications").then((value) =>{
console.log("notfication state", value, )
+1 -1
View File
@@ -63,7 +63,7 @@
</span>
</ion-label>
</div>
<div class="item-date" [class.item-date-active]="dm._id == idSelected">{{dm._updatedAt | date: 'HH:mm'}}</div>
<div class="item-date" [class.item-date-active]="dm._id == idSelected">{{showDateDuration(dm._updatedAt)}}</div>
</div>
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
+41
View File
@@ -138,6 +138,10 @@ export class ChatPage implements OnInit {
/* Fim websocket functions */
this.hideRefreshButton();
this.getChatMembers();
//Teste
let t = this.showDateDuration(new Date());
console.log(t);
}
hideRefreshButton(){
@@ -368,6 +372,43 @@ hideRefreshButton(){
});
}
showDateDuration(start:any){
let end;
end = new Date();
start = new Date(start);
let customizedDate;
const totalSeconds = Math.floor((end - (start))/1000);;
const totalMinutes = Math.floor(totalSeconds/60);
const totalHours = Math.floor(totalMinutes/60);
const totalDays = Math.floor(totalHours/24);
const hours = totalHours - ( totalDays * 24 );
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
if(totalDays == 0){
if(start.getDate() == new Date().getDate()){
let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes());
return time;
}
else{
return 'Ontem';
}
}
else{
let date = start.getDate() + "/" + (start.getMonth()+1) + "/" + start.getFullYear();
return date;
}
}
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
async getChatMembers(){
//return await this.chatService.getMembers(roomId).toPromise();
this.chatService.getAllUsers().subscribe(res=> {
@@ -43,7 +43,7 @@
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
@@ -133,6 +133,47 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
});
} */
}
showDateDuration(start:any){
let end;
end = new Date();
start = new Date(start);
let customizedDate;
const totalSeconds = Math.floor((end - (start))/1000);;
const totalMinutes = Math.floor(totalSeconds/60);
const totalHours = Math.floor(totalMinutes/60);
const totalDays = Math.floor(totalHours/24);
const hours = totalHours - ( totalDays * 24 );
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
if(totalDays == 0){
if(start.getDate() == new Date().getDate()){
let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes());
return time;
}
else{
return 'Ontem';
}
}
else{
let date = start.getDate() + "/" + (start.getMonth()+1) + "/" + start.getFullYear();
return date;
}
}
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
sendMessage(){
let body = {
"message": { "rid": this.roomId, "msg": this.message }
@@ -39,7 +39,7 @@
<div *ngFor="let msg of messages" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
@@ -126,6 +126,43 @@ export class MessagesPage implements OnInit, AfterViewChecked {
});
}
showDateDuration(start:any){
let end;
end = new Date();
start = new Date(start);
let customizedDate;
const totalSeconds = Math.floor((end - (start))/1000);;
const totalMinutes = Math.floor(totalSeconds/60);
const totalHours = Math.floor(totalMinutes/60);
const totalDays = Math.floor(totalHours/24);
const hours = totalHours - ( totalDays * 24 );
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
if(totalDays == 0){
if(start.getDate() == new Date().getDate()){
let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes());
return time;
}
else{
return 'Ontem';
}
}
else{
let date = start.getDate() + "/" + (start.getMonth()+1) + "/" + start.getFullYear();
return date;
}
}
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
async openMessagesOptions(ev?: any) {
const popover = await this.popoverController.create({
component: MessagesOptionsPage,
@@ -154,7 +154,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
const pathname = window.location.pathname
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) {
@@ -266,7 +266,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
getCustomDate(thedate: Date){
return (thedate.getDay()+1) + "/" +
return thedate.getDate() + "/" +
(thedate.getMonth()+1) + "/" +
thedate.getFullYear();
}
+6 -2
View File
@@ -175,6 +175,10 @@ export class NotificationsService {
}
}
tempClearArray(){
this.DataArray = [];
}
async onReceviNotification() {
if(window['WLAuthorizationManager']) {
@@ -231,8 +235,8 @@ export class NotificationsService {
else if (data.Service === "gabinete-digital" && data.Object === "expediente") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente',data.IdObject,'gabinete-digital']));
}
else if (data.Service === "gabinete-digital" && data.Object === "event-list") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',data.IdObject, 'gabinete-digital']));
else if (data.Service === "agenda" && data.Object === "event-list") {
this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event',data.IdObject, 'agenda']));
}else if (data.Service === "gabinete-digital" && data.Object === "despachos") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos',data.IdObject,'gabinete-digital'],{replaceUrl: true}));