| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | */ |
| 18 | /** |
| 19 | * @file K8s Module. |
| 20 | */ |
| 21 | import { CommonModule } from '@angular/common'; |
| 22 | import { HttpClientModule } from '@angular/common/http'; |
| 23 | import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; |
| 24 | import { FormsModule } from '@angular/forms'; |
| 25 | import { ReactiveFormsModule } from '@angular/forms'; |
| 26 | import { RouterModule, Routes } from '@angular/router'; |
| 27 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; |
| 28 | import { NgSelectModule } from '@ng-select/ng-select'; |
| 29 | import { TranslateModule } from '@ngx-translate/core'; |
| 30 | import { DataService } from 'DataService'; |
| 31 | import { K8sActionComponent } from 'K8sActionComponent'; |
| 32 | import { K8sAddClusterComponent } from 'K8sAddClusterComponent'; |
| 33 | import { K8sAddRepoComponent } from 'K8sAddRepoComponent'; |
| 34 | import { K8sClusterComponent } from 'K8sClusterComponent'; |
| 35 | import { K8sComponent } from 'K8sComponent'; |
| 36 | import { K8sRepositoryComponent } from 'K8sRepositoryComponent'; |
| 37 | import { LoaderModule } from 'LoaderModule'; |
| 38 | import { Ng2SmartTableModule } from 'ng2-smart-table'; |
| 39 | import { PagePerRowModule } from 'PagePerRowModule'; |
| 40 | import { PageReloadModule } from 'PageReloadModule'; |
| 41 | |
| 42 | /** To halndle project information */ |
| 43 | const projectInfo: {} = { title: '{project}', url: '/' }; |
| 44 | |
| 45 | /** |
| 46 | * configures routers |
| 47 | */ |
| 48 | const routes: Routes = [ |
| 49 | { |
| 50 | path: '', |
| 51 | component: K8sComponent, |
| 52 | children: [ |
| 53 | { |
| 54 | path: 'cluster', |
| 55 | data: { |
| 56 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 57 | projectInfo, { title: 'PAGE.K8S.MENUK8SCLUSTER', url: null }] |
| 58 | }, |
| 59 | component: K8sClusterComponent |
| 60 | }, |
| 61 | { |
| 62 | path: 'repo', |
| 63 | data: { |
| 64 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 65 | projectInfo, { title: 'PAGE.K8S.MENUK8SREPO', url: null }] |
| 66 | }, |
| 67 | component: K8sRepositoryComponent |
| 68 | } |
| 69 | ] |
| 70 | } |
| 71 | ]; |
| 72 | /** |
| 73 | * Creating @NgModule component for Modules |
| 74 | */ |
| 75 | @NgModule({ |
| 76 | imports: [ |
| 77 | ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }), |
| 78 | FormsModule, |
| 79 | CommonModule, |
| 80 | HttpClientModule, |
| 81 | NgSelectModule, |
| 82 | Ng2SmartTableModule, |
| 83 | TranslateModule, |
| 84 | RouterModule.forChild(routes), |
| 85 | NgbModule, |
| 86 | PagePerRowModule, |
| 87 | LoaderModule, |
| 88 | PageReloadModule |
| 89 | ], |
| 90 | declarations: [ |
| 91 | K8sComponent, |
| 92 | K8sClusterComponent, |
| 93 | K8sRepositoryComponent, |
| 94 | K8sActionComponent, |
| 95 | K8sAddClusterComponent, |
| 96 | K8sAddRepoComponent |
| 97 | ], |
| 98 | providers: [DataService], |
| 99 | schemas: [CUSTOM_ELEMENTS_SCHEMA], |
| 100 | entryComponents: [K8sActionComponent, K8sAddClusterComponent, K8sAddRepoComponent] |
| 101 | }) |
| 102 | /** Exporting a class @exports K8sModule */ |
| 103 | export class K8sModule { |
| 104 | /** Variables declared to avoid state-less class */ |
| 105 | private k8sModule: string; |
| 106 | } |