change login v1 to v2

This commit is contained in:
Peter Maquiran
2024-11-06 10:38:58 +01:00
parent 5c0bd094ca
commit 5c18f281bc
40 changed files with 271 additions and 246 deletions
+101 -20
View File
@@ -1,27 +1,108 @@
import { z } from "zod"; // import { z } from "zod";
import { SHA1 } from 'crypto-js'
import { localstoreService } from "src/app/store/localstore.service";
// Define the schema for the user object // // Define the schema for the user object
const UserSchema = z.object({ // const UserSchema = z.object({
wxUserId: z.number(), // wxUserId: z.number(),
wxFullName: z.string(), // wxFullName: z.string(),
wxeMail: z.string(), // wxeMail: z.string(),
role: z.string(), // role: z.string(),
roleId: z.number(), // roleId: z.number(),
userPhoto: z.string(), // userPhoto: z.string(),
adUserSID: z.string(), // adUserSID: z.string(),
// });
// // Define the schema for the main response object
// const UserDataSchema = z.object({
// user: UserSchema,
// authorization: z.string(),
// refreshToken: z.string(),
// permissions: z.array(z.number()),
// });
// export type IUser = z.infer<typeof UserDataSchema>
// export class UserEntity {
// wxUserId: number
// wxFullName: string
// wxeMail: string
// role: string
// roleId: number
// userPhoto: string
// adUserSID: string
// authorization: string
// refreshToken: string
// permissions: number[]
// Profile: 'PR' | 'MDGPR'| 'Consultant'| 'SGGPR'| 'Unknown'
// constructor(input: IUser) {
// Object.assign(this, input)
// if (input) {
// if (input?.user?.roleId == 100000014) {
// this.Profile = 'PR'
// } else if (input.user.roleId == 100000011) {
// this.Profile = 'MDGPR'
// } else if (input.user.roleId == 99999872) {
// this.Profile = 'Consultant'
// } else if (input.user.roleId == 99999886) {
// this.Profile = 'SGGPR'
// } else {
// this.Profile = 'Unknown'
// }
// }
// }
// }
import { z } from 'zod';
const LoginUserResponseSchema = z.object({
UserId: z.number(),
Authorization: z.string(),
Email: z.string().email(),
FullName: z.string(),
RoleDescription: z.string(),
RoleID: z.number(),
Profile: z.string(), // You can further define the Profile if you have more details
UserPermissions: z.array(z.number()), // Same as above, you can define more details if needed
}); });
// Define the schema for the main response object type LoginUserResponse = z.infer<typeof LoginUserResponseSchema>;
const UserDataSchema = z.object({
user: UserSchema,
authorization: z.string(),
refreshToken: z.string(), const CalendarInterfaceSchema = z.object({
permissions: z.array(z.number()), CalendarId: z.string(),
CalendarName: z.enum(["Oficial", "Pessoal"]),
CalendarRoleId: z.string(),
Id: z.number(),
OwnerUserId: z.unknown(), // You can define more specifically based on your requirements
}); });
export type IUser = z.infer<typeof UserDataSchema> type CalendarInterface = z.infer<typeof CalendarInterfaceSchema>;
const UserSessionSchema = z.object({
UserId: z.number(),
Authorization: z.string(),
Email: z.string().email(),
FullName: z.string(),
RoleDescription: z.string(),
RoleID: z.number(),
Password: z.string(),
RochetChatUserId: z.string(),
Profile: z.enum(['PR', 'MDGPR', 'Consultant', 'SGGPR', 'Unknown']),
LoginPreference: z.enum(['None', 'Password', 'Pin', null]).nullable(),
PIN: z.string(),
Inactivity: z.boolean(),
UrlBeforeInactivity: z.string(),
UserPermissions: z.unknown(), // Again, you can define it more explicitly if needed
UserPhoto: z.string(),
RefreshToken: z.string(),
});
type UserSession = z.infer<typeof UserSessionSchema>;
export class UserEntity { export class UserEntity {
@@ -37,7 +118,7 @@ export class UserEntity {
permissions: number[] permissions: number[]
Profile: 'PR' | 'MDGPR'| 'Consultant'| 'SGGPR'| 'Unknown' Profile: 'PR' | 'MDGPR'| 'Consultant'| 'SGGPR'| 'Unknown'
constructor(input: IUser) { constructor(input: any) {
Object.assign(this, input) Object.assign(this, input)
if (input) { if (input) {
+18
View File
@@ -0,0 +1,18 @@
import { UserLoginOutputResponse } from "../repository/user-remote-repository";
import { UserLoginOutput } from "../use-case/user-login-use-case.service";
export class UserLoginMapper{
static toDomainData(input: UserLoginOutputResponse): UserLoginOutput {
return {
RefreshToken: input.data.refreshToken,
Authorization: input.data.authorization,
Email: input.data.user.wxeMail,
FullName: input.data.user.wxeMail,
RoleDescription: input.data.user.role,
RoleID: input.data.user.roleId,
UserId: input.data.user.wxUserId,
UserPermissions: input.data.permissions,
Profile: ''
}
}
}
@@ -1,7 +1,7 @@
import { HttpErrorResponse } from "@angular/common/http"; import { HttpErrorResponse } from "@angular/common/http";
import { Result } from "neverthrow"; import { Result } from "neverthrow";
import { HttpResult } from "src/app/infra/http/type"; import { HttpResult } from "src/app/infra/http/type";
import { UserLoginInput, UserLoginOutput } from "../use-case/user-login-use-case.service"; import { UserLoginInput } from "../use-case/user-login-use-case.service";
import { z } from "zod"; import { z } from "zod";
const UserRepositoryLoginParams = z.object({ const UserRepositoryLoginParams = z.object({
@@ -9,8 +9,37 @@ const UserRepositoryLoginParams = z.object({
ChannelId: z.number() ChannelId: z.number()
}) })
export type IUserRepositoryLoginParams = z.infer<typeof UserRepositoryLoginParams>
// Define the schema for the user object
const UserSchema = z.object({
wxUserId: z.number(),
wxFullName: z.string(),
wxeMail: z.string(),
role: z.string(),
roleId: z.number(),
userPhoto: z.string(),
adUserSID: z.string(),
});
// Define the schema for the main response object
const UserLoginOutputSchema = z.object({
user: UserSchema,
authorization: z.string(),
refreshToken: z.string(),
permissions: z.array(z.number()),
});
// Define the main schema for the response
const LoginUserResponseSchema = z.object({
success: z.boolean(),
message: z.nullable(z.string()), // Message can be null
data: UserLoginOutputSchema,
});
export type UserLoginOutputResponse = z.infer<typeof LoginUserResponseSchema>
export type IUserRepositoryLoginParams = z.infer<typeof UserRepositoryLoginParams>
export abstract class IUserRemoteRepository { export abstract class IUserRemoteRepository {
abstract login(input: IUserRepositoryLoginParams): Promise<Result<HttpResult<UserLoginOutput>, HttpErrorResponse>> abstract login(input: IUserRepositoryLoginParams): Promise<Result<HttpResult<UserLoginOutputResponse>, HttpErrorResponse>>
} }
@@ -3,9 +3,11 @@ import { z } from 'zod';
import { IUserRemoteRepository } from '../repository/user-remote-repository'; import { IUserRemoteRepository } from '../repository/user-remote-repository';
import { XTracerAsync, TracingType } from 'src/app/services/monitoring/opentelemetry/tracer'; import { XTracerAsync, TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
import { zodSafeValidation } from 'src/app/utils/zodValidation'; import { zodSafeValidation } from 'src/app/utils/zodValidation';
import { AlertController, Platform } from '@ionic/angular'; import { Platform } from '@ionic/angular';
import { AESEncrypt } from 'src/app/services/aesencrypt.service'; import { AESEncrypt } from 'src/app/services/aesencrypt.service';
import { UserLoginMapper } from '../mapper/user-login';
import { UserSession } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service';
const UserLoginInputSchema = z.object({ const UserLoginInputSchema = z.object({
username: z.string(), username: z.string(),
@@ -16,34 +18,22 @@ export type UserLoginInput = z.infer<typeof UserLoginInputSchema>
// Define the schema for the user object
const UserSchema = z.object({
wxUserId: z.number(),
wxFullName: z.string(),
wxeMail: z.string(),
role: z.string(),
roleId: z.number(),
userPhoto: z.string(),
adUserSID: z.string(),
});
// Define the schema for the main response object // Define the schema for the main response object
const UserLoginOutputSchema = z.object({ const UserLoginOutputSchema = z.object({
user: UserSchema, UserId: z.number(),
authorization: z.string(), Authorization: z.string(),
refreshToken: z.string(), RefreshToken: z.string(),
permissions: z.array(z.number()), Email: z.string().email(),
}); FullName: z.string(),
RoleDescription: z.string(),
// Define the main schema for the response RoleID: z.number(),
const LoginUserResponseSchema = z.object({ Profile: z.string(), // You can further define the Profile if you have more details
success: z.boolean(), UserPermissions: z.array(z.number()), // Same as above, you can define more details if needed
message: z.nullable(z.string()), // Message can be null
data: UserLoginOutputSchema,
}); });
export type UserLoginOutput = z.infer<typeof LoginUserResponseSchema>
export type UserLoginOutput = z.infer<typeof UserLoginOutputSchema>
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -76,13 +66,28 @@ export class UserLoginUseCaseService {
ChannelId: channelId ChannelId: channelId
}) })
if(result.isOk()) { return result.map(e => {
if(result.value) {
const data = UserLoginMapper.toDomainData(e.data)
const session: UserSession = Object.assign(SessionStore.user, data)
if (session.RoleID == 100000014) {
session.Profile = 'PR'
} else if (session.RoleID == 100000011) {
session.Profile = 'MDGPR'
} else if (session.RoleID == 99999872) {
session.Profile = 'Consultant'
} else if (session.RoleID == 99999886) {
session.Profile = 'SGGPR'
} else {
session.Profile = 'Unknown'
} }
}
SessionStore.reset(session)
return result.map(e => e.data.data) return UserLoginMapper.toDomainData(e.data)
})
} else { } else {
tracing.setAttribute('parameter error','true') tracing.setAttribute('parameter error','true')
@@ -9,7 +9,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page'; import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { SearchList } from 'src/app/models/search-document'; import { SearchList } from 'src/app/models/search-document';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
@@ -85,7 +85,7 @@ export class CreateProcessPage implements OnInit {
documents: SearchList[] = []; documents: SearchList[] = [];
loggeduser: LoginUserRespose; loggeduser: UserSession;
toppings = new FormControl(); toppings = new FormControl();
@@ -5,7 +5,7 @@ import { Event } from 'src/app/models/event.model'
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchDocumentDetails, SearchFolderDetails, SearchList } from 'src/app/models/search-document'; import { SearchDocumentDetails, SearchFolderDetails, SearchList } from 'src/app/models/search-document';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
@@ -92,7 +92,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
formLocationSatus: boolean = false; formLocationSatus: boolean = false;
showAttendees = false; showAttendees = false;
loggeduser: LoginUserRespose; loggeduser: UserSession;
emptyTextDescription = "Selecionar intervenientes"; emptyTextDescription = "Selecionar intervenientes";
document: SearchFolderDetails | SearchDocumentDetails | any; document: SearchFolderDetails | SearchDocumentDetails | any;
-12
View File
@@ -6,18 +6,6 @@ export class UserForm {
} }
export class LoginUserRespose {
UserId: number;
Authorization: string;
Email: string
FullName: string
RoleDescription: string
RoleID: number
Profile: any;
UserPermissions: any;
}
export class calendarInterface { export class calendarInterface {
CalendarId: string CalendarId: string
CalendarName: "Oficial" | "Pessoal"; CalendarName: "Oficial" | "Pessoal";
@@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { ModalController, NavParams } from '@ionic/angular'; import { ModalController, NavParams } from '@ionic/angular';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service'; import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
@@ -25,7 +25,7 @@ export class AttendeesPageModal implements OnInit {
taskParticipants:EventPerson[] = []; taskParticipants:EventPerson[] = [];
taskParticipantsCc:EventPerson[] = []; taskParticipantsCc:EventPerson[] = [];
loggeduser: LoginUserRespose; loggeduser: UserSession;
hideExternalDomain = true; hideExternalDomain = true;
taskType: any; taskType: any;
@@ -7,7 +7,7 @@ import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchList } from 'src/app/models/search-document'; import { SearchList } from 'src/app/models/search-document';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
@@ -111,7 +111,7 @@ export class BookMeetingModalPage implements OnInit {
sessionStore = SessionStore; sessionStore = SessionStore;
SessionStore=SessionStore SessionStore=SessionStore
environment = environment environment = environment
loggeduser: LoginUserRespose; loggeduser: UserSession;
eventPersons: EventPerson[]; eventPersons: EventPerson[];
contacts: EventPerson[]; contacts: EventPerson[];
@@ -12,7 +12,7 @@ import { ExpedienteDetailPage } from '../expediente-detail/expediente-detail.pag
import { AlertService } from 'src/app/services/alert.service'; import { AlertService } from 'src/app/services/alert.service';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchList } from 'src/app/models/search-document'; import { SearchList } from 'src/app/models/search-document';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
@@ -98,7 +98,7 @@ export class ExpedientTaskModalPage implements OnInit {
taskResult: any = {} taskResult: any = {}
loggeduser: LoginUserRespose; loggeduser: UserSession;
toppings = new FormControl(); toppings = new FormControl();
Form: FormGroup; Form: FormGroup;
@@ -26,7 +26,7 @@ import { NewGroupPage } from 'src/app/ui/chat/modal/new-group/new-group.page';
import { DataService } from 'src/app/services/data.service'; import { DataService } from 'src/app/services/data.service';
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service'; import { TaskService } from 'src/app/services/task.service';
@@ -61,7 +61,7 @@ export class ExpedienteDetailPage implements OnInit {
onlinecheck: boolean; onlinecheck: boolean;
loggeduser: LoginUserRespose; loggeduser: UserSession;
showOptions = false showOptions = false
constructor( constructor(
@@ -7,7 +7,7 @@ import { ViewEventPage } from 'src/app/ui/agenda/modal/view-event/view-event.pag
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page'; import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page'; import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page'; import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page'; import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
@@ -41,7 +41,7 @@ export class ExpedientePrPage implements OnInit {
intervenientes: any = []; intervenientes: any = [];
cc: any = []; cc: any = [];
loggeduser: LoginUserRespose; loggeduser: UserSession;
documents: SearchList[] = []; documents: SearchList[] = [];
attachments:any; attachments:any;
isDelegated: boolean; isDelegated: boolean;
@@ -4,7 +4,7 @@ import { CalendarComponent } from 'ionic2-calendar';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page'; import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service'; import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe'; import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
@@ -26,7 +26,7 @@ export class ExpedientesPrPage implements OnInit {
serialNumber:string; serialNumber:string;
showLoader:boolean; showLoader:boolean;
loggeduser: LoginUserRespose; loggeduser: UserSession;
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>(); @Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
skeletonLoader = true skeletonLoader = true
@@ -1,7 +1,7 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import {NavigationEnd, NavigationExtras, Router } from '@angular/router'; import {NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page'; import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page'; import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page';
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page'; import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
@@ -57,7 +57,7 @@ export class GabineteDigitalPage implements OnInit {
serialNumber: string; serialNumber: string;
loggeduser: LoginUserRespose; loggeduser: UserSession;
mdgpr = "MDGPR"; mdgpr = "MDGPR";
pr = "PR"; pr = "PR";
@@ -10,7 +10,7 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process.
import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page'; import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { ForwardPage } from 'src/app/modals/forward/forward.page'; import { ForwardPage } from 'src/app/modals/forward/forward.page';
@@ -47,7 +47,7 @@ export class PedidoPage implements OnInit {
caller: string; caller: string;
intervenientes: any = [] intervenientes: any = []
cc: any = []; cc: any = [];
loggeduser: LoginUserRespose; loggeduser: UserSession;
taskArrayActions = []; taskArrayActions = [];
showOptions = false showOptions = false
@@ -6,7 +6,7 @@ import { customTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { AlertService } from 'src/app/services/alert.service'; import { AlertService } from 'src/app/services/alert.service';
import { PendentesStore } from 'src/app/store/pendestes-store.service'; import { PendentesStore } from 'src/app/store/pendestes-store.service';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@@ -31,7 +31,7 @@ export class PendentesPage implements OnInit {
serialNumber: string; serialNumber: string;
totalDocs: any; totalDocs: any;
showLoader: boolean; showLoader: boolean;
loggeduser: LoginUserRespose; loggeduser: UserSession;
@Input() profile: string; @Input() profile: string;
segment: string; segment: string;
+2 -2
View File
@@ -86,7 +86,7 @@ export class InactivityPage implements OnInit {
// if current attemp is equal to the current user // if current attemp is equal to the current user
if (attempt.UserId == SessionStore.user.UserId) { if (attempt.UserId == SessionStore.user.UserId) {
await this.authService.SetSession(attempt, this.userattempt); // await this.authService.SetSession(attempt, this.userattempt);
if (this.p.userPermission(this.p.permissionList.Chat.access)) { if (this.p.userPermission(this.p.permissionList.Chat.access)) {
// this.authService.loginChat(); // this.authService.loginChat();
@@ -101,7 +101,7 @@ export class InactivityPage implements OnInit {
window.localStorage.clear(); window.localStorage.clear();
SessionStore.setInativity(true) SessionStore.setInativity(true)
await this.authService.SetSession(attempt, this.userattempt); // await this.authService.SetSession(attempt, this.userattempt);
} }
this.enterWithPassword = false this.enterWithPassword = false
+5 -9
View File
@@ -133,30 +133,26 @@ export class LoginPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
this.UserService.login({ let attempt = await this.UserService.login({
username: newUserName.trim(), username: newUserName.trim(),
password: this.password.trim(), password: this.password.trim(),
}) })
let attempt = await this.authService.login(this.userattempt, { saveSession: false })
/* const data = await this.authService.loginContenteProduction(this.userattempt, { saveSession: true }) */
loader.remove() loader.remove()
if (attempt) { if (attempt.isOk()) {
if (attempt.UserId == SessionStore.user.UserId) { if (attempt.value.UserId == SessionStore.user.UserId) {
await this.authService.SetSession(attempt, this.userattempt); // await this.authService.SetSession(attempt.value, this.userattempt);
this.changeProfileService.run(); this.changeProfileService.run();
try { try {
await this.AgendaDataRepositoryService.getSharedCalendar() await this.AgendaDataRepositoryService.getSharedCalendar()
this.NotificationHolderService.clear() this.NotificationHolderService.clear()
await this.authService.loginToChatWs();
this.NotificationRepositoryService.init() this.NotificationRepositoryService.init()
@@ -189,7 +185,7 @@ export class LoginPage implements OnInit {
window.localStorage.clear(); window.localStorage.clear();
this.storage.clear(); this.storage.clear();
await this.authService.SetSession(attempt, this.userattempt); // await this.authService.SetSession(attempt.value, this.userattempt);
this.NotificationRepositoryService.init() this.NotificationRepositoryService.init()
/* CPSession.save(data) */ /* CPSession.save(data) */
+2 -2
View File
@@ -3,7 +3,7 @@ import { Attachment } from '../models/attachment.model';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { LoginUserRespose } from '../models/user.model'; import { UserSession } from '../models/user.model';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { File } from '@ionic-native/file/ngx'; import { File } from '@ionic-native/file/ngx';
import { Platform } from '@ionic/angular'; import { Platform } from '@ionic/angular';
@@ -14,7 +14,7 @@ import { ChangeProfileService } from './change-profile.service';
}) })
export class AttachmentsService { export class AttachmentsService {
loggeduser: LoginUserRespose; loggeduser: UserSession;
headers: HttpHeaders; headers: HttpHeaders;
constructor( constructor(
+8 -103
View File
@@ -1,7 +1,7 @@
import { Injectable, ErrorHandler } from '@angular/core'; import { Injectable, ErrorHandler } from '@angular/core';
import { StorageService } from './storage.service'; import { StorageService } from './storage.service';
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
import { LoginUserRespose, UserForm, UserSession } from '../models/user.model'; import { UserForm, UserSession } from '../models/user.model';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { BehaviorSubject, of } from 'rxjs'; import { BehaviorSubject, of } from 'rxjs';
import { AlertController, Platform } from '@ionic/angular'; import { AlertController, Platform } from '@ionic/angular';
@@ -15,6 +15,7 @@ import { PermissionService } from './permission.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { captureException } from '@sentry/angular'; import { captureException } from '@sentry/angular';
import { catchError, tap } from 'rxjs/operators'; import { catchError, tap } from 'rxjs/operators';
import { UserLoginOutput } from '../core/user/use-case/user-login-use-case.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@@ -42,12 +43,6 @@ export class AuthService {
private errorHandler: ErrorHandler, private errorHandler: ErrorHandler,
private platform: Platform,) { private platform: Platform,) {
if (SessionStore.exist) {
if (this.p.userPermission(this.p.permissionList.Chat.access) == true) {
this.loginToChatWs()
}
}
window.addEventListener('focus', (event) => { window.addEventListener('focus', (event) => {
if (!this.tabIsActive) { if (!this.tabIsActive) {
@@ -70,7 +65,7 @@ export class AuthService {
} }
async login(user: UserForm, { saveSession = true }): Promise<LoginUserRespose> { async login(user: UserForm, { saveSession = true }): Promise<UserSession> {
user.BasicAuthKey = btoa(user.username + ':' + this.aesencrypt.encrypt(user.password, user.username)); user.BasicAuthKey = btoa(user.username + ':' + this.aesencrypt.encrypt(user.password, user.username));
this.headers = this.headers.set('Authorization', user.BasicAuthKey); this.headers = this.headers.set('Authorization', user.BasicAuthKey);
@@ -95,11 +90,11 @@ export class AuthService {
let response: any; let response: any;
try { try {
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", body, this.opts).toPromise(); response = await this.http.post<UserSession>(environment.apiURL + "UserAuthentication/Login", body, this.opts).toPromise();
if (saveSession) { if (saveSession) {
this.SetSession(response, user) // this.SetSession(response, user)
} }
} catch (error) { } catch (error) {
this.errorHandler.handleError(error); this.errorHandler.handleError(error);
@@ -116,7 +111,7 @@ export class AuthService {
} }
async loginContenteProduction(user: UserForm, { saveSession = true }): Promise<LoginUserRespose> { async loginContenteProduction(user: UserForm, { saveSession = true }): Promise<UserSession> {
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password, user.username)); user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password, user.username));
this.headers = this.headers.set('Authorization', user.BasicAuthKey); this.headers = this.headers.set('Authorization', user.BasicAuthKey);
@@ -127,7 +122,7 @@ export class AuthService {
let response: any; let response: any;
try { try {
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise(); response = await this.http.post<UserSession>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
console.log('JWT', response) console.log('JWT', response)
if (saveSession) { if (saveSession) {
@@ -147,96 +142,6 @@ export class AuthService {
// async UpdateLogin() {} // async UpdateLogin() {}
SetSession(response: LoginUserRespose, user: UserForm) {
const session: UserSession = Object.assign(SessionStore.user, response)
if (response) {
if (session.RoleID == 100000014) {
session.Profile = 'PR'
} else if (session.RoleID == 100000011) {
session.Profile = 'MDGPR'
} else if (session.RoleID == 99999872) {
session.Profile = 'Consultant'
} else if (session.RoleID == 99999886) {
session.Profile = 'SGGPR'
} else {
session.Profile = 'Unknown'
}
session.Password = user.password
SessionStore.reset(session)
return true;
}
this.initialsService.getInitials(session.FullName);
}
loginToChatWs() {
setTimeout(() => {
//if (SessionStore.user.ChatData?.data) {
// this.RochetChatConnectorService.logout();
// this.RochetChatConnectorService.connect();
// this.RochetChatConnectorService.login().then((message: any) => {
// console.log('Chat login', message)
// SessionStore.user.RochetChatUserId = message.result.id
// SessionStore.save()
// this.ChatSystemService.loadChat()
// this.RochetChatConnectorService.setStatus('online')
// window['RochetChatConnectorService'] = this.RochetChatConnectorService
// setTimeout(() => {
// this.ChatSystemService.getAllRooms();
// this.RochetChatConnectorService.setStatus('online')
// }, 200);
// }).catch((error) => {
// console.error(SessionStore.user.ChatData, 'web socket login', error)
// if(window.location.pathname.includes('/home/')) {
// setTimeout(() => {
// this.loginToChatWs();
// }, 4000)
// }
// })
//}
// before sending a message with a attachment
8
// this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
// //
// let downloadFile = "";
// 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);
// return true
// } else if (event.type === HttpEventType.Response) {
// downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
// message.file = {
// guid: message.file.guid,
// image_url: downloadFile,
// type: message.file.type
// }
// return true
// }
// return false
// }
// };
}, 1)
}
autologout(expirationDate: number) { autologout(expirationDate: number) {
setTimeout(() => { setTimeout(() => {
this.logout(); this.logout();
@@ -277,7 +182,7 @@ export class AuthService {
let response: any; let response: any;
try { try {
response = await this.http.delete<LoginUserRespose>(environment.apiURL + "userauthentication/Logout", this.opts).toPromise(); response = await this.http.delete<UserSession>(environment.apiURL + "userauthentication/Logout", this.opts).toPromise();
SessionStore.user.Authorization = ""; SessionStore.user.Authorization = "";
SessionStore.user.RefreshToken = ""; SessionStore.user.RefreshToken = "";
} catch (error) { } catch (error) {
+5 -2
View File
@@ -168,9 +168,12 @@ export class NotificationsService {
DeletePostToken() { DeletePostToken() {
const geturl = environment.apiURL + `notifications/token?userId=${SessionStore.user.UserId}&tokenId=${this.token}`; if(this.token) {
const geturl = environment.apiURL + `notifications/token?userId=${SessionStore.user.UserId}&tokenId=${this.token}`;
this.DeleteToken(geturl) this.DeleteToken(geturl)
}
} }
postToken(token, geturl, tracing: TracingType) { postToken(token, geturl, tracing: TracingType) {
+2 -2
View File
@@ -4,7 +4,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service'; import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model'; import { UserSession } from '../models/user.model';
import { OrganicEntity } from 'src/app/models/organic-entity.model'; import { OrganicEntity } from 'src/app/models/organic-entity.model';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service'; import { ChangeProfileService } from './change-profile.service';
@@ -15,7 +15,7 @@ import { ChangeProfileService } from './change-profile.service';
export class OrganicEntityService { export class OrganicEntityService {
authheader = {}; authheader = {};
loggeduser: LoginUserRespose; loggeduser: UserSession;
headers: HttpHeaders; headers: HttpHeaders;
constructor( constructor(
+2 -2
View File
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { LoginUserRespose } from '../models/user.model'; import { UserSession } from '../models/user.model';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { DocumentSetUpMeeting } from '../models/CallMeeting'; import { DocumentSetUpMeeting } from '../models/CallMeeting';
@@ -16,7 +16,7 @@ import { SessionStore } from '../store/session.service';
export class ProcessesService { export class ProcessesService {
authheader = {}; authheader = {};
loggeduser: LoginUserRespose; loggeduser: UserSession;
headers: HttpHeaders; headers: HttpHeaders;
headers2: HttpHeaders; headers2: HttpHeaders;
+2 -2
View File
@@ -2,7 +2,7 @@ import { Injectable, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service'; import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model'; import { UserSession } from '../models/user.model';
import { Observable, throwError } from 'rxjs'; import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators' import { catchError } from 'rxjs/operators'
import { Publication } from '../models/publication'; import { Publication } from '../models/publication';
@@ -19,7 +19,7 @@ export class PublicationsService {
authheader = {}; authheader = {};
loggeduser: LoginUserRespose; loggeduser: UserSession;
headers: HttpHeaders; headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService, constructor(private http: HttpClient, user: AuthService,
+2 -2
View File
@@ -4,7 +4,7 @@ import { Event } from '../models/event.model';
import { from, Observable } from 'rxjs'; import { from, Observable } from 'rxjs';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service'; import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model'; import { UserSession } from '../models/user.model';
import { EventSearch } from "src/app/models/event-search"; import { EventSearch } from "src/app/models/event-search";
import { TopSearch } from 'src/app/models/top-search'; import { TopSearch } from 'src/app/models/top-search';
import { SessionStore } from '../store/session.service'; import { SessionStore } from '../store/session.service';
@@ -16,7 +16,7 @@ import { ChangeProfileService } from './change-profile.service';
export class SearchService { export class SearchService {
// state // state
authheader = {}; authheader = {};
loggeduser: LoginUserRespose; loggeduser: UserSession;
headers: HttpHeaders; headers: HttpHeaders;
categories= Array; categories= Array;
@@ -4,7 +4,7 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ViewChild } from '@angular/core'; import { ViewChild } from '@angular/core';
import { Searchbar } from 'ionic-angular'; import { Searchbar } from 'ionic-angular';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service'; import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
@@ -46,7 +46,7 @@ export class AttendeePage implements OnInit {
LtaskParticipants: EventPerson[] = []; LtaskParticipants: EventPerson[] = [];
LtaskParticipantsCc: EventPerson[] = []; LtaskParticipantsCc: EventPerson[] = [];
loggeduser: LoginUserRespose; loggeduser: UserSession;
listOfNotAllowdRoute = ['/home/gabinete-digital/despachos/', ] listOfNotAllowdRoute = ['/home/gabinete-digital/despachos/', ]
selectedUserCalendar:any; selectedUserCalendar:any;
@@ -1,6 +1,6 @@
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router'; import { NavigationEnd, Router } from '@angular/router';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { ThemeService } from 'src/app/services/theme.service'; import { ThemeService } from 'src/app/services/theme.service';
import { TaskService } from 'src/app/services/task.service'; import { TaskService } from 'src/app/services/task.service';
@@ -13,7 +13,7 @@ import { TaskService } from 'src/app/services/task.service';
export class AllProcessesPage implements OnInit { export class AllProcessesPage implements OnInit {
skeletonLoader = false; skeletonLoader = false;
loggeduser: LoginUserRespose; loggeduser: UserSession;
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
showSearch = false; showSearch = false;
searchSubject: string = ''; searchSubject: string = '';
@@ -1,6 +1,6 @@
import { Component, OnInit} from '@angular/core'; import { Component, OnInit} from '@angular/core';
import { customTask} from '../../../models/dailyworktask.model'; import { customTask} from '../../../models/dailyworktask.model';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { NavigationStart, Router } from '@angular/router'; import { NavigationStart, Router } from '@angular/router';
import { DespachosprStore } from 'src/app/store/despachospr-store.service'; import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@@ -20,7 +20,7 @@ export class DespachosPrPage implements OnInit {
customTaskPipe = new CustomTaskPipe() customTaskPipe = new CustomTaskPipe()
skeletonLoader = false skeletonLoader = false
loggeduser: LoginUserRespose; loggeduser: UserSession;
despachosprstore = DespachosprStore; despachosprstore = DespachosprStore;
environment = environment environment = environment
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos' filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
@@ -1,7 +1,7 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { NavigationStart, Router } from '@angular/router'; import { NavigationStart, Router } from '@angular/router';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service'; import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe'; import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
@@ -25,7 +25,7 @@ export class ExpedientesPrPage implements OnInit {
customTaskPipe = new CustomTaskPipe() customTaskPipe = new CustomTaskPipe()
expedienteTaskPipe = new ExpedienteTaskPipe() expedienteTaskPipe = new ExpedienteTaskPipe()
loggeduser: LoginUserRespose; loggeduser: UserSession;
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos' filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
showSearch = false showSearch = false
@@ -9,7 +9,7 @@ import { ModalController } from '@ionic/angular';
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page'; import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
import { HeaderSettingsService } from "src/app/services/header-settings.service" import { HeaderSettingsService } from "src/app/services/header-settings.service"
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@@ -33,7 +33,7 @@ export class TaskDetailsPage implements OnInit {
selectedIndex = 0 selectedIndex = 0
dropButton = true dropButton = true
loggeduser: LoginUserRespose; loggeduser: UserSession;
@ViewChild('text', { static: false }) text: ElementRef; @ViewChild('text', { static: false }) text: ElementRef;
constructor( constructor(
@@ -4,7 +4,7 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { customTask} from '../../../models/dailyworktask.model'; import { customTask} from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { PendentesStore } from 'src/app/store/pendestes-store.service'; import { PendentesStore } from 'src/app/store/pendestes-store.service';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { SortService } from 'src/app/services/functions/sort.service'; import { SortService } from 'src/app/services/functions/sort.service';
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
@@ -22,7 +22,7 @@ export class PendentesPage implements OnInit {
skeletonLoader: boolean = false; skeletonLoader: boolean = false;
pendentesstore = PendentesStore; pendentesstore = PendentesStore;
customTaskPipe = new CustomTaskPipe() customTaskPipe = new CustomTaskPipe()
loggeduser: LoginUserRespose; loggeduser: UserSession;
listToPresent = []; listToPresent = [];
@Input() profile:string; @Input() profile:string;
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular'; import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { SearchList } from 'src/app/models/search-document'; import { SearchList } from 'src/app/models/search-document';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
@@ -40,7 +40,7 @@ export class OptsExpedientePrPage implements OnInit {
showEnviarPendentes = false; showEnviarPendentes = false;
loggeduser: LoginUserRespose; loggeduser: UserSession;
constructor( constructor(
private popoverController: PopoverController, private popoverController: PopoverController,
+2 -2
View File
@@ -18,7 +18,7 @@ import {
} from 'angular-calendar'; } from 'angular-calendar';
import { CustomDateFormatter } from './custom-date-formatter.provider'; import { CustomDateFormatter } from './custom-date-formatter.provider';
import { NewEventPage } from './modal/new-event/new-event.page'; import { NewEventPage } from './modal/new-event/new-event.page';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { DateAdapter } from '@angular/material/core'; import { DateAdapter } from '@angular/material/core';
import { eventSource } from 'src/app/models/agenda/eventSource'; import { eventSource } from 'src/app/models/agenda/eventSource';
import { CalendarStore } from 'src/app/store/calendar.service'; import { CalendarStore } from 'src/app/store/calendar.service';
@@ -166,7 +166,7 @@ export class AgendaPage implements OnInit {
*/ */
IsEvent: "edit" | "add" | "view"; IsEvent: "edit" | "add" | "view";
viewingEventObject: CalendarEvent; viewingEventObject: CalendarEvent;
loggeduser: LoginUserRespose; loggeduser: UserSession;
monthNum; monthNum;
yearNum; yearNum;
@@ -3,7 +3,7 @@ import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { NavigationEnd, Router } from '@angular/router'; import { NavigationEnd, Router } from '@angular/router';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { SortService } from 'src/app/services/functions/sort.service'; import { SortService } from 'src/app/services/functions/sort.service';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service'; import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
@@ -33,7 +33,7 @@ export class EventListPage implements OnInit {
eventBody: EventBody; eventBody: EventBody;
categories: string[]; categories: string[];
serialnumber:string; serialnumber:string;
loggeduser: LoginUserRespose; loggeduser: UserSession;
segment:string; segment:string;
eventoaprovacaostore = EventoAprovacaoStore; eventoaprovacaostore = EventoAprovacaoStore;
environment = environment environment = environment
@@ -5,7 +5,7 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchList_v2 } from "src/app/models/search-document"; import { SearchList_v2 } from "src/app/models/search-document";
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { DateAdapter } from '@angular/material/core'; import { DateAdapter } from '@angular/material/core';
import * as _moment from 'moment'; import * as _moment from 'moment';
import * as _rollupMoment from 'moment'; import * as _rollupMoment from 'moment';
@@ -89,7 +89,7 @@ export class NewEventPage implements OnInit {
documents: SearchList_v2[] = []; documents: SearchList_v2[] = [];
loggeduser: LoginUserRespose; loggeduser: UserSession;
Form: FormGroup; Form: FormGroup;
@@ -3,7 +3,7 @@ import { ModalController, NavParams, Platform } from '@ionic/angular';
import { EventBody } from 'src/app/models/eventbody.model'; import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { SearchList } from 'src/app/models/search-document'; import { SearchList } from 'src/app/models/search-document';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { Event } from '../../../../models/event.model'; import { Event } from '../../../../models/event.model';
import { AttendeesPageModal } from '../../../../pages/events/attendees/attendees.page'; import { AttendeesPageModal } from '../../../../pages/events/attendees/attendees.page';
@@ -94,7 +94,7 @@ export class NewEventPage implements OnInit {
documents: SearchList[] = []; documents: SearchList[] = [];
loggeduser: LoginUserRespose; loggeduser: UserSession;
members: any; members: any;
CalendarName; CalendarName;
SessionStore = SessionStore; SessionStore = SessionStore;
@@ -86,7 +86,7 @@ export class InactivityPage implements OnInit {
// if current attemp is equal to the current user // if current attemp is equal to the current user
if (attempt.UserId == SessionStore.user.wxUserId) { if (attempt.UserId == SessionStore.user.wxUserId) {
await this.authService.SetSession(attempt, this.userattempt); // await this.authService.SetSession(attempt, this.userattempt);
if (this.p.userPermission(this.p.permissionList.Chat.access)) { if (this.p.userPermission(this.p.permissionList.Chat.access)) {
// this.authService.loginChat(); // this.authService.loginChat();
@@ -101,7 +101,7 @@ export class InactivityPage implements OnInit {
window.localStorage.clear(); window.localStorage.clear();
SessionStore.setInativity(true) SessionStore.setInativity(true)
await this.authService.SetSession(attempt, this.userattempt); // await this.authService.SetSession(attempt, this.userattempt);
} }
this.enterWithPassword = false this.enterWithPassword = false
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
@@ -10,7 +10,7 @@ import { SessionStore } from 'src/app/store/session.service';
}) })
export class HeaderPrPage implements OnInit { export class HeaderPrPage implements OnInit {
loggeduser: LoginUserRespose; loggeduser: UserSession;
constructor(authService: AuthService) { constructor(authService: AuthService) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
@@ -2,7 +2,7 @@ import { Component, OnInit, ChangeDetectorRef, NgZone } from '@angular/core';
import { AnimationController, ModalController, Platform } from '@ionic/angular'; import { AnimationController, ModalController, Platform } from '@ionic/angular';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { LoginUserRespose } from 'src/app/models/user.model'; import { UserSession } from 'src/app/models/user.model';
import { ProfilePage } from 'src/app/modals/profile/profile.page'; import { ProfilePage } from 'src/app/modals/profile/profile.page';
import { StorageService } from '../../../../services/storage.service'; import { StorageService } from '../../../../services/storage.service';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
@@ -33,7 +33,7 @@ export class HeaderPage implements OnInit {
searchSubject: string = ''; searchSubject: string = '';
showSearch = false; showSearch = false;
loggeduser: LoginUserRespose; loggeduser: UserSession;
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
notificationdata: any[] = []; notificationdata: any[] = [];
DataArray: Array<object> = []; DataArray: Array<object> = [];
+6 -6
View File
@@ -1,11 +1,11 @@
export let versionData = { export let versionData = {
"shortSHA": "33520fc75", "shortSHA": "5c0bd094c",
"SHA": "33520fc758c4a603c67083c152a9863e647728c8", "SHA": "5c0bd094ca5cb379aa625187cc5afb47f576ffec",
"branch": "feature/login-v2", "branch": "feature/login-v2",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Wed Nov 6 09:16:35 2024 +0100'", "lastCommitTime": "'Wed Nov 6 09:20:31 2024 +0100'",
"lastCommitMessage": "remove userId", "lastCommitMessage": "remove userName",
"lastCommitNumber": "6126", "lastCommitNumber": "6127",
"changeStatus": "On branch feature/login-v2\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/services/monitoring/opentelemetry/tracer.ts\n\tmodified: src/app/ui/chat/component/group-contacts/group-contacts.page.html\n\tmodified: src/app/ui/chat/modal/group-contacts/group-contacts.page.html\n\tmodified: version/git-version.ts", "changeStatus": "On branch feature/login-v2\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/core/user/entity/userEntity.ts\n\tnew file: src/app/core/user/mapper/user-login.ts\n\tmodified: src/app/core/user/repository/user-remote-repository.ts\n\tmodified: src/app/core/user/use-case/user-login-use-case.service.ts\n\tmodified: src/app/modals/create-process/create-process.page.ts\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts\n\tmodified: src/app/models/user.model.ts\n\tmodified: src/app/pages/events/attendees/attendees.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts\n\tmodified: src/app/pages/gabinete-digital/pendentes/pendentes.page.ts\n\tmodified: src/app/pages/inactivity/inactivity.page.ts\n\tmodified: src/app/pages/login/login.page.ts\n\tmodified: src/app/services/attachments.service.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/notifications.service.ts\n\tmodified: src/app/services/organic-entity.service.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: src/app/services/publications.service.ts\n\tmodified: src/app/services/search.service.ts\n\tmodified: src/app/shared/event/attendee-modal/attendee-modal.page.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.ts\n\tmodified: src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts\n\tmodified: src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts\n\tmodified: src/app/shared/gabinete-digital/generic/task-details/task-details.page.ts\n\tmodified: src/app/shared/gabinete-digital/pendentes/pendentes.page.ts\n\tmodified: src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts\n\tmodified: src/app/ui/agenda/agenda.page.ts\n\tmodified: src/app/ui/agenda/component/event-list/event-list.page.ts\n\tmodified: src/app/ui/agenda/component/new-event/new-event.page.ts\n\tmodified: src/app/ui/agenda/modal/new-event/new-event.page.ts\n\tmodified: src/app/ui/login/inactivity/inactivity.page.ts\n\tmodified: src/app/ui/shared/components/header-pr/header-pr.page.ts\n\tmodified: src/app/ui/shared/components/header/header.page.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }