Initial Commit ...
This commit is contained in:
@@ -0,0 +1,209 @@
|
||||
import {
|
||||
DefaultLocale,
|
||||
AppResourceIDs,
|
||||
AvailableTranslationResources,
|
||||
} from './localization.config';
|
||||
import {
|
||||
RegistrationStep,
|
||||
XFrameworkIdentitySDKConfig,
|
||||
} from 'x-framework-identity-sdk';
|
||||
import { Pages } from './page.config';
|
||||
import { LogLevel } from '@microsoft/signalr';
|
||||
import { XMabsutApiSDKConfig } from 'x-mabsut-api-sdk';
|
||||
import { NotificationAudioSources } from './audio.config';
|
||||
import { XFrameworkCoreConfig, XPage } from 'x-framework-core';
|
||||
import { XFrameworkServicesConfig } from 'x-framework-services';
|
||||
import { XFrameworkComponentsConfig } from 'x-framework-components';
|
||||
import { XFrameworkPushServiceConfig } from 'x-framework-push-service';
|
||||
|
||||
// tslint:disable-next-line:no-empty-interface
|
||||
export interface AppConfig {
|
||||
//
|
||||
defaultLandingPage?: XPage;
|
||||
defaultBlogPage?: XPage;
|
||||
forceLogin: boolean;
|
||||
|
||||
//
|
||||
refreshTokensDelay?: number;
|
||||
|
||||
//
|
||||
// Content Configurations ...
|
||||
seeMoreResourceId: string;
|
||||
}
|
||||
|
||||
export type XFrameworkCoreSharedConfig = Partial<XFrameworkCoreConfig>;
|
||||
export type XFrameworkServicesSharedConfig = Partial<XFrameworkServicesConfig>;
|
||||
export type XFrameworkComponentsSharedConfig =
|
||||
Partial<XFrameworkComponentsConfig>;
|
||||
export type XFrameworkIdentitySDKSharedConfig =
|
||||
Partial<XFrameworkIdentitySDKConfig>;
|
||||
export type XFrameworkPushServiceSharedConfig =
|
||||
Partial<XFrameworkPushServiceConfig>;
|
||||
export type XMabsutApiSDKSharedConfig = Partial<XMabsutApiSDKConfig>;
|
||||
export type XAppSharedConfig = Partial<AppConfig>;
|
||||
|
||||
export type XConfig = XFrameworkCoreConfig &
|
||||
XFrameworkServicesConfig &
|
||||
XFrameworkComponentsConfig &
|
||||
XFrameworkIdentitySDKConfig &
|
||||
XFrameworkPushServiceConfig &
|
||||
XMabsutApiSDKConfig &
|
||||
AppConfig;
|
||||
export type XSharedConfig = Partial<XConfig>;
|
||||
|
||||
export const xFrameworkCoreSharedConfig: XFrameworkCoreSharedConfig = {
|
||||
appInstanceName: 'xMabsutClient',
|
||||
appNameResource: 'app_name',
|
||||
appCompanyResource: 'company',
|
||||
appVersion: 'v1.1',
|
||||
defaultNotificationDelay: 2000,
|
||||
notificationAudioSources: NotificationAudioSources,
|
||||
availableLanguages: AvailableTranslationResources,
|
||||
defaultLanguage: DefaultLocale,
|
||||
minAllowedImageSize: 512,
|
||||
maxAllowedImageSize: 5242880,
|
||||
minAllowedImageCroppableSize: 512,
|
||||
allowedImageExtensions: ['.png', '.jpg', '.jpeg'],
|
||||
maxProfileImageSize: 5242880,
|
||||
maxProfileImagesUploadFiles: 10,
|
||||
defaultCountryCode: 'IR',
|
||||
defaultPageSize: 5,
|
||||
pageSizes: [5, 10, 20, 40, 50, 100, 200],
|
||||
defaultActionDelay: 500,
|
||||
poweredValue: 'SaherElmITCenter',
|
||||
secretKey: 'SaherElm@09121694056@Hadi_Khazaee_Asl@yahoo.com',
|
||||
};
|
||||
|
||||
export const xFrameworkServicesSharedConfig: XFrameworkServicesSharedConfig = {
|
||||
geoLocationConfig: {
|
||||
enableHighAccuracy: true,
|
||||
timeout: 5000,
|
||||
},
|
||||
};
|
||||
|
||||
export const xFrameworkComponentsSharedConfig: XFrameworkComponentsSharedConfig =
|
||||
{
|
||||
minAllowedFileSize: 512,
|
||||
maxAllowedFileSize: 20971520,
|
||||
maxAllowedSize: 966367641,
|
||||
maxUploadFiles: 10,
|
||||
defaultSearchDebounceTime: 500,
|
||||
};
|
||||
|
||||
export const xFrameworkIdentitySDKSharedConfig: XFrameworkIdentitySDKSharedConfig =
|
||||
{
|
||||
//
|
||||
// Pages,
|
||||
Pages,
|
||||
|
||||
//
|
||||
minAvailableDateConst: 100 * 365 * 24 * 60 * 60 * 1000,
|
||||
maxAvailableDateConst: 18 * 365 * 24 * 60 * 60 * 1000,
|
||||
|
||||
//
|
||||
// Registration Type ...
|
||||
registrationType: [
|
||||
RegistrationStep.Terms,
|
||||
RegistrationStep.Info,
|
||||
RegistrationStep.Avatar,
|
||||
RegistrationStep.EmailConfirmation,
|
||||
RegistrationStep.Finish,
|
||||
],
|
||||
|
||||
//
|
||||
debounceTime: 500,
|
||||
|
||||
//
|
||||
nameMinLength: 3,
|
||||
nameMaxLength: 20,
|
||||
|
||||
//
|
||||
registrationOnlyWithInvitation: false,
|
||||
|
||||
//
|
||||
userNameMinLength: 4,
|
||||
userNameMaxLength: 20,
|
||||
|
||||
//
|
||||
passwordPolicies: {
|
||||
requireDigit: true,
|
||||
requiredLength: 6,
|
||||
requiredUniqueChars: 1,
|
||||
requireLowercase: true,
|
||||
requireNonAlphanumeric: true,
|
||||
requireUppercase: true,
|
||||
},
|
||||
|
||||
//
|
||||
passwordMinLength: 6,
|
||||
passwordMaxLength: 20,
|
||||
|
||||
//
|
||||
verificationCodeLength: 6,
|
||||
delayBetweenTwoVerificationCode: 180,
|
||||
};
|
||||
|
||||
export const xFrameworkPushServiceSharedConfig: XFrameworkPushServiceSharedConfig =
|
||||
{
|
||||
//
|
||||
// Push Notifications ...
|
||||
hubsBaseRoute: 'hubs',
|
||||
pushConnectionMaxRetry: 10,
|
||||
addSupportMessageProtocol: false,
|
||||
connectionLogLevel: LogLevel.None,
|
||||
pushConnectionReconnectDelay: 30000,
|
||||
|
||||
//
|
||||
// Stun Servers ...
|
||||
iceServers: [
|
||||
{
|
||||
urls: [
|
||||
'stun:stun.l.google.com:19302',
|
||||
'stun:stun1.l.google.com:19302',
|
||||
'stun:stun2.l.google.com:19302',
|
||||
],
|
||||
},
|
||||
{
|
||||
urls: ['turn:turn.saherelmhub.ir:3478'],
|
||||
username: 'saherelm',
|
||||
credential: 's@H@1694056',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const xMabsutApiSDKSharedConfig: XMabsutApiSDKSharedConfig = {
|
||||
//
|
||||
// Configure API ...
|
||||
apiIdentifier: 'api',
|
||||
apiVersion: 'v1.0',
|
||||
|
||||
//
|
||||
// Push Notifications ...
|
||||
pushManagerReconnectDelay: 20000,
|
||||
pushServiceRoute: 'push',
|
||||
pushMessageAction: 'PushMessageAsync',
|
||||
};
|
||||
|
||||
export const xAppSharedConfig: XAppSharedConfig = {
|
||||
//
|
||||
defaultLandingPage: Pages.Landing,
|
||||
forceLogin: false,
|
||||
|
||||
//
|
||||
// Refresh Tokens in MilliSeconds ...
|
||||
refreshTokensDelay: 1 * 15 * 1000,
|
||||
|
||||
//
|
||||
// Contents Configurations ...
|
||||
seeMoreResourceId: AppResourceIDs.see_more,
|
||||
};
|
||||
|
||||
export const xSharedConfig: XSharedConfig = {
|
||||
...xFrameworkCoreSharedConfig,
|
||||
...xFrameworkServicesSharedConfig,
|
||||
...xFrameworkComponentsSharedConfig,
|
||||
...xFrameworkIdentitySDKSharedConfig,
|
||||
...xFrameworkPushServiceSharedConfig,
|
||||
...xMabsutApiSDKSharedConfig,
|
||||
...xAppSharedConfig,
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { XNotificationSound, XActionType } from 'x-framework-core';
|
||||
|
||||
export const NotificationAudioSources: XNotificationSound[] = [
|
||||
{
|
||||
type: XActionType.User,
|
||||
resourcePath: './assets/audio/user_notification.wav',
|
||||
},
|
||||
{
|
||||
type: XActionType.System,
|
||||
resourcePath: './assets/audio/system_notification.wav',
|
||||
},
|
||||
{
|
||||
type: XActionType.Capture,
|
||||
resourcePath: './assets/audio/capture_notification.wav',
|
||||
},
|
||||
];
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,483 @@
|
||||
import {
|
||||
XUserRoleInfo,
|
||||
XAvailableRoles,
|
||||
getTopRoleByRoleInfo,
|
||||
} from 'x-mabsut-api-sdk';
|
||||
import {
|
||||
XIconNames,
|
||||
XNavigatorListItem,
|
||||
toNavigatiorListItem,
|
||||
} from 'x-framework-components';
|
||||
import { AppResourceIDs } from './localization.config';
|
||||
import { TagRoutes, Tags } from '../views/tags/v-tag.configs';
|
||||
import { toArray, XPage, XResourceIDs } from 'x-framework-core';
|
||||
import { FileRoutes, Files } from '../views/files/v-file.configs';
|
||||
import { XSimplePage } from '../views/typings/simple.page.typings';
|
||||
import { Account, AccountRoutes } from '../views/account/account.configs';
|
||||
import { WebinarRoutes, Webinars } from '../views/webinar/v-webinar.configs';
|
||||
|
||||
//
|
||||
//#region Route Config ...
|
||||
export enum BaseRoutes {
|
||||
Default = '',
|
||||
Unknown = '**',
|
||||
}
|
||||
|
||||
export enum StartupRoutes {
|
||||
Default = 'startup',
|
||||
}
|
||||
|
||||
export enum LandingRoutes {
|
||||
Default = '#',
|
||||
}
|
||||
|
||||
export enum NotAuthorizedRoutes {
|
||||
Default = 'not-authorized',
|
||||
}
|
||||
|
||||
export enum ErrorRoutes {
|
||||
Default = 'error',
|
||||
}
|
||||
|
||||
export enum HomeRoutes {
|
||||
Default = 'home',
|
||||
}
|
||||
|
||||
export enum AppRoutes {
|
||||
Default = BaseRoutes.Default,
|
||||
Startup = StartupRoutes.Default,
|
||||
Landing = LandingRoutes.Default,
|
||||
Home = HomeRoutes.Default,
|
||||
Webinars = WebinarRoutes.Default,
|
||||
Tags = TagRoutes.Default,
|
||||
Files = FileRoutes.Default,
|
||||
Account = AccountRoutes.Default,
|
||||
NotAuthorized = NotAuthorizedRoutes.Default,
|
||||
Error = ErrorRoutes.Default,
|
||||
Unknown = BaseRoutes.Unknown,
|
||||
}
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Page Configs ...
|
||||
export enum PageName {
|
||||
//
|
||||
//#region Startup ...
|
||||
Startup = AppRoutes.Startup,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Landing ...
|
||||
Landing = AppRoutes.Landing,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Home ...
|
||||
Home = AppRoutes.Home,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Webinar ...
|
||||
Webinars = AppRoutes.Webinars,
|
||||
WebinarsExplorer = WebinarRoutes.WebinarsExplorer,
|
||||
WebinarsManagement = WebinarRoutes.WebinarsManagement,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Tag ...
|
||||
Tags = AppRoutes.Tags,
|
||||
TagsExplorer = TagRoutes.TagsExplorer,
|
||||
TagsManagement = TagRoutes.TagsManagement,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region File ...
|
||||
Files = AppRoutes.Files,
|
||||
FilesExplorer = FileRoutes.FilesExplorer,
|
||||
FilesManagement = FileRoutes.FilesManagement,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Account ...
|
||||
Account = AppRoutes.Account,
|
||||
Login = AccountRoutes.Login,
|
||||
Logout = AccountRoutes.Logout,
|
||||
Profile = AccountRoutes.Profile,
|
||||
Register = AccountRoutes.Register,
|
||||
EmailConfirm = AccountRoutes.EmailConfirm,
|
||||
PhoneConfirm = AccountRoutes.PhoneConfirm,
|
||||
ResetPassword = AccountRoutes.ResetPassword,
|
||||
ChangePassword = AccountRoutes.ChangePassword,
|
||||
SearchProfiles = AccountRoutes.SearchProfiles,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region NotAuthorized ...
|
||||
NotAuthorized = AppRoutes.NotAuthorized,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Error ...
|
||||
Error = AppRoutes.Error,
|
||||
//#endregion
|
||||
}
|
||||
|
||||
export type PageNames = keyof typeof PageName;
|
||||
|
||||
export type PageNameIdentifier = PageName | PageNames | string;
|
||||
|
||||
export type PageIndexType = {
|
||||
[key in PageNames]?: XPage | XSimplePage;
|
||||
};
|
||||
|
||||
export const PageIndex: PageIndexType = {
|
||||
//
|
||||
//#region Startup ...
|
||||
Startup: {
|
||||
id: `${PageName.Startup}`,
|
||||
name: `${PageName.Startup}`,
|
||||
title: AppResourceIDs.startup_page_title,
|
||||
description: AppResourceIDs.startup_page_description,
|
||||
baseRoute: `${AppRoutes.Startup}`,
|
||||
route: ['/', `${AppRoutes.Startup}`],
|
||||
icon: XIconNames.friendship_unknown,
|
||||
},
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Landing ...
|
||||
Landing: {
|
||||
id: `${PageName.Landing}`,
|
||||
name: `${PageName.Landing}`,
|
||||
title: XResourceIDs.app_name,
|
||||
description: XResourceIDs.company,
|
||||
baseRoute: `${AppRoutes.Landing}`,
|
||||
route: ['/', `${AppRoutes.Landing}`],
|
||||
icon: XIconNames.posts,
|
||||
},
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Home ...
|
||||
Home: {
|
||||
icon: XIconNames.home,
|
||||
id: `${PageName.Home}`,
|
||||
name: `${PageName.Home}`,
|
||||
baseRoute: `${AppRoutes.Home}`,
|
||||
route: ['/', `${AppRoutes.Home}`],
|
||||
title: AppResourceIDs.home_page_title,
|
||||
description: AppResourceIDs.home_page_description,
|
||||
},
|
||||
//#endregion
|
||||
|
||||
//
|
||||
// Webinars ...
|
||||
Webinars: {
|
||||
...Webinars,
|
||||
},
|
||||
|
||||
//
|
||||
// Tags ...
|
||||
Tags: {
|
||||
...Tags,
|
||||
},
|
||||
|
||||
//
|
||||
// Files ...
|
||||
Files: {
|
||||
...Files,
|
||||
},
|
||||
|
||||
//
|
||||
// Account ...
|
||||
Account: {
|
||||
...Account,
|
||||
},
|
||||
|
||||
//
|
||||
//#region Error Page ...
|
||||
Error: {
|
||||
id: `${PageName.Error}`,
|
||||
name: `${PageName.Error}`,
|
||||
title: AppResourceIDs.error_page_title,
|
||||
description: AppResourceIDs.error_page_description,
|
||||
baseRoute: `${AppRoutes.Error}`,
|
||||
route: ['/', `${AppRoutes.Error}`],
|
||||
icon: XIconNames.error,
|
||||
},
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Not Authorized Page ...
|
||||
NotAuthorized: {
|
||||
id: `${PageName.NotAuthorized}`,
|
||||
name: `${PageName.NotAuthorized}`,
|
||||
title: AppResourceIDs.not_authorized_page_title,
|
||||
description: AppResourceIDs.not_authorized_page_description,
|
||||
baseRoute: `${AppRoutes.NotAuthorized}`,
|
||||
route: ['/', `${AppRoutes.NotAuthorized}`],
|
||||
icon: XIconNames.friendship_block,
|
||||
},
|
||||
//#endregion
|
||||
};
|
||||
|
||||
//
|
||||
// a Const of Available Pages ...
|
||||
const accountChilds = toArray(PageIndex.Account.childs);
|
||||
export const Pages: any = {
|
||||
//
|
||||
//#region Startup ...
|
||||
Startup: PageIndex.Startup,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Landing ...
|
||||
Landing: PageIndex.Landing,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Home ...
|
||||
Home: PageIndex.Home,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
// Webinars ...
|
||||
Webinars: PageIndex.Webinars,
|
||||
WebinarsExplorer: Webinars.childs[1],
|
||||
WebinarsManagement: Webinars.childs[0],
|
||||
|
||||
//
|
||||
// Tags ...
|
||||
Tags: PageIndex.Tags,
|
||||
TagsExplorer: Tags.childs[1],
|
||||
TagsManagement: Tags.childs[0],
|
||||
|
||||
//
|
||||
// Files ...
|
||||
Files: PageIndex.Files,
|
||||
FilesExplorer: Files.childs[1],
|
||||
FilesManagement: Files.childs[0],
|
||||
|
||||
//
|
||||
//#region Account ...
|
||||
Account: PageIndex.Account,
|
||||
Login: Account.childs[0],
|
||||
Logout: Account.childs[1],
|
||||
Profile: Account.childs[2],
|
||||
Register: Account.childs[3],
|
||||
EmailConfirm: Account.childs[4],
|
||||
PhoneConfirm: Account.childs[5],
|
||||
ResetPassword: Account.childs[6],
|
||||
ChangePassword: Account.childs[7],
|
||||
SearchProfiles: Account.childs[8],
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Error ...
|
||||
Error: PageIndex.Error,
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Notuthorized ...
|
||||
NotAuthorized: PageIndex.NotAuthorized,
|
||||
//#endregion
|
||||
};
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Navigator Pages ...
|
||||
//
|
||||
//#region Navigation Items ...
|
||||
//
|
||||
// Admin Naigator Pages ...
|
||||
const AdminNavPageItems: XNavigatorListItem[] = [
|
||||
//
|
||||
// Home ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Home),
|
||||
},
|
||||
|
||||
//
|
||||
// Webinars ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Webinars),
|
||||
},
|
||||
|
||||
//
|
||||
// Tags ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Tags),
|
||||
},
|
||||
|
||||
//
|
||||
// Files ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Files),
|
||||
},
|
||||
|
||||
//
|
||||
// Account ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Account),
|
||||
childs: [
|
||||
//
|
||||
// Profile ...
|
||||
{ ...toNavigatiorListItem(Pages.Profile) },
|
||||
//
|
||||
// Change Password ...
|
||||
{ ...toNavigatiorListItem(Pages.ChangePassword) },
|
||||
//
|
||||
// Search Profiles ...
|
||||
{ ...toNavigatiorListItem(Pages.SearchProfiles) },
|
||||
],
|
||||
href: '',
|
||||
},
|
||||
|
||||
//
|
||||
// Logout ...
|
||||
{
|
||||
...toNavigatiorListItem(Pages.Logout),
|
||||
href: '',
|
||||
},
|
||||
];
|
||||
|
||||
//
|
||||
// Agent Navigator Pages ...
|
||||
const AgentNavPageItems: XNavigatorListItem[] = [
|
||||
//
|
||||
// Home ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Home),
|
||||
},
|
||||
|
||||
//
|
||||
// Webinars ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Webinars),
|
||||
},
|
||||
|
||||
//
|
||||
// Account ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Account),
|
||||
childs: [
|
||||
//
|
||||
// Profile ...
|
||||
{ ...toNavigatiorListItem(Pages.Profile) },
|
||||
//
|
||||
// Change Password ...
|
||||
{ ...toNavigatiorListItem(Pages.ChangePassword) },
|
||||
//
|
||||
// Search Profiles ...
|
||||
{ ...toNavigatiorListItem(Pages.SearchProfiles) },
|
||||
],
|
||||
href: '',
|
||||
},
|
||||
|
||||
//
|
||||
// Logout ...
|
||||
{
|
||||
...toNavigatiorListItem(Pages.Logout),
|
||||
href: '',
|
||||
},
|
||||
];
|
||||
|
||||
//
|
||||
// Users Navigator Pages ...
|
||||
const UserNavPageItems: XNavigatorListItem[] = [
|
||||
//
|
||||
// Home ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Home),
|
||||
},
|
||||
|
||||
//
|
||||
// Webinars ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Webinars),
|
||||
childs: [
|
||||
//
|
||||
// Webinars Explorer ...
|
||||
{ ...toNavigatiorListItem(Pages.WebinarsExplorer) },
|
||||
],
|
||||
},
|
||||
|
||||
//
|
||||
// Account ...
|
||||
{
|
||||
...toNavigatiorListItem(PageIndex.Account),
|
||||
childs: [
|
||||
//
|
||||
// Profile ...
|
||||
{ ...toNavigatiorListItem(Pages.Profile) },
|
||||
//
|
||||
// Change Password ...
|
||||
{ ...toNavigatiorListItem(Pages.ChangePassword) },
|
||||
//
|
||||
// Search Profiles ...
|
||||
{ ...toNavigatiorListItem(Pages.SearchProfiles) },
|
||||
],
|
||||
},
|
||||
|
||||
//
|
||||
// Logout ...
|
||||
{
|
||||
...toNavigatiorListItem(Pages.Logout),
|
||||
href: '',
|
||||
},
|
||||
];
|
||||
|
||||
//
|
||||
// Guest ...
|
||||
const GuestNavPageItems: XNavigatorListItem[] = [
|
||||
//
|
||||
// Register ...
|
||||
{
|
||||
...toNavigatiorListItem(Pages.Register),
|
||||
// href: '',
|
||||
},
|
||||
//
|
||||
// Login ...
|
||||
{
|
||||
...toNavigatiorListItem(Pages.Login),
|
||||
// href: '',
|
||||
},
|
||||
];
|
||||
//#endregion
|
||||
|
||||
//
|
||||
//#region Navigator Pages Provider ...
|
||||
export async function getNavPages(
|
||||
roleInfo: XUserRoleInfo
|
||||
): Promise<XNavigatorListItem[]> {
|
||||
//
|
||||
if (!roleInfo) {
|
||||
//
|
||||
// Guest Users ...
|
||||
return GuestNavPageItems;
|
||||
}
|
||||
|
||||
//
|
||||
// TODO: Fix these ...
|
||||
const topRole = getTopRoleByRoleInfo(roleInfo);
|
||||
switch (topRole) {
|
||||
//
|
||||
case XAvailableRoles.Admin:
|
||||
return AdminNavPageItems;
|
||||
|
||||
//
|
||||
case XAvailableRoles.Agent:
|
||||
return AgentNavPageItems;
|
||||
|
||||
//
|
||||
// TODO: Fix this ...
|
||||
case XAvailableRoles.User:
|
||||
return UserNavPageItems;
|
||||
|
||||
//
|
||||
default:
|
||||
return GuestNavPageItems;
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
//#endregion
|
||||
@@ -0,0 +1,13 @@
|
||||
import { XCONFIG } from './x.config';
|
||||
import { XApiConfiguration } from 'x-framework-identity-sdk';
|
||||
|
||||
/**
|
||||
* Api Configuration
|
||||
*/
|
||||
export const XAPI_CONFIG = new XApiConfiguration({
|
||||
//
|
||||
baseApiPath: XCONFIG.baseUrl,
|
||||
apiVersion: XCONFIG.apiVersion,
|
||||
poweredByValue: XCONFIG.poweredValue,
|
||||
revisionSecretKey: XCONFIG.secretKey,
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import { XConfig } from './app.config';
|
||||
import { InjectionToken } from '@angular/core';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
export const XCONFIG: XConfig = JSON.parse(
|
||||
JSON.stringify(environment.configurations)
|
||||
);
|
||||
|
||||
export const X_CONFIG = new InjectionToken<XConfig>('x_config');
|
||||
Reference in New Issue
Block a user