Refactor SDK Api Changes Side affects ...
This commit is contained in:
@@ -4,12 +4,6 @@ import {
|
||||
TemplateRef,
|
||||
ChangeDetectionStrategy,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
XFileDto,
|
||||
XPersonDto,
|
||||
XWebinarDto,
|
||||
XWebinarType,
|
||||
} from 'x-mabsut-api-sdk';
|
||||
import {
|
||||
XRef,
|
||||
nameof,
|
||||
@@ -20,6 +14,12 @@ import {
|
||||
XResourceIdentifier,
|
||||
getComponentSelector,
|
||||
} from 'x-framework-core';
|
||||
import {
|
||||
XFileDto,
|
||||
XPersonDto,
|
||||
XWebinarDto,
|
||||
XWebinarType,
|
||||
} from 'x-saherelm-api-sdk';
|
||||
import {
|
||||
XListItem,
|
||||
XSlotName,
|
||||
@@ -110,7 +110,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
toolbarShowSubTitle = true;
|
||||
titleRes = this.ResourceIDs.app_name;
|
||||
toolbarSubTitle = this.resourceProvider(
|
||||
this.AppResourceIDs.webinars_management_page_title
|
||||
this.AppResourceIDs.webinars_management_page_title,
|
||||
);
|
||||
toolbarTitle = this.resourceProvider(this.titleRes);
|
||||
|
||||
@@ -121,11 +121,11 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
readonly TagsPresenterPresertTypes = Object.assign(
|
||||
VTagsPresenterPresentType,
|
||||
{}
|
||||
{},
|
||||
);
|
||||
readonly FilesPresenterPresertTypes = Object.assign(
|
||||
{},
|
||||
VFilesPresenterPresentType
|
||||
VFilesPresenterPresentType,
|
||||
);
|
||||
readonly ButtonTypes = Object.assign(XButtonType, {});
|
||||
readonly ModelFieldTypes = Object.assign(VModelFieldTypes);
|
||||
@@ -213,19 +213,19 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
|
||||
//
|
||||
this.applyTakeUntilWrapper(
|
||||
this.managerService.settingsService.isMobile$
|
||||
this.managerService.settingsService.isMobile$,
|
||||
).subscribe((res) => {
|
||||
//
|
||||
if (!isNullOrUndefined(this.activeTab)) {
|
||||
//
|
||||
switch(this.activeTab) {
|
||||
switch (this.activeTab) {
|
||||
//
|
||||
case VQueryPresenterTabs.List:
|
||||
sendAction({
|
||||
provider: this.listItemActionProvider,
|
||||
action: VBaseDtoAction.Refresh
|
||||
action: VBaseDtoAction.Refresh,
|
||||
});
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -445,7 +445,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
? this.LIST_OWNER_REF
|
||||
: fd.template,
|
||||
};
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
* @returns
|
||||
*/
|
||||
async handleGetQueryResult(
|
||||
query: XQueryDto
|
||||
query: XQueryDto,
|
||||
): Promise<XQueryResultDto<VWebinarViewDto>> {
|
||||
//
|
||||
let result: XQueryResultDto<VWebinarViewDto> = undefined;
|
||||
@@ -472,7 +472,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Retrieve Webinar Dto Result ...
|
||||
this.dtoQueryResult = await this.getValueAsync(
|
||||
this.queryModelTask(query)
|
||||
this.queryModelTask(query),
|
||||
);
|
||||
|
||||
//
|
||||
@@ -490,7 +490,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Converts XWebinarDto to VWebinarViewDto ...
|
||||
result.items = this.dtoQueryResult.items.map((i) =>
|
||||
ToWebinarViewDto(i, this.managerService.currentLocale)
|
||||
ToWebinarViewDto(i, this.managerService.currentLocale),
|
||||
);
|
||||
|
||||
//
|
||||
@@ -583,7 +583,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
* @returns
|
||||
*/
|
||||
async validateAndPrepareListItems(
|
||||
items: Array<XListItem<VWebinarViewDto>>
|
||||
items: Array<XListItem<VWebinarViewDto>>,
|
||||
): Promise<Array<XListItem<VWebinarViewDto>>> {
|
||||
//
|
||||
let result: Array<XListItem<VWebinarViewDto>> = [];
|
||||
@@ -611,7 +611,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
*/
|
||||
async requestFillingItems(
|
||||
exists: Array<VWebinarViewDto>,
|
||||
recieved: Array<VWebinarViewDto>
|
||||
recieved: Array<VWebinarViewDto>,
|
||||
): Promise<VQueryFilledItemsProcessingResult<VWebinarViewDto>> {
|
||||
//
|
||||
let result: VQueryFilledItemsProcessingResult<VWebinarViewDto> =
|
||||
@@ -668,7 +668,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
ids.forEach((id) => {
|
||||
//
|
||||
const iSelector = `${selector}[${nameof<VWebinarViewDto>(
|
||||
'id'
|
||||
'id',
|
||||
)}="${id}"][${nameof<VWebinarViewComponent>('presentType')}="${
|
||||
VBaseDtoPresentType.AsView
|
||||
}"]`;
|
||||
@@ -891,7 +891,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
// Since Cancel only Fired when Lock Breaked, here we do not need to handle it ...
|
||||
this.sendQueryPresenterAction(
|
||||
VQueryPresenterAction.ChangeTab,
|
||||
this.prevTab || VQueryPresenterTabs.List
|
||||
this.prevTab || VQueryPresenterTabs.List,
|
||||
);
|
||||
}
|
||||
//
|
||||
@@ -918,7 +918,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
async handleAddModel(
|
||||
model: VWebinarViewDto,
|
||||
tags?: Array<string>,
|
||||
files?: Array<File>
|
||||
files?: Array<File>,
|
||||
) {
|
||||
//
|
||||
if (isNullOrUndefined(model)) {
|
||||
@@ -956,7 +956,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Retrieve Connection ID ...
|
||||
const connectionId =
|
||||
this.sharedService.mabsutAPIService.webinars.webinarEntityPushService
|
||||
this.sharedService.saherElmAPIService.webinars.webinarEntityPushService
|
||||
.connectionId;
|
||||
|
||||
//
|
||||
@@ -966,12 +966,12 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Issue Task ...
|
||||
response = await this.getValueAsync(
|
||||
this.sharedService.mabsutAPIService.webinars.webinarProviderService.create(
|
||||
this.sharedService.saherElmAPIService.webinars.webinarProviderService.create(
|
||||
dtoModel, // Model ...
|
||||
pTags, // Tags ...
|
||||
pFiles, // Files ...
|
||||
connectionId // Connection Id ...
|
||||
)
|
||||
connectionId, // Connection Id ...
|
||||
),
|
||||
);
|
||||
} catch (ex) {
|
||||
//
|
||||
@@ -1191,7 +1191,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
* @returns
|
||||
*/
|
||||
detailsFilesActionsProvider: (
|
||||
f: XFileDto | File
|
||||
f: XFileDto | File,
|
||||
) => Array<XSimpleListItemSlideOption> = (f) => {
|
||||
return [];
|
||||
};
|
||||
@@ -1209,7 +1209,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
// Since Cancel only Fired when Lock Breaked, here we do not need to handle it ...
|
||||
this.sendQueryPresenterAction(
|
||||
VQueryPresenterAction.ChangeTab,
|
||||
this.prevTab || VQueryPresenterTabs.List
|
||||
this.prevTab || VQueryPresenterTabs.List,
|
||||
);
|
||||
}
|
||||
//
|
||||
@@ -1267,7 +1267,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Retrieve Connection ID ...
|
||||
const connectionId =
|
||||
this.sharedService.mabsutAPIService.webinars.webinarEntityPushService
|
||||
this.sharedService.saherElmAPIService.webinars.webinarEntityPushService
|
||||
.connectionId;
|
||||
|
||||
//
|
||||
@@ -1277,10 +1277,10 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Issue Task ...
|
||||
response = await this.getValueAsync(
|
||||
this.sharedService.mabsutAPIService.webinars.webinarProviderService.update(
|
||||
this.sharedService.saherElmAPIService.webinars.webinarProviderService.update(
|
||||
dtoModel,
|
||||
connectionId
|
||||
)
|
||||
connectionId,
|
||||
),
|
||||
);
|
||||
} catch (ex) {
|
||||
//
|
||||
@@ -1386,7 +1386,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
* @param error
|
||||
*/
|
||||
async handleCustomError(
|
||||
error?: VQueryPresenterActionIdentifier
|
||||
error?: VQueryPresenterActionIdentifier,
|
||||
): Promise<void> {
|
||||
//
|
||||
await this.setLoadingState(false);
|
||||
@@ -1609,7 +1609,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
(!isNullOrUndefined(actions.childs) &&
|
||||
this.hasChild(actions.childs) &&
|
||||
actions.childs.findIndex(
|
||||
(a) => a.id === defaultEditFabButton.id
|
||||
(a) => a.id === defaultEditFabButton.id,
|
||||
)) >= 0
|
||||
) {
|
||||
//
|
||||
@@ -1642,7 +1642,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
(!isNullOrUndefined(actions.childs) &&
|
||||
this.hasChild(actions.childs) &&
|
||||
actions.childs.findIndex(
|
||||
(a) => a.id === defaultRemoveFabButton.id
|
||||
(a) => a.id === defaultRemoveFabButton.id,
|
||||
)) >= 0
|
||||
) {
|
||||
//
|
||||
@@ -1675,7 +1675,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
(!isNullOrUndefined(actions.childs) &&
|
||||
this.hasChild(actions.childs) &&
|
||||
actions.childs.findIndex(
|
||||
(a) => a.id === defaultCloseFabButton.id
|
||||
(a) => a.id === defaultCloseFabButton.id,
|
||||
)) >= 0
|
||||
) {
|
||||
//
|
||||
@@ -1708,7 +1708,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
(!isNullOrUndefined(actions.childs) &&
|
||||
this.hasChild(actions.childs) &&
|
||||
actions.childs.findIndex(
|
||||
(a) => a.id === defaultConnectFabButton.id
|
||||
(a) => a.id === defaultConnectFabButton.id,
|
||||
)) >= 0
|
||||
) {
|
||||
//
|
||||
@@ -1881,7 +1881,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
this.sendQueryPresenterAction(
|
||||
VQueryPresenterAction.ChangeTab,
|
||||
VQueryPresenterTabs.Details
|
||||
VQueryPresenterTabs.Details,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1912,7 +1912,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
this.sendQueryPresenterAction(
|
||||
VQueryPresenterAction.ChangeTab,
|
||||
VQueryPresenterTabs.Update
|
||||
VQueryPresenterTabs.Update,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1967,7 +1967,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
this.activeTab = VQueryPresenterTabs.Details;
|
||||
this.sendQueryPresenterAction(
|
||||
VQueryPresenterAction.ChangeTab,
|
||||
this.activeTab
|
||||
this.activeTab,
|
||||
);
|
||||
} else {
|
||||
this.hasParams = false;
|
||||
@@ -2008,13 +2008,13 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
try {
|
||||
//
|
||||
const connectionId =
|
||||
this.sharedService.mabsutAPIService.webinars.webinarEntityPushService
|
||||
.connectionId;
|
||||
this.sharedService.saherElmAPIService.webinars
|
||||
.webinarEntityPushService.connectionId;
|
||||
response = await this.getValueAsync(
|
||||
this.sharedService.mabsutAPIService.webinars.webinarProviderService.update(
|
||||
this.sharedService.saherElmAPIService.webinars.webinarProviderService.update(
|
||||
dtoModel,
|
||||
connectionId
|
||||
)
|
||||
connectionId,
|
||||
),
|
||||
);
|
||||
} catch {
|
||||
//
|
||||
@@ -2032,7 +2032,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
const updateVDto = ToWebinarViewDto(
|
||||
response,
|
||||
this.managerService.currentLocale
|
||||
this.managerService.currentLocale,
|
||||
);
|
||||
const actions = await this.prepareListActions(updateVDto);
|
||||
this.sendQueryPresenterAction(VQueryPresenterAction.UpdateModel, {
|
||||
@@ -2099,15 +2099,15 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
try {
|
||||
//
|
||||
const connectionId =
|
||||
this.sharedService.mabsutAPIService.webinars.webinarEntityPushService
|
||||
.connectionId;
|
||||
this.sharedService.saherElmAPIService.webinars
|
||||
.webinarEntityPushService.connectionId;
|
||||
|
||||
//
|
||||
await this.getValueAsync(
|
||||
this.sharedService.mabsutAPIService.webinars.webinarProviderService.remove(
|
||||
this.sharedService.saherElmAPIService.webinars.webinarProviderService.remove(
|
||||
model.id,
|
||||
connectionId
|
||||
)
|
||||
connectionId,
|
||||
),
|
||||
);
|
||||
} catch {
|
||||
//
|
||||
@@ -2136,7 +2136,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
this.prevTab = undefined;
|
||||
this.sendQueryPresenterAction(
|
||||
VQueryPresenterAction.ChangeTab,
|
||||
VQueryPresenterTabs.List
|
||||
VQueryPresenterTabs.List,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -2157,7 +2157,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
!this.toolbarShowBack ||
|
||||
!isFunction(this.toolbarBackHandler) ||
|
||||
[VQueryPresenterTabs.Add, VQueryPresenterTabs.Update].includes(
|
||||
this.activeTab
|
||||
this.activeTab,
|
||||
)
|
||||
) {
|
||||
return;
|
||||
@@ -2209,7 +2209,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
private provideItemOptions(
|
||||
userId: string,
|
||||
isAdmin: boolean,
|
||||
item: VWebinarViewDto
|
||||
item: VWebinarViewDto,
|
||||
) {
|
||||
//
|
||||
let result: Array<XSimpleListItemSlideOption> = [];
|
||||
@@ -2283,13 +2283,13 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Check Connected Before ...
|
||||
if (
|
||||
this.sharedService.mabsutAPIService.webinars.webinarEntityPushService.isConnected()
|
||||
this.sharedService.saherElmAPIService.webinars.webinarEntityPushService.isConnected()
|
||||
) {
|
||||
this.isPushServiceConnected = true;
|
||||
} else {
|
||||
//
|
||||
this.isPushServiceConnected = true;
|
||||
await this.sharedService.mabsutAPIService.webinars.webinarEntityPushService.connect();
|
||||
await this.sharedService.saherElmAPIService.webinars.webinarEntityPushService.connect();
|
||||
}
|
||||
} catch {
|
||||
//
|
||||
@@ -2306,8 +2306,8 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// On Added ...
|
||||
this.applyTakeUntilWrapper(
|
||||
this.sharedService.mabsutAPIService.webinars.webinarEntityPushService
|
||||
.onAdded$
|
||||
this.sharedService.saherElmAPIService.webinars.webinarEntityPushService
|
||||
.onAdded$,
|
||||
).subscribe(async (event) => {
|
||||
//
|
||||
if (isNullOrUndefined(event)) {
|
||||
@@ -2346,8 +2346,8 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// On Removed ...
|
||||
this.applyTakeUntilWrapper(
|
||||
this.sharedService.mabsutAPIService.webinars.webinarEntityPushService
|
||||
.onDeleted$
|
||||
this.sharedService.saherElmAPIService.webinars.webinarEntityPushService
|
||||
.onDeleted$,
|
||||
).subscribe(async (event) => {
|
||||
//
|
||||
if (isNullOrUndefined(event) && isNullOrUndefined(this.dtoQueryResult)) {
|
||||
@@ -2357,7 +2357,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Check if Model Exists in Current Context or not ...
|
||||
let model = this.dtoQueryResult.items.find(
|
||||
(i) => i.id === event.model.id
|
||||
(i) => i.id === event.model.id,
|
||||
);
|
||||
const modelP = ToWebinarViewDto(model, this.managerService.currentLocale);
|
||||
if (!isNullOrUndefined(model) && !isNullOrUndefined(modelP)) {
|
||||
@@ -2391,7 +2391,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
this.sendQueryPresenterAction(
|
||||
VQueryPresenterAction.ChangeTab,
|
||||
VQueryPresenterTabs.List
|
||||
VQueryPresenterTabs.List,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -2399,8 +2399,8 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// On Updated ...
|
||||
this.applyTakeUntilWrapper(
|
||||
this.sharedService.mabsutAPIService.webinars.webinarEntityPushService
|
||||
.onUpdated$
|
||||
this.sharedService.saherElmAPIService.webinars.webinarEntityPushService
|
||||
.onUpdated$,
|
||||
).subscribe(async (event) => {
|
||||
//
|
||||
if (isNullOrUndefined(event) || isNullOrUndefined(this.dtoQueryResult)) {
|
||||
@@ -2410,7 +2410,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
// Check if Model Exists in Current Context or not ...
|
||||
let model = this.dtoQueryResult.items.find(
|
||||
(i) => i.id === event.model.id
|
||||
(i) => i.id === event.model.id,
|
||||
);
|
||||
if (isNullOrUndefined(model)) {
|
||||
return;
|
||||
@@ -2420,9 +2420,9 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
let fromEntity: XWebinarDto = undefined;
|
||||
try {
|
||||
fromEntity = await this.getValueAsync(
|
||||
this.sharedService.mabsutAPIService.webinars.webinarProviderService.get(
|
||||
event.model.id
|
||||
)
|
||||
this.sharedService.saherElmAPIService.webinars.webinarProviderService.get(
|
||||
event.model.id,
|
||||
),
|
||||
);
|
||||
} catch {
|
||||
return;
|
||||
@@ -2436,7 +2436,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
//
|
||||
const modelP = ToWebinarViewDto(
|
||||
fromEntity,
|
||||
this.managerService.currentLocale
|
||||
this.managerService.currentLocale,
|
||||
);
|
||||
|
||||
//
|
||||
@@ -2472,7 +2472,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
const selector = getQuerySelectorOfSpecifiedAttribute(
|
||||
VWebinarViewComponent,
|
||||
this.ModelFieldNames.id,
|
||||
this.updateModel.id
|
||||
this.updateModel.id,
|
||||
);
|
||||
await this.waitForElement(selector).then(async (el) => {
|
||||
//
|
||||
@@ -2504,7 +2504,7 @@ export abstract class WebinarsBaseProviderPage extends VQueryPresenterBasePage {
|
||||
const selector = getQuerySelectorOfSpecifiedAttribute(
|
||||
VWebinarViewComponent,
|
||||
this.ModelFieldNames.id,
|
||||
this.detailsModel.id
|
||||
this.detailsModel.id,
|
||||
);
|
||||
await this.waitForElement(selector).then(async (el) => {
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user