From 5dfda1885b5d7e01f6ff2c28a26f1e45af7cbdd4 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 21 Apr 2019 12:22:11 +0200 Subject: [PATCH] More dead code. --- src/Squidex/app/app.module.ts | 10 +---- .../angular/forms/file-drop.directive.ts | 10 +++-- .../angular/user-report.component.ts | 40 ------------------- src/Squidex/app/framework/configurations.ts | 4 -- src/Squidex/app/framework/module.ts | 9 ++--- 5 files changed, 11 insertions(+), 62 deletions(-) delete mode 100644 src/Squidex/app/framework/angular/user-report.component.ts diff --git a/src/Squidex/app/app.module.ts b/src/Squidex/app/app.module.ts index 43724634c..98b2a6c97 100644 --- a/src/Squidex/app/app.module.ts +++ b/src/Squidex/app/app.module.ts @@ -23,8 +23,7 @@ import { DecimalSeparatorConfig, SqxFrameworkModule, SqxSharedModule, - TitlesConfig, - UserReportConfig + TitlesConfig } from './shared'; import { SqxShellModule } from './shell'; @@ -66,10 +65,6 @@ export function configCurrency() { return new CurrencyConfig('EUR', '€', true); } -export function configUserReport() { - return new UserReportConfig('221afe63-0ca2-42aa-8efe-188d77964a7f'); -} - @NgModule({ imports: [ BrowserModule, @@ -93,8 +88,7 @@ export function configUserReport() { { provide: ApiUrlConfig, useFactory: configApiUrl }, { provide: CurrencyConfig, useFactory: configCurrency }, { provide: DecimalSeparatorConfig, useFactory: configDecimalSeparator }, - { provide: TitlesConfig, useFactory: configTitles }, - { provide: UserReportConfig, useFactory: configUserReport } + { provide: TitlesConfig, useFactory: configTitles } ], entryComponents: [AppComponent] }) diff --git a/src/Squidex/app/framework/angular/forms/file-drop.directive.ts b/src/Squidex/app/framework/angular/forms/file-drop.directive.ts index 52968da94..7b572d106 100644 --- a/src/Squidex/app/framework/angular/forms/file-drop.directive.ts +++ b/src/Squidex/app/framework/angular/forms/file-drop.directive.ts @@ -50,11 +50,13 @@ export class FileDropDirective { const result: File[] = []; - for (let i = 0; i < event.clipboardData.items.length; i++) { - const file = event.clipboardData.items[i].getAsFile(); + if (event.clipboardData) { + for (let i = 0; i < event.clipboardData.items.length; i++) { + const file = event.clipboardData.items[i].getAsFile(); - if (this.isAllowedFile(file)) { - result.push(file!); + if (this.isAllowedFile(file)) { + result.push(file!); + } } } diff --git a/src/Squidex/app/framework/angular/user-report.component.ts b/src/Squidex/app/framework/angular/user-report.component.ts deleted file mode 100644 index 7abc5dd45..000000000 --- a/src/Squidex/app/framework/angular/user-report.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Squidex Headless CMS - * - * @license - * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. - */ - -import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; -import { timer } from 'rxjs'; - -import { - ResourceLoaderService, - ResourceOwner, - UserReportConfig -} from '@app/framework/internal'; - -@Component({ - selector: 'sqx-user-report', - template: '' -}) -export class UserReportComponent extends ResourceOwner implements OnInit { - constructor(changeDetector: ChangeDetectorRef, - private readonly config: UserReportConfig, - private readonly resourceLoader: ResourceLoaderService - ) { - super(); - - changeDetector.detach(); - } - - public ngOnInit() { - window['_urq'] = window['_urq'] || []; - window['_urq'].push(['initSite', this.config.siteId]); - - this.own( - timer(4000).subscribe(() => { - this.resourceLoader.loadScript('https://cdn.userreport.com/userreport.js'); - })); - } -} \ No newline at end of file diff --git a/src/Squidex/app/framework/configurations.ts b/src/Squidex/app/framework/configurations.ts index 117de9bc9..f46f4857a 100644 --- a/src/Squidex/app/framework/configurations.ts +++ b/src/Squidex/app/framework/configurations.ts @@ -44,8 +44,4 @@ export class DecimalSeparatorConfig { export class ProductionModeConfig { constructor(public readonly isProductionMode: boolean) { } -} - -export class UserReportConfig { - constructor(public readonly siteId: string) { } } \ No newline at end of file diff --git a/src/Squidex/app/framework/module.ts b/src/Squidex/app/framework/module.ts index 816429552..54ea7050f 100644 --- a/src/Squidex/app/framework/module.ts +++ b/src/Squidex/app/framework/module.ts @@ -83,8 +83,7 @@ import { TitleService, ToggleComponent, TooltipDirective, - TransformInputDirective, - UserReportComponent + TransformInputDirective } from './declarations'; @NgModule({ @@ -153,8 +152,7 @@ import { TitleComponent, ToggleComponent, TooltipDirective, - TransformInputDirective, - UserReportComponent + TransformInputDirective ], exports: [ AutocompleteComponent, @@ -218,8 +216,7 @@ import { TitleComponent, ToggleComponent, TooltipDirective, - TransformInputDirective, - UserReportComponent + TransformInputDirective ] }) export class SqxFrameworkModule {