283 lines
11 KiB
TypeScript
283 lines
11 KiB
TypeScript
|
import {NgModule} from '@angular/core';
|
||
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||
|
import {HTTP_INTERCEPTORS, HttpClientJsonpModule, HttpClientModule} from '@angular/common/http';
|
||
|
import {BrowserModule} from '@angular/platform-browser';
|
||
|
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||
|
import {CommonModule, DatePipe, HashLocationStrategy, LocationStrategy} from '@angular/common';
|
||
|
import {AppRoutes} from './app.routes';
|
||
|
import {BreadcrumbModule} from 'primeng/breadcrumb';
|
||
|
import {ButtonModule} from 'primeng/button';
|
||
|
import {ContextMenuModule} from 'primeng/contextmenu';
|
||
|
import {FullCalendarModule} from '@fullcalendar/angular';
|
||
|
import {InputNumberModule} from 'primeng/inputnumber';
|
||
|
import {InputMaskModule} from 'primeng/inputmask';
|
||
|
import {InputSwitchModule} from 'primeng/inputswitch';
|
||
|
import {InputTextModule} from 'primeng/inputtext';
|
||
|
import {InputTextareaModule} from 'primeng/inputtextarea';
|
||
|
import {MegaMenuModule} from 'primeng/megamenu';
|
||
|
import {MenuModule} from 'primeng/menu';
|
||
|
import {MenubarModule} from 'primeng/menubar';
|
||
|
import {PanelMenuModule} from 'primeng/panelmenu';
|
||
|
import {RadioButtonModule} from 'primeng/radiobutton';
|
||
|
import {ScrollPanelModule} from 'primeng/scrollpanel';
|
||
|
import {SlideMenuModule} from 'primeng/slidemenu';
|
||
|
import {SliderModule} from 'primeng/slider';
|
||
|
import {StepsModule} from 'primeng/steps';
|
||
|
import {TabMenuModule} from 'primeng/tabmenu';
|
||
|
import {TieredMenuModule} from 'primeng/tieredmenu';
|
||
|
// Application Components
|
||
|
import {AppComponent} from './app.component';
|
||
|
import {AppMainComponent} from './app.main.component';
|
||
|
import {AppMenuComponent} from './app.menu.component';
|
||
|
import {AppMenuitemComponent} from './app.menuitem.component';
|
||
|
import {AppProfileComponent} from './app.profile.component';
|
||
|
import {AppBreadcrumbComponent} from './app.breadcrumb.component';
|
||
|
import {AppConfigComponent} from './app.config.component';
|
||
|
import {AppTopBarComponent} from './app.topbar.component';
|
||
|
import {AppFooterComponent} from './app.footer.component';
|
||
|
|
||
|
// Demo pages
|
||
|
import {AppCodeModule} from './app.code.component';
|
||
|
import {DashboardDemoComponent} from './demo/view/dashboarddemo.component';
|
||
|
import {MenusDemoComponent} from './demo/view/menusdemo.component';
|
||
|
// Demo services
|
||
|
import {EventService} from './demo/service/eventservice';
|
||
|
import {IconService} from './demo/service/iconservice';
|
||
|
|
||
|
// Application services
|
||
|
import {BreadcrumbService} from './app.breadcrumb.service';
|
||
|
import {MenuService} from './app.menu.service';
|
||
|
|
||
|
import dayGridPlugin from '@fullcalendar/daygrid';
|
||
|
import timeGridPlugin from '@fullcalendar/timegrid';
|
||
|
import interactionPlugin from '@fullcalendar/interaction';
|
||
|
import {LabelModule} from '@progress/kendo-angular-label';
|
||
|
import {IconsModule} from '@progress/kendo-angular-icons';
|
||
|
import {EditorModule} from 'primeng/editor';
|
||
|
import {SpinnerModule} from 'primeng/spinner';
|
||
|
import {AuthService} from './_services/auth/auth.service';
|
||
|
import {RatingComponent} from './helper/rating.component';
|
||
|
import {ExcelModule, GridModule, PDFModule} from '@progress/kendo-angular-grid';
|
||
|
import {InputsModule} from '@progress/kendo-angular-inputs';
|
||
|
import {ChartsModule} from '@progress/kendo-angular-charts';
|
||
|
import 'hammerjs';
|
||
|
import {EmployeeServices} from './_services/employee/employee.service';
|
||
|
import {TreeViewModule} from '@progress/kendo-angular-treeview';
|
||
|
import {DialogsModule, WindowModule} from '@progress/kendo-angular-dialog';
|
||
|
import {BasicFromBuilderModule} from './form-builder/Basic-From-Builder.module';
|
||
|
import {ButtonsModule} from '@progress/kendo-angular-buttons';
|
||
|
import {AttendanceServices} from './_services/attendance/attendance.service';
|
||
|
import {UploadModule, UploadsModule} from '@progress/kendo-angular-upload';
|
||
|
import {NotificationModule} from '@progress/kendo-angular-notification';
|
||
|
import {HRMNotificationService} from './app.notification.service';
|
||
|
import {DataTransferService} from './data.transfer.service';
|
||
|
import {DropDownsModule} from '@progress/kendo-angular-dropdowns';
|
||
|
import {ToastrModule} from 'ngx-toastr';
|
||
|
import {UntilityHandlerService} from './utility.hanldler.service';
|
||
|
import {IndicatorsModule} from '@progress/kendo-angular-indicators';
|
||
|
import {UsersService} from './authentication/users/users.service';
|
||
|
import {LoginComponent} from './login.component';
|
||
|
import {ForgotPasswordComponent} from './forgot-password.component';
|
||
|
import {loadingPanelService} from './hrm-loding panel/loding.panel.service';
|
||
|
import {ReportsModule} from './reports/reports.module';
|
||
|
import {PdfViewerModule} from 'ng2-pdf-viewer';
|
||
|
import {LoadingPanelModule} from './hrm-loding panel/loading-panel.module';
|
||
|
import {TrainingService} from './_services/training/training.service';
|
||
|
import {ProfileUpdateComponent} from './profile-update/profile-update.component';
|
||
|
import {DatePickerModule} from '@progress/kendo-angular-dateinputs';
|
||
|
import {PanelModule} from 'primeng/panel';
|
||
|
import {ProfileUpdateAdminComponent} from './profile-update-admin/profile-update-admin.component';
|
||
|
import {CardModule} from '@progress/kendo-angular-layout';
|
||
|
import {SelfProfileComponent} from './self-profile/self-profile.component';
|
||
|
import {TabViewModule} from 'primeng/tabview';
|
||
|
import {Pickermodule} from './picker/picker.module';
|
||
|
import {NgxExtendedPdfViewerModule} from 'ngx-extended-pdf-viewer';
|
||
|
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
||
|
import {ProgressBarModule} from '@progress/kendo-angular-progressbar';
|
||
|
import {RippleModule} from 'primeng/ripple';
|
||
|
import {MsalGuard, MsalInterceptor, MsalModule, MsalRedirectComponent, MsalService} from '@azure/msal-angular';
|
||
|
import {InteractionType, PublicClientApplication} from '@azure/msal-browser';
|
||
|
|
||
|
FullCalendarModule.registerPlugins([
|
||
|
dayGridPlugin,
|
||
|
timeGridPlugin,
|
||
|
interactionPlugin
|
||
|
]);
|
||
|
|
||
|
@NgModule({
|
||
|
imports: [
|
||
|
BrowserModule,
|
||
|
FormsModule,
|
||
|
AppRoutes,
|
||
|
FontAwesomeModule,
|
||
|
HttpClientModule,
|
||
|
BrowserAnimationsModule,
|
||
|
BreadcrumbModule,
|
||
|
ButtonModule,
|
||
|
ContextMenuModule,
|
||
|
FullCalendarModule,
|
||
|
InputNumberModule,
|
||
|
InputMaskModule,
|
||
|
InputSwitchModule,
|
||
|
InputTextModule,
|
||
|
InputTextareaModule,
|
||
|
MegaMenuModule,
|
||
|
MenuModule,
|
||
|
MenubarModule,
|
||
|
PanelMenuModule,
|
||
|
RadioButtonModule,
|
||
|
RippleModule,
|
||
|
ScrollPanelModule,
|
||
|
SlideMenuModule,
|
||
|
SliderModule,
|
||
|
StepsModule,
|
||
|
TabMenuModule,
|
||
|
TieredMenuModule,
|
||
|
AppCodeModule,
|
||
|
DropDownsModule,
|
||
|
NgxExtendedPdfViewerModule,
|
||
|
EditorModule,
|
||
|
ToastrModule.forRoot({
|
||
|
timeOut: 8000,
|
||
|
positionClass: 'toast-top-center',
|
||
|
preventDuplicates: false,
|
||
|
}),
|
||
|
SpinnerModule,
|
||
|
GridModule,
|
||
|
InputsModule,
|
||
|
PDFModule,
|
||
|
ExcelModule,
|
||
|
ChartsModule,
|
||
|
ReactiveFormsModule,
|
||
|
TreeViewModule,
|
||
|
DialogsModule,
|
||
|
HttpClientJsonpModule,
|
||
|
BasicFromBuilderModule,
|
||
|
ButtonsModule,
|
||
|
UploadModule,
|
||
|
LabelModule,
|
||
|
IconsModule,
|
||
|
WindowModule,
|
||
|
IndicatorsModule,
|
||
|
NotificationModule,
|
||
|
UploadsModule,
|
||
|
ReportsModule,
|
||
|
PdfViewerModule,
|
||
|
CommonModule,
|
||
|
LoadingPanelModule,
|
||
|
DatePickerModule,
|
||
|
PanelModule,
|
||
|
CardModule,
|
||
|
TabViewModule,
|
||
|
Pickermodule,
|
||
|
NgxExtendedPdfViewerModule,
|
||
|
ProgressBarModule,
|
||
|
MsalModule.forRoot(new PublicClientApplication(
|
||
|
{
|
||
|
auth:
|
||
|
{
|
||
|
// clientId: 'ac400e87-866c-4498-bd88-f02d96a7e4c3',
|
||
|
// redirectUri: 'http://localhost:4200',
|
||
|
// authority: 'https://login.microsoftonline.com/50f23abd-2de3-4dd4-a1c9-571b7c9ebe4e'
|
||
|
|
||
|
//for PETROMAX(development)
|
||
|
clientId: 'ca3fba22-bf8e-40b7-bc95-88bf4481019d',
|
||
|
redirectUri: 'http://localhost:4200',
|
||
|
authority: 'https://login.microsoftonline.com/0ccbbd58-9cd0-415c-a100-c6ac318a5a14'
|
||
|
|
||
|
//for PETROMAX(cel cloude)
|
||
|
// clientId: '38249861-a763-4130-b144-90b40a4764a2',
|
||
|
// redirectUri: 'https://celclouds.com/Petromax',
|
||
|
// authority: 'https://login.microsoftonline.com/7b81ccc5-ba35-4bf8-854f-49f9c02d3fb1'
|
||
|
|
||
|
//for PETROMAX(CEL UAT)
|
||
|
// clientId: '5d67ff94-6b09-493f-9481-0230773eb0ff',
|
||
|
// redirectUri: 'https://celbd.com/petromaxHRUAT',
|
||
|
// authority: 'https://login.microsoftonline.com/0ccbbd58-9cd0-415c-a100-c6ac318a5a14'
|
||
|
|
||
|
//for SGSREVAMP(CEL UAT)
|
||
|
// clientId: 'c3356e94-eba4-43a3-b516-cb9a2d1cfe83',
|
||
|
// redirectUri: 'https://celbd.com/sgsRevamp',
|
||
|
// authority: 'https://login.microsoftonline.com/0ccbbd58-9cd0-415c-a100-c6ac318a5a14'
|
||
|
},
|
||
|
cache:
|
||
|
{
|
||
|
cacheLocation: 'localStorage',
|
||
|
storeAuthStateInCookie: false
|
||
|
}
|
||
|
}
|
||
|
),
|
||
|
{
|
||
|
interactionType: InteractionType.Redirect,
|
||
|
authRequest: {
|
||
|
scopes: ['user.read']
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
interactionType: InteractionType.Redirect,
|
||
|
protectedResourceMap: new Map(
|
||
|
[
|
||
|
['https://graph.microsoft.com/v1.0/me', ['user.Read']]
|
||
|
]
|
||
|
)
|
||
|
}
|
||
|
)
|
||
|
],
|
||
|
declarations: [
|
||
|
AppComponent,
|
||
|
AppMainComponent,
|
||
|
AppMenuComponent,
|
||
|
AppMenuitemComponent,
|
||
|
AppProfileComponent,
|
||
|
AppTopBarComponent,
|
||
|
AppFooterComponent,
|
||
|
AppConfigComponent,
|
||
|
AppBreadcrumbComponent,
|
||
|
DashboardDemoComponent,
|
||
|
ProfileUpdateComponent,
|
||
|
MenusDemoComponent,
|
||
|
ForgotPasswordComponent,
|
||
|
|
||
|
RatingComponent,
|
||
|
LoginComponent,
|
||
|
ProfileUpdateAdminComponent,
|
||
|
SelfProfileComponent
|
||
|
],
|
||
|
providers:
|
||
|
[
|
||
|
{provide: LocationStrategy, useClass: HashLocationStrategy},
|
||
|
{
|
||
|
provide: HTTP_INTERCEPTORS,
|
||
|
useClass: MsalInterceptor,
|
||
|
multi: true
|
||
|
},
|
||
|
MsalService,
|
||
|
EventService, IconService, MenuService,
|
||
|
BreadcrumbService,
|
||
|
|
||
|
DatePipe,
|
||
|
AuthService,
|
||
|
TrainingService,
|
||
|
EmployeeServices,
|
||
|
DataTransferService,
|
||
|
AttendanceServices,
|
||
|
UntilityHandlerService,
|
||
|
HRMNotificationService,
|
||
|
UsersService,
|
||
|
loadingPanelService
|
||
|
],
|
||
|
bootstrap: [AppComponent, MsalRedirectComponent]
|
||
|
})
|
||
|
|
||
|
export class AppModule {
|
||
|
constructor(public authService: AuthService) {
|
||
|
this.overrideDate();
|
||
|
}
|
||
|
|
||
|
overrideDate() {
|
||
|
Date.prototype.toJSON = function(key) {
|
||
|
return this.toLocaleDateString('en-US') + ' ' + this.toLocaleTimeString('en-US');
|
||
|
};
|
||
|
}
|
||
|
}
|