@eui/cli 19.0.0-next.9 → 19.0.0-rc.2
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.
- package/.version.properties +1 -1
- package/lib/skeletons/_angular/base/package.json +2 -2
- package/lib/skeletons/_angular/base/src/.eslintrc.json +2 -1
- package/lib/skeletons/_angular/base/src/app/app-starter.service.ts +28 -28
- package/lib/skeletons/_angular/base/src/app/app.component.spec.ts +37 -9
- package/lib/skeletons/_angular/base/src/app/app.component.ts +2 -3
- package/lib/skeletons/_angular/base/src/app/app.config.ts +25 -14
- package/lib/skeletons/_angular/base-mobile/package.json +1 -1
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.ts +30 -40
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.config.ts +26 -11
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/home/home.component.ts +4 -4
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.ts +30 -40
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.config.ts +26 -11
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/home/home.component.ts +4 -4
- package/lib/skeletons/web-symfony/myapp-web/package.json +2 -2
- package/package.json +2 -2
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
19.0.0-
|
|
1
|
+
19.0.0-rc.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "19.0.0-
|
|
3
|
+
"version": "19.0.0-rc.2",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"private": true,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@eui/deps-base": "19.0.0-
|
|
24
|
+
"@eui/deps-base": "19.0.0-rc.2"
|
|
25
25
|
},
|
|
26
26
|
"resolutions": {
|
|
27
27
|
"js-yaml": ">=3.13.1",
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
46
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
47
|
-
"@typescript-eslint/
|
|
47
|
+
"@typescript-eslint/no-empty-object-type": "error",
|
|
48
|
+
"@typescript-eslint/no-unsafe-function-type": "error",
|
|
48
49
|
"@typescript-eslint/consistent-type-definitions": "off",
|
|
49
50
|
"@typescript-eslint/dot-notation": "off",
|
|
50
51
|
"@typescript-eslint/explicit-member-accessibility": [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, Injectable } from '@angular/core';
|
|
2
2
|
import { HttpClient } from '@angular/common/http';
|
|
3
3
|
import {
|
|
4
4
|
CONFIG_TOKEN,
|
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
EuiAppConfig,
|
|
8
8
|
UserDetails,
|
|
9
9
|
UserPreferences,
|
|
10
|
+
EuiServiceStatus,
|
|
10
11
|
} from '@eui/core';
|
|
11
|
-
import { Observable, of
|
|
12
|
+
import { catchError, Observable, of } from 'rxjs';
|
|
12
13
|
import { switchMap } from 'rxjs/operators';
|
|
13
14
|
|
|
14
15
|
@Injectable({
|
|
@@ -16,25 +17,17 @@ import { switchMap } from 'rxjs/operators';
|
|
|
16
17
|
})
|
|
17
18
|
export class AppStarterService {
|
|
18
19
|
defaultUserPreferences: UserPreferences | undefined;
|
|
20
|
+
private userService: UserService = inject(UserService);
|
|
21
|
+
private i18nService: I18nService = inject(I18nService);
|
|
22
|
+
private config: EuiAppConfig = inject(CONFIG_TOKEN);
|
|
23
|
+
private http: HttpClient = inject(HttpClient);
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// eslint-disable-next-line
|
|
29
|
-
start(): Observable<any> {
|
|
30
|
-
|
|
31
|
-
return zip(
|
|
32
|
-
this.initUserService().pipe(
|
|
33
|
-
switchMap((userStatus) => {
|
|
34
|
-
console.log(userStatus);
|
|
35
|
-
return this.i18nService.init();
|
|
36
|
-
}),
|
|
37
|
-
),
|
|
25
|
+
start(): Observable<EuiServiceStatus> {
|
|
26
|
+
return this.initUserService().pipe(
|
|
27
|
+
switchMap((userStatus) => {
|
|
28
|
+
console.log(userStatus);
|
|
29
|
+
return this.i18nService.init();
|
|
30
|
+
}),
|
|
38
31
|
);
|
|
39
32
|
}
|
|
40
33
|
|
|
@@ -43,12 +36,10 @@ export class AppStarterService {
|
|
|
43
36
|
* create user: UserState object
|
|
44
37
|
* then initialise to the UserService on run time
|
|
45
38
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
).pipe(
|
|
51
|
-
switchMap(([userDetails]) => this.userService.init(userDetails)));
|
|
39
|
+
initUserService(): Observable<EuiServiceStatus> {
|
|
40
|
+
return this.fetchUserDetails().pipe(
|
|
41
|
+
switchMap((userDetails) => this.userService.init(userDetails))
|
|
42
|
+
);
|
|
52
43
|
}
|
|
53
44
|
|
|
54
45
|
/**
|
|
@@ -58,11 +49,20 @@ export class AppStarterService {
|
|
|
58
49
|
// const url = this.config.modules.your_custom_module.your_custom_endpoint
|
|
59
50
|
const moduleCoreApi= this.config.modules?.['core'];
|
|
60
51
|
const url = `${moduleCoreApi?.['base']}${moduleCoreApi?.['userDetails']}`;
|
|
61
|
-
const user = {
|
|
52
|
+
const user = {
|
|
53
|
+
userId: 'anonymous',
|
|
54
|
+
firstName: 'FirstName',
|
|
55
|
+
lastName: 'LastName',
|
|
56
|
+
fullName: 'FullName',
|
|
57
|
+
};
|
|
62
58
|
|
|
63
59
|
if (!url) {
|
|
64
60
|
return of(user);
|
|
65
61
|
}
|
|
66
|
-
return this.http.get<UserDetails>(url)
|
|
62
|
+
return this.http.get<UserDetails>(url)
|
|
63
|
+
.pipe(
|
|
64
|
+
// in case of Http failure return dummy user
|
|
65
|
+
catchError(() => of(user)),
|
|
66
|
+
);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -1,26 +1,54 @@
|
|
|
1
|
-
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
-
import {RouterModule} from '@angular/router';
|
|
3
|
-
import {AppComponent} from './app.component';
|
|
4
|
-
import {EuiAppModule} from '@eui/components/layout';
|
|
5
|
-
import {
|
|
6
|
-
import {routes} from './app.routes';
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { RouterModule } from '@angular/router';
|
|
3
|
+
import { AppComponent } from './app.component';
|
|
4
|
+
import { EuiAppModule } from '@eui/components/layout';
|
|
5
|
+
import { routes } from './app.routes';
|
|
7
6
|
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
|
7
|
+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
8
|
+
import { AppStarterService } from './app-starter.service';
|
|
9
|
+
import { CONFIG_TOKEN, I18nService, I18nState, UserService} from '@eui/core';
|
|
10
|
+
import { EuiAppConfig } from '@eui/core';
|
|
11
|
+
import { Observable, of } from 'rxjs';
|
|
12
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
13
|
+
import SpyObj = jasmine.SpyObj;
|
|
14
|
+
|
|
8
15
|
|
|
9
16
|
describe('AppComponent', () => {
|
|
10
17
|
let component: AppComponent;
|
|
11
18
|
let fixture: ComponentFixture<AppComponent>;
|
|
19
|
+
let userServiceMock: SpyObj<UserService>;
|
|
20
|
+
let i18nServiceMock: SpyObj<I18nService>;
|
|
21
|
+
let configMock: EuiAppConfig;
|
|
12
22
|
|
|
13
23
|
beforeEach(async () => {
|
|
24
|
+
|
|
25
|
+
// Handle the overloaded getState method
|
|
26
|
+
type GetStateReturnType<T> = T extends keyof I18nState ? Observable<I18nState[T]> : Observable<I18nState>;
|
|
27
|
+
|
|
28
|
+
userServiceMock = jasmine.createSpyObj('UserService', ['init']);
|
|
29
|
+
i18nServiceMock = jasmine.createSpyObj<I18nService>('I18nService', ['init', 'getState']);
|
|
30
|
+
i18nServiceMock.getState.and.callFake(<K extends keyof I18nState>(key?: K): GetStateReturnType<K> => {
|
|
31
|
+
if (typeof key === 'string') {
|
|
32
|
+
return of({ activeLang: 'en' }[key]) as GetStateReturnType<K>;
|
|
33
|
+
}
|
|
34
|
+
return of({ activeLang: 'en' }) as GetStateReturnType<K>;
|
|
35
|
+
});
|
|
36
|
+
configMock = {global: {}, modules: {core: {base: 'localhost:3000', userDetails: 'dummy'}}};
|
|
37
|
+
|
|
14
38
|
await TestBed.configureTestingModule({
|
|
15
39
|
imports: [
|
|
16
40
|
RouterModule.forRoot(routes),
|
|
17
|
-
CoreModule,
|
|
18
41
|
EuiAppModule,
|
|
42
|
+
TranslateModule.forRoot(),
|
|
19
43
|
],
|
|
20
44
|
providers: [
|
|
21
|
-
|
|
45
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
46
|
+
provideHttpClientTesting(),
|
|
47
|
+
AppStarterService,
|
|
48
|
+
{provide: UserService, useValue: userServiceMock},
|
|
49
|
+
{provide: I18nService, useValue: i18nServiceMock},
|
|
50
|
+
{provide: CONFIG_TOKEN, useValue: configMock},
|
|
22
51
|
],
|
|
23
|
-
declarations: [AppComponent],
|
|
24
52
|
}).compileComponents();
|
|
25
53
|
|
|
26
54
|
fixture = TestBed.createComponent(AppComponent);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Component } from '@angular/core';
|
|
2
|
-
// import { BrowserModule } from '@angular/platform-browser';
|
|
3
|
-
// import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
4
2
|
import { TranslateModule } from '@ngx-translate/core';
|
|
5
3
|
import { EuiLayoutModule } from '@eui/components/layout';
|
|
6
4
|
import { EuiLanguageSelectorModule } from '@eui/components/eui-language-selector';
|
|
7
5
|
import { EuiUserProfileModule } from '@eui/components/eui-user-profile';
|
|
8
6
|
import { EuiIconModule } from '@eui/components/eui-icon';
|
|
7
|
+
import { EuiMenuItem } from '@eui/components/eui-menu';
|
|
9
8
|
|
|
10
9
|
@Component({
|
|
11
10
|
selector: 'app-root',
|
|
@@ -20,7 +19,7 @@ import { EuiIconModule } from '@eui/components/eui-icon';
|
|
|
20
19
|
],
|
|
21
20
|
})
|
|
22
21
|
export class AppComponent {
|
|
23
|
-
sidebarItems = [
|
|
22
|
+
sidebarItems: EuiMenuItem[] = [
|
|
24
23
|
{ label: 'Home', url: 'screen/home' },
|
|
25
24
|
{ label: 'Module 1', url: 'screen/module1', children: [
|
|
26
25
|
{ label: 'page 1', url: 'screen/module1/page1' },
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, provideAppInitializer } from '@angular/core';
|
|
2
|
+
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
|
|
2
3
|
import { provideRouter } from '@angular/router';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
3
5
|
|
|
4
6
|
import { routes } from './app.routes';
|
|
5
7
|
import { AppStarterService } from './app-starter.service';
|
|
@@ -15,19 +17,29 @@ import {
|
|
|
15
17
|
CoreModule as EuiCoreModule,
|
|
16
18
|
translateConfig,
|
|
17
19
|
EUI_CONFIG_TOKEN,
|
|
20
|
+
provideEuiInitializer,
|
|
21
|
+
EuiServiceStatus,
|
|
18
22
|
} from '@eui/core';
|
|
19
23
|
|
|
20
24
|
import { appConfig as euiAppConfig} from '../config';
|
|
21
25
|
import { environment } from '../environments/environment';
|
|
26
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The provided function is injected at application startup and executed during
|
|
30
|
+
* app initialization. If the function returns a Promise or an Observable, initialization
|
|
31
|
+
* does not complete until the Promise is resolved or the Observable is completed.
|
|
32
|
+
*/
|
|
33
|
+
const init = (): Observable<EuiServiceStatus> => {
|
|
34
|
+
const appStarter = inject(AppStarterService);
|
|
35
|
+
return appStarter.start();
|
|
36
|
+
};
|
|
22
37
|
|
|
23
38
|
export const appConfig: ApplicationConfig = {
|
|
24
39
|
providers: [
|
|
25
|
-
importProvidersFrom(EuiCoreModule.forRoot()),
|
|
26
|
-
importProvidersFrom(TranslateModule.forRoot(translateConfig)),
|
|
27
|
-
provideHttpClient(withInterceptorsFromDi()),
|
|
28
40
|
{
|
|
29
41
|
provide: EUI_CONFIG_TOKEN,
|
|
30
|
-
useValue: { euiAppConfig, environment }
|
|
42
|
+
useValue: { appConfig: euiAppConfig, environment }
|
|
31
43
|
},
|
|
32
44
|
{
|
|
33
45
|
// Sets the withCredentials on Ajax Request to send the JSESSIONID cookie to another domain.
|
|
@@ -58,16 +70,15 @@ export const appConfig: ApplicationConfig = {
|
|
|
58
70
|
useClass: CachePreventionInterceptor,
|
|
59
71
|
multi: true,
|
|
60
72
|
},
|
|
61
|
-
|
|
73
|
+
provideEuiInitializer(),
|
|
74
|
+
provideAppInitializer(init),
|
|
75
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
76
|
+
importProvidersFrom(
|
|
77
|
+
EuiCoreModule.forRoot(),
|
|
78
|
+
TranslateModule.forRoot(translateConfig)
|
|
79
|
+
),
|
|
62
80
|
AppStarterService,
|
|
63
|
-
// {
|
|
64
|
-
// provide: APP_INITIALIZER,
|
|
65
|
-
// useFactory: (appStarterService: AppStarterService) => () => new Promise<void>((resolve) => {
|
|
66
|
-
// appStarterService.start().subscribe(() => resolve());
|
|
67
|
-
// }),
|
|
68
|
-
// deps: [AppStarterService],
|
|
69
|
-
// multi: true
|
|
70
|
-
// },
|
|
71
81
|
provideRouter(routes),
|
|
82
|
+
provideAnimations(),
|
|
72
83
|
],
|
|
73
84
|
};
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { Component,
|
|
2
|
-
import {
|
|
1
|
+
import { Component, OnInit, Signal } from '@angular/core';
|
|
2
|
+
import { RouterOutlet } from '@angular/router';
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
UserService,
|
|
5
5
|
UserState,
|
|
6
|
-
CoreState,
|
|
7
6
|
} from '@eui/core';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { RouterOutlet } from '@angular/router';
|
|
7
|
+
import { EclAppModule } from '@eui/ecl/components/ecl-app';
|
|
8
|
+
import { EclBreadcrumbModule } from '@eui/ecl/components/ecl-breadcrumb';
|
|
9
|
+
import { EclIconModule } from '@eui/ecl/components/ecl-icon';
|
|
10
|
+
import { EclMenuItemSelectEvent, EclMenuModule } from '@eui/ecl/components/ecl-menu';
|
|
11
|
+
import { EclLinkModule } from '@eui/ecl/components/ecl-link';
|
|
12
|
+
import { EclPageHeaderModule } from '@eui/ecl/components/ecl-page-header';
|
|
13
|
+
import { EclSiteFooterModule } from '@eui/ecl/components/ecl-site-footer';
|
|
14
|
+
import { EclSiteHeaderLoginEvent, EclSiteHeaderModule, EclSiteHeaderSearchEvent } from '@eui/ecl/components/ecl-site-header';
|
|
17
15
|
import { TranslateModule } from '@ngx-translate/core';
|
|
18
16
|
|
|
19
17
|
@Component({
|
|
@@ -21,55 +19,47 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
21
19
|
templateUrl: './app.component.html',
|
|
22
20
|
standalone: true,
|
|
23
21
|
imports: [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
EclAppModule,
|
|
23
|
+
EclBreadcrumbModule,
|
|
24
|
+
EclIconModule,
|
|
25
|
+
EclLinkModule,
|
|
26
|
+
EclMenuModule,
|
|
27
|
+
EclPageHeaderModule,
|
|
28
|
+
EclSiteHeaderModule,
|
|
29
|
+
EclSiteFooterModule,
|
|
31
30
|
RouterOutlet,
|
|
32
31
|
TranslateModule,
|
|
33
32
|
]
|
|
34
33
|
})
|
|
35
|
-
export class AppComponent implements
|
|
36
|
-
userInfos: UserState;
|
|
37
|
-
// Observe state changes
|
|
38
|
-
userState: Observable<UserState>;
|
|
39
|
-
// an array to keep all subscriptions and easily unsubscribe
|
|
40
|
-
subs: Subscription[] = [];
|
|
34
|
+
export class AppComponent implements OnInit {
|
|
41
35
|
|
|
42
36
|
isLoggedIn = false;
|
|
37
|
+
userState: Signal<UserState>;
|
|
38
|
+
userInfos: UserState;
|
|
43
39
|
|
|
44
|
-
constructor(
|
|
45
|
-
private store: Store<CoreState>,
|
|
46
|
-
) {
|
|
47
|
-
this.userState = this.store.select(getUserState);
|
|
48
|
-
this.subs.push(this.userState.subscribe((user: UserState) => {
|
|
49
|
-
this.userInfos = { ...user };
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
40
|
+
constructor(private userService: UserService<UserState>,) { }
|
|
52
41
|
|
|
53
|
-
|
|
54
|
-
this.
|
|
42
|
+
ngOnInit(): void {
|
|
43
|
+
this.userState = this.userService.getSignal();
|
|
44
|
+
this.userInfos = this.userState();
|
|
55
45
|
}
|
|
56
46
|
|
|
57
|
-
onLogin(evt: EclSiteHeaderLoginEvent) {
|
|
47
|
+
onLogin(evt: EclSiteHeaderLoginEvent): void {
|
|
58
48
|
this.isLoggedIn = true;
|
|
59
49
|
console.log(evt);
|
|
60
50
|
}
|
|
61
51
|
|
|
62
|
-
onLogout(evt: MouseEvent) {
|
|
52
|
+
onLogout(evt: MouseEvent): void {
|
|
63
53
|
this.isLoggedIn = false;
|
|
64
54
|
evt.preventDefault();
|
|
65
55
|
console.log('logout');
|
|
66
56
|
}
|
|
67
57
|
|
|
68
|
-
onSearch(evt: EclSiteHeaderSearchEvent) {
|
|
58
|
+
onSearch(evt: EclSiteHeaderSearchEvent): void {
|
|
69
59
|
console.log(evt);
|
|
70
60
|
}
|
|
71
61
|
|
|
72
|
-
onMenuItemSelected(evt: EclMenuItemSelectEvent) {
|
|
62
|
+
onMenuItemSelected(evt: EclMenuItemSelectEvent): void {
|
|
73
63
|
console.log('menu item selected', evt);
|
|
74
64
|
}
|
|
75
65
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, provideAppInitializer } from '@angular/core';
|
|
2
|
+
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
|
|
2
3
|
import { provideRouter } from '@angular/router';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
3
5
|
|
|
4
6
|
import { routes } from './app.routes';
|
|
5
7
|
import { AppStarterService } from './app-starter.service';
|
|
6
|
-
|
|
8
|
+
|
|
7
9
|
import { TranslateModule } from '@ngx-translate/core';
|
|
8
10
|
|
|
9
11
|
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
@@ -15,19 +17,29 @@ import {
|
|
|
15
17
|
CoreModule as EuiCoreModule,
|
|
16
18
|
translateConfig,
|
|
17
19
|
EUI_CONFIG_TOKEN,
|
|
20
|
+
provideEuiInitializer,
|
|
21
|
+
EuiServiceStatus,
|
|
18
22
|
} from '@eui/core';
|
|
19
23
|
|
|
20
24
|
import { appConfig as euiAppConfig} from '../config';
|
|
21
25
|
import { environment } from '../environments/environment';
|
|
26
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The provided function is injected at application startup and executed during
|
|
30
|
+
* app initialization. If the function returns a Promise or an Observable, initialization
|
|
31
|
+
* does not complete until the Promise is resolved or the Observable is completed.
|
|
32
|
+
*/
|
|
33
|
+
const init = (): Observable<EuiServiceStatus> => {
|
|
34
|
+
const appStarter = inject(AppStarterService);
|
|
35
|
+
return appStarter.start();
|
|
36
|
+
};
|
|
22
37
|
|
|
23
38
|
export const appConfig: ApplicationConfig = {
|
|
24
39
|
providers: [
|
|
25
|
-
importProvidersFrom(EuiCoreModule.forRoot()),
|
|
26
|
-
importProvidersFrom(TranslateModule.forRoot(translateConfig)),
|
|
27
|
-
provideHttpClient(withInterceptorsFromDi()),
|
|
28
40
|
{
|
|
29
41
|
provide: EUI_CONFIG_TOKEN,
|
|
30
|
-
useValue: { euiAppConfig, environment }
|
|
42
|
+
useValue: { appConfig: euiAppConfig, environment }
|
|
31
43
|
},
|
|
32
44
|
{
|
|
33
45
|
// Sets the withCredentials on Ajax Request to send the JSESSIONID cookie to another domain.
|
|
@@ -58,12 +70,15 @@ export const appConfig: ApplicationConfig = {
|
|
|
58
70
|
useClass: CachePreventionInterceptor,
|
|
59
71
|
multi: true,
|
|
60
72
|
},
|
|
61
|
-
|
|
73
|
+
provideEuiInitializer(),
|
|
74
|
+
provideAppInitializer(init),
|
|
75
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
76
|
+
importProvidersFrom(
|
|
77
|
+
EuiCoreModule.forRoot(),
|
|
78
|
+
TranslateModule.forRoot(translateConfig)
|
|
79
|
+
),
|
|
62
80
|
AppStarterService,
|
|
63
|
-
{
|
|
64
|
-
provide: EclLanguageService,
|
|
65
|
-
useClass: EclDefaultLanguageService
|
|
66
|
-
},
|
|
67
81
|
provideRouter(routes),
|
|
82
|
+
provideAnimations(),
|
|
68
83
|
],
|
|
69
84
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Component, Inject } from '@angular/core';
|
|
2
2
|
import { CONFIG_TOKEN, EuiAppConfig } from '@eui/core';
|
|
3
3
|
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { EclListModule } from '@eui/ecl/components/ecl-list';
|
|
5
|
+
import { EclLinkModule } from '@eui/ecl/components/ecl-link';
|
|
6
6
|
|
|
7
7
|
@Component({
|
|
8
8
|
templateUrl: './home.component.html',
|
|
9
9
|
standalone: true,
|
|
10
10
|
imports: [
|
|
11
11
|
TranslateModule,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
EclLinkModule,
|
|
13
|
+
EclListModule,
|
|
14
14
|
],
|
|
15
15
|
})
|
|
16
16
|
export class HomeComponent {
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { Component,
|
|
2
|
-
import {
|
|
1
|
+
import { Component, OnInit, Signal } from '@angular/core';
|
|
2
|
+
import { RouterOutlet } from '@angular/router';
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
UserService,
|
|
5
5
|
UserState,
|
|
6
|
-
CoreState,
|
|
7
6
|
} from '@eui/core';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { RouterOutlet } from '@angular/router';
|
|
7
|
+
import { EclAppModule } from '@eui/ecl/components/ecl-app';
|
|
8
|
+
import { EclBreadcrumbModule } from '@eui/ecl/components/ecl-breadcrumb';
|
|
9
|
+
import { EclIconModule } from '@eui/ecl/components/ecl-icon';
|
|
10
|
+
import { EclMenuItemSelectEvent, EclMenuModule } from '@eui/ecl/components/ecl-menu';
|
|
11
|
+
import { EclLinkModule } from '@eui/ecl/components/ecl-link';
|
|
12
|
+
import { EclPageHeaderModule } from '@eui/ecl/components/ecl-page-header';
|
|
13
|
+
import { EclSiteFooterModule } from '@eui/ecl/components/ecl-site-footer';
|
|
14
|
+
import { EclSiteHeaderLoginEvent, EclSiteHeaderModule, EclSiteHeaderSearchEvent } from '@eui/ecl/components/ecl-site-header';
|
|
17
15
|
import { TranslateModule } from '@ngx-translate/core';
|
|
18
16
|
|
|
19
17
|
@Component({
|
|
@@ -21,55 +19,47 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
21
19
|
templateUrl: './app.component.html',
|
|
22
20
|
standalone: true,
|
|
23
21
|
imports: [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
EclAppModule,
|
|
23
|
+
EclBreadcrumbModule,
|
|
24
|
+
EclIconModule,
|
|
25
|
+
EclLinkModule,
|
|
26
|
+
EclMenuModule,
|
|
27
|
+
EclPageHeaderModule,
|
|
28
|
+
EclSiteHeaderModule,
|
|
29
|
+
EclSiteFooterModule,
|
|
31
30
|
RouterOutlet,
|
|
32
31
|
TranslateModule,
|
|
33
32
|
]
|
|
34
33
|
})
|
|
35
|
-
export class AppComponent implements
|
|
36
|
-
userInfos: UserState;
|
|
37
|
-
// Observe state changes
|
|
38
|
-
userState: Observable<UserState>;
|
|
39
|
-
// an array to keep all subscriptions and easily unsubscribe
|
|
40
|
-
subs: Subscription[] = [];
|
|
34
|
+
export class AppComponent implements OnInit {
|
|
41
35
|
|
|
42
36
|
isLoggedIn = false;
|
|
37
|
+
userState: Signal<UserState>;
|
|
38
|
+
userInfos: UserState;
|
|
43
39
|
|
|
44
|
-
constructor(
|
|
45
|
-
private store: Store<CoreState>,
|
|
46
|
-
) {
|
|
47
|
-
this.userState = this.store.select(getUserState);
|
|
48
|
-
this.subs.push(this.userState.subscribe((user: UserState) => {
|
|
49
|
-
this.userInfos = { ...user };
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
40
|
+
constructor(private userService: UserService<UserState>,) { }
|
|
52
41
|
|
|
53
|
-
|
|
54
|
-
this.
|
|
42
|
+
ngOnInit(): void {
|
|
43
|
+
this.userState = this.userService.getSignal();
|
|
44
|
+
this.userInfos = this.userState();
|
|
55
45
|
}
|
|
56
46
|
|
|
57
|
-
onLogin(evt: EclSiteHeaderLoginEvent) {
|
|
47
|
+
onLogin(evt: EclSiteHeaderLoginEvent): void {
|
|
58
48
|
this.isLoggedIn = true;
|
|
59
49
|
console.log(evt);
|
|
60
50
|
}
|
|
61
51
|
|
|
62
|
-
onLogout(evt: MouseEvent) {
|
|
52
|
+
onLogout(evt: MouseEvent): void {
|
|
63
53
|
this.isLoggedIn = false;
|
|
64
54
|
evt.preventDefault();
|
|
65
55
|
console.log('logout');
|
|
66
56
|
}
|
|
67
57
|
|
|
68
|
-
onSearch(evt: EclSiteHeaderSearchEvent) {
|
|
58
|
+
onSearch(evt: EclSiteHeaderSearchEvent): void {
|
|
69
59
|
console.log(evt);
|
|
70
60
|
}
|
|
71
61
|
|
|
72
|
-
onMenuItemSelected(evt: EclMenuItemSelectEvent) {
|
|
62
|
+
onMenuItemSelected(evt: EclMenuItemSelectEvent): void {
|
|
73
63
|
console.log('menu item selected', evt);
|
|
74
64
|
}
|
|
75
65
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, provideAppInitializer } from '@angular/core';
|
|
2
|
+
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
|
|
2
3
|
import { provideRouter } from '@angular/router';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
3
5
|
|
|
4
6
|
import { routes } from './app.routes';
|
|
5
7
|
import { AppStarterService } from './app-starter.service';
|
|
6
|
-
|
|
8
|
+
|
|
7
9
|
import { TranslateModule } from '@ngx-translate/core';
|
|
8
10
|
|
|
9
11
|
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
@@ -15,19 +17,29 @@ import {
|
|
|
15
17
|
CoreModule as EuiCoreModule,
|
|
16
18
|
translateConfig,
|
|
17
19
|
EUI_CONFIG_TOKEN,
|
|
20
|
+
provideEuiInitializer,
|
|
21
|
+
EuiServiceStatus,
|
|
18
22
|
} from '@eui/core';
|
|
19
23
|
|
|
20
24
|
import { appConfig as euiAppConfig} from '../config';
|
|
21
25
|
import { environment } from '../environments/environment';
|
|
26
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The provided function is injected at application startup and executed during
|
|
30
|
+
* app initialization. If the function returns a Promise or an Observable, initialization
|
|
31
|
+
* does not complete until the Promise is resolved or the Observable is completed.
|
|
32
|
+
*/
|
|
33
|
+
const init = (): Observable<EuiServiceStatus> => {
|
|
34
|
+
const appStarter = inject(AppStarterService);
|
|
35
|
+
return appStarter.start();
|
|
36
|
+
};
|
|
22
37
|
|
|
23
38
|
export const appConfig: ApplicationConfig = {
|
|
24
39
|
providers: [
|
|
25
|
-
importProvidersFrom(EuiCoreModule.forRoot()),
|
|
26
|
-
importProvidersFrom(TranslateModule.forRoot(translateConfig)),
|
|
27
|
-
provideHttpClient(withInterceptorsFromDi()),
|
|
28
40
|
{
|
|
29
41
|
provide: EUI_CONFIG_TOKEN,
|
|
30
|
-
useValue: { euiAppConfig, environment }
|
|
42
|
+
useValue: { appConfig: euiAppConfig, environment }
|
|
31
43
|
},
|
|
32
44
|
{
|
|
33
45
|
// Sets the withCredentials on Ajax Request to send the JSESSIONID cookie to another domain.
|
|
@@ -58,12 +70,15 @@ export const appConfig: ApplicationConfig = {
|
|
|
58
70
|
useClass: CachePreventionInterceptor,
|
|
59
71
|
multi: true,
|
|
60
72
|
},
|
|
61
|
-
|
|
73
|
+
provideEuiInitializer(),
|
|
74
|
+
provideAppInitializer(init),
|
|
75
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
76
|
+
importProvidersFrom(
|
|
77
|
+
EuiCoreModule.forRoot(),
|
|
78
|
+
TranslateModule.forRoot(translateConfig)
|
|
79
|
+
),
|
|
62
80
|
AppStarterService,
|
|
63
|
-
{
|
|
64
|
-
provide: EclLanguageService,
|
|
65
|
-
useClass: EclDefaultLanguageService
|
|
66
|
-
},
|
|
67
81
|
provideRouter(routes),
|
|
82
|
+
provideAnimations(),
|
|
68
83
|
],
|
|
69
84
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Component, Inject } from '@angular/core';
|
|
2
2
|
import { CONFIG_TOKEN, EuiAppConfig } from '@eui/core';
|
|
3
3
|
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { EclListModule } from '@eui/ecl/components/ecl-list';
|
|
5
|
+
import { EclLinkModule } from '@eui/ecl/components/ecl-link';
|
|
6
6
|
|
|
7
7
|
@Component({
|
|
8
8
|
templateUrl: './home.component.html',
|
|
9
9
|
standalone: true,
|
|
10
10
|
imports: [
|
|
11
11
|
TranslateModule,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
EclLinkModule,
|
|
13
|
+
EclListModule,
|
|
14
14
|
],
|
|
15
15
|
})
|
|
16
16
|
export class HomeComponent {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "19.0.0-
|
|
3
|
+
"version": "19.0.0-rc.2",
|
|
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": "19.0.0-
|
|
21
|
+
"@eui/deps-base": "19.0.0-rc.2"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eui/cli",
|
|
3
|
-
"version": "19.0.0-
|
|
3
|
+
"version": "19.0.0-rc.2",
|
|
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.21.
|
|
16
|
+
"@eui/tools": "6.21.11"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@eui/tools": "^6.0.0",
|