diff --git a/front/angular.json b/front/angular.json index adea128..8e9beb3 100644 --- a/front/angular.json +++ b/front/angular.json @@ -16,6 +16,7 @@ "index": "src/index.html", "main": "src/main.ts", "tsConfig": "src/tsconfig.app.json", + "preserveSymlinks": true, "polyfills": [ "zone.js" ], @@ -54,7 +55,7 @@ "outputHashing": "none", "sourceMap": true, "namedChunks": true, - "aot": true, + "aot": false, "extractLicenses": true, "vendorChunk": true, "buildOptimizer": false diff --git a/front/src/app/app.component.ts b/front/src/app/app.component.ts index a2eec70..1335015 100644 --- a/front/src/app/app.component.ts +++ b/front/src/app/app.component.ts @@ -6,11 +6,7 @@ import { Component, OnInit } from '@angular/core'; import { ArianeService } from './service'; -import { MenuItem } from '@kangaroo-and-rabbit/kar-cw/model'; -import { SSOService, SessionService, UserService } from '@kangaroo-and-rabbit/kar-cw/service'; -import { EventOnMenu } from '@kangaroo-and-rabbit/kar-cw/component/top-menu/top-menu'; -import { MenuPosition, isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; -import { UserRoles222 } from '@kangaroo-and-rabbit/kar-cw/service/session'; +import { MenuItem, SSOService, SessionService, UserService, UserRoles222, EventOnMenu, MenuPosition, isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; enum MenuEventType { SSO_LOGIN = "SSO_CALL_LOGIN", diff --git a/front/src/app/app.module.ts b/front/src/app/app.module.ts index d2831ce..ff8bde8 100644 --- a/front/src/app/app.module.ts +++ b/front/src/app/app.module.ts @@ -23,7 +23,12 @@ import { import { GenderService, DataService, PlaylistService, ArtistService, AlbumService, TrackService, ArianeService, PlayerService } from './service'; import { UploadScene } from './scene/upload/upload'; import { ElementSeriesComponent, ElementTrackComponent, ElementSeasonComponent, ElementVideoComponent, ElementPlayerAudioComponent, DescriptionAreaComponent } from './component'; -import { KarCWModule } from '@kangaroo-and-rabbit/kar-cw'; +import { ALL_COMPONENTS, ALL_SCENES, ALL_SERVICES, ALL_GUARDS, KarCWModule, UserService } from '@kangaroo-and-rabbit/kar-cw'; +import { KarusicEnvironmentService, environment } from 'environments/environment'; + +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { CommonModule } from "@angular/common"; + @NgModule({ declarations: [ @@ -37,7 +42,6 @@ import { KarCWModule } from '@kangaroo-and-rabbit/kar-cw'; ElementPlayerAudioComponent, DescriptionAreaComponent, PopInCreateType, - HomeScene, HelpScene, GenderScene, @@ -53,15 +57,25 @@ import { KarCWModule } from '@kangaroo-and-rabbit/kar-cw'; AlbumEditScene, ArtistEditScene, UploadScene, + //...ALL_COMPONENTS, + //...ALL_SCENES, ], imports: [ + KarCWModule, + FormsModule, + ReactiveFormsModule, + CommonModule, + BrowserModule, RouterModule, AppRoutingModule, HttpClientModule, - KarCWModule, ], providers: [ + KarusicEnvironmentService, + { provide: 'ENVIRONMENT', useValue: KarusicEnvironmentService }, + //...ALL_SERVICES, + //...ALL_GUARDS, PlayerService, GenderService, DataService, @@ -72,6 +86,8 @@ import { KarCWModule } from '@kangaroo-and-rabbit/kar-cw'; ArianeService, ], exports: [ + //...ALL_COMPONENTS, + //...ALL_SCENES, AppComponent, ElementTypeComponent, ElementSeriesComponent, @@ -82,6 +98,6 @@ import { KarCWModule } from '@kangaroo-and-rabbit/kar-cw'; bootstrap: [ AppComponent ], - schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], + //schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], }) export class AppModule { } diff --git a/front/src/app/component/element-player-audio/element-player-audio.ts b/front/src/app/component/element-player-audio/element-player-audio.ts index 4c44e01..add96f0 100644 --- a/front/src/app/component/element-player-audio/element-player-audio.ts +++ b/front/src/app/component/element-player-audio/element-player-audio.ts @@ -3,14 +3,13 @@ * @copyright 2018, Edouard DUPIN, all right reserved * @license PROPRIETARY (see license file) */ -import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; +import { Component, OnInit, ViewChild, ElementRef, Inject } from '@angular/core'; import { DataService, PlayerService, TrackService, AlbumService, ArtistService } from 'app/service'; import { PlaylistCurrent } from 'app/service/player'; import { Title } from '@angular/platform-browser'; -import { environment } from 'environments/environment'; import { Album, Artist, Track } from 'app/back-api'; -import { isArray, isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw/utils'; +import { isArray, isNullOrUndefined, Environment } from '@kangaroo-and-rabbit/kar-cw'; export enum PlayMode { @@ -70,6 +69,7 @@ export class ElementPlayerAudioComponent implements OnInit { } } constructor( + @Inject('ENVIRONMENT') private environment: Environment, private playerService: PlayerService, private trackService: TrackService, private dataService: DataService, @@ -147,7 +147,7 @@ export class ElementPlayerAudioComponent implements OnInit { title = `${title} (${this.dataAuthor})`; } - this.titleService.setTitle(`${environment.applName} > ${title}`) + this.titleService.setTitle(`${this.environment.applName} > ${title}`) } changeMetadata() { console.log('list of the stream:'); diff --git a/front/src/app/component/element-season/element-season.ts b/front/src/app/component/element-season/element-season.ts index 608abfc..35e4385 100644 --- a/front/src/app/component/element-season/element-season.ts +++ b/front/src/app/component/element-season/element-season.ts @@ -4,7 +4,7 @@ * @license PROPRIETARY (see license file) */ import { Component, OnInit, Input } from '@angular/core'; -import { isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw/utils'; +import { isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; import { NodeSmall } from 'app/back-api'; import { AlbumService, DataService } from 'app/service'; diff --git a/front/src/app/component/element-series/element-series.ts b/front/src/app/component/element-series/element-series.ts index bee51dd..a2e91d3 100644 --- a/front/src/app/component/element-series/element-series.ts +++ b/front/src/app/component/element-series/element-series.ts @@ -7,7 +7,7 @@ import { Component, OnInit, Input } from '@angular/core'; import { DataService, TrackService } from 'app/service'; import { NodeSmall } from 'app/back-api'; -import { isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw/utils'; +import { isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; @Component({ selector: 'app-element-series', diff --git a/front/src/app/component/element-track/element-track.ts b/front/src/app/component/element-track/element-track.ts index 3e3ea1b..f61537d 100644 --- a/front/src/app/component/element-track/element-track.ts +++ b/front/src/app/component/element-track/element-track.ts @@ -4,7 +4,7 @@ * @license PROPRIETARY (see license file) */ import { Component, OnInit, Input } from '@angular/core'; -import { isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw/utils'; +import { isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; import { NodeSmall } from 'app/back-api'; import { AlbumService, DataService } from 'app/service'; diff --git a/front/src/app/popin/create-type/create-type.ts b/front/src/app/popin/create-type/create-type.ts index cda9b8f..f922045 100644 --- a/front/src/app/popin/create-type/create-type.ts +++ b/front/src/app/popin/create-type/create-type.ts @@ -4,7 +4,7 @@ * @license PROPRIETARY (see license file) */ import { Component, OnInit } from '@angular/core'; -import { PopInService } from '@kangaroo-and-rabbit/kar-cw/service'; +import { PopInService } from '@kangaroo-and-rabbit/kar-cw'; @Component({ selector: 'create-type', diff --git a/front/src/app/scene/album-edit/album-edit.ts b/front/src/app/scene/album-edit/album-edit.ts index e7d4e47..9bf0262 100644 --- a/front/src/app/scene/album-edit/album-edit.ts +++ b/front/src/app/scene/album-edit/album-edit.ts @@ -5,8 +5,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { UploadProgress } from '@kangaroo-and-rabbit/kar-cw/popin/upload-progress/upload-progress'; -import { PopInService } from '@kangaroo-and-rabbit/kar-cw/service'; +import { UploadProgress, PopInService } from '@kangaroo-and-rabbit/kar-cw'; import { Album } from 'app/back-api'; import { AlbumService, ArianeService, DataService, TrackService } from 'app/service'; diff --git a/front/src/app/scene/album/albums.ts b/front/src/app/scene/album/albums.ts index 97a5e4b..d0ae512 100644 --- a/front/src/app/scene/album/albums.ts +++ b/front/src/app/scene/album/albums.ts @@ -5,11 +5,10 @@ */ import { Component, OnInit } from '@angular/core'; -import { DataTools } from '@kangaroo-and-rabbit/kar-cw/utils/data-tools'; -import { Album, Artist, NodeSmall, Track } from 'app/back-api'; +import { DataTools } from '@kangaroo-and-rabbit/kar-cw'; +import { Album, Artist, Track } from 'app/back-api'; import { ArtistService, DataService, ArianeService, AlbumService, PlayerService, TrackService } from 'app/service'; -import { filter } from 'rxjs'; @Component({ selector: 'app-albums', diff --git a/front/src/app/scene/artist-edit/artist-edit.ts b/front/src/app/scene/artist-edit/artist-edit.ts index 3520a3a..a3b7603 100644 --- a/front/src/app/scene/artist-edit/artist-edit.ts +++ b/front/src/app/scene/artist-edit/artist-edit.ts @@ -5,8 +5,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { UploadProgress } from '@kangaroo-and-rabbit/kar-cw/popin/upload-progress/upload-progress'; -import { PopInService } from '@kangaroo-and-rabbit/kar-cw/service'; +import { PopInService, UploadProgress } from '@kangaroo-and-rabbit/kar-cw'; import { Artist, Track } from 'app/back-api'; import { ArtistService, DataService, GenderService, ArianeService, TrackService } from 'app/service'; diff --git a/front/src/app/scene/track-edit/track-edit.ts b/front/src/app/scene/track-edit/track-edit.ts index 583186f..374abb5 100644 --- a/front/src/app/scene/track-edit/track-edit.ts +++ b/front/src/app/scene/track-edit/track-edit.ts @@ -5,8 +5,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { PopInService, isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; -import { UploadProgress } from '@kangaroo-and-rabbit/kar-cw/popin/upload-progress/upload-progress'; +import { UploadProgress, PopInService, isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; import { Track } from 'app/back-api'; diff --git a/front/src/app/scene/upload/upload.ts b/front/src/app/scene/upload/upload.ts index 6c126e8..2ae32fd 100644 --- a/front/src/app/scene/upload/upload.ts +++ b/front/src/app/scene/upload/upload.ts @@ -5,8 +5,8 @@ */ import { Component, OnInit } from '@angular/core'; -import { PopInService, isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; -import { UploadProgress } from '@kangaroo-and-rabbit/kar-cw/popin/upload-progress/upload-progress'; +import { UploadProgress,PopInService, isNullOrUndefined } from '@kangaroo-and-rabbit/kar-cw'; +import { } from '@kangaroo-and-rabbit/kar-cw/popin/upload-progress/upload-progress'; import { Artist, Gender } from 'app/back-api'; import { GenderService, ArtistService, TrackService, AlbumService } from 'app/service'; diff --git a/front/src/app/service/GenericDataService.ts b/front/src/app/service/GenericDataService.ts index 20e0a20..806e5d9 100644 --- a/front/src/app/service/GenericDataService.ts +++ b/front/src/app/service/GenericDataService.ts @@ -1,7 +1,4 @@ -import { TypeCheck, isNullOrUndefined } from "@kangaroo-and-rabbit/kar-cw/utils"; -import { DataTools } from "@kangaroo-and-rabbit/kar-cw/utils/data-tools"; - -import { DataStore } from '@kangaroo-and-rabbit/kar-cw/utils/data-store'; +import { DataStore, DataTools, TypeCheck, isNullOrUndefined } from "@kangaroo-and-rabbit/kar-cw"; export class GenericDataService { protected dataStore: DataStore; diff --git a/front/src/app/service/album.ts b/front/src/app/service/album.ts index c073aa9..eb87c21 100644 --- a/front/src/app/service/album.ts +++ b/front/src/app/service/album.ts @@ -10,10 +10,7 @@ import { Album, AlbumResource, UUID } from 'app/back-api'; import { RESTConfig, isArrayOf } from 'app/back-api/rest-tools'; import { environment } from 'environments/environment'; import { GenericDataService } from './GenericDataService'; -import { SessionService, TypeCheck, isNumber } from '@kangaroo-and-rabbit/kar-cw'; -import { DataTools } from '@kangaroo-and-rabbit/kar-cw/utils/data-tools'; - -import { DataStore } from '@kangaroo-and-rabbit/kar-cw/utils/data-store'; +import { DataTools, DataStore, SessionService, TypeCheck, isNumber } from '@kangaroo-and-rabbit/kar-cw'; @Injectable() export class AlbumService extends GenericDataService { diff --git a/front/src/app/service/artist.ts b/front/src/app/service/artist.ts index 0b75683..5d3e512 100644 --- a/front/src/app/service/artist.ts +++ b/front/src/app/service/artist.ts @@ -10,9 +10,7 @@ import { Artist, ArtistResource, UUID } from 'app/back-api'; import { RESTConfig } from 'app/back-api/rest-tools'; import { environment } from 'environments/environment'; import { GenericDataService } from './GenericDataService'; -import { SessionService } from '@kangaroo-and-rabbit/kar-cw/service'; - -import { DataStore } from '@kangaroo-and-rabbit/kar-cw/utils/data-store'; +import { DataStore, SessionService } from '@kangaroo-and-rabbit/kar-cw'; @Injectable() diff --git a/front/src/app/service/gender.ts b/front/src/app/service/gender.ts index 3f949b1..4c806e5 100644 --- a/front/src/app/service/gender.ts +++ b/front/src/app/service/gender.ts @@ -6,12 +6,11 @@ import { Injectable } from '@angular/core'; -import { SessionService } from '@kangaroo-and-rabbit/kar-cw/service'; import { GenderResource, Gender, UUID } from 'app/back-api'; import { RESTConfig } from 'app/back-api/rest-tools'; -import { DataStore } from '@kangaroo-and-rabbit/kar-cw/utils/data-store'; import { environment } from 'environments/environment'; import { GenericDataService } from './GenericDataService'; +import { DataStore, SessionService } from '@kangaroo-and-rabbit/kar-cw'; export interface MessageLogIn { id: number; diff --git a/front/src/environments/environment.ts b/front/src/environments/environment.ts index 54c16ce..ab7fa03 100644 --- a/front/src/environments/environment.ts +++ b/front/src/environments/environment.ts @@ -3,6 +3,9 @@ // `ng build --env=prod` then `environment.prod.ts` will be used instead. // The list of which env maps to which file can be found in `.angular-cli.json`. +import { Injectable } from "@angular/core"; +import { EnvironmentService } from '@kangaroo-and-rabbit/kar-cw'; + const serverSSOAddress = 'http://atria-soft.org' const environment_back_prod = { @@ -71,3 +74,18 @@ const environment_hybrid = { export const environment = environment_local; + +@Injectable({ providedIn: 'root' }) +export class KarusicEnvironmentService extends EnvironmentService { + + public production = environment.production; + // URL of development API + public applName = environment.applName; + public defaultServer = environment.defaultServer; + public server = environment.server; + public ssoSite = environment.ssoSite; + public ssoSignIn = environment.ssoSignIn; + public ssoSignUp = environment.ssoSignUp; + public ssoSignOut = environment.ssoSignOut; + public tokenStoredInPermanentStorage = environment.tokenStoredInPermanentStorage; +}; \ No newline at end of file