Browse Source

Made the app compile again.

pull/216/head
Sebastian Stehle 8 years ago
parent
commit
713902da06
  1. 3
      src/Squidex/app/features/content/pages/content/content-field.component.ts
  2. 4
      src/Squidex/app/features/content/pages/content/content-page.component.ts
  3. 2
      src/Squidex/app/features/content/pages/contents/contents-page.component.ts
  4. 2
      src/Squidex/app/features/content/shared/assets-editor.component.ts
  5. 2
      src/Squidex/app/features/content/shared/references-editor.component.ts
  6. 3
      src/Squidex/app/features/dashboard/pages/dashboard-page.component.ts
  7. 2
      src/Squidex/app/features/rules/pages/rules/rules-page.component.ts
  8. 2
      src/Squidex/app/features/schemas/pages/schema/types/string-validation.component.ts
  9. 2
      src/Squidex/app/framework/angular/http-extensions-impl.ts
  10. 2
      src/Squidex/app/framework/angular/keys.pipe.ts
  11. 4
      src/Squidex/app/framework/angular/onboarding-tooltip.component.ts
  12. 2
      src/Squidex/app/framework/angular/toggle.component.ts
  13. 2
      src/Squidex/app/framework/utils/immutable-array.ts
  14. 2
      src/Squidex/app/framework/utils/version.ts
  15. 4
      src/Squidex/app/shared/components/app-context.ts
  16. 4
      src/Squidex/app/shared/guards/unset-app.guard.spec.ts
  17. 4
      src/Squidex/app/shared/services/assets.service.ts
  18. 2
      src/Squidex/app/shared/services/auth.service.ts
  19. 12
      src/Squidex/app/shared/services/schemas.service.ts
  20. 2
      src/Squidex/app/shell/pages/internal/apps-menu.component.ts
  21. 50
      src/Squidex/package.json
  22. 3
      src/Squidex/tsconfig.json

3
src/Squidex/app/features/content/pages/content/content-field.component.ts

@ -41,7 +41,8 @@ export class ContentFieldComponent implements OnInit {
}
public ngOnInit() {
this.masterLanguageCode = this.languages.find(l => l.isMaster).iso2Code;
this.masterLanguageCode = this.languages.find(l => l.isMaster)!.iso2Code;
if (this.field.isDisabled) {
this.fieldForm.disable();
}

4
src/Squidex/app/features/content/pages/content/content-page.component.ts

@ -47,7 +47,7 @@ export class ContentPageComponent implements CanComponentDeactivate, OnDestroy,
public schema: SchemaDetailsDto;
public content: ContentDto;
public contentOld: ContentDto;
public contentOld: ContentDto | null;
public contentFormSubmitted = false;
public contentForm: FormGroup;
@ -122,12 +122,14 @@ export class ContentPageComponent implements CanComponentDeactivate, OnDestroy,
}
public showLatest() {
if (this.contentOld) {
this.content = this.contentOld;
this.contentOld = null;
this.emitContentUpdated(this.content);
this.populateContentForm();
}
}
public saveAndPublish() {
this.saveContent(true);

2
src/Squidex/app/features/content/pages/contents/contents-page.component.ts

@ -170,7 +170,7 @@ export class ContentsPageComponent implements OnDestroy, OnInit {
}
public load(showInfo = false) {
this.contentsService.getContents(this.ctx.appName, this.schema.name, this.contentsPager.pageSize, this.contentsPager.skip, this.contentsQuery, null, this.isArchive)
this.contentsService.getContents(this.ctx.appName, this.schema.name, this.contentsPager.pageSize, this.contentsPager.skip, this.contentsQuery, undefined, this.isArchive)
.subscribe(dtos => {
this.contentItems = ImmutableArray.of(dtos.items);
this.contentsPager = this.contentsPager.setCount(dtos.total);

2
src/Squidex/app/features/content/shared/assets-editor.component.ts

@ -70,7 +70,7 @@ export class AssetsEditorComponent implements ControlValueAccessor, OnDestroy, O
this.assetsService.getAssets(this.ctx.appName, 10000, 0, undefined, undefined, value)
.subscribe(dtos => {
this.oldAssets = ImmutableArray.of(assetIds.map(id => dtos.items.find(x => x.id === id)));
this.oldAssets = ImmutableArray.of(assetIds.map(id => dtos.items.find(x => x.id === id)).filter(a => !!a).map(a => a!));
});
}
}

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

@ -84,7 +84,7 @@ export class ReferencesEditorComponent implements ControlValueAccessor, OnInit {
this.contentsService.getContents(this.ctx.appName, this.schemaId, 10000, 0, undefined, contentIds)
.subscribe(dtos => {
this.contentItems = ImmutableArray.of(contentIds.map(id => dtos.items.find(c => c.id === id)).filter(c => !!c));
this.contentItems = ImmutableArray.of(contentIds.map(id => dtos.items.find(c => c.id === id)).filter(r => !!r).map(r => r!));
});
}
}

3
src/Squidex/app/features/dashboard/pages/dashboard-page.component.ts

@ -9,6 +9,7 @@ import { Component, OnInit } from '@angular/core';
import {
AppContext,
AppDto,
DateTime,
fadeAnimation,
UsagesService
@ -35,7 +36,7 @@ export class DashboardPageComponent implements OnInit {
public chartCallsCount: any;
public chartCallsPerformance: any;
public app = this.ctx.appChanges.filter(x => !!x);
public app = this.ctx.appChanges.filter(x => !!x).map(x => <AppDto>x);
public chartOptions = {
responsive: true,

2
src/Squidex/app/features/rules/pages/rules/rules-page.component.ts

@ -42,7 +42,7 @@ export class RulesPageComponent implements OnInit {
public schemas: SchemaDto[];
public wizardMode = 'Wizard';
public wizardRule: RuleDto;
public wizardRule: RuleDto | null;
constructor(public readonly ctx: AppContext,
private readonly schemasService: SchemasService,

2
src/Squidex/app/features/schemas/pages/schema/types/string-validation.component.ts

@ -99,7 +99,7 @@ export class StringValidationComponent implements OnDestroy, OnInit {
} else if (this.editForm.controls['pattern'].value && this.editForm.controls['pattern'].value.trim() !== '') {
this.patternName = 'Advanced';
} else {
this.patternName = undefined;
this.patternName = '';
}
}
}

2
src/Squidex/app/framework/angular/http-extensions-impl.ts

@ -112,7 +112,7 @@ export module HTTP {
export function pretifyError(message: string): Observable<any> {
return this.catch((response: HttpErrorResponse) => {
let result: ErrorDto = null;
let result: ErrorDto | null = null;
if (!(response.error instanceof Error)) {
try {

2
src/Squidex/app/framework/angular/keys.pipe.ts

@ -12,7 +12,7 @@ import { Pipe, PipeTransform } from '@angular/core';
pure: true
})
export class KeysPipe implements PipeTransform {
public transform(value: any, args: any[] = null): any {
public transform(value: any): any {
return Object.keys(value);
}
}

4
src/Squidex/app/framework/angular/onboarding-tooltip.component.ts

@ -25,7 +25,7 @@ import { fadeAnimation } from './animations';
export class OnboardingTooltipComponent implements OnDestroy, OnInit {
private showTimer: any;
private closeTimer: any;
private forMouseDownListener: Function;
private forMouseDownListener: Function | null;
public tooltipModal = new ModalView();
@ -91,7 +91,7 @@ export class OnboardingTooltipComponent implements OnDestroy, OnInit {
}
}
private isSameOrParent(underCursor: Element): boolean {
private isSameOrParent(underCursor: Element | null): boolean {
if (!underCursor) {
return false;
} if (this.for === underCursor) {

2
src/Squidex/app/framework/angular/toggle.component.ts

@ -24,7 +24,7 @@ export class ToggleComponent implements ControlValueAccessor {
private callChange = (v: any) => { /* NOOP */ };
private callTouched = () => { /* NOOP */ };
public isChecked: boolean | null = null;
public isChecked: boolean | null | undefined = null;
public isDisabled = false;
public writeValue(value: boolean | null | undefined) {

2
src/Squidex/app/framework/utils/immutable-array.ts

@ -61,7 +61,7 @@ export class ImmutableArray<T> implements Iterable<T> {
return new ImmutableArray<T>(this.items.filter(v => predicate(v!)));
}
public find(predicate: (item: T, index: number) => boolean): T {
public find(predicate: (item: T, index: number) => boolean): T | undefined {
return this.items.find(predicate);
}

2
src/Squidex/app/framework/utils/version.ts

@ -7,7 +7,7 @@
export class Version {
constructor(
public readonly value?: string
public readonly value: string
) {
}
}

4
src/Squidex/app/shared/components/app-context.ts

@ -30,7 +30,7 @@ export class AppContext implements OnDestroy {
return this.appField;
}
public get appChanges(): Observable<AppDto> {
public get appChanges(): Observable<AppDto | null> {
return this.appsStore.selectedApp;
}
@ -59,7 +59,7 @@ export class AppContext implements OnDestroy {
) {
this.appSubscription =
this.appsStore.selectedApp.take(1).subscribe(app => {
this.appField = app;
this.appField = app!;
});
}

4
src/Squidex/app/shared/guards/unset-app.guard.spec.ts

@ -25,9 +25,9 @@ describe('UnsetAppGuard', () => {
const guard = new UnsetAppGuard(appStoreService.object);
let result: boolean = undefined;
let result = false;
guard.canActivate(null, null)
guard.canActivate(<any>{}, <any>{})
.subscribe(value => {
result = value;
});

4
src/Squidex/app/shared/services/assets.service.ts

@ -198,7 +198,7 @@ export class AssetsService {
response.pixelWidth,
response.pixelHeight,
assetUrl,
new Version(event.headers.get('etag')));
new Version(event.headers.get('etag')!));
return dto;
}
@ -268,7 +268,7 @@ export class AssetsService {
response.pixelWidth,
response.pixelHeight);
return new Versioned(new Version(event.headers.get('etag')), replaced);
return new Versioned(new Version(event.headers.get('etag')!), replaced);
}
})
.do(() => {

2
src/Squidex/app/shared/services/auth.service.ts

@ -35,7 +35,7 @@ export class Profile {
}
public get isExpired(): boolean {
return this.user.expired;
return this.user.expired || false;
}
public get authToken(): string {

12
src/Squidex/app/shared/services/schemas.service.ts

@ -385,10 +385,12 @@ export class StringFieldPropertiesDto extends FieldPropertiesDto {
}
if (this.allowedValues && this.allowedValues.length > 0) {
const values: (string | null)[] = this.allowedValues;
if (this.isRequired && !isOptional) {
validators.push(ValidatorsEx.validValues(this.allowedValues));
validators.push(ValidatorsEx.validValues(values));
} else {
validators.push(ValidatorsEx.validValues(this.allowedValues.concat([null])));
validators.push(ValidatorsEx.validValues(values.concat([null])));
}
}
@ -437,10 +439,12 @@ export class NumberFieldPropertiesDto extends FieldPropertiesDto {
}
if (this.allowedValues && this.allowedValues.length > 0) {
const values: (number | null)[] = this.allowedValues;
if (this.isRequired && !isOptional) {
validators.push(ValidatorsEx.validValues(this.allowedValues));
validators.push(ValidatorsEx.validValues(values));
} else {
validators.push(ValidatorsEx.validValues(this.allowedValues.concat([null])));
validators.push(ValidatorsEx.validValues(values.concat([null])));
}
}

2
src/Squidex/app/shell/pages/internal/apps-menu.component.ts

@ -36,7 +36,7 @@ export class AppsMenuComponent implements OnDestroy, OnInit {
public appsMenu = new ModalView(false, true);
public apps: AppDto[] = [];
public selectedApp: AppDto;
public selectedApp: AppDto | null;
constructor(
private readonly appsStore: AppsStoreService

50
src/Squidex/package.json

@ -15,22 +15,22 @@
"build:clean": "rimraf wwwroot/build"
},
"dependencies": {
"@angular/animations": "5.1.0",
"@angular/common": "5.1.0",
"@angular/compiler": "5.1.0",
"@angular/core": "5.1.0",
"@angular/forms": "5.1.0",
"@angular/http": "5.1.0",
"@angular/platform-browser": "5.1.0",
"@angular/platform-browser-dynamic": "5.1.0",
"@angular/platform-server": "5.1.0",
"@angular/router": "5.1.0",
"@angular/animations": "5.1.3",
"@angular/common": "5.1.3",
"@angular/compiler": "5.1.3",
"@angular/core": "5.1.3",
"@angular/forms": "5.1.3",
"@angular/http": "5.1.3",
"@angular/platform-browser": "5.1.3",
"@angular/platform-browser-dynamic": "5.1.3",
"@angular/platform-server": "5.1.3",
"@angular/router": "5.1.3",
"angular2-chartjs": "0.4.1",
"babel-polyfill": "6.26.0",
"bootstrap": "4.0.0-alpha.6",
"core-js": "2.5.3",
"graphiql": "0.11.10",
"moment": "2.19.4",
"graphiql": "0.11.11",
"moment": "2.20.1",
"mousetrap": "1.6.1",
"ng2-dnd": "5.0.2",
"oidc-client": "1.4.1",
@ -38,18 +38,18 @@
"progressbar.js": "1.0.1",
"react": "16.2.0",
"react-dom": "16.2.0",
"rxjs": "5.5.5",
"zone.js": "0.8.18"
"rxjs": "5.5.6",
"zone.js": "0.8.19"
},
"devDependencies": {
"@angular/compiler": "5.1.0",
"@angular/compiler-cli": "5.1.0",
"@ngtools/webpack": "1.9.0",
"@types/core-js": "0.9.35",
"@angular/compiler": "5.1.3",
"@angular/compiler-cli": "5.1.3",
"@ngtools/webpack": "1.9.3",
"@types/core-js": "0.9.44",
"@types/jasmine": "2.5.45",
"@types/mousetrap": "1.5.34",
"@types/node": "7.0.5",
"@types/react": "16.0.25",
"@types/mousetrap": "1.6",
"@types/node": "8.5.2",
"@types/react": "16.0.34",
"@types/react-dom": "16.0.3",
"angular2-router-loader": "0.3.5",
"angular2-template-loader": "0.6.2",
@ -59,13 +59,13 @@
"css-loader": "0.28.7",
"exports-loader": "0.6.4",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"file-loader": "1.1.6",
"html-loader": "0.5.1",
"html-webpack-plugin": "2.30.1",
"ignore-loader": "^0.1.2",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-core": "2.8.0",
"karma": "1.7.1",
"karma": "2.0.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage": "1.1.1",
@ -75,7 +75,7 @@
"karma-mocha-reporter": "2.2.5",
"karma-phantomjs-launcher": "1.0.4",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.6",
"karma-webpack": "2.0.9",
"node-sass": "4.7.2",
"noop-loader": "^1.0.0",
"null-loader": "0.1.1",
@ -84,7 +84,7 @@
"rimraf": "2.6.2",
"sass-lint": "1.12.1",
"sass-loader": "6.0.6",
"style-loader": "0.19.0",
"style-loader": "0.19.1",
"tslint": "5.8.0",
"tslint-loader": "3.5.3",
"typemoq": "2.1.0",

3
src/Squidex/tsconfig.json

@ -3,13 +3,14 @@
"baseUrl": ".",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "esnext", "dom"],
"moduleResolution": "node",
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"removeComments": false,
"sourceMap": true,
"strictNullChecks": false,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5",
"paths": {

Loading…
Cancel
Save