Skip to content

Commit

Permalink
refactor(user): differenciate User & MeUser models
Browse files Browse the repository at this point in the history
make things clearer and move the User model in domain from gn4-api
  • Loading branch information
fgravin committed Nov 28, 2023
1 parent b69ce36 commit 8e46984
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions libs/common/domain/src/lib/model/user/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,20 @@ export interface MeUserModel {
organisation: string
profileIcon?: string
}

export interface UserModel {
profile?: string
surname?: string
enabled?: boolean
username?: string
id?: number
email?: string
emailAddresses?: Set<string>
organisation?: string
kind?: string
lastLoginDate?: string
accountNonExpired?: boolean
accountNonLocked?: boolean
credentialsNonExpired?: boolean
name?: string
}
4 changes: 2 additions & 2 deletions libs/feature/catalog/src/lib/my-org/my-org.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export class MyOrgService {
logoUrl: string
recordCount: number
userCount: number
userList: UserApiModel[]
userList: UserModel[]
}>

private myOrgDataSubject = new BehaviorSubject<{
orgName: string
logoUrl: string
recordCount: number
userCount: number
userList: UserApiModel[]
userList: UserModel[]
}>({
orgName: '',
logoUrl: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MeUserModel } from '@geonetwork-ui/common/domain/model/user/user.model'
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class UserPreviewComponent {
@Input() user: UserModel
@Input() user: MeUserModel
@Input() avatarPlaceholder?: string

get userFullName() {
Expand Down

0 comments on commit 8e46984

Please sign in to comment.