Refactor SDK Api Changes Side affects ...

This commit is contained in:
2026-04-17 17:50:35 +03:30
parent a986295e19
commit ed8690f2be
39 changed files with 593 additions and 583 deletions
@@ -72,7 +72,7 @@ export class VRegisterComponent extends VBaseInCardComponent {
//
// getTermsAndConditionsTask ...
isChanged = changeKeys.includes(
nameofInstance(this, 'getTermsAndConditionsTask')
nameofInstance(this, 'getTermsAndConditionsTask'),
);
if (isChanged) {
//
@@ -82,8 +82,8 @@ export class VRegisterComponent extends VBaseInCardComponent {
if (!isValid) {
//
this.getTermsAndConditionsTask = (lang: string) => {
return this.sharedService.mabsutAPIService.terms.termsProviderService.get(
lang
return this.sharedService.saherElmAPIService.terms.termsProviderService.get(
lang,
);
};
}
@@ -177,7 +177,7 @@ export class VRegisterComponent extends VBaseInCardComponent {
this.step =
this.managerService.secureStorageService.readOfType<VRegistrationSteps>(
RegistrationKeys.Step,
false
false,
);
//
@@ -197,7 +197,7 @@ export class VRegisterComponent extends VBaseInCardComponent {
this.actionRequest =
this.managerService.secureStorageService.readOfType<XActionRequestDto>(
RegistrationKeys.ActionRequest,
false
false,
);
}
@@ -208,7 +208,7 @@ export class VRegisterComponent extends VBaseInCardComponent {
this.actionResponse =
this.managerService.secureStorageService.readOfType<XActionResponseDto>(
RegistrationKeys.ActionResponse,
false
false,
);
}
@@ -318,7 +318,7 @@ export class VRegisterComponent extends VBaseInCardComponent {
this.managerService.secureStorageService.write(
RegistrationKeys.Step,
this.step,
true
true,
);
//
@@ -326,7 +326,7 @@ export class VRegisterComponent extends VBaseInCardComponent {
this.managerService.secureStorageService.write(
RegistrationKeys.ActionRequest,
this.actionRequest,
true
true,
);
//
@@ -334,7 +334,7 @@ export class VRegisterComponent extends VBaseInCardComponent {
this.managerService.secureStorageService.write(
RegistrationKeys.ActionResponse,
this.actionResponse,
true
true,
);
}
@@ -31,11 +31,6 @@ import {
isNullOrEmptyString,
XResourceIdentifier,
} from 'x-framework-core';
import {
toRoleInfo,
XAvailableRoles,
extractAvaialableRoles,
} from 'x-mabsut-api-sdk';
import {
defaultAvatar,
UserProfileTasks,
@@ -43,6 +38,11 @@ import {
VUserDtoContainer,
VUserPresentTypeIdentifier,
} from './v-user.typings';
import {
toRoleInfo,
XAvailableRoles,
extractAvaialableRoles,
} from 'x-saherelm-api-sdk';
import {
XSlotName,
XFormValidators,
@@ -111,7 +111,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
readonly FriendshipActionsPresentTypes = Object.assign(
{},
FriendshipActionsPresentType
FriendshipActionsPresentType,
);
readonly VPresentTypes = Object.assign({}, VUserPresentType);
readonly FormControlTypes = Object.assign({}, XFormControlType);
@@ -253,7 +253,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
result = applyFormatDate(
value,
XDateFormat.DateOfBirth,
this.managerService
this.managerService,
);
}
@@ -607,7 +607,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
result = applyFormatDate(
value,
XDateFormat.EventDate,
this.managerService
this.managerService,
);
}
@@ -633,7 +633,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
result = applyFormatDate(
value,
XDateFormat.EventDate,
this.managerService
this.managerService,
);
}
@@ -839,7 +839,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
public managerService: XManagerService,
public changeDetector: ChangeDetectorRef,
protected popoverService: XPopoverService,
protected propertyProvider: VUserDtoContainer
protected propertyProvider: VUserDtoContainer,
) {
super(
zone,
@@ -851,7 +851,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
managerService,
changeDetector,
popoverService,
propertyProvider
propertyProvider,
);
}
//#endregion
@@ -868,7 +868,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const canSelectUserChanged = changeKeys.includes(
nameof<VUserComponent>('canSelectUser')
nameof<VUserComponent>('canSelectUser'),
);
if (canSelectUserChanged) {
//
@@ -879,7 +879,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const isAvatarChanged = changeKeys.includes(
nameof<VUserComponent>('avatarSize')
nameof<VUserComponent>('avatarSize'),
);
if (isAvatarChanged) {
this.handleAvatarSizeChanged();
@@ -887,7 +887,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const isUserInfoColorChanged = changeKeys.includes(
nameof<VUserComponent>('userInfoColor')
nameof<VUserComponent>('userInfoColor'),
);
if (isUserInfoColorChanged) {
//
@@ -898,7 +898,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const isPutUserInfoOnCardHeaderChanged = changeKeys.includes(
nameof<VUserComponent>('putUserInfoOnCardHeader')
nameof<VUserComponent>('putUserInfoOnCardHeader'),
);
if (isPutUserInfoOnCardHeaderChanged) {
if (isNullOrUndefined(this.putUserInfoOnCardHeader)) {
@@ -914,7 +914,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const isAutoStylingSlotsChanged = changeKeys.includes(
nameof<VUserComponent>('autoStylingSlots')
nameof<VUserComponent>('autoStylingSlots'),
);
if (isAutoStylingSlotsChanged) {
//
@@ -925,7 +925,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const isFriendshipActionsTypeChanged = changeKeys.includes(
nameof<VUserComponent>('friendshipActionsType')
nameof<VUserComponent>('friendshipActionsType'),
);
if (isFriendshipActionsTypeChanged) {
if (isNullOrUndefined(isFriendshipActionsTypeChanged)) {
@@ -936,7 +936,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const isShowActionsOnProfileViewChanged = changeKeys.includes(
nameof<VUserComponent>('showActionsOnProfileView')
nameof<VUserComponent>('showActionsOnProfileView'),
);
if (isShowActionsOnProfileViewChanged) {
if (isNullOrUndefined(this.showActionsOnProfileView)) {
@@ -947,13 +947,13 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const isAvatarSlotChanged = changeKeys.includes(
nameof<VUserComponent>('avatarSlot')
nameof<VUserComponent>('avatarSlot'),
);
const isFullNameSlotChanged = changeKeys.includes(
nameof<VUserComponent>('fullNameSlot')
nameof<VUserComponent>('fullNameSlot'),
);
const isFriendshipActionsSlotChanged = changeKeys.includes(
nameof<VUserComponent>('friendshipActionsSlot')
nameof<VUserComponent>('friendshipActionsSlot'),
);
if (
isAvatarSlotChanged ||
@@ -976,7 +976,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
this.applyTakeUntilWrapper(this.sharedService.user$).subscribe(
async (up) => {
await this.validateFieldsOnUser(up);
}
},
);
}
//#endregion
@@ -989,7 +989,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
* @param model
*/
validate(
model?: Partial<XUserProfileDto>
model?: Partial<XUserProfileDto>,
): VModelValidationResult<XUserProfileDto> {
//
let result: VModelValidationResult<XUserProfileDto>;
@@ -1014,7 +1014,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
!isNullOrUndefined(normalized) && !this.isSameAsDefault(normalized);
if (!isValid) {
validationErrors.push(
this.getExceptionMessage(XExceptionIDs.InvalidArgs)
this.getExceptionMessage(XExceptionIDs.InvalidArgs),
);
} else {
//
@@ -1026,8 +1026,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.user_id
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidUserName)}`
this.AppResourceIDs.user_id,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidUserName)}`,
);
}
@@ -1037,8 +1037,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.user_name
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidUserName)}`
this.AppResourceIDs.user_name,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidUserName)}`,
);
}
@@ -1050,8 +1050,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.email
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidEmailAddress)}`
this.AppResourceIDs.email,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidEmailAddress)}`,
);
}
@@ -1063,8 +1063,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.phone_number
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidMobileNumber)}`
this.AppResourceIDs.phone_number,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidMobileNumber)}`,
);
}
@@ -1078,8 +1078,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.date_of_birth
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidData)}`
this.AppResourceIDs.date_of_birth,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidData)}`,
);
}
@@ -1089,8 +1089,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.first_name
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidArgs)}`
this.AppResourceIDs.first_name,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidArgs)}`,
);
}
@@ -1100,8 +1100,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.last_name
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidArgs)}`
this.AppResourceIDs.last_name,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidArgs)}`,
);
}
@@ -1113,8 +1113,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.gender
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidArgs)}`
this.AppResourceIDs.gender,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidArgs)}`,
);
}
@@ -1124,13 +1124,13 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
!isNullOrUndefined(normalized.roles) &&
this.hasChild(normalized.roles) &&
normalized.roles.every((r: any) =>
extractAvaialableRoles().includes(r)
extractAvaialableRoles().includes(r),
);
if (!isValid) {
validationErrors.push(
`${this.resourceProvider(
this.AppResourceIDs.role
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidArgs)}`
this.AppResourceIDs.role,
)}: ${this.getExceptionMessage(XExceptionIDs.InvalidArgs)}`,
);
}
@@ -1204,8 +1204,8 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
!isNullOrUndefined(profile.avatar) &&
!isNullOrEmptyString(profile.avatar)
? profile.avatar
: defaultAvatar
)
: defaultAvatar,
),
);
}
@@ -1216,7 +1216,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
*/
getUserFullName() {
return this.getValue(this.model).pipe(
map((profile) => getFullName(profile))
map((profile) => getFullName(profile)),
);
}
@@ -1245,7 +1245,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
return result;
})
}),
);
}
@@ -1277,7 +1277,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
return result;
})
}),
);
}
@@ -1291,7 +1291,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
wrapWithCard: this.getValue(this.wrapWithCard),
putUserInfoOnCardHeader: this.getValue(this.putUserInfoOnCardHeader),
}).pipe(
map((info) => !(!!info.wrapWithCard && !!info.putUserInfoOnCardHeader))
map((info) => !(!!info.wrapWithCard && !!info.putUserInfoOnCardHeader)),
);
}
@@ -1325,7 +1325,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
return result;
}),
first()
first(),
);
}
@@ -1384,7 +1384,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
return result;
}),
first()
first(),
);
}
@@ -1395,7 +1395,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
*/
isFriendshipActionsSupported() {
return this.getValue(this.supportFriendshipActions).pipe(
map((isSupport) => isNullOrUndefined(isSupport) || !!isSupport)
map((isSupport) => isNullOrUndefined(isSupport) || !!isSupport),
);
}
//#endregion
@@ -1493,14 +1493,14 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
// UnFollow Follower ...
mTaskName = XFriendshipTasks.UnFollowFollower;
mTask = this.sharedService.accountsService.unFollowFollower(
event.destUser
event.destUser,
);
} else if (event.type === XFriendshipType.Following) {
//
// UnFollow Following ...
mTaskName = XFriendshipTasks.UnFollowFollowing;
mTask = this.sharedService.accountsService.unFollowFollowing(
event.destUser
event.destUser,
);
}
break;
@@ -1645,7 +1645,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
'emailConfirmed',
'phoneNumberConfirmed',
],
true
true,
);
} else if (isAdmin) {
//
@@ -1677,7 +1677,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
'emailConfirmed',
'phoneNumberConfirmed',
],
true
true,
);
}
}
@@ -1710,7 +1710,7 @@ export class VUserComponent extends VBaseDtoComponent<XUserProfileDto> {
//
const mTaskName = XFriendshipTasks.LoadProfile;
const mTask = this.sharedService.accountsService.getProfile(
this.model.userId
this.model.userId,
);
//
+1 -1
View File
@@ -7,7 +7,7 @@ import {
import { defaultAvatar, defaultFullName } from './v-user.typings';
import { XGender, XUserProfileDto } from 'x-framework-identity-sdk';
import { AppResourceIDs } from 'src/app/config/localization.config';
import { getTopRoleByRoles, XAvailableRoles } from 'x-mabsut-api-sdk';
import { getTopRoleByRoles, XAvailableRoles } from 'x-saherelm-api-sdk';
/**
* Generate User Full Name ...