diff --git a/main/src/index.ts b/main/src/index.ts index 228db634..a6023ee1 100644 --- a/main/src/index.ts +++ b/main/src/index.ts @@ -74,25 +74,31 @@ function createWindow() { const window = new AppWindow(); if (__DEV__) { - const { - default: installExtension, - REDUX_DEVTOOLS - } = require('electron-devtools-installer'); + // const { + // default: installExtension, + // REDUX_DEVTOOLS + // } = require('electron-devtools-installer'); - require('electron-debug')({ showDevTools: true }); + import('electron-debug').then(ed => { + ed.default({ showDevTools: true }); + }); - const ChromeLens = { - id: 'idikgljglpfilbhaboonnpnnincjhjkd', - electron: '>=1.2.1' - }; + import('electron-devtools-installer').then(edi => { + const ChromeLens = { + id: 'idikgljglpfilbhaboonnpnnincjhjkd', + electron: '>=1.2.1' + }; - const extensions = [REDUX_DEVTOOLS, ChromeLens]; + const extensions = [edi.REDUX_DEVTOOLS, ChromeLens]; - for (const extension of extensions) { - try { - installExtension(extension); - } catch (e) {} - } + for (const extension of extensions) { + try { + edi.default(extension); + } catch (e) { + console.log(e); + } + } + }); } window.onClose(() => { diff --git a/projects/ucap-webmessenger-app/src/app/app-routing.module.ts b/projects/ucap-webmessenger-app/src/app/app-routing.module.ts index fc9282b1..e27fc322 100644 --- a/projects/ucap-webmessenger-app/src/app/app-routing.module.ts +++ b/projects/ucap-webmessenger-app/src/app/app-routing.module.ts @@ -6,17 +6,25 @@ const routes: Routes = [ { path: '', redirectTo: '/messenger', pathMatch: 'full' }, { path: 'messenger', - loadChildren: - './pages/messenger/messenger.page.module#AppMessengerPageModule', + loadChildren: () => + import('./pages/messenger/messenger.page.module').then( + m => m.AppMessengerPageModule + ), canActivate: [AppAuthGuard] }, { path: 'account', - loadChildren: './pages/account/account.page.module#AppAccountPageModule' + loadChildren: () => + import('./pages/account/account.page.module').then( + m => m.AppAccountPageModule + ) }, { path: 'template', - loadChildren: './pages/template/template.page.module#AppTemplatePageModule' + loadChildren: () => + import('./pages/template/template.page.module').then( + m => m.AppTemplatePageModule + ) } ]; diff --git a/projects/ucap-webmessenger-app/src/app/app.module.ts b/projects/ucap-webmessenger-app/src/app/app.module.ts index ef08b1d7..93696aa2 100644 --- a/projects/ucap-webmessenger-app/src/app/app.module.ts +++ b/projects/ucap-webmessenger-app/src/app/app.module.ts @@ -14,6 +14,7 @@ import { UCapPiModule } from '@ucap-webmessenger/pi'; import { UCapProtocolModule } from '@ucap-webmessenger/protocol'; import { UCapAuthenticationProtocolModule } from '@ucap-webmessenger/protocol-authentication'; import { UCapEventProtocolModule } from '@ucap-webmessenger/protocol-event'; +import { UCapGroupProtocolModule } from '@ucap-webmessenger/protocol-group'; import { UCapInfoProtocolModule } from '@ucap-webmessenger/protocol-info'; import { UCapInnerProtocolModule } from '@ucap-webmessenger/protocol-inner'; import { UCapOptionProtocolModule } from '@ucap-webmessenger/protocol-option'; @@ -73,6 +74,7 @@ import { AppNativeLayoutModule } from './layouts/native/native.layout.module'; }), UCapAuthenticationProtocolModule.forRoot(), UCapEventProtocolModule.forRoot(), + UCapGroupProtocolModule.forRoot(), UCapInfoProtocolModule.forRoot(), UCapInnerProtocolModule.forRoot(), UCapOptionProtocolModule.forRoot(), diff --git a/projects/ucap-webmessenger-app/src/environments/environment.type.ts b/projects/ucap-webmessenger-app/src/environments/environment.type.ts index 056db724..d3f07688 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.type.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.type.ts @@ -1,5 +1,3 @@ -import * as url from 'url'; - export abstract class UrlConfig { constructor( protected useSsl: boolean, @@ -18,13 +16,20 @@ export abstract class UrlConfig { : 'http:'; } - protected getUrl(extra: url.UrlObject): string { - return url.format({ - ...extra, - protocol: this.getProtocol(), - hostname: this.domain, - port: this.port - }); + protected getUrl(extra: Partial): string { + const url = new URL( + `${this.getProtocol()}//${this.domain}:${String(this.port)}` + ); + + for (const key in extra) { + if (extra.hasOwnProperty(key)) { + url[key] = extra[key]; + } + } + + console.log('url.href', url.href); + + return url.href; } } diff --git a/projects/ucap-webmessenger-app/tsconfig.app.json b/projects/ucap-webmessenger-app/tsconfig.app.json index cfbd9495..902c0ffb 100644 --- a/projects/ucap-webmessenger-app/tsconfig.app.json +++ b/projects/ucap-webmessenger-app/tsconfig.app.json @@ -1,5 +1,9 @@ { "extends": "../../tsconfig.json", + "angularCompilerOptions": { + "enableIvy": true, + "allowEmptyCodegenFiles": true + }, "compilerOptions": { "outDir": "../../out-tsc/app", "types": [] diff --git a/projects/ucap-webmessenger-ui/src/lib/components/image.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/image.component.ts index 8164653c..a7bd765b 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/image.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/image.component.ts @@ -7,14 +7,8 @@ import { ucapAnimations } from '../animations'; @Component({ selector: 'ucap-ui-imaage', template: ` - + `, - styles: [], animations: ucapAnimations }) export class ImageComponent implements OnInit { @@ -31,41 +25,27 @@ export class ImageComponent implements OnInit { default: string; @Input() - set style(style: string | object) { - let mappedStyles = style as string; - - if (typeof style === 'object') { - mappedStyles = Object.entries(style).reduce( - (styleString, [propName, propValue]) => { - propName = propName.replace( - /([A-Z])/g, - matches => `-${matches[0].toLowerCase()}` - ); - return `${styleString}${propName}:${propValue};`; - }, - '' - ); - - this.baseStyle = this.domSanitizer.bypassSecurityTrustStyle(mappedStyles); - } else if (typeof style === 'string') { - this.baseStyle = this.domSanitizer.bypassSecurityTrustStyle(mappedStyles); - } + set style(style: string) { + this.logger.debug('style', style); + this.baseStyle = style; } @Input() set imageClass(classes: string) { - if (classes && classes.length) { - classes.split(' ').forEach((className: string) => { - this.classList[className] = true; - }); + // if (classes && classes.length) { + // classes.split(' ').forEach((className: string) => { + // this.classList[className] = true; + // }); - this.elementRef.nativeElement.className = ''; - } + // this.elementRef.nativeElement.className = ''; + // } + this.classes = classes; } baseStyle: SafeStyle; imageSrc: string; - classList: { [key: string]: boolean } = {}; + // classList: { [key: string]: boolean } = {}; + classes: string; constructor( private elementRef: ElementRef, diff --git a/projects/ucap-webmessenger-ui/src/public-api.ts b/projects/ucap-webmessenger-ui/src/public-api.ts index 0716a842..e534045a 100644 --- a/projects/ucap-webmessenger-ui/src/public-api.ts +++ b/projects/ucap-webmessenger-ui/src/public-api.ts @@ -4,6 +4,9 @@ export * from './lib/animations'; +export * from './lib/components/file-upload-queue.component'; +export * from './lib/components/image.component'; + export * from './lib/dialogs/alert.dialog.component'; export * from './lib/dialogs/confirm.dialog.component';