@eui/cli 18.0.0-next.4 → 18.0.0-next.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/.version.properties +1 -1
  2. package/bin/eui-cli.js +4 -3
  3. package/lib/install.js +0 -1
  4. package/lib/skeletons/_angular/base/angular.json +5 -4
  5. package/lib/skeletons/_angular/base/package.json +2 -2
  6. package/lib/skeletons/_angular/base/src/app/app-routing.module.ts +1 -1
  7. package/lib/skeletons/_angular/base/src/app/app-starter.service.spec.ts +65 -0
  8. package/lib/skeletons/_angular/base/src/app/app-starter.service.ts +4 -2
  9. package/lib/skeletons/_angular/base/src/app/app.component.spec.ts +78 -0
  10. package/lib/skeletons/_angular/base/src/app/app.module.spec.ts +31 -0
  11. package/lib/skeletons/_angular/base/src/app/core/core.module.ts +1 -0
  12. package/lib/skeletons/_angular/base/src/app/core/reducers/index.ts +2 -1
  13. package/lib/skeletons/_angular/base/src/app/features/home/home.component.ts +2 -1
  14. package/lib/skeletons/_angular/base/src/config/global.ts +1 -1
  15. package/lib/skeletons/_angular/base/src/config/index.ts +1 -1
  16. package/lib/skeletons/_angular/base/src/config/modules.ts +1 -1
  17. package/lib/skeletons/_angular/base/src/environments/environment.prod.ts +1 -1
  18. package/lib/skeletons/_angular/base/src/environments/environment.ts +1 -1
  19. package/lib/skeletons/_angular/base/src/index.html +1 -1
  20. package/lib/skeletons/_angular/base-mobile/angular.json +1 -1
  21. package/lib/skeletons/_angular/base-mobile/package.json +4 -4
  22. package/lib/skeletons/_angular/base-mobile/src/app/core/core.module.ts +5 -4
  23. package/lib/skeletons/_angular/base-mobile/src/app/core/reducers/index.ts +2 -1
  24. package/lib/skeletons/_angular/options/ecl-ec/angular.json +4 -4
  25. package/lib/skeletons/_angular/options/ecl-eu/angular.json +4 -4
  26. package/lib/skeletons/web-symfony/myapp-web/package.json +2 -2
  27. package/package.json +2 -2
@@ -1 +1 @@
1
- 18.0.0-next.4
1
+ 18.0.0-next.41
package/bin/eui-cli.js CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const tools = require('@eui/tools/scripts/utils/tools');
4
3
  const chalk = require('chalk');
4
+ const tools = require('@eui/tools/scripts/utils/tools');
5
5
  const figlet = require('figlet');
6
6
  const path = require('path');
7
+ const fs = require('fs');
7
8
  const generators = require('../lib/generators');
8
9
  const config = require('../lib/config');
9
10
 
@@ -31,8 +32,8 @@ if (args.targetPath) {
31
32
  targetPath = path.join(targetPath, 'packages');
32
33
  }
33
34
 
34
- if (!tools.isDirExists(targetPath)) {
35
- tools.mkdir(targetPath);
35
+ if (fs.readdirSync(targetPath).length < 1) {
36
+ fs.mkdirSync(targetPath);
36
37
  }
37
38
 
38
39
  // otherwise taking the default config targetPath defined
package/lib/install.js CHANGED
@@ -5,7 +5,6 @@ const tools = require('@eui/tools/scripts/utils/tools');
5
5
  const utils = require('./utils');
6
6
  const chalk = require('chalk');
7
7
 
8
-
9
8
  module.exports.start = (options) => {
10
9
 
11
10
  if (!options.config.npmInstall) {
@@ -39,13 +39,14 @@
39
39
  },
40
40
  {
41
41
  "glob": "**/*",
42
- "input": "node_modules/@eui/styles-base/src/assets/",
42
+ "input": "node_modules/@eui/styles/dist/assets/",
43
43
  "output": "./assets"
44
44
  }
45
45
  ],
46
46
  "styles": [
47
- "node_modules/@eui/styles/dist/styles/eui.css",
48
- "node_modules/@eui/styles/dist/styles/eui-utilities.css",
47
+ "node_modules/@eui/styles/dist/eui.css",
48
+ "node_modules/@eui/styles/dist/eui-utilities.css",
49
+ "node_modules/@eui/styles/dist/eui-theme-eui-legacy.css",
49
50
  "src/styles.scss"
50
51
  ]
51
52
  },
@@ -145,7 +146,7 @@
145
146
  },
146
147
  {
147
148
  "glob": "**/*",
148
- "input": "node_modules/@eui/styles-base/src/assets/",
149
+ "input": "node_modules/@eui/styles/dist/assets/",
149
150
  "output": "./assets"
150
151
  }
151
152
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "18.0.0-next.4",
3
+ "version": "18.0.0-next.41",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -20,6 +20,6 @@
20
20
  },
21
21
  "private": true,
22
22
  "dependencies": {
23
- "@eui/deps-base": "18.0.0-next.4"
23
+ "@eui/deps-base": "18.0.0-next.41"
24
24
  }
25
25
  }
@@ -1,7 +1,7 @@
1
1
  import { NgModule } from '@angular/core';
2
2
  import { RouterModule, Routes } from '@angular/router';
3
3
 
4
- const routes: Routes = [
4
+ export const routes: Routes = [
5
5
  { path: '', redirectTo: 'screen/home', pathMatch: 'full' },
6
6
  { path: 'index.jsp', redirectTo: 'screen/home' },
7
7
  { path: 'screen/home', loadChildren: () => import('./features/home/home.module').then(m => m.Module) },
@@ -0,0 +1,65 @@
1
+ import {TestBed} from '@angular/core/testing';
2
+ import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
3
+ import {CONFIG_TOKEN, I18nService, UserService} from '@eui/core';
4
+ import {EuiAppConfig} from '@eui/base';
5
+ import {of} from 'rxjs';
6
+ import {AppStarterService} from './app-starter.service';
7
+ import SpyObj = jasmine.SpyObj;
8
+
9
+ describe('AppStarterService', () => {
10
+ let service: AppStarterService;
11
+ let httpMock: HttpTestingController;
12
+ let userServiceMock: SpyObj<UserService>;
13
+ let i18nServiceMock: SpyObj<I18nService>;
14
+ let configMock: EuiAppConfig;
15
+
16
+ beforeEach(() => {
17
+ userServiceMock = jasmine.createSpyObj('UserService', ['init']);
18
+ i18nServiceMock = jasmine.createSpyObj('I18nService', ['init']);
19
+ configMock = {global: {}, modules: {core: {base: 'localhost:3000', userDetails: 'dummy'}}};
20
+
21
+ TestBed.configureTestingModule({
22
+ imports: [HttpClientTestingModule],
23
+ providers: [
24
+ AppStarterService,
25
+ {provide: UserService, useValue: userServiceMock},
26
+ {provide: I18nService, useValue: i18nServiceMock},
27
+ {provide: CONFIG_TOKEN, useValue: configMock},
28
+ ],
29
+ });
30
+
31
+ service = TestBed.inject(AppStarterService);
32
+ httpMock = TestBed.inject(HttpTestingController);
33
+ });
34
+
35
+ it('should be created', () => {
36
+ expect(service).toBeTruthy();
37
+ });
38
+
39
+ it('should call start method', () => {
40
+ userServiceMock.init.and.returnValue(of(null));
41
+ i18nServiceMock.init.and.returnValue(of(null));
42
+ service.start().subscribe(() => {
43
+ expect(userServiceMock.init).toHaveBeenCalled();
44
+ expect(i18nServiceMock.init).toHaveBeenCalled();
45
+ });
46
+ });
47
+
48
+ it('should call initUserService method', () => {
49
+ userServiceMock.init.and.returnValue(of(null));
50
+ service.initUserService().subscribe(() => {
51
+ expect(userServiceMock.init).toHaveBeenCalled();
52
+ });
53
+ });
54
+
55
+ it('should fetch user details', () => {
56
+ const dummyUserDetails = {userId: 'anonymous'};
57
+ service['fetchUserDetails']().subscribe(userDetails => {
58
+ expect(userDetails).toEqual(dummyUserDetails);
59
+ });
60
+
61
+ const req = httpMock.expectOne(`${configMock.modules.core.base}${configMock.modules.core.userDetails}`);
62
+ expect(req.request.method).toBe('GET');
63
+ req.flush(dummyUserDetails);
64
+ });
65
+ });
@@ -2,11 +2,13 @@ import { Inject, Injectable } from '@angular/core';
2
2
  import {
3
3
  CONFIG_TOKEN,
4
4
  UserService,
5
+ I18nService,
6
+ } from '@eui/core';
7
+ import {
5
8
  EuiAppConfig,
6
9
  UserDetails,
7
10
  UserPreferences,
8
- I18nService,
9
- } from '@eui/core';
11
+ } from '@eui/base';
10
12
  import { HttpClient } from '@angular/common/http';
11
13
  import { Observable, of, zip } from 'rxjs';
12
14
  import { switchMap } from 'rxjs/operators';
@@ -0,0 +1,78 @@
1
+ import {ComponentFixture, TestBed} from '@angular/core/testing';
2
+ import {RouterModule} from '@angular/router';
3
+ import {DebugElement, Predicate} from '@angular/core';
4
+ import {By} from '@angular/platform-browser';
5
+ import {AppComponent} from './app.component';
6
+ import {EuiAppModule} from '@eui/components/layout';
7
+ import {HttpClientTestingModule} from '@angular/common/http/testing';
8
+ import {CoreModule} from "./core/core.module";
9
+ import {routes} from "./app-routing.module";
10
+
11
+ describe('AppComponent', () => {
12
+ let component: AppComponent;
13
+ let fixture: ComponentFixture<AppComponent>;
14
+
15
+ beforeEach(async () => {
16
+ await TestBed.configureTestingModule({
17
+ imports: [
18
+ RouterModule.forRoot(routes),
19
+ CoreModule,
20
+ EuiAppModule,
21
+ HttpClientTestingModule,
22
+ ],
23
+ declarations: [AppComponent],
24
+ }).compileComponents();
25
+
26
+ fixture = TestBed.createComponent(AppComponent);
27
+ component = fixture.componentInstance;
28
+ });
29
+
30
+ it('should create the app', () => {
31
+ expect(component).toBeTruthy();
32
+ });
33
+
34
+ it('should have correct sidebarItems', () => {
35
+ expect(component.sidebarItems).toEqual([
36
+ {label: 'Home', url: 'screen/home'},
37
+ {
38
+ label: 'Module 1', url: 'screen/module1', children: [
39
+ {label: 'page 1', url: 'screen/module1/page1'},
40
+ {label: 'page 2', url: 'screen/module1/page2'},
41
+ ]
42
+ },
43
+ {label: 'Module 2', url: 'screen/module2'},
44
+ ]);
45
+ });
46
+
47
+ it('should have correct notificationItems', () => {
48
+ expect(component.notificationItems).toEqual([
49
+ {label: 'Title label 1', subLabel: 'Subtitle label'},
50
+ {label: 'Title label 2', subLabel: 'Subtitle label'},
51
+ {label: 'Title label 3', subLabel: 'Subtitle label'},
52
+ {label: 'Title label 4', subLabel: 'Subtitle label'},
53
+ ]);
54
+ });
55
+
56
+ it('should render correct number of eui-app-sidebar-menu items', () => {
57
+ fixture.detectChanges();
58
+ const compiled = fixture.debugElement;
59
+ expect(compiled.queryAll(By.css('eui-menu-item')).length).toEqual(component.sidebarItems.length);
60
+ });
61
+
62
+ it('should render correct number of eui-notifications on icon badge', () => {
63
+ fixture.detectChanges();
64
+ const compiled = fixture.debugElement;
65
+ const predicate = By.css('eui-notifications > eui-icon-svg-button > button > eui-icon-svg > eui-badge');
66
+ expect(compiled.queryAll(predicate)[0].nativeNode.innerText).toEqual(component.notificationItems.length.toString());
67
+ });
68
+
69
+ it('should render correct number of eui-notifications on list', () => {
70
+ fixture.detectChanges();
71
+ const compiled = fixture.debugElement;
72
+ const notificationButton: Predicate<DebugElement> = By.css('eui-notifications > eui-icon-svg-button > button');
73
+ compiled.query(notificationButton).nativeElement.click();
74
+ fixture.detectChanges();
75
+ expect(compiled.queryAll(By.css('eui-notification-item')).length)
76
+ .toEqual(component.notificationItems.length);
77
+ });
78
+ });
@@ -0,0 +1,31 @@
1
+ import {TestBed} from '@angular/core/testing';
2
+ import {AppModule} from './app.module';
3
+ import {AppStarterService} from './app-starter.service';
4
+ import {of} from 'rxjs';
5
+
6
+ describe('AppModule', () => {
7
+ let appStarterService: AppStarterService;
8
+
9
+ beforeAll(() => {
10
+ TestBed.resetTestingModule()
11
+ });
12
+
13
+ beforeEach(async () => {
14
+ const appStarterServiceMock = {
15
+ start: jasmine.createSpy('start').and.returnValue(of(null)),
16
+ };
17
+ await TestBed.configureTestingModule({
18
+ imports: [AppModule],
19
+ providers: [
20
+ {provide: AppStarterService, useValue: appStarterServiceMock},
21
+ ],
22
+ }).compileComponents();
23
+
24
+ appStarterService = TestBed.inject(AppStarterService);
25
+ });
26
+
27
+ it('should call start method of AppStarterService', () => {
28
+ expect(appStarterService.start).toHaveBeenCalled();
29
+ });
30
+
31
+ });
@@ -32,6 +32,7 @@ import { SharedModule } from '@shared/shared.module';
32
32
  EffectsModule.forRoot([...CoreModuleEffects]),
33
33
  TranslateModule.forRoot(translateConfig),
34
34
  StoreModule.forRoot(REDUCER_TOKEN, { metaReducers }),
35
+ StoreModule.forRoot(REDUCER_TOKEN, { metaReducers }),
35
36
  !environment.production ? StoreDevtoolsModule.instrument({ maxAge: 50 }) : [],
36
37
  ],
37
38
  declarations: [
@@ -1,7 +1,8 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { MetaReducer } from '@ngrx/store';
3
3
  import { storeFreeze } from 'ngrx-store-freeze';
4
- import { reducers as coreReducers, CoreState, getAppState, localStorageSync } from '@eui/core';
4
+ import { reducers as coreReducers, localStorageSync } from '@eui/core';
5
+ import { CoreState, getAppState } from '@eui/base';
5
6
 
6
7
  import { environment } from '../../../environments/environment';
7
8
 
@@ -1,5 +1,6 @@
1
1
  import { Component, Inject } from '@angular/core';
2
- import { CONFIG_TOKEN, EuiAppConfig } from '@eui/core';
2
+ import { CONFIG_TOKEN } from '@eui/core';
3
+ import { EuiAppConfig } from '@eui/base';
3
4
 
4
5
  @Component({
5
6
  templateUrl: './home.component.html',
@@ -1,4 +1,4 @@
1
- import { GlobalConfig } from '@eui/core';
1
+ import { GlobalConfig } from '@eui/base';
2
2
 
3
3
  export const GLOBAL: GlobalConfig = {
4
4
  appTitle: 'CSDR-app',
@@ -1,4 +1,4 @@
1
- import { EuiAppConfig } from '@eui/core';
1
+ import { EuiAppConfig } from '@eui/base';
2
2
  import { GLOBAL } from './global';
3
3
  import { MODULES } from './modules';
4
4
 
@@ -1,4 +1,4 @@
1
- import { ModulesConfig } from '@eui/core';
1
+ import { ModulesConfig } from '@eui/base';
2
2
 
3
3
  export const MODULES: ModulesConfig = {
4
4
  core: {
@@ -1,4 +1,4 @@
1
- import { EuiEnvConfig } from '@eui/core';
1
+ import { EuiEnvConfig } from '@eui/base';
2
2
 
3
3
  export const environment: EuiEnvConfig = {
4
4
  production: true,
@@ -1,4 +1,4 @@
1
- import { EuiEnvConfig } from '@eui/core';
1
+ import { EuiEnvConfig } from '@eui/base';
2
2
 
3
3
  export const environment: EuiEnvConfig = {
4
4
  production: false,
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
- <html>
2
+ <html class="eui-t-eui-legacy">
3
3
 
4
4
  <head>
5
5
  <meta charset="utf-8">
@@ -46,7 +46,7 @@
46
46
  },
47
47
  {
48
48
  "glob": "**/*",
49
- "input": "node_modules/@eui/styles-base/dist/assets/images",
49
+ "input": "node_modules/@eui/styles/dist/assets/images",
50
50
  "output": "./assets/images"
51
51
  },
52
52
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "18.0.0-next.4",
3
+ "version": "18.0.0-next.41",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -20,8 +20,8 @@
20
20
  },
21
21
  "private": true,
22
22
  "dependencies": {
23
- "@eui/deps-base": "16.2.16-snapshot-1711635173997",
24
- "@eui/mobile-core": "16.9.0-snapshot-1711463915848",
25
- "@eui/mobile-styles": "16.9.0-snapshot-1711463915848"
23
+ "@eui/deps-base": "16.2.17-snapshot-1712283114368",
24
+ "@eui/mobile-core": "16.10.0",
25
+ "@eui/mobile-styles": "16.10.0"
26
26
  }
27
27
  }
@@ -1,7 +1,7 @@
1
1
  import { NgModule } from '@angular/core';
2
2
  import { TranslateModule } from '@ngx-translate/core';
3
3
  import { StoreModule } from '@ngrx/store';
4
- import { EffectsModule } from '@ngrx/effects';
4
+ // import { EffectsModule } from '@ngrx/effects';
5
5
  import { StoreDevtoolsModule } from '@ngrx/store-devtools';
6
6
 
7
7
  import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
@@ -15,7 +15,7 @@ import {
15
15
  EuLoginSessionTimeoutHandlingInterceptor,
16
16
  CoreModule as EuiCoreModule,
17
17
  translateConfig,
18
- CoreModuleEffects,
18
+ // CoreModuleEffects,
19
19
  EUI_CONFIG_TOKEN,
20
20
  } from '@eui/core';
21
21
 
@@ -31,9 +31,10 @@ import { SharedModule } from '@shared/shared.module';
31
31
  HttpClientModule,
32
32
  SharedModule,
33
33
  EuiCoreModule.forRoot(),
34
- EffectsModule.forRoot([...CoreModuleEffects]),
34
+ // EffectsModule.forRoot([...CoreModuleEffects]),
35
35
  TranslateModule.forRoot(translateConfig),
36
- StoreModule.forRoot(REDUCER_TOKEN, { metaReducers }),
36
+ StoreModule.forRoot(),
37
+ // StoreModule.forRoot(REDUCER_TOKEN, { metaReducers }),
37
38
  !environment.production ? StoreDevtoolsModule.instrument({ maxAge: 50 }) : [],
38
39
  IonicModule.forRoot({mode: 'md'}),
39
40
  ],
@@ -1,7 +1,8 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { MetaReducer } from '@ngrx/store';
3
3
  import { storeFreeze } from 'ngrx-store-freeze';
4
- import { reducers as coreReducers, CoreState, getAppState, localStorageSync } from '@eui/core';
4
+ import { reducers as coreReducers, localStorageSync } from '@eui/core';
5
+ import { CoreState, getAppState } from '@eui/base';
5
6
 
6
7
  import { environment } from '../../../environments/environment';
7
8
 
@@ -39,12 +39,12 @@
39
39
  },
40
40
  {
41
41
  "glob": "**/*",
42
- "input": "node_modules/@eui/styles-base/src/assets/ecl",
42
+ "input": "node_modules/@eui/styles/dist/assets/ecl",
43
43
  "output": "./assets/images/ecl"
44
44
  },
45
45
  {
46
46
  "glob": "**/*",
47
- "input": "node_modules/@eui/styles-base/src/assets",
47
+ "input": "node_modules/@eui/styles/dist/assets",
48
48
  "output": "./assets"
49
49
  },
50
50
  {
@@ -159,12 +159,12 @@
159
159
  },
160
160
  {
161
161
  "glob": "**/*",
162
- "input": "node_modules/@eui/styles-base/dist/assets/ecl",
162
+ "input": "node_modules/@eui/styles/dist/assets/ecl",
163
163
  "output": "./assets/images/ecl"
164
164
  },
165
165
  {
166
166
  "glob": "**/*",
167
- "input": "node_modules/@eui/styles-base/dist/assets",
167
+ "input": "node_modules/@eui/styles/dist/assets",
168
168
  "output": "./assets"
169
169
  },
170
170
  {
@@ -39,12 +39,12 @@
39
39
  },
40
40
  {
41
41
  "glob": "**/*",
42
- "input": "node_modules/@eui/styles-base/src/assets/ecl",
42
+ "input": "node_modules/@eui/styles/dist/assets/ecl",
43
43
  "output": "./assets/images/ecl"
44
44
  },
45
45
  {
46
46
  "glob": "**/*",
47
- "input": "node_modules/@eui/styles-base/src/assets",
47
+ "input": "node_modules/@eui/styles/dist/assets",
48
48
  "output": "./assets"
49
49
  },
50
50
  {
@@ -159,12 +159,12 @@
159
159
  },
160
160
  {
161
161
  "glob": "**/*",
162
- "input": "node_modules/@eui/styles-base/dist/assets/ecl",
162
+ "input": "node_modules/@eui/styles/dist/assets/ecl",
163
163
  "output": "./assets/images/ecl"
164
164
  },
165
165
  {
166
166
  "glob": "**/*",
167
- "input": "node_modules/@eui/styles-base/dist/assets",
167
+ "input": "node_modules/@eui/styles/dist/assets",
168
168
  "output": "./assets"
169
169
  },
170
170
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "18.0.0-next.4",
3
+ "version": "18.0.0-next.41",
4
4
  "license": "EUPL-1.1",
5
5
  "description": "eUI JEE Symfony app scripts",
6
6
  "scripts": {
@@ -18,6 +18,6 @@
18
18
  },
19
19
  "private": true,
20
20
  "dependencies": {
21
- "@eui/deps-base": "18.0.0-next.4"
21
+ "@eui/deps-base": "18.0.0-next.41"
22
22
  }
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/cli",
3
- "version": "18.0.0-next.4",
3
+ "version": "18.0.0-next.41",
4
4
  "tag": "next",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI CLI app generator",
@@ -13,7 +13,7 @@
13
13
  "url": "https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui"
14
14
  },
15
15
  "dependencies": {
16
- "@eui/tools": "6.16.6"
16
+ "@eui/tools": "6.16.13"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@eui/tools": "^6.0.0",