New VIM Design with the config implemented.
[osm/NG-UI.git] / src / app / vim-accounts / VimAccountsModule.ts
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 Vim Account module.
20  */
21 import { CommonModule } from '@angular/common';
22 import { HttpClientModule } from '@angular/common/http';
23 import { 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 { CodemirrorModule } from '@ctrl/ngx-codemirror';
28 import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
29 import { NgSelectModule } from '@ng-select/ng-select';
30 import { TranslateModule } from '@ngx-translate/core';
31 import { DataService } from 'DataService';
32 import { InfoVimComponent } from 'InfoVim';
33 import { LoaderModule } from 'LoaderModule';
34 import { NewVimaccountComponent } from 'NewVimaccount';
35 import { Ng2SmartTableModule } from 'ng2-smart-table';
36 import { PagePerRowModule } from 'PagePerRowModule';
37 import { PageReloadModule } from 'PageReloadModule';
38 import { VimAccountDetailsComponent } from 'VimAccountDetails';
39 import { VimAccountsComponent } from 'VimAccountsComponent';
40
41 /** To halndle project information */
42 const projectInfo: {} = { title: '{project}', url: '/' };
43
44 /** const values for dashboard Routes */
45 const routes: Routes = [
46     {
47         path: '',
48         component: VimAccountsComponent,
49         children: [
50             {
51                 path: 'details',
52                 data: {
53                     breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
54                         projectInfo, { title: 'VIMACCOUNTS', url: null }]
55                 },
56                 component: VimAccountDetailsComponent
57             },
58             {
59                 path: 'info/:id',
60                 data: {
61                     breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
62                         projectInfo, { title: 'VIMACCOUNTS', url: '/vim/details' }, { title: '{id}', url: null }]
63                 },
64                 component: InfoVimComponent
65             },
66             {
67                 path: 'new',
68                 data: {
69                     breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
70                         projectInfo, { title: 'VIMACCOUNTS', url: '/vim/details' }, { title: 'PAGE.VIMDETAILS.NEWVIM', url: null }]
71                 },
72                 component: NewVimaccountComponent
73             }
74         ]
75     }
76 ];
77
78 /**
79  * Creating @NgModule component for Modules
80  */
81 @NgModule({
82     imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }), FormsModule, CommonModule,
83         HttpClientModule, NgSelectModule, Ng2SmartTableModule, TranslateModule, RouterModule.forChild(routes), NgbModule,
84         PagePerRowModule, LoaderModule, PageReloadModule, CodemirrorModule],
85     declarations: [VimAccountsComponent, InfoVimComponent, VimAccountDetailsComponent, NewVimaccountComponent],
86     providers: [DataService],
87     entryComponents: [InfoVimComponent]
88 })
89 /** Exporting a class @exports VimAccountsModule */
90 export class VimAccountsModule {
91     /** Variables declared to avoid state-less class */
92     private vimModule: string;
93 }