Browse Source

TSLint improvements.

pull/130/head
Sebastian Stehle 9 years ago
parent
commit
0630964f45
  1. 2
      src/Squidex/app/features/administration/administration-area.component.html
  2. 2
      src/Squidex/app/features/administration/pages/users/users-page.component.html
  3. 2
      src/Squidex/app/features/api/pages/graphql/graphql-page.component.ts
  4. 4
      src/Squidex/app/features/content/pages/content/content-field.component.html
  5. 2
      src/Squidex/app/features/content/pages/contents/contents-page.component.html
  6. 2
      src/Squidex/app/features/content/pages/schemas/schemas-page.component.html
  7. 4
      src/Squidex/app/features/content/shared/content-item.component.html
  8. 2
      src/Squidex/app/features/content/shared/content-item.component.ts
  9. 2
      src/Squidex/app/features/content/shared/references-editor.component.html
  10. 4
      src/Squidex/app/features/content/shared/references-editor.component.ts
  11. 4
      src/Squidex/app/features/schemas/pages/schema/schema-page.component.html
  12. 2
      src/Squidex/app/features/schemas/pages/schema/types/boolean-validation.component.html
  13. 6
      src/Squidex/app/features/schemas/pages/schema/types/boolean-validation.component.ts
  14. 4
      src/Squidex/app/features/schemas/pages/schema/types/date-time-validation.component.html
  15. 12
      src/Squidex/app/features/schemas/pages/schema/types/date-time-validation.component.ts
  16. 2
      src/Squidex/app/features/schemas/pages/schema/types/number-validation.component.html
  17. 6
      src/Squidex/app/features/schemas/pages/schema/types/number-validation.component.ts
  18. 4
      src/Squidex/app/features/schemas/pages/schema/types/string-validation.component.html
  19. 12
      src/Squidex/app/features/schemas/pages/schema/types/string-validation.component.ts
  20. 6
      src/Squidex/app/features/schemas/pages/schemas/schemas-page.component.html
  21. 2
      src/Squidex/app/features/settings/pages/clients/client.component.html
  22. 8
      src/Squidex/app/features/settings/pages/contributors/contributors-page.component.html
  23. 2
      src/Squidex/app/framework/angular/autocomplete.component.html
  24. 24
      src/Squidex/app/framework/angular/autocomplete.component.ts
  25. 2
      src/Squidex/app/framework/angular/cloak.directive.ts
  26. 30
      src/Squidex/app/framework/angular/date-time.pipes.ts
  27. 5
      src/Squidex/app/framework/angular/http-extensions-impl.ts
  28. 2
      src/Squidex/app/framework/angular/http-extensions.ts
  29. 2
      src/Squidex/app/framework/angular/image-source.directive.ts
  30. 25
      src/Squidex/app/framework/angular/indeterminate-value.directive.ts
  31. 31
      src/Squidex/app/framework/angular/lowercase-input.directive.ts
  32. 6
      src/Squidex/app/framework/angular/money.pipe.ts
  33. 6
      src/Squidex/app/framework/angular/name.pipe.ts
  34. 2
      src/Squidex/app/framework/angular/panel-container.directive.ts
  35. 4
      src/Squidex/app/framework/angular/sorted.directive.ts
  36. 2
      src/Squidex/app/framework/angular/template-wrapper.directive.ts
  37. 18
      src/Squidex/app/framework/angular/validators.ts
  38. 12
      src/Squidex/app/framework/module.ts
  39. 6
      src/Squidex/app/framework/utils/immutable-array.ts
  40. 4
      src/Squidex/app/shared/components/asset.component.html
  41. 2
      src/Squidex/app/shared/components/asset.component.ts
  42. 6
      src/Squidex/app/shared/components/history.component.html
  43. 16
      src/Squidex/app/shared/components/pipes.ts
  44. 2
      src/Squidex/app/shell/pages/app/app-area.component.html
  45. 2
      src/Squidex/app/shell/pages/home/home-page.component.ts
  46. 2
      src/Squidex/app/shell/pages/internal/profile-menu.component.html
  47. 4
      src/Squidex/package.json
  48. 12
      src/Squidex/tsconfig.json
  49. 40
      src/Squidex/tslint.json

2
src/Squidex/app/features/administration/administration-area.component.html

@ -13,6 +13,6 @@
</ul> </ul>
</div> </div>
<div class="panel-container"> <div sqxPanelContainer class="panel-container">
<router-outlet></router-outlet> <router-outlet></router-outlet>
</div> </div>

2
src/Squidex/app/features/administration/pages/users/users-page.component.html

@ -60,7 +60,7 @@
<ng-template ngFor let-user [ngForOf]="usersItems"> <ng-template ngFor let-user [ngForOf]="usersItems">
<tr [routerLink]="user.id" routerLinkActive="active"> <tr [routerLink]="user.id" routerLinkActive="active">
<td> <td>
<img class="user-picture" [attr.title]="user.name" [attr.src]="user | userDtoPicture" /> <img class="user-picture" [attr.title]="user.name" [attr.src]="user | sqxUserDtoPicture" />
</td> </td>
<td> <td>
<span class="user-name table-cell">{{user.displayName}}</span> <span class="user-name table-cell">{{user.displayName}}</span>

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

@ -13,6 +13,8 @@ import * as ReactDOM from 'react-dom';
const GraphiQL = require('graphiql'); const GraphiQL = require('graphiql');
/* tslint:disable:use-view-encapsulation */
import { import {
ApiUrlConfig, ApiUrlConfig,
AppComponentBase, AppComponentBase,

4
src/Squidex/app/features/content/pages/content/content-field.component.html

@ -1,6 +1,6 @@
<div class="table-items-row" [class.invalid]="fieldForm.invalid"> <div class="table-items-row" [class.invalid]="fieldForm.invalid">
<label> <label>
{{field | displayName:'properties.label':'name'}} <span class="field-required" [class.hidden]="!field.properties.isRequired">*</span> {{field | sqxDisplayName:'properties.label':'name'}} <span class="field-required" [class.hidden]="!field.properties.isRequired">*</span>
</label> </label>
<span class="field-disabled" *ngIf="field.isDisabled">Disabled</span> <span class="field-disabled" *ngIf="field.isDisabled">Disabled</span>
@ -12,7 +12,7 @@
<div *ngFor="let partition of fieldPartitions"> <div *ngFor="let partition of fieldPartitions">
<div *ngIf="partition == fieldPartition"> <div *ngIf="partition == fieldPartition">
<sqx-control-errors [for]="partition" fieldName="{{field | displayName:'properties.label':'name'}}" [submitted]="contentFormSubmitted"></sqx-control-errors> <sqx-control-errors [for]="partition" fieldName="{{field | sqxDisplayName:'properties.label':'name'}}" [submitted]="contentFormSubmitted"></sqx-control-errors>
<div [ngSwitch]="field.properties.fieldType"> <div [ngSwitch]="field.properties.fieldType">
<div *ngSwitchCase="'Number'"> <div *ngSwitchCase="'Number'">

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

@ -52,7 +52,7 @@
<thead> <thead>
<tr> <tr>
<th *ngFor="let field of contentFields"> <th *ngFor="let field of contentFields">
<span class="field">{{field | displayName:'properties.label':'name'}}</span> <span class="field">{{field | sqxDisplayName:'properties.label':'name'}}</span>
</th> </th>
<th> <th>
Updated Updated

2
src/Squidex/app/features/content/pages/schemas/schemas-page.component.html

@ -25,7 +25,7 @@
<div class="panel-content"> <div class="panel-content">
<ul class="nav flex-column nav-dark nav-dark-bordered"> <ul class="nav flex-column nav-dark nav-dark-bordered">
<li class="nav-item" *ngFor="let schema of schemasFiltered | async"> <li class="nav-item" *ngFor="let schema of schemasFiltered | async">
<a class="nav-link" [routerLink]="schema.name" routerLinkActive="active">{{schema | displayName}} <i class="icon-angle-right"></i></a> <a class="nav-link" [routerLink]="schema.name" routerLinkActive="active">{{schema | sqxDisplayName}} <i class="icon-angle-right"></i></a>
</li> </li>
</ul> </ul>
</div> </div>

4
src/Squidex/app/features/content/shared/content-item.component.html

@ -6,10 +6,10 @@
<td> <td>
<span class="item-published" [class.unpublished]="!content.isPublished"></span> <span class="item-published" [class.unpublished]="!content.isPublished"></span>
<small class="item-modified">{{content.lastModified | fromNow}}</small> <small class="item-modified">{{content.lastModified | sqxFromNow}}</small>
</td> </td>
<td> <td>
<img class="user-picture" [attr.title]="content.lastModifiedBy | userNameRef" [attr.src]="content.lastModifiedBy | userPictureRef" /> <img class="user-picture" [attr.title]="content.lastModifiedBy | sqxUserNameRef" [attr.src]="content.lastModifiedBy | sqxUserPictureRef" />
</td> </td>
<td *ngIf="!isReadOnly"> <td *ngIf="!isReadOnly">
<div class="dropdown dropdown-options" *ngIf="content"> <div class="dropdown dropdown-options" *ngIf="content">

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

@ -19,6 +19,8 @@ import {
SchemaDto SchemaDto
} from 'shared'; } from 'shared';
/* tslint:disable:component-selector */
@Component({ @Component({
selector: '[sqxContent]', selector: '[sqxContent]',
styleUrls: ['./content-item.component.scss'], styleUrls: ['./content-item.component.scss'],

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

@ -19,7 +19,7 @@
<tbody dnd-sortable-container [sortableData]="contentItems.mutableValues"> <tbody dnd-sortable-container [sortableData]="contentItems.mutableValues">
<ng-template ngFor let-content let-i="index" [ngForOf]="contentItems"> <ng-template ngFor let-content let-i="index" [ngForOf]="contentItems">
<tr [sqxContent]="content" dnd-sortable [sortableIndex]="i" (sorted)="onContentsSorted($event)" <tr [sqxContent]="content" dnd-sortable [sortableIndex]="i" (sqxSorted)="onContentsSorted($event)"
[language]="languageSelected" [language]="languageSelected"
[schemaFields]="contentFields" [schemaFields]="contentFields"
[schema]="schema" [schema]="schema"

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

@ -7,7 +7,7 @@
// tslint:disable:prefer-for-of // tslint:disable:prefer-for-of
import { Component, forwardRef, Input } from '@angular/core'; import { Component, forwardRef, Input, OnInit } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { import {
@ -34,7 +34,7 @@ export const SQX_REFERENCES_EDITOR_CONTROL_VALUE_ACCESSOR: any = {
templateUrl: './references-editor.component.html', templateUrl: './references-editor.component.html',
providers: [SQX_REFERENCES_EDITOR_CONTROL_VALUE_ACCESSOR] providers: [SQX_REFERENCES_EDITOR_CONTROL_VALUE_ACCESSOR]
}) })
export class ReferencesEditorComponent extends AppComponentBase implements ControlValueAccessor { export class ReferencesEditorComponent extends AppComponentBase implements ControlValueAccessor, OnInit {
private changeCallback: (value: any) => void = NOOP; private changeCallback: (value: any) => void = NOOP;
private touchedCallback: () => void = NOOP; private touchedCallback: () => void = NOOP;

4
src/Squidex/app/features/schemas/pages/schema/schema-page.component.html

@ -30,7 +30,7 @@
</div> </div>
<h3 class="panel-title"> <h3 class="panel-title">
{{schemaInformation | displayName}} <i class="schema-edit icon-pencil" (click)="editSchemaDialog.show()"></i> {{schemaInformation | sqxDisplayName}} <i class="schema-edit icon-pencil" (click)="editSchemaDialog.show()"></i>
</h3> </h3>
</div> </div>
@ -41,7 +41,7 @@
<div class="panel-main"> <div class="panel-main">
<div class="panel-content panel-content-scroll" dnd-sortable-container [sortableData]="schemaFields.mutableValues"> <div class="panel-content panel-content-scroll" dnd-sortable-container [sortableData]="schemaFields.mutableValues">
<div *ngFor="let field of schemaFields; let i = index" dnd-sortable [sortableIndex]="i" (sorted)="sortFields($event)"> <div *ngFor="let field of schemaFields; let i = index" dnd-sortable [sortableIndex]="i" (sqxSorted)="sortFields($event)">
<sqx-field [field]="field" [schemas]="schemas" <sqx-field [field]="field" [schemas]="schemas"
(disabling)="disableField(field)" (disabling)="disableField(field)"
(deleting)="deleteField(field)" (deleting)="deleteField(field)"

2
src/Squidex/app/features/schemas/pages/schema/types/boolean-validation.component.html

@ -7,7 +7,7 @@
</div> </div>
</div> </div>
<div class="form-group row" *ngIf="!(hideDefaultValue | async)"> <div class="form-group row" *ngIf="showDefaultValue | async">
<label class="col col-3 col-form-checkbox-label" for="field-default-value">Default Value</label> <label class="col col-3 col-form-checkbox-label" for="field-default-value">Default Value</label>
<div class="col col-6"> <div class="col col-6">

6
src/Squidex/app/features/schemas/pages/schema/types/boolean-validation.component.ts

@ -23,15 +23,15 @@ export class BooleanValidationComponent implements OnInit {
@Input() @Input()
public properties: BooleanFieldPropertiesDto; public properties: BooleanFieldPropertiesDto;
public hideDefaultValue: Observable<boolean>; public showDefaultValue: Observable<boolean>;
public ngOnInit() { public ngOnInit() {
this.editForm.addControl('defaultValue', this.editForm.addControl('defaultValue',
new FormControl(this.properties.defaultValue)); new FormControl(this.properties.defaultValue));
this.hideDefaultValue = this.showDefaultValue =
this.editForm.controls['isRequired'].valueChanges this.editForm.controls['isRequired'].valueChanges
.startWith(this.properties.isRequired) .startWith(this.properties.isRequired)
.map(x => !!x); .map(x => !x);
} }
} }

4
src/Squidex/app/features/schemas/pages/schema/types/date-time-validation.component.html

@ -23,7 +23,7 @@
</div> </div>
</div> </div>
<div *ngIf="!(hideDefaultValues | async)"> <div *ngIf="showDefaultValues | async">
<div class="form-group row"> <div class="form-group row">
<label class="col col-3 col-form-label">Default Mode:</label> <label class="col col-3 col-form-label">Default Mode:</label>
@ -35,7 +35,7 @@
</div> </div>
</div> </div>
<div class="form-group row" *ngIf="!(hideDefaultValue | async)"> <div class="form-group row" *ngIf="showDefaultValue | async">
<label class="col col-3 col-form-label" for="field-default-value">Default Value</label> <label class="col col-3 col-form-label" for="field-default-value">Default Value</label>
<div class="col col-9"> <div class="col col-9">

12
src/Squidex/app/features/schemas/pages/schema/types/date-time-validation.component.ts

@ -23,8 +23,8 @@ export class DateTimeValidationComponent implements OnInit {
@Input() @Input()
public properties: DateTimeFieldPropertiesDto; public properties: DateTimeFieldPropertiesDto;
public hideDefaultValues: Observable<boolean>; public showDefaultValues: Observable<boolean>;
public hideDefaultValue: Observable<boolean>; public showDefaultValue: Observable<boolean>;
public calculatedDefaultValues = ['Now', 'Today']; public calculatedDefaultValues = ['Now', 'Today'];
@ -47,14 +47,14 @@ export class DateTimeValidationComponent implements OnInit {
ValidatorsEx.validDateTime() ValidatorsEx.validDateTime()
])); ]));
this.hideDefaultValues = this.showDefaultValues =
this.editForm.controls['isRequired'].valueChanges this.editForm.controls['isRequired'].valueChanges
.startWith(this.properties.isRequired) .startWith(this.properties.isRequired)
.map(x => !!x); .map(x => !x);
this.hideDefaultValue = this.showDefaultValue =
this.editForm.controls['calculatedDefaultValue'].valueChanges this.editForm.controls['calculatedDefaultValue'].valueChanges
.startWith(this.properties.calculatedDefaultValue) .startWith(this.properties.calculatedDefaultValue)
.map(x => !!x); .map(x => !x);
} }
} }

2
src/Squidex/app/features/schemas/pages/schema/types/number-validation.component.html

@ -20,7 +20,7 @@
</div> </div>
</div> </div>
<div class="form-group row" *ngIf="!(hideDefaultValue | async)"> <div class="form-group row" *ngIf="showDefaultValue | async">
<label class="col col-3 col-form-label" for="field-default-value">Default Value</label> <label class="col col-3 col-form-label" for="field-default-value">Default Value</label>
<div class="col col-6"> <div class="col col-6">

6
src/Squidex/app/features/schemas/pages/schema/types/number-validation.component.ts

@ -23,7 +23,7 @@ export class NumberValidationComponent implements OnInit {
@Input() @Input()
public properties: NumberFieldPropertiesDto; public properties: NumberFieldPropertiesDto;
public hideDefaultValue: Observable<boolean>; public showDefaultValue: Observable<boolean>;
public ngOnInit() { public ngOnInit() {
this.editForm.addControl('maxValue', this.editForm.addControl('maxValue',
@ -35,9 +35,9 @@ export class NumberValidationComponent implements OnInit {
this.editForm.addControl('defaultValue', this.editForm.addControl('defaultValue',
new FormControl(this.properties.defaultValue)); new FormControl(this.properties.defaultValue));
this.hideDefaultValue = this.showDefaultValue =
this.editForm.controls['isRequired'].valueChanges this.editForm.controls['isRequired'].valueChanges
.startWith(this.properties.isRequired) .startWith(this.properties.isRequired)
.map(x => !!x); .map(x => !x);
} }
} }

4
src/Squidex/app/features/schemas/pages/schema/types/string-validation.component.html

@ -27,7 +27,7 @@
<input type="text" class="form-control" id="field-pattern" formControlName="pattern" placeholder="Regex Pattern" /> <input type="text" class="form-control" id="field-pattern" formControlName="pattern" placeholder="Regex Pattern" />
</div> </div>
</div> </div>
<div class="form-group row" *ngIf="!(hidePatternMessage | async)"> <div class="form-group row" *ngIf="showPatternMessage | async">
<label class="col col-3 col-form-label" for="field-pattern-message">Pattern Message</label> <label class="col col-3 col-form-label" for="field-pattern-message">Pattern Message</label>
<div class="col col-6"> <div class="col col-6">
@ -35,7 +35,7 @@
</div> </div>
</div> </div>
<div class="form-group row" *ngIf="!(hideDefaultValue | async)"> <div class="form-group row" *ngIf="showDefaultValue | async">
<label class="col col-3 col-form-label" for="field-default-value">Default Value</label> <label class="col col-3 col-form-label" for="field-default-value">Default Value</label>
<div class="col col-6"> <div class="col col-6">

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

@ -25,8 +25,8 @@ export class StringValidationComponent implements OnDestroy, OnInit {
@Input() @Input()
public properties: StringFieldPropertiesDto; public properties: StringFieldPropertiesDto;
public hideDefaultValue: Observable<boolean>; public showDefaultValue: Observable<boolean>;
public hidePatternMessage: Observable<boolean>; public showPatternMessage: Observable<boolean>;
public ngOnDestroy() { public ngOnDestroy() {
this.patternSubscription.unsubscribe(); this.patternSubscription.unsubscribe();
@ -48,15 +48,15 @@ export class StringValidationComponent implements OnDestroy, OnInit {
this.editForm.setControl('defaultValue', this.editForm.setControl('defaultValue',
new FormControl(this.properties.defaultValue)); new FormControl(this.properties.defaultValue));
this.hideDefaultValue = this.showDefaultValue =
this.editForm.controls['isRequired'].valueChanges this.editForm.controls['isRequired'].valueChanges
.startWith(this.properties.isRequired) .startWith(this.properties.isRequired)
.map(x => !!x); .map(x => !x);
this.hidePatternMessage = this.showPatternMessage =
this.editForm.controls['pattern'].valueChanges this.editForm.controls['pattern'].valueChanges
.startWith('') .startWith('')
.map(x => !x || x.trim().length === 0); .map(x => x && x.trim().length > 0);
this.patternSubscription = this.patternSubscription =
this.editForm.controls['pattern'].valueChanges.subscribe((value: string) => { this.editForm.controls['pattern'].valueChanges.subscribe((value: string) => {

6
src/Squidex/app/features/schemas/pages/schemas/schemas-page.component.html

@ -33,15 +33,15 @@
<a class="nav-link" [routerLink]="[schema.name]" routerLinkActive="active"> <a class="nav-link" [routerLink]="[schema.name]" routerLinkActive="active">
<div class="row"> <div class="row">
<div class="col col-4"> <div class="col col-4">
<span class="schema-name">{{schema | displayName:'properties.label':'name'}}</span> <span class="schema-name">{{schema | sqxDisplayName:'properties.label':'name'}}</span>
</div> </div>
<div class="col col-4"> <div class="col col-4">
<span class="schema-user"> <span class="schema-user">
<i class="icon-user"></i> {{schema.lastModifiedBy | userNameRef}} <i class="icon-user"></i> {{schema.lastModifiedBy | sqxUserNameRef}}
</span> </span>
</div> </div>
<div class="col col-4 schema-modified"> <div class="col col-4 schema-modified">
<small class="item-modified">{{schema.lastModified | fromNow}}</small> <small class="item-modified">{{schema.lastModified | sqxFromNow}}</small>
<span class="item-published" [class.unpublished]="!schema.isPublished"></span> <span class="item-published" [class.unpublished]="!schema.isPublished"></span>
</div> </div>

2
src/Squidex/app/features/settings/pages/clients/client.component.html

@ -15,7 +15,7 @@
<div class="client-header"> <div class="client-header">
<form *ngIf="isRenaming" class="form-inline" [formGroup]="renameForm" (ngSubmit)="rename()"> <form *ngIf="isRenaming" class="form-inline" [formGroup]="renameForm" (ngSubmit)="rename()">
<div class="form-group mr-1"> <div class="form-group mr-1">
<sqx-control-errors for="name" [submitted]="renameFormSubmitted"></sqx-control-errors> <sqx-control-errors for="name"></sqx-control-errors>
<input type="text" class="form-control client-name enabled" formControlName="name" maxlength="20" sqxFocusOnInit (keydown)="onKeyDown($event.keyCode)" /> <input type="text" class="form-control client-name enabled" formControlName="name" maxlength="20" sqxFocusOnInit (keydown)="onKeyDown($event.keyCode)" />
</div> </div>

8
src/Squidex/app/features/settings/pages/contributors/contributors-page.component.html

@ -30,13 +30,13 @@
<ng-template ngFor let-contributor [ngForOf]="appContributors"> <ng-template ngFor let-contributor [ngForOf]="appContributors">
<tr> <tr>
<td> <td>
<img class="user-picture" [attr.title]="contributor.contributorId | userName" [attr.src]="contributor.contributorId | userPicture" /> <img class="user-picture" [attr.title]="contributor.contributorId | sqxUserName" [attr.src]="contributor.contributorId | sqxUserPicture" />
</td> </td>
<td> <td>
<span class="user-name table-cell">{{contributor.contributorId | userName}}</span> <span class="user-name table-cell">{{contributor.contributorId | sqxUserName}}</span>
</td> </td>
<td> <td>
<span class="user-email table-cell">{{contributor.contributorId | userEmail}}</span> <span class="user-email table-cell">{{contributor.contributorId | sqxUserEmail}}</span>
</td> </td>
<td> <td>
<select class="form-control" [ngModel]="contributor.permission" (ngModelChange)="changePermission(contributor, $event)" [disabled]="currentUserId === contributor.contributorId"> <select class="form-control" [ngModel]="contributor.permission" (ngModelChange)="changePermission(contributor, $event)" [disabled]="currentUserId === contributor.contributorId">
@ -59,7 +59,7 @@
<div class="form-group mr-1"> <div class="form-group mr-1">
<sqx-autocomplete [source]="usersDataSource" formControlName="user" [inputName]="'contributor'" placeholder="Find existing user" displayProperty="email"> <sqx-autocomplete [source]="usersDataSource" formControlName="user" [inputName]="'contributor'" placeholder="Find existing user" displayProperty="email">
<ng-template let-user="$implicit"> <ng-template let-user="$implicit">
<img class="user-picture autocomplete-user-picture" [attr.src]="user | userDtoPicture" /> <img class="user-picture autocomplete-user-picture" [attr.src]="user | sqxUserDtoPicture" />
<span class="user-name autocomplete-user-name">{{user.displayName}}</span> <span class="user-name autocomplete-user-name">{{user.displayName}}</span>
<span class="user-email autocomplete-user-email">{{user.email}}</span> <span class="user-email autocomplete-user-email">{{user.email}}</span>

2
src/Squidex/app/framework/angular/autocomplete.component.html

@ -6,7 +6,7 @@
autocapitalize="off"> autocapitalize="off">
<div *ngIf="items.length > 0" [sqxModalTarget]="input" class="control-dropdown" #container> <div *ngIf="items.length > 0" [sqxModalTarget]="input" class="control-dropdown" #container>
<div *ngFor="let item of items; let i = index;" class="control-dropdown-item control-dropdown-item-selectable" [class.active]="i === selectedIndex" (mousedown)="selectItem(item)" (mouseover)="selectIndex(i)" [sqxScrollActive]="i === itemSelection" [container]="container"> <div *ngFor="let item of items; let i = index;" class="control-dropdown-item control-dropdown-item-selectable" [class.active]="i === selectedIndex" (mousedown)="selectItem(item)" (mouseover)="selectIndex(i)" [sqxScrollActive]="i === selectedIndex" [container]="container">
<span *ngIf="!itemTemplate">{{item}}</span> <span *ngIf="!itemTemplate">{{item}}</span>
<ng-template *ngIf="itemTemplate" [sqxTemplateWrapper]="itemTemplate" [item]="item" [index]="i"></ng-template> <ng-template *ngIf="itemTemplate" [sqxTemplateWrapper]="itemTemplate" [item]="item" [index]="i"></ng-template>

24
src/Squidex/app/framework/angular/autocomplete.component.ts

@ -159,28 +159,28 @@ export class AutocompleteComponent implements ControlValueAccessor, OnDestroy, O
} }
} }
private up() { public selectIndex(selection: number) {
this.selectIndex(this.selectedIndex - 1); if (selection < 0) {
selection = 0;
} }
private down() { if (selection >= this.items.length) {
this.selectIndex(this.selectedIndex + 1); selection = this.items.length - 1;
} }
private resetValue() { this.selectedIndex = selection;
this.queryInput.setValue('');
} }
private selectIndex(selection: number) { private up() {
if (selection < 0) { this.selectIndex(this.selectedIndex - 1);
selection = 0;
} }
if (selection >= this.items.length) { private down() {
selection = this.items.length - 1; this.selectIndex(this.selectedIndex + 1);
} }
this.selectedIndex = selection; private resetValue() {
this.queryInput.setValue('');
} }
private reset() { private reset() {

2
src/Squidex/app/framework/angular/cloak.directive.ts

@ -8,7 +8,7 @@
import { Directive, ElementRef, OnInit, Renderer } from '@angular/core'; import { Directive, ElementRef, OnInit, Renderer } from '@angular/core';
@Directive({ @Directive({
selector: '.sqx-cloak' selector: '[sqxCloak]'
}) })
export class CloakDirective implements OnInit { export class CloakDirective implements OnInit {
constructor( constructor(

30
src/Squidex/app/framework/angular/date-time.pipes.ts

@ -5,76 +5,76 @@
* Copyright (c) Sebastian Stehle. All rights reserved * Copyright (c) Sebastian Stehle. All rights reserved
*/ */
import { Pipe } from '@angular/core'; import { Pipe, PipeTransform } from '@angular/core';
import { DateTime } from './../utils/date-time'; import { DateTime } from './../utils/date-time';
import { Duration } from './../utils/duration'; import { Duration } from './../utils/duration';
@Pipe({ @Pipe({
name: 'shortDate', name: 'sqxShortDate',
pure: true pure: true
}) })
export class ShortDatePipe { export class ShortDatePipe implements PipeTransform {
public transform(value: DateTime): any { public transform(value: DateTime): any {
return value.toStringFormat('DD.MMM'); return value.toStringFormat('DD.MMM');
} }
} }
@Pipe({ @Pipe({
name: 'month', name: 'sqxMonth',
pure: true pure: true
}) })
export class MonthPipe { export class MonthPipe implements PipeTransform {
public transform(value: DateTime): any { public transform(value: DateTime): any {
return value.toStringFormat('MMMM'); return value.toStringFormat('MMMM');
} }
} }
@Pipe({ @Pipe({
name: 'fromNow', name: 'sqxFromNow',
pure: true pure: true
}) })
export class FromNowPipe { export class FromNowPipe implements PipeTransform {
public transform(value: DateTime): any { public transform(value: DateTime): any {
return value.toFromNow(); return value.toFromNow();
} }
} }
@Pipe({ @Pipe({
name: 'dayOfWeek', name: 'sqxDayOfWeek',
pure: true pure: true
}) })
export class DayOfWeekPipe { export class DayOfWeekPipe implements PipeTransform {
public transform(value: DateTime): any { public transform(value: DateTime): any {
return value.toStringFormat('dd'); return value.toStringFormat('dd');
} }
} }
@Pipe({ @Pipe({
name: 'day', name: 'sqxDay',
pure: true pure: true
}) })
export class DayPipe { export class DayPipe implements PipeTransform {
public transform(value: DateTime): any { public transform(value: DateTime): any {
return value.toStringFormat('DD'); return value.toStringFormat('DD');
} }
} }
@Pipe({ @Pipe({
name: 'shortTime', name: 'sqxShortTime',
pure: true pure: true
}) })
export class ShortTimePipe { export class ShortTimePipe implements PipeTransform {
public transform(value: DateTime): any { public transform(value: DateTime): any {
return value.toStringFormat('HH:mm'); return value.toStringFormat('HH:mm');
} }
} }
@Pipe({ @Pipe({
name: 'duration', name: 'sqxDuration',
pure: true pure: true
}) })
export class DurationPipe { export class DurationPipe implements PipeTransform {
public transform(value: Duration): any { public transform(value: Duration): any {
return value.toString(); return value.toString();
} }

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

@ -20,11 +20,12 @@ export class EntityCreatedDto {
export class ErrorDto { export class ErrorDto {
public get displayMessage(): string { public get displayMessage(): string {
let result = this.message; let result = this.message;
let lastChar = '';
if (this.details && this.details.length > 0) { if (this.details && this.details.length > 0) {
const detailMessage = this.details[0]; const detailMessage = this.details[0];
const lastChar = result[result.length - 1]; lastChar = result[result.length - 1];
if (lastChar !== '.' && lastChar !== ',') { if (lastChar !== '.' && lastChar !== ',') {
result += '.'; result += '.';
@ -34,7 +35,7 @@ export class ErrorDto {
result += detailMessage; result += detailMessage;
} }
const lastChar = result[result.length - 1]; lastChar = result[result.length - 1];
if (lastChar !== '.') { if (lastChar !== '.') {
result += '.'; result += '.';

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

@ -9,6 +9,8 @@ import { Observable } from 'rxjs/Observable';
import { pretifyError } from './http-extensions-impl'; import { pretifyError } from './http-extensions-impl';
/* tslint:disable:no-shadowed-variable */
declare module 'rxjs/Observable' { declare module 'rxjs/Observable' {
interface Observable<T> { interface Observable<T> {
pretifyError(message: string): Observable<any>; pretifyError(message: string): Observable<any>;

2
src/Squidex/app/framework/angular/image-source.directive.ts

@ -12,7 +12,7 @@ import { MathHelper } from './../utils/math-helper';
@Directive({ @Directive({
selector: '[sqxImageSource]' selector: '[sqxImageSource]'
}) })
export class ImageSourceComponent implements OnChanges, OnInit, AfterViewInit { export class ImageSourceDirective implements OnChanges, OnInit, AfterViewInit {
private retries = 0; private retries = 0;
private query: string | null = null; private query: string | null = null;

25
src/Squidex/app/framework/angular/indeterminate-value.directive.ts

@ -5,7 +5,7 @@
* Copyright (c) Sebastian Stehle. All rights reserved * Copyright (c) Sebastian Stehle. All rights reserved
*/ */
import { Directive, forwardRef, ElementRef, Renderer } from '@angular/core'; import { Directive, forwardRef, ElementRef, HostListener, Renderer } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
const NOOP = () => { /* NOOP */ }; const NOOP = () => { /* NOOP */ };
@ -16,10 +16,7 @@ export const SQX_INDETERMINATE_VALUE_CONTROL_VALUE_ACCESSOR: any = {
@Directive({ @Directive({
selector: '[sqxIndeterminateValue]', selector: '[sqxIndeterminateValue]',
providers: [SQX_INDETERMINATE_VALUE_CONTROL_VALUE_ACCESSOR], providers: [SQX_INDETERMINATE_VALUE_CONTROL_VALUE_ACCESSOR]
host: {
'(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()'
}
}) })
export class IndeterminateValueDirective implements ControlValueAccessor { export class IndeterminateValueDirective implements ControlValueAccessor {
private changeCallback: (value: any) => void = NOOP; private changeCallback: (value: any) => void = NOOP;
@ -31,6 +28,16 @@ export class IndeterminateValueDirective implements ControlValueAccessor {
) { ) {
} }
@HostListener('onChange', ['$event.target.value'])
public onChange(value: any) {
this.changeCallback(value);
}
@HostListener('blur')
public onTouched() {
this.touchedCallback();
}
public writeValue(value: any) { public writeValue(value: any) {
if (value === undefined || value === null) { if (value === undefined || value === null) {
this.renderer.setElementProperty(this.element.nativeElement, 'indeterminate', true); this.renderer.setElementProperty(this.element.nativeElement, 'indeterminate', true);
@ -50,12 +57,4 @@ export class IndeterminateValueDirective implements ControlValueAccessor {
public registerOnTouched(fn: any) { public registerOnTouched(fn: any) {
this.touchedCallback = fn; this.touchedCallback = fn;
} }
public onChange(value: any) {
this.changeCallback(value);
}
public onTouched() {
this.touchedCallback();
}
} }

31
src/Squidex/app/framework/angular/lowercase-input.directive.ts

@ -5,7 +5,7 @@
* Copyright (c) Sebastian Stehle. All rights reserved * Copyright (c) Sebastian Stehle. All rights reserved
*/ */
import { Directive, forwardRef, ElementRef, Renderer } from '@angular/core'; import { Directive, forwardRef, ElementRef, HostListener, Renderer } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
const NOOP = () => { /* NOOP */ }; const NOOP = () => { /* NOOP */ };
@ -16,10 +16,7 @@ export const SQX_LOWERCASE_INPUT_VALUE_ACCESSOR: any = {
@Directive({ @Directive({
selector: '[sqxLowerCaseInput]', selector: '[sqxLowerCaseInput]',
providers: [SQX_LOWERCASE_INPUT_VALUE_ACCESSOR], providers: [SQX_LOWERCASE_INPUT_VALUE_ACCESSOR]
host: {
'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'
}
}) })
export class LowerCaseInputDirective implements ControlValueAccessor { export class LowerCaseInputDirective implements ControlValueAccessor {
private changeCallback: (value: any) => void = NOOP; private changeCallback: (value: any) => void = NOOP;
@ -31,6 +28,19 @@ export class LowerCaseInputDirective implements ControlValueAccessor {
) { ) {
} }
@HostListener('onChange', ['$event.target.value'])
public onChange(value: any) {
const normalizedValue = (value == null ? '' : value.toString()).toLowerCase();
this.renderer.setElementProperty(this.element.nativeElement, 'value', normalizedValue);
this.changeCallback(normalizedValue);
}
@HostListener('blur')
public onTouched() {
this.touchedCallback();
}
public writeValue(value: any) { public writeValue(value: any) {
const normalizedValue = (value == null ? '' : value.toString()).toLowerCase(); const normalizedValue = (value == null ? '' : value.toString()).toLowerCase();
@ -48,15 +58,4 @@ export class LowerCaseInputDirective implements ControlValueAccessor {
public registerOnTouched(fn: any) { public registerOnTouched(fn: any) {
this.touchedCallback = fn; this.touchedCallback = fn;
} }
public onChange(value: any) {
const normalizedValue = (value == null ? '' : value.toString()).toLowerCase();
this.renderer.setElementProperty(this.element.nativeElement, 'value', normalizedValue);
this.changeCallback(normalizedValue);
}
public onTouched() {
this.touchedCallback();
}
} }

6
src/Squidex/app/framework/angular/money.pipe.ts

@ -5,15 +5,15 @@
* Copyright (c) Sebastian Stehle. All rights reserved * Copyright (c) Sebastian Stehle. All rights reserved
*/ */
import { Pipe } from '@angular/core'; import { Pipe, PipeTransform } from '@angular/core';
import { CurrencyConfig, DecimalSeparatorConfig } from './../configurations'; import { CurrencyConfig, DecimalSeparatorConfig } from './../configurations';
@Pipe({ @Pipe({
name: 'money', name: 'sqxMoney',
pure: true pure: true
}) })
export class MoneyPipe { export class MoneyPipe implements PipeTransform {
constructor( constructor(
private readonly currency: CurrencyConfig, private readonly currency: CurrencyConfig,
private readonly separator: DecimalSeparatorConfig private readonly separator: DecimalSeparatorConfig

6
src/Squidex/app/framework/angular/name.pipe.ts

@ -5,15 +5,15 @@
* Copyright (c) Sebastian Stehle. All rights reserved * Copyright (c) Sebastian Stehle. All rights reserved
*/ */
import { Pipe } from '@angular/core'; import { Pipe, PipeTransform } from '@angular/core';
import { StringHelper } from './../utils/string-helper'; import { StringHelper } from './../utils/string-helper';
@Pipe({ @Pipe({
name: 'displayName', name: 'sqxDisplayName',
pure: true pure: true
}) })
export class DisplayNamePipe { export class DisplayNamePipe implements PipeTransform {
public transform(value: any, field1 = 'label', field2 = 'name'): any { public transform(value: any, field1 = 'label', field2 = 'name'): any {
if (!value) { if (!value) {
return ''; return '';

2
src/Squidex/app/framework/angular/panel-container.directive.ts

@ -10,7 +10,7 @@ import { AfterViewInit, Directive, ElementRef, HostListener, OnDestroy, Renderer
import { PanelComponent } from './panel.component'; import { PanelComponent } from './panel.component';
@Directive({ @Directive({
selector: '.panel-container' selector: '[sqxPanelContainer]'
}) })
export class PanelContainerDirective implements AfterViewInit, OnDestroy { export class PanelContainerDirective implements AfterViewInit, OnDestroy {
private readonly panels: PanelComponent[] = []; private readonly panels: PanelComponent[] = [];

4
src/Squidex/app/framework/angular/sorted.directive.ts

@ -15,12 +15,12 @@ import {
} from 'ng2-dnd'; } from 'ng2-dnd';
@Directive({ @Directive({
selector: '[sorted]' selector: '[sqxSorted]'
}) })
export class SortedDirective { export class SortedDirective {
private oldArray: any[]; private oldArray: any[];
@Output() @Output('sqxSorted')
public sorted = new EventEmitter<Array<any>>(); public sorted = new EventEmitter<Array<any>>();
constructor( constructor(

2
src/Squidex/app/framework/angular/template-wrapper.directive.ts

@ -10,7 +10,7 @@ import { Directive, EmbeddedViewRef, Input, OnChanges, OnDestroy, OnInit, Simple
@Directive({ @Directive({
selector: '[sqxTemplateWrapper]' selector: '[sqxTemplateWrapper]'
}) })
export class TemplateWrapper implements OnInit, OnDestroy, OnChanges { export class TemplateWrapperDirective implements OnInit, OnDestroy, OnChanges {
@Input() @Input()
public item: any; public item: any;

18
src/Squidex/app/framework/angular/validators.ts

@ -14,20 +14,20 @@ import {
import { DateTime } from './../utils/date-time'; import { DateTime } from './../utils/date-time';
export module ValidatorsEx { export module ValidatorsEx {
export function pattern(pattern: string | RegExp, message?: string): ValidatorFn { export function pattern(regex: string | RegExp, message?: string): ValidatorFn {
if (!pattern) { if (!regex) {
return Validators.nullValidator; return Validators.nullValidator;
} }
let regex: RegExp; let regeExp: RegExp;
let regexStr: string; let regexStr: string;
if (typeof pattern === 'string') { if (typeof regex === 'string') {
regexStr = `^${pattern}$`; regexStr = `^${regex}$`;
regex = new RegExp(regexStr); regeExp = new RegExp(regexStr);
} else { } else {
regexStr = pattern.toString(); regexStr = regex.toString();
regex = pattern; regeExp = regex;
} }
return (control: AbstractControl): { [key: string]: any } => { return (control: AbstractControl): { [key: string]: any } => {
@ -37,7 +37,7 @@ export module ValidatorsEx {
return null; return null;
} }
if (!regex.test(n)) { if (!regeExp.test(n)) {
if (message) { if (message) {
return { patternmessage: { requiredPattern: regexStr, actualValue: n, message } }; return { patternmessage: { requiredPattern: regexStr, actualValue: n, message } };
} else { } else {

12
src/Squidex/app/framework/module.ts

@ -29,7 +29,7 @@ import {
FocusOnInitDirective, FocusOnInitDirective,
FromNowPipe, FromNowPipe,
GeolocationEditorComponent, GeolocationEditorComponent,
ImageSourceComponent, ImageSourceDirective,
IndeterminateValueDirective, IndeterminateValueDirective,
JsonEditorComponent, JsonEditorComponent,
LocalStoreService, LocalStoreService,
@ -59,7 +59,7 @@ import {
SortedDirective, SortedDirective,
StarsComponent, StarsComponent,
TagEditorComponent, TagEditorComponent,
TemplateWrapper, TemplateWrapperDirective,
TitleService, TitleService,
TitleComponent, TitleComponent,
ToggleComponent, ToggleComponent,
@ -90,7 +90,7 @@ import {
FocusOnInitDirective, FocusOnInitDirective,
FromNowPipe, FromNowPipe,
GeolocationEditorComponent, GeolocationEditorComponent,
ImageSourceComponent, ImageSourceDirective,
IndeterminateValueDirective, IndeterminateValueDirective,
JsonEditorComponent, JsonEditorComponent,
LowerCaseInputDirective, LowerCaseInputDirective,
@ -114,7 +114,7 @@ import {
SortedDirective, SortedDirective,
StarsComponent, StarsComponent,
TagEditorComponent, TagEditorComponent,
TemplateWrapper, TemplateWrapperDirective,
TitleComponent, TitleComponent,
ToggleComponent, ToggleComponent,
UserReportComponent UserReportComponent
@ -135,7 +135,7 @@ import {
FocusOnInitDirective, FocusOnInitDirective,
FromNowPipe, FromNowPipe,
GeolocationEditorComponent, GeolocationEditorComponent,
ImageSourceComponent, ImageSourceDirective,
IndeterminateValueDirective, IndeterminateValueDirective,
JsonEditorComponent, JsonEditorComponent,
LowerCaseInputDirective, LowerCaseInputDirective,
@ -159,7 +159,7 @@ import {
SortedDirective, SortedDirective,
StarsComponent, StarsComponent,
TagEditorComponent, TagEditorComponent,
TemplateWrapper, TemplateWrapperDirective,
TitleComponent, TitleComponent,
ToggleComponent, ToggleComponent,
UserReportComponent, UserReportComponent,

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

@ -31,15 +31,15 @@ export class ImmutableArray<T> implements Iterable<T> {
this.items = items; this.items = items;
} }
public static empty<T>(): ImmutableArray<T> { public static empty<V>(): ImmutableArray<V> {
return ImmutableArray.EMPTY; return ImmutableArray.EMPTY;
} }
public static of<T>(items?: T[]): ImmutableArray<T> { public static of<V>(items?: V[]): ImmutableArray<V> {
if (!items || items.length === 0) { if (!items || items.length === 0) {
return ImmutableArray.EMPTY; return ImmutableArray.EMPTY;
} else { } else {
return new ImmutableArray<T>(freeze([...items])); return new ImmutableArray<V>(freeze([...items]));
} }
} }

4
src/Squidex/app/shared/components/asset.component.html

@ -33,10 +33,10 @@
{{fileType}} {{fileType}}
</span> </span>
<span class="file-user"> <span class="file-user">
<i class="icon-user"></i> {{asset.lastModifiedBy | userNameRef}} <i class="icon-user"></i> {{asset.lastModifiedBy | sqxUserNameRef}}
</span> </span>
<span class="file-modified"> <span class="file-modified">
{{asset.lastModified | fromNow}} {{asset.lastModified | sqxFromNow}}
</span> </span>
</div> </div>
</div> </div>

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

@ -192,7 +192,7 @@ export class AssetComponent extends AppComponentBase implements OnInit {
} }
} }
private resetRename() { public resetRename() {
this.renameForm.enable(); this.renameForm.enable();
this.renameForm.controls['name'].setValue(this.asset.fileName); this.renameForm.controls['name'].setValue(this.asset.fileName);
this.renameFormSubmitted = false; this.renameFormSubmitted = false;

6
src/Squidex/app/shared/components/history.component.html

@ -13,13 +13,13 @@
<div class="panel-content panel-content-blank"> <div class="panel-content panel-content-blank">
<div *ngFor="let event of events | async" class="event"> <div *ngFor="let event of events | async" class="event">
<div class="event-left"> <div class="event-left">
<img class="user-picture" [attr.title]="event.actor | userNameRef:'I'" [attr.src]="event.actor | userPictureRef" /> <img class="user-picture" [attr.title]="event.actor | sqxUserNameRef:'I'" [attr.src]="event.actor | sqxUserPictureRef" />
</div> </div>
<div class="event-main"> <div class="event-main">
<div class="event-message"> <div class="event-message">
<span class="event-actor user-ref">{{event.actor | userNameRef:'I'}}</span> <span [innerHTML]="format(event.message) | async"></span> <span class="event-actor user-ref">{{event.actor | sqxUserNameRef:'I'}}</span> <span [innerHTML]="format(event.message) | async"></span>
</div> </div>
<div class="event-created">{{event.created | fromNow}}</div> <div class="event-created">{{event.created | sqxFromNow}}</div>
</div> </div>
</div> </div>
</div> </div>

16
src/Squidex/app/shared/components/pipes.ts

@ -49,7 +49,7 @@ class UserAsyncPipe implements OnDestroy {
} }
@Pipe({ @Pipe({
name: 'userName', name: 'sqxUserName',
pure: false pure: false
}) })
export class UserNamePipe extends UserAsyncPipe implements PipeTransform { export class UserNamePipe extends UserAsyncPipe implements PipeTransform {
@ -63,7 +63,7 @@ export class UserNamePipe extends UserAsyncPipe implements PipeTransform {
} }
@Pipe({ @Pipe({
name: 'userNameRef', name: 'sqxUserNameRef',
pure: false pure: false
}) })
export class UserNameRefPipe extends UserAsyncPipe implements PipeTransform { export class UserNameRefPipe extends UserAsyncPipe implements PipeTransform {
@ -89,7 +89,7 @@ export class UserNameRefPipe extends UserAsyncPipe implements PipeTransform {
} }
@Pipe({ @Pipe({
name: 'userEmail', name: 'sqxUserEmail',
pure: false pure: false
}) })
export class UserEmailPipe extends UserAsyncPipe implements PipeTransform { export class UserEmailPipe extends UserAsyncPipe implements PipeTransform {
@ -103,7 +103,7 @@ export class UserEmailPipe extends UserAsyncPipe implements PipeTransform {
} }
@Pipe({ @Pipe({
name: 'userEmailRef', name: 'sqxUserEmailRef',
pure: false pure: false
}) })
export class UserEmailRefPipe extends UserAsyncPipe implements PipeTransform { export class UserEmailRefPipe extends UserAsyncPipe implements PipeTransform {
@ -125,7 +125,7 @@ export class UserEmailRefPipe extends UserAsyncPipe implements PipeTransform {
} }
@Pipe({ @Pipe({
name: 'userDtoPicture', name: 'sqxUserDtoPicture',
pure: false pure: false
}) })
export class UserDtoPicture implements PipeTransform { export class UserDtoPicture implements PipeTransform {
@ -140,7 +140,7 @@ export class UserDtoPicture implements PipeTransform {
} }
@Pipe({ @Pipe({
name: 'userIdPicture', name: 'sqxUserIdPicture',
pure: false pure: false
}) })
export class UserIdPicturePipe implements PipeTransform { export class UserIdPicturePipe implements PipeTransform {
@ -155,7 +155,7 @@ export class UserIdPicturePipe implements PipeTransform {
} }
@Pipe({ @Pipe({
name: 'userPicture', name: 'sqxUserPicture',
pure: false pure: false
}) })
export class UserPicturePipe extends UserAsyncPipe implements PipeTransform { export class UserPicturePipe extends UserAsyncPipe implements PipeTransform {
@ -171,7 +171,7 @@ export class UserPicturePipe extends UserAsyncPipe implements PipeTransform {
} }
@Pipe({ @Pipe({
name: 'userPictureRef', name: 'sqxUserPictureRef',
pure: false pure: false
}) })
export class UserPictureRefPipe extends UserAsyncPipe implements PipeTransform { export class UserPictureRefPipe extends UserAsyncPipe implements PipeTransform {

2
src/Squidex/app/shell/pages/app/app-area.component.html

@ -2,6 +2,6 @@
<sqx-left-menu></sqx-left-menu> <sqx-left-menu></sqx-left-menu>
</div> </div>
<div class="panel-container"> <div sqxPanelContainer class="panel-container">
<router-outlet></router-outlet> <router-outlet></router-outlet>
</div> </div>

2
src/Squidex/app/shell/pages/home/home-page.component.ts

@ -11,7 +11,7 @@ import { Router } from '@angular/router';
import { AuthService } from 'shared'; import { AuthService } from 'shared';
@Component({ @Component({
selector: 'home-page', selector: 'sqx-home-page',
styleUrls: ['./home-page.component.scss'], styleUrls: ['./home-page.component.scss'],
templateUrl: './home-page.component.html' templateUrl: './home-page.component.html'
}) })

2
src/Squidex/app/shell/pages/internal/profile-menu.component.html

@ -2,7 +2,7 @@
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<span class="nav-link dropdown-toggle" (click)="modalMenu.toggle()"> <span class="nav-link dropdown-toggle" (click)="modalMenu.toggle()">
<span class="user"> <span class="user">
<img class="user-picture" [attr.src]="profileId | userIdPicture" /> <img class="user-picture" [attr.src]="profileId | sqxUserIdPicture" />
</span> </span>
</span> </span>

4
src/Squidex/package.json

@ -74,7 +74,7 @@
"karma-mocha-reporter": "2.2.3", "karma-mocha-reporter": "2.2.3",
"karma-phantomjs-launcher": "1.0.4", "karma-phantomjs-launcher": "1.0.4",
"karma-sourcemap-loader": "0.3.7", "karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.3", "karma-webpack": "2.0.4",
"node-sass": "4.5.3", "node-sass": "4.5.3",
"noop-loader": "^1.0.0", "noop-loader": "^1.0.0",
"null-loader": "0.1.1", "null-loader": "0.1.1",
@ -84,7 +84,7 @@
"sass-lint": "1.10.2", "sass-lint": "1.10.2",
"sass-loader": "6.0.6", "sass-loader": "6.0.6",
"style-loader": "0.18.2", "style-loader": "0.18.2",
"tslint": "4.5.1", "tslint": "5.5.0",
"tslint-loader": "3.5.3", "tslint-loader": "3.5.3",
"typemoq": "1.7.0", "typemoq": "1.7.0",
"typescript": "2.4.1", "typescript": "2.4.1",

12
src/Squidex/tsconfig.json

@ -13,9 +13,15 @@
"suppressImplicitAnyIndexErrors": true, "suppressImplicitAnyIndexErrors": true,
"target": "es5", "target": "es5",
"paths": { "paths": {
"framework": ["app/framework"], "framework": [
"features": ["app/features"], "app/framework"
"shared": ["app/shared"] ],
"features": [
"app/features"
],
"shared": [
"app/shared"
]
} }
} }
} }

40
src/Squidex/tslint.json

@ -1,17 +1,37 @@
{ {
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": { "rules": {
"angular-whitespace": false,
"banana-in-box": true,
"class-name": true, "class-name": true,
"comment-format": [ "comment-format": [
true, true,
"check-space" "check-space"
], ],
"component-class-suffix": true,
"component-selector": [
true,
"element",
"sqx",
"kebab-case"
],
"curly": true, "curly": true,
"directive-class-suffix": true,
"directive-selector": [
true,
"attribute",
"sqx",
"camelCase"
],
"eofline": false, "eofline": false,
"forin": true, "forin": true,
"indent": [ "indent": [
true, true,
"spaces" "spaces"
], ],
"invoke-injectable": true,
"label-position": true, "label-position": true,
"max-line-length": [ "max-line-length": [
true, true,
@ -21,7 +41,9 @@
true, true,
"check-accessor" "check-accessor"
], ],
"no-access-missing-member": false,
"no-arg": true, "no-arg": true,
"no-attribute-parameter-decorator": true,
"no-bitwise": true, "no-bitwise": true,
"no-console": [ "no-console": [
true, true,
@ -36,15 +58,17 @@
"no-duplicate-variable": true, "no-duplicate-variable": true,
"no-empty": true, "no-empty": true,
"no-eval": true, "no-eval": true,
"no-forward-ref": false,
"no-inferrable-types": [ "no-inferrable-types": [
true, true,
"ignore-params" "ignore-params"
], ],
"no-input-rename": false,
"no-output-rename": false,
"no-shadowed-variable": true, "no-shadowed-variable": true,
"no-string-literal": false, "no-string-literal": false,
"no-switch-case-fall-through": true, "no-switch-case-fall-through": true,
"no-trailing-whitespace": true, "no-trailing-whitespace": true,
"no-unused-expression": true, "no-unused-expression": true,
"no-use-before-declare": true, "no-use-before-declare": true,
"no-var-keyword": true, "no-var-keyword": true,
@ -63,6 +87,11 @@
"ordered-imports": [ "ordered-imports": [
false false
], ],
"pipe-naming": [
true,
"camelCase",
"sqx"
],
"prefer-for-of": true, "prefer-for-of": true,
"quotemark": [ "quotemark": [
true, true,
@ -72,6 +101,9 @@
"semicolon": [ "semicolon": [
"always" "always"
], ],
"templates-no-negated-async": true,
"templates-use-public": true,
"template-to-ng-template": true,
"trailing-comma": [ "trailing-comma": [
true, true,
{ {
@ -93,6 +125,12 @@
"variable-declaration": "nospace" "variable-declaration": "nospace"
} }
], ],
"use-host-property-decorator": true,
"use-input-property-decorator": true,
"use-life-cycle-interface": true,
"use-output-property-decorator": true,
"use-pipe-transform-interface": true,
"use-view-encapsulation": true,
"variable-name": false, "variable-name": false,
"whitespace": [ "whitespace": [
true, true,

Loading…
Cancel
Save