diff --git a/src/app/pages/publications/new-action/new-action.page.html b/src/app/pages/publications/new-action/new-action.page.html index a235279df..b0a6b8150 100644 --- a/src/app/pages/publications/new-action/new-action.page.html +++ b/src/app/pages/publications/new-action/new-action.page.html @@ -105,7 +105,7 @@
-
+
diff --git a/src/app/pages/publications/new-action/new-action.page.ts b/src/app/pages/publications/new-action/new-action.page.ts index 3a2fdca85..a39ad6007 100644 --- a/src/app/pages/publications/new-action/new-action.page.ts +++ b/src/app/pages/publications/new-action/new-action.page.ts @@ -126,6 +126,9 @@ export class NewActionPage implements OnInit { Date: new FormControl(this.dateValid, [ Validators.required ]), + Detail: new FormControl(this.folder.Detail, [ + Validators.required + ]) }) } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 3382f75a9..da5b8b97c 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -12,7 +12,7 @@ import { AESEncrypt } from '../services/aesencrypt.service'; import { CookieService } from 'ngx-cookie-service'; import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'; 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 { ProcessesService } from 'src/app/services/processes.service'; import { AttachmentsService } from 'src/app/services/attachments.service'; @@ -97,10 +97,6 @@ export class AuthService { SetSession(response: LoginUserRespose, user:UserForm) { const session: UserSession = Object.assign(SessionStore.user, response) - - - - if (response) { if( session.RoleID == 100000014) { session.Profile = 'PR' @@ -124,58 +120,25 @@ export class AuthService { this.initialsService.getInitials(session.FullName); } - //Login to rocketChat server2 - //user: UserForm async loginChat(responseChat = this.ValidatedUserChat) { if(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) { - /* setTimeout(()=>{ - this.loginChat(this.ValidatedUserChat); - }, expirationDate) */ } loginToChatWs() { - setTimeout(()=>{ + setTimeout(() => { this.RochetChatConnectorService.connect(); this.RochetChatConnectorService.login().then((message: any) => { - SessionStore.user.RochetChatUserId = message.result.id SessionStore.save() - // - - this.RochetChatConnectorService.setStatus('online') setTimeout(() => { @@ -185,7 +148,6 @@ export class AuthService { // alert('wsLogin') }).catch((message) => { - // alert('ws login failed') }) @@ -239,8 +201,6 @@ export class AuthService { if (message.file.type == "application/img") { const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise(); - - if (event.type === HttpEventType.DownloadProgress) { //this.downloadProgess = Math.round((100 * event.loaded) / event.total); // @@ -267,7 +227,7 @@ export class AuthService { } autologout(expirationDate:number) { - setTimeout(()=>{ + setTimeout(() => { this.logout(); }, expirationDate) } @@ -278,14 +238,14 @@ export class AuthService { localStorage.removeItem('userChat'); SessionStore.setInativity(false) - SessionStore.setUrlBeforeInactivity(this.router.url) + SessionStore.setUrlBeforeInactivity(this.router.url); setTimeout(() => { this.router.navigateByUrl('/', { replaceUrl: true }); }, 100) } - //Get user data from RocketChat | global object + // Get user data from RocketChat | global object getUserData() { this.storageService.get(AuthConnstants.AUTH).then(res=>{ this.userData$.next(res); @@ -293,11 +253,6 @@ export class AuthService { } logoutChat() { - //this.storageService.clear(); - /* this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{ - this.userData$.next(''); - this.router.navigate(['']); - }) */ } async presentAlert(message: string) { diff --git a/src/app/services/chat/chat-system.service.ts b/src/app/services/chat/chat-system.service.ts index 90e7c66eb..61c16a9e4 100644 --- a/src/app/services/chat/chat-system.service.ts +++ b/src/app/services/chat/chat-system.service.ts @@ -599,8 +599,6 @@ export class ChatSystemService { this.loadingUsers = true let _res - // console.log('getuser') - try { _res = await this.ChatService.getAllUsers().toPromise(); } catch (error) { diff --git a/src/app/shared/publication/new-action/new-action.page.html b/src/app/shared/publication/new-action/new-action.page.html index 22f9d8a3a..826ca06c6 100644 --- a/src/app/shared/publication/new-action/new-action.page.html +++ b/src/app/shared/publication/new-action/new-action.page.html @@ -97,12 +97,12 @@ -
+
-
+
diff --git a/src/app/shared/publication/new-action/new-action.page.ts b/src/app/shared/publication/new-action/new-action.page.ts index 32b81ec7f..d20a9c679 100644 --- a/src/app/shared/publication/new-action/new-action.page.ts +++ b/src/app/shared/publication/new-action/new-action.page.ts @@ -85,16 +85,17 @@ export class NewActionPage implements OnInit { injectValidation() { - - this.Form = new FormGroup({ Subject: new FormControl(this.folder.Description, [ Validators.required, - // Validators.minLength(4) + //Validators.minLength(1) ]), Date: new FormControl(this.dateValid, [ Validators.required ]), + Detail: new FormControl(this.folder.Detail, [ + Validators.required + ]) }) }