mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
improve create publication
This commit is contained in:
@@ -105,7 +105,7 @@
|
|||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-textarea-class">
|
<div class="ion-textarea-class" [class.input-error]="Form?.get('Detail')?.invalid && validateFrom ">
|
||||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
|
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ export class NewActionPage implements OnInit {
|
|||||||
Date: new FormControl(this.dateValid, [
|
Date: new FormControl(this.dateValid, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
|
Detail: new FormControl(this.folder.Detail, [
|
||||||
|
Validators.required
|
||||||
|
])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { AESEncrypt } from '../services/aesencrypt.service';
|
|||||||
import { CookieService } from 'ngx-cookie-service';
|
import { CookieService } from 'ngx-cookie-service';
|
||||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { NfService } from 'src/app/services/chat/nf.service'
|
import { NfService } from 'src/app/services/chat/nf.service';
|
||||||
import { MessageService } from 'src/app/services/chat/message.service';
|
import { MessageService } from 'src/app/services/chat/message.service';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
@@ -97,10 +97,6 @@ export class AuthService {
|
|||||||
SetSession(response: LoginUserRespose, user:UserForm) {
|
SetSession(response: LoginUserRespose, user:UserForm) {
|
||||||
const session: UserSession = Object.assign(SessionStore.user, response)
|
const session: UserSession = Object.assign(SessionStore.user, response)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (response) {
|
if (response) {
|
||||||
if( session.RoleID == 100000014) {
|
if( session.RoleID == 100000014) {
|
||||||
session.Profile = 'PR'
|
session.Profile = 'PR'
|
||||||
@@ -124,58 +120,25 @@ export class AuthService {
|
|||||||
this.initialsService.getInitials(session.FullName);
|
this.initialsService.getInitials(session.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Login to rocketChat server2
|
|
||||||
//user: UserForm
|
|
||||||
async loginChat(responseChat = this.ValidatedUserChat) {
|
async loginChat(responseChat = this.ValidatedUserChat) {
|
||||||
|
|
||||||
if(SessionStore?.user?.ChatData) {
|
if(SessionStore?.user?.ChatData) {
|
||||||
this.ValidatedUserChat = SessionStore.user.ChatData
|
this.ValidatedUserChat = SessionStore.user.ChatData
|
||||||
}
|
}
|
||||||
|
|
||||||
/* const expirationMinutes = 30;
|
|
||||||
let date = new Date().getTime();
|
|
||||||
let expirationDate = new Date(new Date().getTime() + expirationMinutes*60*1000);
|
|
||||||
|
|
||||||
let postData = {
|
|
||||||
"user": SessionStore.user.UserName,
|
|
||||||
"password": SessionStore.user.Password,
|
|
||||||
}
|
|
||||||
|
|
||||||
let responseChat = await this.httpService.post('login', postData).toPromise();
|
|
||||||
|
|
||||||
if(responseChat) {
|
|
||||||
|
|
||||||
this.ValidatedUserChat = responseChat;
|
|
||||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
|
||||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
|
|
||||||
this.presentAlert('Network error');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.autoLoginChat(expirationDate.getTime() - date); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async autoLoginChat(expirationDate:number) {
|
async autoLoginChat(expirationDate:number) {
|
||||||
/* setTimeout(()=>{
|
|
||||||
this.loginChat(this.ValidatedUserChat);
|
|
||||||
}, expirationDate) */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loginToChatWs() {
|
loginToChatWs() {
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
|
|
||||||
this.RochetChatConnectorService.connect();
|
this.RochetChatConnectorService.connect();
|
||||||
this.RochetChatConnectorService.login().then((message: any) => {
|
this.RochetChatConnectorService.login().then((message: any) => {
|
||||||
|
|
||||||
|
|
||||||
SessionStore.user.RochetChatUserId = message.result.id
|
SessionStore.user.RochetChatUserId = message.result.id
|
||||||
SessionStore.save()
|
SessionStore.save()
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
this.RochetChatConnectorService.setStatus('online')
|
this.RochetChatConnectorService.setStatus('online')
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -185,7 +148,6 @@ export class AuthService {
|
|||||||
// alert('wsLogin')
|
// alert('wsLogin')
|
||||||
|
|
||||||
}).catch((message) => {
|
}).catch((message) => {
|
||||||
|
|
||||||
// alert('ws login failed')
|
// alert('ws login failed')
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -239,8 +201,6 @@ export class AuthService {
|
|||||||
if (message.file.type == "application/img") {
|
if (message.file.type == "application/img") {
|
||||||
const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise();
|
const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (event.type === HttpEventType.DownloadProgress) {
|
if (event.type === HttpEventType.DownloadProgress) {
|
||||||
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
||||||
//
|
//
|
||||||
@@ -267,7 +227,7 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
autologout(expirationDate:number) {
|
autologout(expirationDate:number) {
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
this.logout();
|
this.logout();
|
||||||
}, expirationDate)
|
}, expirationDate)
|
||||||
}
|
}
|
||||||
@@ -278,14 +238,14 @@ export class AuthService {
|
|||||||
localStorage.removeItem('userChat');
|
localStorage.removeItem('userChat');
|
||||||
|
|
||||||
SessionStore.setInativity(false)
|
SessionStore.setInativity(false)
|
||||||
SessionStore.setUrlBeforeInactivity(this.router.url)
|
SessionStore.setUrlBeforeInactivity(this.router.url);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.router.navigateByUrl('/', { replaceUrl: true });
|
this.router.navigateByUrl('/', { replaceUrl: true });
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get user data from RocketChat | global object
|
// Get user data from RocketChat | global object
|
||||||
getUserData() {
|
getUserData() {
|
||||||
this.storageService.get(AuthConnstants.AUTH).then(res=>{
|
this.storageService.get(AuthConnstants.AUTH).then(res=>{
|
||||||
this.userData$.next(res);
|
this.userData$.next(res);
|
||||||
@@ -293,11 +253,6 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logoutChat() {
|
logoutChat() {
|
||||||
//this.storageService.clear();
|
|
||||||
/* this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
|
|
||||||
this.userData$.next('');
|
|
||||||
this.router.navigate(['']);
|
|
||||||
}) */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async presentAlert(message: string) {
|
async presentAlert(message: string) {
|
||||||
|
|||||||
@@ -599,8 +599,6 @@ export class ChatSystemService {
|
|||||||
this.loadingUsers = true
|
this.loadingUsers = true
|
||||||
let _res
|
let _res
|
||||||
|
|
||||||
// console.log('getuser')
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_res = await this.ChatService.getAllUsers().toPromise();
|
_res = await this.ChatService.getAllUsers().toPromise();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -97,12 +97,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div" >
|
||||||
<div class="ion-item-class-2 d-flex">
|
<div class="ion-item-class-2 d-flex">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-textarea-class flex-grow-1">
|
<div class="ion-textarea-class flex-grow-1" [class.input-error]="Form?.get('Detail')?.invalid && validateFrom ">
|
||||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
|
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -85,16 +85,17 @@ export class NewActionPage implements OnInit {
|
|||||||
|
|
||||||
injectValidation() {
|
injectValidation() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.Form = new FormGroup({
|
this.Form = new FormGroup({
|
||||||
Subject: new FormControl(this.folder.Description, [
|
Subject: new FormControl(this.folder.Description, [
|
||||||
Validators.required,
|
Validators.required,
|
||||||
// Validators.minLength(4)
|
//Validators.minLength(1)
|
||||||
]),
|
]),
|
||||||
Date: new FormControl(this.dateValid, [
|
Date: new FormControl(this.dateValid, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
|
Detail: new FormControl(this.folder.Detail, [
|
||||||
|
Validators.required
|
||||||
|
])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user