awf-test-lib 0.1.23 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +10 -30
  4. package/src/lib/core/core-routing.module.ts +10 -0
  5. package/src/lib/core/core.module.ts +35 -0
  6. package/src/lib/core/menu/menu.component.css +18 -0
  7. package/src/lib/core/menu/menu.component.html +8 -0
  8. package/src/lib/core/menu/menu.component.spec.ts +23 -0
  9. package/src/lib/core/menu/menu.component.ts +28 -0
  10. package/src/lib/core/menu-consomer/menu-consomer.component.html +20 -0
  11. package/src/lib/core/menu-consomer/menu-consomer.component.scss +20 -0
  12. package/src/lib/core/menu-consomer/menu-consomer.component.spec.ts +25 -0
  13. package/src/lib/core/menu-consomer/menu-consomer.component.ts +21 -0
  14. package/src/lib/core/menu-ge-portal/menu-ge-portal.component.html +7 -0
  15. package/src/lib/core/menu-ge-portal/menu-ge-portal.component.scss +17 -0
  16. package/src/lib/core/menu-ge-portal/menu-ge-portal.component.spec.ts +25 -0
  17. package/src/lib/core/menu-ge-portal/menu-ge-portal.component.ts +83 -0
  18. package/src/lib/core/menu-warranty/menu-warranty.component.html +20 -0
  19. package/src/lib/core/menu-warranty/menu-warranty.component.scss +16 -0
  20. package/src/lib/core/menu-warranty/menu-warranty.component.spec.ts +25 -0
  21. package/src/lib/core/menu-warranty/menu-warranty.component.ts +31 -0
  22. package/src/lib/core/not-found/not-found.component.css +31 -0
  23. package/src/lib/core/not-found/not-found.component.html +6 -0
  24. package/src/lib/core/not-found/not-found.component.spec.ts +23 -0
  25. package/src/lib/core/not-found/not-found.component.ts +15 -0
  26. package/src/lib/core/top-bar/top-bar.component.css +116 -0
  27. package/src/lib/core/top-bar/top-bar.component.html +1 -0
  28. package/src/lib/core/top-bar/top-bar.component.spec.ts +23 -0
  29. package/src/lib/core/top-bar/top-bar.component.ts +39 -0
  30. package/{lib/models/account.model.d.ts → src/lib/models/account.model.ts} +6 -3
  31. package/src/lib/models/alternativeDate.model.ts +6 -0
  32. package/src/lib/models/applicationName.ts +6 -0
  33. package/{lib/models/cancelPMMailRequest.model.d.ts → src/lib/models/cancelPMMailRequest.model.ts} +3 -1
  34. package/src/lib/models/customObject.model.ts +4 -0
  35. package/src/lib/models/detailedPmJob.model.ts +25 -0
  36. package/src/lib/models/emailStatus.ts +4 -0
  37. package/src/lib/models/emailType.ts +19 -0
  38. package/src/lib/models/eventStatus.ts +8 -0
  39. package/src/lib/models/field.ts +7 -0
  40. package/src/lib/models/language.ts +4 -0
  41. package/{lib/models/mailRequest.model.d.ts → src/lib/models/mailRequest.model.ts} +3 -1
  42. package/src/lib/models/pMGroupedJob.model.ts +4 -0
  43. package/{lib/models/pmJob.model.d.ts → src/lib/models/pmJob.model.ts} +7 -6
  44. package/src/lib/models/pmJobRequest.model.ts +6 -0
  45. package/{lib/models/pmJobStatus.d.ts → src/lib/models/pmJobStatus.ts} +8 -3
  46. package/src/lib/models/reason.model.ts +7 -0
  47. package/src/lib/models/reasonCode.ts +9 -0
  48. package/src/lib/models/reasonContact.ts +7 -0
  49. package/{lib/models/reportDateMailRequest.model.d.ts → src/lib/models/reportDateMailRequest.model.ts} +3 -1
  50. package/src/lib/models/role.ts +5 -0
  51. package/src/lib/models/service.model.ts +8 -0
  52. package/src/lib/models/serviceName.ts +14 -0
  53. package/{lib/models/socialLoginRequest.model.d.ts → src/lib/models/socialLoginRequest.model.ts} +1 -1
  54. package/src/lib/models/socialMadia.ts +4 -0
  55. package/src/lib/models/stingBoolean.ts +7 -0
  56. package/src/lib/models/system.ts +15 -0
  57. package/{lib/models/theme.model.d.ts → src/lib/models/theme.model.ts} +18 -11
  58. package/src/lib/models/tokenStatus.ts +6 -0
  59. package/src/lib/models/warranty.ts +18 -0
  60. package/src/lib/pipes/pipes/pipes.module.ts +14 -0
  61. package/src/lib/pipes/subrtring-w.pipe.spec.ts +8 -0
  62. package/src/lib/pipes/subrtring-w.pipe.ts +16 -0
  63. package/src/lib/pipes/substring.pipe.spec.ts +8 -0
  64. package/src/lib/pipes/substring.pipe.ts +15 -0
  65. package/src/lib/shared/choose-another-date/choose-another-date.component.html +12 -0
  66. package/src/lib/shared/choose-another-date/choose-another-date.component.scss +12 -0
  67. package/src/lib/shared/choose-another-date/choose-another-date.component.spec.ts +25 -0
  68. package/src/lib/shared/choose-another-date/choose-another-date.component.ts +127 -0
  69. package/src/lib/shared/confirm-dialog/confirm-dialog.component.html +26 -0
  70. package/src/lib/shared/confirm-dialog/confirm-dialog.component.scss +0 -0
  71. package/src/lib/shared/confirm-dialog/confirm-dialog.component.spec.ts +25 -0
  72. package/src/lib/shared/confirm-dialog/confirm-dialog.component.ts +39 -0
  73. package/src/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.css +0 -0
  74. package/src/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.html +19 -0
  75. package/src/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.spec.ts +23 -0
  76. package/src/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.ts +36 -0
  77. package/src/lib/shared/confirmed-date-information/confirmed-date-information.component.html +25 -0
  78. package/src/lib/shared/confirmed-date-information/confirmed-date-information.component.scss +23 -0
  79. package/src/lib/shared/confirmed-date-information/confirmed-date-information.component.spec.ts +25 -0
  80. package/src/lib/shared/confirmed-date-information/confirmed-date-information.component.ts +30 -0
  81. package/src/lib/shared/contact/contact.component.css +144 -0
  82. package/src/lib/shared/contact/contact.component.html +136 -0
  83. package/src/lib/shared/contact/contact.component.spec.ts +23 -0
  84. package/src/lib/shared/contact/contact.component.ts +169 -0
  85. package/src/lib/shared/contact-support/contact-support.component.html +130 -0
  86. package/src/lib/shared/contact-support/contact-support.component.scss +10 -0
  87. package/src/lib/shared/contact-support/contact-support.component.spec.ts +25 -0
  88. package/src/lib/shared/contact-support/contact-support.component.ts +188 -0
  89. package/src/lib/shared/dashboard/dashboard.component.html +81 -0
  90. package/src/lib/shared/dashboard/dashboard.component.scss +5 -0
  91. package/src/lib/shared/dashboard/dashboard.component.spec.ts +23 -0
  92. package/src/lib/shared/dashboard/dashboard.component.ts +23 -0
  93. package/src/lib/shared/maintenance-list/maintenance-list.component.html +105 -0
  94. package/src/lib/shared/maintenance-list/maintenance-list.component.scss +26 -0
  95. package/src/lib/shared/maintenance-list/maintenance-list.component.spec.ts +25 -0
  96. package/src/lib/shared/maintenance-list/maintenance-list.component.ts +403 -0
  97. package/src/lib/shared/shared-routing.module.ts +10 -0
  98. package/src/lib/shared/shared.module.ts +80 -0
  99. package/src/lib/shared/show-links/show-links.component.html +49 -0
  100. package/src/lib/shared/show-links/show-links.component.scss +0 -0
  101. package/src/lib/shared/show-links/show-links.component.spec.ts +25 -0
  102. package/src/lib/shared/show-links/show-links.component.ts +78 -0
  103. package/src/lib/shared/system-list/system-list.component.css +0 -0
  104. package/src/lib/shared/system-list/system-list.component.html +40 -0
  105. package/src/lib/shared/system-list/system-list.component.spec.ts +23 -0
  106. package/src/lib/shared/system-list/system-list.component.ts +26 -0
  107. package/{public-api.d.ts → src/public-api.ts} +16 -1
  108. package/src/test.ts +27 -0
  109. package/tsconfig.lib.dev.json +10 -0
  110. package/tsconfig.lib.json +15 -0
  111. package/tsconfig.lib.pp.json +10 -0
  112. package/tsconfig.lib.prod.json +10 -0
  113. package/tsconfig.spec.json +17 -0
  114. package/esm2020/awf-test-lib.mjs +0 -5
  115. package/esm2020/lib/core/core-routing.module.mjs +0 -18
  116. package/esm2020/lib/core/core.module.mjs +0 -51
  117. package/esm2020/lib/core/menu/menu.component.mjs +0 -40
  118. package/esm2020/lib/core/menu-consomer/menu-consomer.component.mjs +0 -27
  119. package/esm2020/lib/core/menu-ge-portal/menu-ge-portal.component.mjs +0 -105
  120. package/esm2020/lib/core/menu-warranty/menu-warranty.component.mjs +0 -35
  121. package/esm2020/lib/core/not-found/not-found.component.mjs +0 -19
  122. package/esm2020/lib/core/top-bar/top-bar.component.mjs +0 -41
  123. package/esm2020/lib/models/account.model.mjs +0 -3
  124. package/esm2020/lib/models/alternativeDate.model.mjs +0 -3
  125. package/esm2020/lib/models/applicationName.mjs +0 -7
  126. package/esm2020/lib/models/cancelPMMailRequest.model.mjs +0 -4
  127. package/esm2020/lib/models/customObject.model.mjs +0 -3
  128. package/esm2020/lib/models/detailedPmJob.model.mjs +0 -3
  129. package/esm2020/lib/models/emailStatus.mjs +0 -6
  130. package/esm2020/lib/models/emailType.mjs +0 -17
  131. package/esm2020/lib/models/eventStatus.mjs +0 -9
  132. package/esm2020/lib/models/field.mjs +0 -9
  133. package/esm2020/lib/models/language.mjs +0 -6
  134. package/esm2020/lib/models/mailRequest.model.mjs +0 -3
  135. package/esm2020/lib/models/pMGroupedJob.model.mjs +0 -3
  136. package/esm2020/lib/models/pmJob.model.mjs +0 -3
  137. package/esm2020/lib/models/pmJobRequest.model.mjs +0 -3
  138. package/esm2020/lib/models/pmJobStatus.mjs +0 -17
  139. package/esm2020/lib/models/reason.model.mjs +0 -3
  140. package/esm2020/lib/models/reasonCode.mjs +0 -9
  141. package/esm2020/lib/models/reasonContact.mjs +0 -8
  142. package/esm2020/lib/models/reportDateMailRequest.model.mjs +0 -4
  143. package/esm2020/lib/models/role.mjs +0 -7
  144. package/esm2020/lib/models/service.model.mjs +0 -3
  145. package/esm2020/lib/models/serviceName.mjs +0 -12
  146. package/esm2020/lib/models/socialLoginRequest.model.mjs +0 -3
  147. package/esm2020/lib/models/socialMadia.mjs +0 -5
  148. package/esm2020/lib/models/stingBoolean.mjs +0 -6
  149. package/esm2020/lib/models/system.mjs +0 -3
  150. package/esm2020/lib/models/theme.model.mjs +0 -2
  151. package/esm2020/lib/models/tokenStatus.mjs +0 -7
  152. package/esm2020/lib/models/warranty.mjs +0 -3
  153. package/esm2020/lib/pipes/pipes/pipes.module.mjs +0 -21
  154. package/esm2020/lib/pipes/subrtring-w.pipe.mjs +0 -20
  155. package/esm2020/lib/pipes/substring.pipe.mjs +0 -16
  156. package/esm2020/lib/shared/choose-another-date/choose-another-date.component.mjs +0 -110
  157. package/esm2020/lib/shared/confirm-dialog/confirm-dialog.component.mjs +0 -45
  158. package/esm2020/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.mjs +0 -42
  159. package/esm2020/lib/shared/confirmed-date-information/confirmed-date-information.component.mjs +0 -39
  160. package/esm2020/lib/shared/contact/contact.component.mjs +0 -160
  161. package/esm2020/lib/shared/contact-support/contact-support.component.mjs +0 -172
  162. package/esm2020/lib/shared/dashboard/dashboard.component.mjs +0 -35
  163. package/esm2020/lib/shared/maintenance-list/maintenance-list.component.mjs +0 -352
  164. package/esm2020/lib/shared/shared-routing.module.mjs +0 -18
  165. package/esm2020/lib/shared/shared.module.mjs +0 -144
  166. package/esm2020/lib/shared/show-links/show-links.component.mjs +0 -80
  167. package/esm2020/lib/shared/system-list/system-list.component.mjs +0 -33
  168. package/esm2020/public-api.mjs +0 -48
  169. package/fesm2015/awf-test-lib.mjs +0 -1654
  170. package/fesm2015/awf-test-lib.mjs.map +0 -1
  171. package/fesm2020/awf-test-lib.mjs +0 -1650
  172. package/fesm2020/awf-test-lib.mjs.map +0 -1
  173. package/index.d.ts +0 -5
  174. package/lib/core/core-routing.module.d.ts +0 -7
  175. package/lib/core/core.module.d.ts +0 -15
  176. package/lib/core/menu/menu.component.d.ts +0 -17
  177. package/lib/core/menu-consomer/menu-consomer.component.d.ts +0 -12
  178. package/lib/core/menu-ge-portal/menu-ge-portal.component.d.ts +0 -20
  179. package/lib/core/menu-warranty/menu-warranty.component.d.ts +0 -15
  180. package/lib/core/not-found/not-found.component.d.ts +0 -10
  181. package/lib/core/top-bar/top-bar.component.d.ts +0 -13
  182. package/lib/models/alternativeDate.model.d.ts +0 -6
  183. package/lib/models/applicationName.d.ts +0 -5
  184. package/lib/models/customObject.model.d.ts +0 -3
  185. package/lib/models/detailedPmJob.model.d.ts +0 -23
  186. package/lib/models/emailStatus.d.ts +0 -4
  187. package/lib/models/emailType.d.ts +0 -15
  188. package/lib/models/eventStatus.d.ts +0 -7
  189. package/lib/models/field.d.ts +0 -7
  190. package/lib/models/language.d.ts +0 -4
  191. package/lib/models/pMGroupedJob.model.d.ts +0 -3
  192. package/lib/models/pmJobRequest.model.d.ts +0 -5
  193. package/lib/models/reason.model.d.ts +0 -4
  194. package/lib/models/reasonCode.d.ts +0 -7
  195. package/lib/models/reasonContact.d.ts +0 -6
  196. package/lib/models/role.d.ts +0 -5
  197. package/lib/models/service.model.d.ts +0 -8
  198. package/lib/models/serviceName.d.ts +0 -10
  199. package/lib/models/socialMadia.d.ts +0 -3
  200. package/lib/models/stingBoolean.d.ts +0 -4
  201. package/lib/models/system.d.ts +0 -14
  202. package/lib/models/tokenStatus.d.ts +0 -5
  203. package/lib/models/warranty.d.ts +0 -17
  204. package/lib/pipes/pipes/pipes.module.d.ts +0 -9
  205. package/lib/pipes/subrtring-w.pipe.d.ts +0 -7
  206. package/lib/pipes/substring.pipe.d.ts +0 -7
  207. package/lib/shared/choose-another-date/choose-another-date.component.d.ts +0 -33
  208. package/lib/shared/confirm-dialog/confirm-dialog.component.d.ts +0 -21
  209. package/lib/shared/confirm-dialog-contact/confirm-dialog-contact.component.d.ts +0 -19
  210. package/lib/shared/confirmed-date-information/confirmed-date-information.component.d.ts +0 -17
  211. package/lib/shared/contact/contact.component.d.ts +0 -39
  212. package/lib/shared/contact-support/contact-support.component.d.ts +0 -50
  213. package/lib/shared/dashboard/dashboard.component.d.ts +0 -18
  214. package/lib/shared/maintenance-list/maintenance-list.component.d.ts +0 -81
  215. package/lib/shared/shared-routing.module.d.ts +0 -7
  216. package/lib/shared/shared.module.d.ts +0 -40
  217. package/lib/shared/show-links/show-links.component.d.ts +0 -24
  218. package/lib/shared/system-list/system-list.component.d.ts +0 -16
package/karma.conf.js ADDED
@@ -0,0 +1,44 @@
1
+ // Karma configuration file, see link for more information
2
+ // https://karma-runner.github.io/1.0/config/configuration-file.html
3
+
4
+ module.exports = function (config) {
5
+ config.set({
6
+ basePath: '',
7
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
+ plugins: [
9
+ require('karma-jasmine'),
10
+ require('karma-chrome-launcher'),
11
+ require('karma-jasmine-html-reporter'),
12
+ require('karma-coverage'),
13
+ require('@angular-devkit/build-angular/plugins/karma')
14
+ ],
15
+ client: {
16
+ jasmine: {
17
+ // you can add configuration options for Jasmine here
18
+ // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19
+ // for example, you can disable the random execution with `random: false`
20
+ // or set a specific seed with `seed: 4321`
21
+ },
22
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
23
+ },
24
+ jasmineHtmlReporter: {
25
+ suppressAll: true // removes the duplicated traces
26
+ },
27
+ coverageReporter: {
28
+ dir: require('path').join(__dirname, '../../coverage/awf-test-lib'),
29
+ subdir: '.',
30
+ reporters: [
31
+ { type: 'html' },
32
+ { type: 'text-summary' }
33
+ ]
34
+ },
35
+ reporters: ['progress', 'kjhtml'],
36
+ port: 9876,
37
+ colors: true,
38
+ logLevel: config.LOG_INFO,
39
+ autoWatch: true,
40
+ browsers: ['Chrome'],
41
+ singleRun: false,
42
+ restartOnFileChange: true
43
+ });
44
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/awf-test-lib",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,31 +1,11 @@
1
- {
2
- "name": "awf-test-lib",
3
- "version": "0.1.23",
4
- "peerDependencies": {
5
- "@angular/common": "^17.2.2",
6
- "@angular/core": "^17.2.2"
7
- },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
- "module": "fesm2015/awf-test-lib.mjs",
12
- "es2020": "fesm2020/awf-test-lib.mjs",
13
- "esm2020": "esm2020/awf-test-lib.mjs",
14
- "fesm2020": "fesm2020/awf-test-lib.mjs",
15
- "fesm2015": "fesm2015/awf-test-lib.mjs",
16
- "typings": "index.d.ts",
17
- "exports": {
18
- "./package.json": {
19
- "default": "./package.json"
20
- },
21
- ".": {
22
- "types": "./index.d.ts",
23
- "esm2020": "./esm2020/awf-test-lib.mjs",
24
- "es2020": "./fesm2020/awf-test-lib.mjs",
25
- "es2015": "./fesm2015/awf-test-lib.mjs",
26
- "node": "./fesm2015/awf-test-lib.mjs",
27
- "default": "./fesm2020/awf-test-lib.mjs"
28
- }
29
- },
30
- "sideEffects": false
1
+ {
2
+ "name": "awf-test-lib",
3
+ "version": "0.1.25",
4
+ "peerDependencies": {
5
+ "@angular/common": "^17.2.2",
6
+ "@angular/core": "^17.2.2"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ }
31
11
  }
@@ -0,0 +1,10 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { RouterModule, Routes } from '@angular/router';
3
+
4
+ const routes: Routes = [];
5
+
6
+ @NgModule({
7
+ imports: [RouterModule.forChild(routes)],
8
+ exports: [RouterModule]
9
+ })
10
+ export class CoreRoutingModule { }
@@ -0,0 +1,35 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { CoreRoutingModule } from './core-routing.module';
4
+ import { NotFoundComponent } from './not-found/not-found.component';
5
+ import {MegaMenuModule} from 'primeng/megamenu';
6
+ import { TopBarComponent } from './top-bar/top-bar.component';
7
+ import { MenuComponent } from './menu/menu.component';
8
+ import { MenuWarrantyComponent } from './menu-warranty/menu-warranty.component';
9
+ import { MenuConsomerComponent } from './menu-consomer/menu-consomer.component';
10
+ import { MenuGePortalComponent } from './menu-ge-portal/menu-ge-portal.component';
11
+
12
+
13
+
14
+
15
+ @NgModule({
16
+ declarations: [
17
+ TopBarComponent,
18
+ NotFoundComponent,
19
+ MenuComponent,
20
+ MenuWarrantyComponent,
21
+ MenuConsomerComponent,
22
+ MenuGePortalComponent,
23
+ ],
24
+ imports: [
25
+ CommonModule,
26
+ CoreRoutingModule,
27
+ MegaMenuModule
28
+ ],
29
+ exports: [
30
+ NotFoundComponent,
31
+ MenuComponent,
32
+ TopBarComponent,
33
+ ]
34
+ })
35
+ export class CoreModule { }
@@ -0,0 +1,18 @@
1
+ /*--------------------------------------------------------------
2
+ # Sidebar
3
+ --------------------------------------------------------------*/
4
+ .layout-menu .logo img {
5
+ width: 150px;
6
+ max-height: 20px;
7
+ margin-left: 24px;
8
+ }
9
+ @media (max-width: var(--smscreen)) {
10
+ .layout-menu .logo img {
11
+ max-height: 33px;
12
+ margin-left: 0px;
13
+ }
14
+ }
15
+ .layout-menu .a {
16
+ font-family: var(--font);
17
+ }
18
+
@@ -0,0 +1,8 @@
1
+
2
+
3
+ <awf-menu-warranty [haveConsumerDataId]="haveConsumerDataId" [translate]="translate" [isAdmin]="isAdmin" *ngIf="applicationName ==='WarrantyPortal' " (logOutClick)=logout() (hideMenu)="hideMenuMethode()">
4
+ </awf-menu-warranty>
5
+ <awf-menu-consomer [translate]="translate" [isAdmin]="isAdmin" *ngIf="applicationName ==='ConsomerPortal' " (logOutClick)=logout() (hideMenu)="hideMenuMethode()">
6
+ </awf-menu-consomer>
7
+ <awf-menu-ge-portal [translate]="translate" [isAdmin]="isAdmin" *ngIf="applicationName ==='GEPortal' " (logOutClick)=logout() (hideMenu)="hideMenuMethode()">
8
+ </awf-menu-ge-portal>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MenuComponent } from './menu.component';
4
+
5
+ describe('MenuComponent', () => {
6
+ let component: MenuComponent;
7
+ let fixture: ComponentFixture<MenuComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ MenuComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(MenuComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,28 @@
1
+ import { Component,EventEmitter, Output, Input, OnInit } from '@angular/core';
2
+ @Component({
3
+ selector: 'awf-menu',
4
+ templateUrl: './menu.component.html',
5
+ styleUrls: ['./menu.component.css']
6
+ })
7
+ export class MenuComponent implements OnInit {
8
+ @Output() logOutClick: EventEmitter<any> = new EventEmitter();
9
+ @Output() hideMenu: EventEmitter<any> = new EventEmitter();
10
+ @Input() active!: boolean ;
11
+ @Input() isAdmin!: boolean ;
12
+ @Input() translate!: any;
13
+ @Input() applicationName!: any;
14
+ @Input() haveConsumerDataId!: boolean ;
15
+ constructor() { }
16
+ ngOnInit(): void {}
17
+
18
+
19
+ logout() {
20
+ this.logOutClick.emit();
21
+ }
22
+
23
+ hideMenuMethode()
24
+ {
25
+ this.hideMenu.emit();
26
+ }
27
+
28
+ }
@@ -0,0 +1,20 @@
1
+ <div class="layout-menu" *ngIf="translate">
2
+ <div class="menu-category"> <i class="pi pi-home"></i> {{translate.general}}</div>
3
+ <div class="menu-items">
4
+ <a routerLink="./">{{translate.Homepage}}</a>
5
+ <a routerLink="./device">{{translate.myDevices}}</a>
6
+ <a routerLink="./personalData">{{translate.personalData}}</a>
7
+ </div>
8
+
9
+ <div class="menu-category" *ngIf="isAdmin "> <i class="pi pi-cog"></i> {{translate.config}}</div>
10
+ <div class="menu-items" *ngIf="isAdmin ">
11
+ <a routerLink="./theme">{{translate.themes}}</a>
12
+ <a routerLink="./servicesConfig">{{translate.services}}</a>
13
+ </div>
14
+
15
+ <div class="menu-category"> <i class="pi pi-user"></i> {{translate.account}}</div>
16
+ <div class="menu-items">
17
+ <a >{{translate.profile}}</a>
18
+ <a (click)="logout()">{{translate.logout}}</a>
19
+ </div>
20
+ </div>
@@ -0,0 +1,20 @@
1
+ /*--------------------------------------------------------------
2
+ # Sidebar
3
+ --------------------------------------------------------------*/
4
+
5
+ .layout-menu {
6
+ .logo {
7
+ img {
8
+ width: 150px;
9
+ max-height: 20px;
10
+ margin-left: 24px;
11
+ @media (max-width: var(--smscreen)) {
12
+ max-height: 33px;
13
+ margin-left: 0px;
14
+ }
15
+ }
16
+ }
17
+ .a {
18
+ font-family: var(--font);
19
+ }
20
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MenuConsomerComponent } from './menu-consomer.component';
4
+
5
+ describe('MenuConsomerComponent', () => {
6
+ let component: MenuConsomerComponent;
7
+ let fixture: ComponentFixture<MenuConsomerComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ MenuConsomerComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(MenuConsomerComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,21 @@
1
+ import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'awf-menu-consomer',
5
+ templateUrl: './menu-consomer.component.html',
6
+ styleUrls: ['./menu-consomer.component.scss']
7
+ })
8
+ export class MenuConsomerComponent implements OnChanges {
9
+ @Output() logOutClick: EventEmitter<any> = new EventEmitter();
10
+ @Input() translate!: any;
11
+ @Input() isAdmin!: boolean;
12
+ constructor() { }
13
+
14
+ ngOnChanges(): void {
15
+ }
16
+
17
+ logout() {
18
+ this.logOutClick.emit();
19
+ }
20
+
21
+ }
@@ -0,0 +1,7 @@
1
+ <div class="layout-menu" *ngIf="translate">
2
+ <div class="menu" (click)="menuMethode()"> <i class="pi pi-home"></i> {{translate.home}}</div>
3
+ <div class="menu" (click)="menuMethode('contact')"> <i class="pi pi-phone"></i> {{translate.contact}}</div>
4
+ <div class="menu" (click)="menuMethode('systems')"> <i class="pi pi-eye"></i> {{translate.systems}}</div>
5
+ <div class="menu" (click)="menuMethode('maintenance')"> <i class="pi pi-inbox"></i> {{translate.maintenance}}</div>
6
+ <div class="menu" (click)="logout()"> <i class="pi pi-power-off"></i> {{translate.logout}}</div>
7
+ </div>
@@ -0,0 +1,17 @@
1
+ .layout-menu {
2
+ margin-left: 50px;
3
+
4
+ .menu {
5
+ display: block;
6
+ color: #8DA1B5;
7
+ font-weight: 300;
8
+ padding: 1rem 0 0.5rem 0;
9
+ font-size: 16px;
10
+ cursor: pointer;
11
+ &:hover {
12
+ font-weight: bold;
13
+ color: var(--primarycolor);
14
+ }
15
+ }
16
+
17
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MenuGePortalComponent } from './menu-ge-portal.component';
4
+
5
+ describe('MenuGePortalComponent', () => {
6
+ let component: MenuGePortalComponent;
7
+ let fixture: ComponentFixture<MenuGePortalComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ MenuGePortalComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(MenuGePortalComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,83 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import { Router } from '@angular/router';
3
+ import { jwtDecode } from "jwt-decode";
4
+
5
+ @Component({
6
+ selector: 'awf-menu-ge-portal',
7
+ templateUrl: './menu-ge-portal.component.html',
8
+ styleUrls: ['./menu-ge-portal.component.scss']
9
+ })
10
+ export class MenuGePortalComponent {
11
+ @Output() logOutClick: EventEmitter<any> = new EventEmitter();
12
+ @Input() translate!: any;
13
+ @Input() isAdmin!: boolean;
14
+ @Output() hideMenu: EventEmitter<any> = new EventEmitter();
15
+ displayViewAs : boolean = false;
16
+
17
+ constructor(private readonly router : Router) {
18
+ this.displayViewAs = !this.isTokenExpired();
19
+ }
20
+
21
+ logout() {
22
+ this.displayViewAs = !this.isTokenExpired();
23
+ if(this.displayViewAs){
24
+ this.deleteConnexionInfo();
25
+ this.navigate("/ge")
26
+ }else{
27
+ this.logOutClick.emit();
28
+ }
29
+ }
30
+
31
+ menuMethode(path? : string) {
32
+ this.redirectByPath(path);
33
+ this.hideMenu.emit();
34
+ }
35
+
36
+ isTokenExpired(): boolean {
37
+ const token = sessionStorage.getItem("va-token") ? sessionStorage.getItem("va-token") : localStorage.getItem("va-token")
38
+ if (!token) {
39
+ return true; // Token absent, considéré comme expiré
40
+ }
41
+ const tokenData : any = jwtDecode(token);
42
+ const expirationTime = tokenData?.exp; // Convertir en millisecondes
43
+ const currentTimeInSeconds = Math.floor(Date.now() / 1000); // Temps actuel en secondes
44
+ const isExpired = expirationTime ? expirationTime < currentTimeInSeconds : true;
45
+ if(isExpired){
46
+ this.deleteConnexionInfo();
47
+ }
48
+ return isExpired
49
+
50
+ }
51
+ redirectByPath(path? : string){
52
+ this.displayViewAs = !this.isTokenExpired();
53
+ if(this.displayViewAs){
54
+ switch (path) {
55
+ case null || undefined || '' : this.navigate('/ge/view-as/home'); break;
56
+ case 'contact' : this.navigate('/ge/view-as/contact'); break;
57
+ case 'maintenance' : this.navigate('/ge/view-as/maintenance'); break;
58
+ case 'systems' : this.navigate('/ge/view-as/systems'); break;
59
+ default: this.navigate('/ge/view-as/home');
60
+ }
61
+ }else {
62
+ switch (path) {
63
+ case null || undefined || '' : this.navigate('/ge'); break;
64
+ case 'contact' : this.navigate('/ge/contact'); break;
65
+ case 'maintenance' : this.navigate('/ge/maintenance'); break;
66
+ case 'systems' : this.navigate('/ge/systems'); break;
67
+ default: this.navigate('/ge');
68
+ }
69
+ }
70
+ }
71
+ deleteConnexionInfo(){
72
+ sessionStorage.removeItem("va-token");
73
+ sessionStorage.removeItem("va-email");
74
+ localStorage.removeItem("va-token");
75
+ localStorage.removeItem("va-email");
76
+ sessionStorage.setItem("va","false")
77
+ localStorage.setItem("va","false")
78
+ }
79
+ navigate(route: string):void{
80
+ this.router.navigate([route])
81
+ }
82
+
83
+ }
@@ -0,0 +1,20 @@
1
+ <div class="layout-menu" *ngIf="translate">
2
+ <div class="menu-category"> <i class="pi pi-home"></i> {{translate.general}}</div>
3
+ <div class="menu-items">
4
+ <a routerLink="./warranties" (click)="hideMenuMethode()">{{translate.Homepage}}</a>
5
+ <a routerLink="./device" (click)="hideMenuMethode()">{{translate.devices}}</a>
6
+ </div>
7
+ <div class="menu-category" *ngIf="isAdmin "> <i class="pi pi-cog"></i> {{translate.config}}</div>
8
+ <div class="menu-items" *ngIf="isAdmin ">
9
+
10
+ <a routerLink="./theme" (click)="hideMenuMethode()">{{translate.themes}}</a>
11
+ <a routerLink="./servicesConfig" (click)="hideMenuMethode()">{{translate.services}}</a>
12
+ </div>
13
+ <div class="menu-category"> <i class="pi pi-user"></i> {{translate.account}}</div>
14
+ <div class="menu-items">
15
+ <a routerLink="./account" *ngIf="haveConsumerDataId" (click)="hideMenuMethode()">{{translate.personalData}}</a>
16
+ <a routerLink="./account/optionsList" *ngIf="haveConsumerDataId" (click)="hideMenuMethode()">{{translate.optionsList}}</a>
17
+ <a routerLink="./account/change-password" *ngIf="haveConsumerDataId" (click)="hideMenuMethode()">{{translate.changePassword}}</a>
18
+ <a (click)="logout()">{{translate.logout}}</a>
19
+ </div>
20
+ </div>
@@ -0,0 +1,16 @@
1
+ .layout-menu {
2
+ .logo {
3
+ img {
4
+ width: 150px;
5
+ max-height: 20px;
6
+ margin-left: 24px;
7
+ @media (max-width: var(--smscreen)) {
8
+ max-height: 33px;
9
+ margin-left: 0px;
10
+ }
11
+ }
12
+ }
13
+ .a {
14
+ font-family: var(--font);
15
+ }
16
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MenuWarrantyComponent } from './menu-warranty.component';
4
+
5
+ describe('MenuWarrantyComponent', () => {
6
+ let component: MenuWarrantyComponent;
7
+ let fixture: ComponentFixture<MenuWarrantyComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ MenuWarrantyComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(MenuWarrantyComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,31 @@
1
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
+
3
+
4
+
5
+
6
+ @Component({
7
+ selector: 'awf-menu-warranty',
8
+ templateUrl: './menu-warranty.component.html',
9
+ styleUrls: ['./menu-warranty.component.scss']
10
+ })
11
+ export class MenuWarrantyComponent implements OnInit {
12
+ @Output() logOutClick: EventEmitter<any> = new EventEmitter();
13
+ @Output() hideMenu: EventEmitter<any> = new EventEmitter();
14
+ @Input() isAdmin!: boolean;
15
+ @Input() translate!: any;
16
+ @Input() haveConsumerDataId!: boolean;
17
+
18
+
19
+ constructor( ) { }
20
+
21
+ ngOnInit(): void {
22
+
23
+
24
+ }
25
+ logout() { this.logOutClick.emit();
26
+ }
27
+ hideMenuMethode()
28
+ {
29
+ this.hideMenu.emit();
30
+ }
31
+ }
@@ -0,0 +1,31 @@
1
+
2
+
3
+ .container{
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ width: 100%;
8
+ background-color: #5ca3dd93;
9
+ }
10
+ h2{
11
+ font-size: 150px;
12
+ margin: 0;
13
+ text-shadow: 15px 5px 2px black;
14
+ }
15
+ h3{
16
+ font-size: 40px;
17
+ margin: 20px;
18
+ }
19
+ p{
20
+ font-size: 18px;
21
+ margin: 5px;
22
+ }
23
+ p:last-of-type{
24
+ margin-bottom: 35px;
25
+ }
26
+ a{
27
+ text-decoration: none;
28
+
29
+ }
30
+
31
+
@@ -0,0 +1,6 @@
1
+ <div class="container" *ngIf="translate">
2
+ <h2>{{translate.title}}</h2>
3
+ <h3>{{translate.oops}}</h3>
4
+ <p>{{translate.checkUrl}}</p>
5
+ <p>{{translate.otherwise}}<a routerLink="./home">{{translate.clickHere}} </a>{{translate.redirect}}</p>
6
+ </div>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { NotFoundComponent } from './not-found.component';
4
+
5
+ describe('NotFoundComponent', () => {
6
+ let component: NotFoundComponent;
7
+ let fixture: ComponentFixture<NotFoundComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ NotFoundComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(NotFoundComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,15 @@
1
+ import { Component, OnChanges,Input } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'awf-not-found',
5
+ templateUrl: './not-found.component.html',
6
+ styleUrls: ['./not-found.component.css']
7
+ })
8
+ export class NotFoundComponent implements OnChanges {
9
+ @Input() translate!: any;
10
+ @Input() applicationName!: any;
11
+ constructor() { }
12
+
13
+ ngOnChanges(): void {}
14
+
15
+ }