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 {
schema?: SchemaDetailsDto | null;
schemaInvalid: boolean;
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 {
suggestedItems: any[];
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 {
stars: number;
starsArray: number[];
value: number | null;

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

@ -78,7 +78,6 @@ interface State {
hasFocus: boolean;
suggestedItems: string[];
suggestedIndex: number;
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 {
hasTabs: 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.
*/
import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
import { ChangeDetectorRef, OnDestroy } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { Observable, Subscription } from 'rxjs';
import { onErrorResumeNext } from 'rxjs/operators';
import { onErrorResumeNext, skip } from 'rxjs/operators';
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();
constructor(
@ -54,18 +54,17 @@ export abstract class StatefulComponent<T = any> extends State<T> implements OnD
state: T
) {
super(state);
this.takeOver(
this.changes.pipe(skip(1)).subscribe(() => {
this.changeDetector.detectChanges();
}));
}
public ngOnDestroy() {
this.subscriptions.ngOnDestroy();
}
public ngOnInit() {
this.changes.subscribe(() => {
this.changeDetector.detectChanges();
});
}
public takeOver<R>(subscription: Subscription | UnsubscribeFunction | Observable<R>) {
this.subscriptions.takeOver(subscription);
}

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

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

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

@ -20,7 +20,6 @@ import {
interface State {
selectedAssets: { [id: string]: AssetDto };
selectionCount: number;
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 {
latitude: 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, {
isFullscreen: false
});
this.resourceLoader.loadStyle('https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
}
public writeValue(obj: any) {
@ -81,6 +79,7 @@ export class MarkdownEditorComponent extends StatefulControlComponent<State, str
}
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.simplemde = new SimpleMDE({
toolbar: [

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

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

Loading…
Cancel
Save