Browse Source

Small improvements.

pull/345/head
Sebastian Stehle 7 years ago
parent
commit
75c0e497af
  1. 1
      src/Squidex/app/features/content/shared/references-editor.component.ts
  2. 1
      src/Squidex/app/framework/angular/forms/autocomplete.component.ts
  3. 1
      src/Squidex/app/framework/angular/forms/stars.component.ts
  4. 1
      src/Squidex/app/framework/angular/forms/tag-editor.component.ts
  5. 1
      src/Squidex/app/framework/angular/modals/modal-dialog.component.ts
  6. 17
      src/Squidex/app/framework/angular/stateful.component.ts
  7. 1
      src/Squidex/app/shared/components/asset.component.ts
  8. 1
      src/Squidex/app/shared/components/assets-selector.component.ts
  9. 1
      src/Squidex/app/shared/components/geolocation-editor.component.ts
  10. 3
      src/Squidex/app/shared/components/markdown-editor.component.ts
  11. 1
      src/Squidex/app/shared/components/schema-category.component.ts

1
src/Squidex/app/features/content/shared/references-editor.component.ts

@ -30,7 +30,6 @@ export const SQX_REFERENCES_EDITOR_CONTROL_VALUE_ACCESSOR: any = {
interface State { interface State {
schema?: SchemaDetailsDto | null; schema?: SchemaDetailsDto | null;
schemaInvalid: boolean; schemaInvalid: boolean;
contentItems: ImmutableArray<ContentDto>; contentItems: ImmutableArray<ContentDto>;

1
src/Squidex/app/framework/angular/forms/autocomplete.component.ts

@ -27,7 +27,6 @@ export const SQX_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR: any = {
interface State { interface State {
suggestedItems: any[]; suggestedItems: any[];
suggestedIndex: number; suggestedIndex: number;
} }

1
src/Squidex/app/framework/angular/forms/stars.component.ts

@ -16,7 +16,6 @@ export const SQX_STARS_CONTROL_VALUE_ACCESSOR: any = {
interface State { interface State {
stars: number; stars: number;
starsArray: number[]; starsArray: number[];
value: number | null; value: number | null;

1
src/Squidex/app/framework/angular/forms/tag-editor.component.ts

@ -78,7 +78,6 @@ interface State {
hasFocus: boolean; hasFocus: boolean;
suggestedItems: string[]; suggestedItems: string[];
suggestedIndex: number; suggestedIndex: number;
items: any[]; items: any[];

1
src/Squidex/app/framework/angular/modals/modal-dialog.component.ts

@ -11,7 +11,6 @@ import { fadeAnimation, StatefulComponent } from '@app/framework/internal';
interface State { interface State {
hasTabs: boolean; hasTabs: boolean;
hasFooter: boolean; hasFooter: boolean;
} }

17
src/Squidex/app/framework/angular/stateful.component.ts

@ -5,10 +5,10 @@
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/ */
import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core'; import { ChangeDetectorRef, OnDestroy } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms'; import { ControlValueAccessor } from '@angular/forms';
import { Observable, Subscription } from 'rxjs'; import { Observable, Subscription } from 'rxjs';
import { onErrorResumeNext } from 'rxjs/operators'; import { onErrorResumeNext, skip } from 'rxjs/operators';
import { Types } from './../utils/types'; import { Types } from './../utils/types';
@ -46,7 +46,7 @@ export class ResourceOwner implements OnDestroy {
} }
} }
export abstract class StatefulComponent<T = any> extends State<T> implements OnDestroy, OnInit { export abstract class StatefulComponent<T = any> extends State<T> implements OnDestroy {
private readonly subscriptions = new ResourceOwner(); private readonly subscriptions = new ResourceOwner();
constructor( constructor(
@ -54,18 +54,17 @@ export abstract class StatefulComponent<T = any> extends State<T> implements OnD
state: T state: T
) { ) {
super(state); super(state);
this.takeOver(
this.changes.pipe(skip(1)).subscribe(() => {
this.changeDetector.detectChanges();
}));
} }
public ngOnDestroy() { public ngOnDestroy() {
this.subscriptions.ngOnDestroy(); this.subscriptions.ngOnDestroy();
} }
public ngOnInit() {
this.changes.subscribe(() => {
this.changeDetector.detectChanges();
});
}
public takeOver<R>(subscription: Subscription | UnsubscribeFunction | Observable<R>) { public takeOver<R>(subscription: Subscription | UnsubscribeFunction | Observable<R>) {
this.subscriptions.takeOver(subscription); this.subscriptions.takeOver(subscription);
} }

1
src/Squidex/app/shared/components/asset.component.ts

@ -27,7 +27,6 @@ import {
interface State { interface State {
isTagging: boolean; isTagging: boolean;
isRenaming: boolean; isRenaming: boolean;
progress: number; progress: number;

1
src/Squidex/app/shared/components/assets-selector.component.ts

@ -20,7 +20,6 @@ import {
interface State { interface State {
selectedAssets: { [id: string]: AssetDto }; selectedAssets: { [id: string]: AssetDto };
selectionCount: number; selectionCount: number;
isListView: boolean; isListView: boolean;

1
src/Squidex/app/shared/components/geolocation-editor.component.ts

@ -25,7 +25,6 @@ export const SQX_GEOLOCATION_EDITOR_CONTROL_VALUE_ACCESSOR: any = {
interface Geolocation { interface Geolocation {
latitude: number; latitude: number;
longitude: number; longitude: number;
} }

3
src/Squidex/app/shared/components/markdown-editor.component.ts

@ -56,8 +56,6 @@ export class MarkdownEditorComponent extends StatefulControlComponent<State, str
super(changeDetector, { super(changeDetector, {
isFullscreen: false isFullscreen: false
}); });
this.resourceLoader.loadStyle('https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
} }
public writeValue(obj: any) { public writeValue(obj: any) {
@ -81,6 +79,7 @@ export class MarkdownEditorComponent extends StatefulControlComponent<State, str
} }
public ngAfterViewInit() { public ngAfterViewInit() {
this.resourceLoader.loadStyle('https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
this.resourceLoader.loadScript('https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js').then(() => { this.resourceLoader.loadScript('https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js').then(() => {
this.simplemde = new SimpleMDE({ this.simplemde = new SimpleMDE({
toolbar: [ toolbar: [

1
src/Squidex/app/shared/components/schema-category.component.ts

@ -23,7 +23,6 @@ interface State {
displayName?: string; displayName?: string;
schemasFiltered: ImmutableArray<SchemaDto>; schemasFiltered: ImmutableArray<SchemaDto>;
schemasForCategory: ImmutableArray<SchemaDto>; schemasForCategory: ImmutableArray<SchemaDto>;
isOpen: boolean; isOpen: boolean;

Loading…
Cancel
Save