Browse Source

Javascript features bumped.

pull/65/head
Sebastian Stehle 9 years ago
parent
commit
92622e5564
  1. 2
      src/Squidex.Events/Schemas/WebhookAdded.cs
  2. 13
      src/Squidex.Infrastructure/RandomHash.cs
  3. 2
      src/Squidex.Read.MongoDb/Schemas/MongoSchemaWebhookEntity.cs
  4. 6
      src/Squidex.Read/Schemas/ISchemaWebhookEntity.cs
  5. 11
      src/Squidex.Read/Schemas/WebhookInvoker.cs
  6. 2
      src/Squidex.Write/Schemas/Commands/AddWebhook.cs
  7. 4
      src/Squidex/Controllers/Api/Webhooks/Models/WebhookDto.cs
  8. 6
      src/Squidex/app/features/administration/pages/users/user-page.component.ts
  9. 12
      src/Squidex/app/features/content/pages/content/content-page.component.ts
  10. 4
      src/Squidex/app/features/dashboard/pages/dashboard-page.component.ts
  11. 8
      src/Squidex/app/features/schemas/pages/schema/schema-page.component.ts
  12. 2
      src/Squidex/app/features/schemas/pages/schema/types/boolean-validation.component.ts
  13. 4
      src/Squidex/app/features/schemas/pages/schema/types/date-time-validation.component.ts
  14. 4
      src/Squidex/app/features/schemas/pages/schema/types/number-ui.component.ts
  15. 2
      src/Squidex/app/features/schemas/pages/schema/types/number-validation.component.ts
  16. 4
      src/Squidex/app/features/schemas/pages/schema/types/string-ui.component.ts
  17. 8
      src/Squidex/app/features/schemas/pages/schema/types/string-validation.component.ts
  18. 6
      src/Squidex/app/features/schemas/pages/schemas/schema-form.component.ts
  19. 4
      src/Squidex/app/features/settings/pages/clients/client.component.ts
  20. 4
      src/Squidex/app/features/settings/pages/clients/clients-page.component.ts
  21. 2
      src/Squidex/app/features/settings/pages/contributors/contributors-page.component.ts
  22. 10
      src/Squidex/app/features/settings/pages/languages/language.component.ts
  23. 2
      src/Squidex/app/features/settings/pages/languages/languages-page.component.ts
  24. 4
      src/Squidex/app/features/settings/pages/plans/plans-page.component.ts
  25. 6
      src/Squidex/app/features/webhooks/pages/webhooks-page.component.html
  26. 6
      src/Squidex/app/features/webhooks/pages/webhooks-page.component.ts
  27. 2
      src/Squidex/app/framework/angular/control-errors.component.ts
  28. 4
      src/Squidex/app/framework/angular/geolocation-editor.component.ts
  29. 2
      src/Squidex/app/framework/angular/parent-link.directive.ts
  30. 6
      src/Squidex/app/shared/components/app-form.component.ts
  31. 4
      src/Squidex/app/shared/components/asset.component.ts
  32. 4
      src/Squidex/app/shared/services/app-languages.service.spec.ts
  33. 2
      src/Squidex/app/shared/services/app-languages.service.ts
  34. 2
      src/Squidex/app/shared/services/users.service.spec.ts
  35. 6
      src/Squidex/app/shared/services/webhooks.service.spec.ts
  36. 6
      src/Squidex/app/shared/services/webhooks.service.ts
  37. 44
      src/Squidex/package.json
  38. 4
      tests/Squidex.Write.Tests/Schemas/SchemaDomainObjectTests.cs

2
src/Squidex.Events/Schemas/WebhookAdded.cs

@ -18,6 +18,6 @@ namespace Squidex.Events.Schemas
public Uri Url { get; set; }
public string SecurityToken { get; set; }
public string SharedSecret { get; set; }
}
}

13
src/Squidex.Infrastructure/RandomHash.cs

@ -15,13 +15,20 @@ namespace Squidex.Infrastructure
public static class RandomHash
{
public static string New()
{
return Guid.NewGuid().ToString().Sha256Base64().Replace("+", "x");
}
public static string Sha256Base64(this string value)
{
using (var sha = SHA256.Create())
{
var bytes = Encoding.UTF8.GetBytes(Guid.NewGuid().ToString());
var hash = sha.ComputeHash(bytes);
var bytesValue = Encoding.UTF8.GetBytes(value);
var bytesHash = sha.ComputeHash(bytesValue);
var result = Convert.ToBase64String(bytesHash);
return Convert.ToBase64String(hash).Replace("+", "x");
return result;
}
}
}

2
src/Squidex.Read.MongoDb/Schemas/MongoSchemaWebhookEntity.cs

@ -26,7 +26,7 @@ namespace Squidex.Read.MongoDb.Schemas
[BsonRequired]
[BsonElement]
public string SecurityToken { get; set; }
public string SharedSecret { get; set; }
[BsonRequired]
[BsonElement]

6
src/Squidex.Read/Schemas/ISchemaWebhookEntity.cs

@ -12,12 +12,12 @@ namespace Squidex.Read.Schemas
{
public interface ISchemaWebhookEntity
{
Guid Id { get; }
Guid SchemaId { get; }
Guid Id { get; }
Uri Url { get; }
string SecurityToken { get; }
string SharedSecret { get; }
}
}

11
src/Squidex.Read/Schemas/WebhookInvoker.cs

@ -13,6 +13,7 @@ using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NodaTime;
using Squidex.Events.Contents;
using Squidex.Infrastructure;
using Squidex.Infrastructure.CQRS.Events;
@ -71,7 +72,7 @@ namespace Squidex.Read.Schemas
foreach (var hook in schemaHooks)
{
DispatchEventAsync(payload, hook).Forget();
DispatchEventAsync(payload, hook, @event.Headers.Timestamp()).Forget();
}
}
}
@ -85,7 +86,7 @@ namespace Squidex.Read.Schemas
new JProperty("data", JObject.FromObject(@event.Payload, webhookSerializer)));
}
private async Task DispatchEventAsync(JObject payload, ISchemaWebhookEntity webhook)
private async Task DispatchEventAsync(JObject payload, ISchemaWebhookEntity webhook, Instant instant)
{
try
{
@ -93,6 +94,10 @@ namespace Squidex.Read.Schemas
.WriteProperty("Action", "SendToHook")
.WriteProperty("Status", "Invoked")))
{
var signature = $"{instant.ToUnixTimeSeconds()}{webhook.SharedSecret}".Sha256Base64();
payload["Signature"] = signature;
using (var client = new HttpClient())
{
client.Timeout = Timeout;
@ -102,7 +107,7 @@ namespace Squidex.Read.Schemas
Content = new StringContent(payload.ToString(), Encoding.UTF8, "application/json")
};
message.Headers.TryAddWithoutValidation("X-SecurityToken", webhook.SecurityToken);
message.Headers.TryAddWithoutValidation("X-Signature", signature);
message.Headers.Add("User-Agent", "Squidex");
var response = await client.SendAsync(message);

2
src/Squidex.Write/Schemas/Commands/AddWebhook.cs

@ -18,7 +18,7 @@ namespace Squidex.Write.Schemas.Commands
public Uri Url { get; set; }
public string SecurityToken { get; } = RandomHash.New();
public string SharedSecret { get; } = RandomHash.New();
public void Validate(IList<ValidationError> errors)
{

4
src/Squidex/Controllers/Api/Webhooks/Models/WebhookDto.cs

@ -30,9 +30,9 @@ namespace Squidex.Controllers.Api.Webhooks.Models
public Uri Url { get; set; }
/// <summary>
/// The security token that is added as request header.
/// The shared secret that is used to calculate the signature.
/// </summary>
[Required]
public string SecurityToken { get; set; }
public string SharedSecret { get; set; }
}
}

6
src/Squidex/app/features/administration/pages/users/user-page.component.ts

@ -30,7 +30,7 @@ export class UserPageComponent extends ComponentBase implements OnInit {
public userFormSubmitted = false;
public userForm: FormGroup;
public userId: string;
public userFormError: string;
public userFormError? = '';
public isCurrentUser = false;
public isNewMode = false;
@ -65,7 +65,7 @@ export class UserPageComponent extends ComponentBase implements OnInit {
const enable = (message?: string) => {
this.userForm.enable();
this.userForm.get('password').reset();
this.userForm.controls['password'].reset();
this.userFormSubmitted = false;
this.userFormError = message;
};
@ -82,7 +82,7 @@ export class UserPageComponent extends ComponentBase implements OnInit {
created.id,
requestDto.email,
requestDto.displayName,
created.pictureUrl));
created.pictureUrl!));
this.notifyInfo('User created successfully.');
back();

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

@ -179,17 +179,13 @@ export class ContentPageComponent extends AppComponentBase implements CanCompone
this.contentForm.markAsPristine();
for (const field of this.schema.fields.filter(f => !f.isDisabled)) {
const fieldForm = this.contentForm.get(field.name);
fieldForm.enable();
this.contentForm.controls[field.name].enable();
}
}
private disable() {
for (const field of this.schema.fields.filter(f => !f.isDisabled)) {
const fieldForm = this.contentForm.get(field.name);
fieldForm.disable();
this.contentForm.controls[field.name].disable();
}
}
@ -256,10 +252,10 @@ export class ContentPageComponent extends AppComponentBase implements CanCompone
if (field.partitioning === 'language') {
for (let language of this.languages) {
fieldForm.get(language.iso2Code).setValue(fieldValue[language.iso2Code]);
fieldForm.controls[language.iso2Code].setValue(fieldValue[language.iso2Code]);
}
} else {
fieldForm.get('iv').setValue(fieldValue['iv']);
fieldForm.controls['iv'].setValue(fieldValue['iv']);
}
}
}

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

@ -167,7 +167,7 @@ export class DashboardPageComponent extends AppComponentBase implements OnInit,
}
}
function formatCalls(count: number): string {
function formatCalls(count: number): string | null {
if (count > 1000) {
count = count / 1000;
@ -179,7 +179,7 @@ function formatCalls(count: number): string {
return count + 'k';
} else if (count < 0) {
return undefined;
return null;
} else {
return count.toString();
}

8
src/Squidex/app/features/schemas/pages/schema/schema-page.component.ts

@ -82,7 +82,7 @@ export class SchemaPageComponent extends AppComponentBase implements OnInit {
});
public get hasName() {
return this.addFieldForm.get('name').value && this.addFieldForm.get('name').value.length > 0;
return this.addFieldForm.controls['name'].value && this.addFieldForm.controls['name'].value.length > 0;
}
constructor(apps: AppsStoreService, notifications: NotificationService,
@ -227,10 +227,10 @@ export class SchemaPageComponent extends AppComponentBase implements OnInit {
if (this.addFieldForm.valid) {
this.addFieldForm.disable();
const properties = createProperties(this.addFieldForm.get('type')!.value);
const partitioning = this.addFieldForm.get('isLocalizable')!.value ? 'language' : 'invariant';
const properties = createProperties(this.addFieldForm.controls['type'].value);
const partitioning = this.addFieldForm.controls['isLocalizable'].value ? 'language' : 'invariant';
const requestDto = new AddFieldDto(this.addFieldForm.get('name')!.value, partitioning, properties);
const requestDto = new AddFieldDto(this.addFieldForm.controls['name'].value, partitioning, properties);
const reset = () => {
this.addFieldForm.reset({ type: 'String' });

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

@ -30,7 +30,7 @@ export class BooleanValidationComponent implements OnInit {
new FormControl(this.properties.defaultValue));
this.hideDefaultValue =
this.editForm.get('isRequired')!.valueChanges
this.editForm.controls['isRequired'].valueChanges
.startWith(this.properties.isRequired)
.map(x => !!x);
}

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

@ -48,12 +48,12 @@ export class DateTimeValidationComponent implements OnInit {
]));
this.hideDefaultValues =
this.editForm.get('isRequired')!.valueChanges
this.editForm.controls['isRequired'].valueChanges
.startWith(this.properties.isRequired)
.map(x => !!x);
this.hideDefaultValue =
this.editForm.get('calculatedDefaultValue')!.valueChanges
this.editForm.controls['calculatedDefaultValue'].valueChanges
.startWith(this.properties.calculatedDefaultValue)
.map(x => !!x);
}

4
src/Squidex/app/features/schemas/pages/schema/types/number-ui.component.ts

@ -46,14 +46,14 @@ export class NumberUIComponent implements OnDestroy, OnInit {
new FormControl(this.properties.allowedValues, []));
this.hideAllowedValues =
this.editForm.get('editor')!.valueChanges
this.editForm.controls['editor'].valueChanges
.startWith(this.properties.editor)
.map(x => !x || x === 'Input' || x === 'Textarea');
this.editorSubscription =
this.hideAllowedValues.subscribe(isSelection => {
if (isSelection) {
this.editForm.get('allowedValues')!.setValue(undefined);
this.editForm.controls['allowedValues'].setValue(undefined);
}
});
}

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

@ -36,7 +36,7 @@ export class NumberValidationComponent implements OnInit {
new FormControl(this.properties.defaultValue));
this.hideDefaultValue =
this.editForm.get('isRequired')!.valueChanges
this.editForm.controls['isRequired'].valueChanges
.startWith(this.properties.isRequired)
.map(x => !!x);
}

4
src/Squidex/app/features/schemas/pages/schema/types/string-ui.component.ts

@ -46,7 +46,7 @@ export class StringUIComponent implements OnDestroy, OnInit {
new FormControl(this.properties.allowedValues));
this.hideAllowedValues =
this.editForm.get('editor')!.valueChanges
this.editForm.controls['editor'].valueChanges
.startWith(this.properties.editor)
.map(x => !x || x === 'Input' || x === 'TextArea' || x === 'RichText' || x === 'Markdown');
@ -54,7 +54,7 @@ export class StringUIComponent implements OnDestroy, OnInit {
this.hideAllowedValues
.subscribe(isSelection => {
if (isSelection) {
this.editForm.get('allowedValues')!.setValue(undefined);
this.editForm.controls['allowedValues'].setValue(undefined);
}
});
}

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

@ -49,19 +49,19 @@ export class StringValidationComponent implements OnDestroy, OnInit {
new FormControl(this.properties.defaultValue));
this.hideDefaultValue =
this.editForm.get('isRequired')!.valueChanges
this.editForm.controls['isRequired'].valueChanges
.startWith(this.properties.isRequired)
.map(x => !!x);
this.hidePatternMessage =
this.editForm.get('pattern')!.valueChanges
this.editForm.controls['pattern'].valueChanges
.startWith('')
.map(x => !x || x.trim().length === 0);
this.patternSubscription =
this.editForm.get('pattern')!.valueChanges.subscribe((value: string) => {
this.editForm.controls['pattern'].valueChanges.subscribe((value: string) => {
if (!value || value.length === 0) {
this.editForm.get('patternMessage')!.setValue(undefined);
this.editForm.controls['patternMessage'].setValue(undefined);
}
});
}

6
src/Squidex/app/features/schemas/pages/schemas/schema-form.component.ts

@ -56,7 +56,7 @@ export class SchemaFormComponent {
});
public schemaName =
this.createForm.get('name')!.valueChanges.map(n => n || FALLBACK_NAME)
this.createForm.controls['name'].valueChanges.map(n => n || FALLBACK_NAME)
.startWith(FALLBACK_NAME);
constructor(
@ -85,9 +85,9 @@ export class SchemaFormComponent {
this.createForm.disable();
const schemaVersion = new Version();
const schemaName = this.createForm.get('name')!.value;
const schemaName = this.createForm.controls['name'].value;
const requestDto = Object.assign(this.createForm.get('import')!.value || {}, {});
const requestDto = Object.assign(this.createForm.controls['import'].value || {}, {});
requestDto.name = schemaName;

4
src/Squidex/app/features/settings/pages/clients/client.component.ts

@ -73,7 +73,7 @@ export class ClientComponent {
}
public resetForm() {
this.renameForm.get('name')!.setValue(this.clientName);
this.renameForm.controls['name'].setValue(this.clientName);
}
public cancelRename() {
@ -94,7 +94,7 @@ export class ClientComponent {
public rename() {
try {
const newName = this.renameForm.get('name')!.value;
const newName = this.renameForm.controls['name'].value;
if (newName !== this.clientName) {
this.renaming.emit(newName);

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

@ -44,7 +44,7 @@ export class ClientsPageComponent extends AppComponentBase implements OnInit {
});
public get hasName() {
return this.addClientForm.get('name').value && this.addClientForm.get('name').value.length > 0;
return this.addClientForm.controls['name'].value && this.addClientForm.controls['name'].value.length > 0;
}
constructor(apps: AppsStoreService, notifications: NotificationService,
@ -102,7 +102,7 @@ export class ClientsPageComponent extends AppComponentBase implements OnInit {
this.addClientFormSubmitted = true;
this.addClientForm.disable();
const requestDto = new CreateAppClientDto(this.addClientForm.get('name')!.value);
const requestDto = new CreateAppClientDto(this.addClientForm.controls['name'].value);
this.appNameOnce()
.switchMap(app => this.appClientsService.postClient(app, requestDto, this.version))

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

@ -125,7 +125,7 @@ export class ContributorsPageComponent extends AppComponentBase implements OnIni
}
public assignContributor() {
const requestDto = new AppContributorDto(this.addContributorForm.get('user')!.value.model.id, 'Editor');
const requestDto = new AppContributorDto(this.addContributorForm.controls['user'].value.model.id, 'Editor');
this.appNameOnce()
.switchMap(app => this.appContributorsService.postContributor(app, requestDto, this.version))

10
src/Squidex/app/features/settings/pages/languages/language.component.ts

@ -66,10 +66,10 @@ export class LanguageComponent implements OnInit, OnChanges, OnDestroy {
public ngOnInit() {
this.isMasterSubscription =
this.editForm.get('isMaster').valueChanges
this.editForm.controls['isMaster'].valueChanges
.subscribe(v => {
this.isMaster = v;
this.editForm.get('isOptional').setValue(false);
this.editForm.controls['isOptional'].setValue(false);
});
this.resetForm();
@ -92,7 +92,7 @@ export class LanguageComponent implements OnInit, OnChanges, OnDestroy {
}
public addLanguage() {
this.addFallbackLanguage(this.addLanguageForm.get('language')!.value);
this.addFallbackLanguage(this.addLanguageForm.controls['language'].value);
}
public removeFallbackLanguage(language: AppLanguageDto) {
@ -115,8 +115,8 @@ export class LanguageComponent implements OnInit, OnChanges, OnDestroy {
new AppLanguageDto(
this.language.iso2Code,
this.language.englishName,
this.editForm.get('isMaster')!.value,
this.editForm.get('isOptional')!.value,
this.editForm.controls['isMaster'].value,
this.editForm.controls['isOptional'].value,
this.fallbackLanguages.map(l => l.iso2Code));
this.saving.emit(newLanguage);

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

@ -77,7 +77,7 @@ export class LanguagesPageComponent extends AppComponentBase implements OnInit {
}
public addLanguage() {
const requestDto = new AddAppLanguageDto(this.addLanguageForm.get('language')!.value.iso2Code);
const requestDto = new AddAppLanguageDto(this.addLanguageForm.controls['language'].value.iso2Code);
this.appNameOnce()
.switchMap(app => this.appLanguagesService.postLanguages(app, requestDto, this.version))

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

@ -87,7 +87,7 @@ export class PlansPageComponent extends AppComponentBase implements OnInit {
return FileHelper.fileSize(count);
}
public formatCalls(count: number): string {
public formatCalls(count: number): string | null {
if (count > 1000) {
count = count / 1000;
@ -99,7 +99,7 @@ export class PlansPageComponent extends AppComponentBase implements OnInit {
return count + 'k';
} else if (count < 0) {
return undefined;
return null;
} else {
return count.toString();
}

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

@ -59,12 +59,12 @@
</td>
</tr>
<tr>
<td>Token:</td>
<td>Secret:</td>
<td>
<input readonly class="form-control" [attr.value]="webhook.webhook.securityToken" #inputToken />
<input readonly class="form-control" [attr.value]="webhook.webhook.sharedSecret" #inputSecret />
</td>
<td>
<button type="button" class="btn btn-primary btn-link" [sqxCopy]="inputToken">
<button type="button" class="btn btn-primary btn-link" [sqxCopy]="inputSecret">
<i class="icon-copy"></i>
</button>
</td>

6
src/Squidex/app/features/webhooks/pages/webhooks-page.component.ts

@ -49,7 +49,7 @@ export class WebhooksPageComponent extends AppComponentBase implements OnInit {
});
public get hasUrl() {
return this.addWebhookForm.get('url').value && this.addWebhookForm.get('url').value.length > 0;
return this.addWebhookForm.controls['url'].value && this.addWebhookForm.controls['url'].value.length > 0;
}
constructor(apps: AppsStoreService, notifications: NotificationService,
@ -98,8 +98,8 @@ export class WebhooksPageComponent extends AppComponentBase implements OnInit {
this.addWebhookFormSubmitted = true;
this.addWebhookForm.disable();
const requestDto = new CreateWebhookDto(this.addWebhookForm.get('url')!.value);
const schemaId = this.addWebhookForm.get('schemaId')!.value;
const requestDto = new CreateWebhookDto(this.addWebhookForm.controls['url'].value);
const schemaId = this.addWebhookForm.controls['schemaId'].value;
const schema = this.schemas.find(s => s.id === schemaId);
this.appNameOnce()

2
src/Squidex/app/framework/angular/control-errors.component.ts

@ -101,6 +101,6 @@ export class ControlErrorsComponent implements OnChanges {
this.displayFieldName = this.for.substr(0, 1).toUpperCase() + this.for.substr(1);
}
this.control = this.formGroupDirective.form.get(this.for);
this.control = this.formGroupDirective.form.controls[this.for];
}
}

4
src/Squidex/app/framework/angular/geolocation-editor.component.ts

@ -108,8 +108,8 @@ export class GeolocationEditorComponent implements ControlValueAccessor, AfterVi
}
public updateValueByInput() {
if (this.geolocationForm.get('latitude').value !== null &&
this.geolocationForm.get('longitude').value !== null &&
if (this.geolocationForm.controls['latitude'].value !== null &&
this.geolocationForm.controls['longitude'].value !== null &&
this.geolocationForm.valid) {
this.value = this.geolocationForm.value;
} else {

2
src/Squidex/app/framework/angular/parent-link.directive.ts

@ -35,7 +35,7 @@ export class ParentLinkDirective implements OnInit, OnDestroy {
this.urlSubscription =
this.route.url.subscribe(() => {
this.url = this.isLazyLoaded ?
this.router.createUrlTree(['.'], { relativeTo: this.route.parent.parent }).toString() :
this.router.createUrlTree(['.'], { relativeTo: this.route.parent!.parent }).toString() :
this.router.createUrlTree(['.'], { relativeTo: this.route.parent }).toString();
this.renderer.setElementAttribute(this.element.nativeElement, 'href', this.url);

6
src/Squidex/app/shared/components/app-form.component.ts

@ -30,7 +30,7 @@ export class AppFormComponent {
@Output()
public cancelled = new EventEmitter();
public createFormError = '';
public createFormError? = '';
public createFormSubmitted = false;
public createForm: FormGroup =
this.formBuilder.group({
@ -43,7 +43,7 @@ export class AppFormComponent {
});
public appName =
this.createForm.get('name')!.valueChanges.map(n => n || FALLBACK_NAME)
this.createForm.controls['name'].valueChanges.map(n => n || FALLBACK_NAME)
.startWith(FALLBACK_NAME);
constructor(
@ -64,7 +64,7 @@ export class AppFormComponent {
if (this.createForm.valid) {
this.createForm.disable();
const request = new CreateAppDto(this.createForm.get('name')!.value);
const request = new CreateAppDto(this.createForm.controls['name'].value);
const enable = (message?: string) => {
this.createForm.enable();

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

@ -164,7 +164,7 @@ export class AssetComponent extends AppComponentBase implements OnInit {
if (this.renameForm.valid) {
this.renameForm.disable();
const requestDto = new UpdateAssetDto(this.renameForm.get('name').value);
const requestDto = new UpdateAssetDto(this.renameForm.controls['name'].value);
this.appNameOnce()
.switchMap(app => this.assetsService.putAsset(app, this.asset.id, requestDto, this.version))
@ -194,7 +194,7 @@ export class AssetComponent extends AppComponentBase implements OnInit {
private resetRename() {
this.renameForm.enable();
this.renameForm.get('name').setValue(this.asset.fileName);
this.renameForm.controls['name'].setValue(this.asset.fileName);
this.renameFormSubmitted = false;
this.renameDialog.hide();
}

4
src/Squidex/app/shared/services/app-languages.service.spec.ts

@ -61,7 +61,7 @@ describe('AppLanguagesService', () => {
expect(languages).toEqual(
[
new AppLanguageDto('de', 'German', true, true, ['de', 'en']),
new AppLanguageDto('en', 'English', false, false, undefined)
new AppLanguageDto('en', 'English', false, false, [])
]);
authService.verifyAll();
@ -90,7 +90,7 @@ describe('AppLanguagesService', () => {
});
expect(language).toEqual(
new AppLanguageDto('de', 'German', false, false, undefined));
new AppLanguageDto('de', 'German', false, false, []));
authService.verifyAll();
});

2
src/Squidex/app/shared/services/app-languages.service.ts

@ -79,7 +79,7 @@ export class AppLanguagesService {
response.englishName,
response.isMaster === true,
response.isOptional === true,
response.fallback);
response.fallback || []);
})
.catchError('Failed to add language. Please reload.');
}

2
src/Squidex/app/shared/services/users.service.spec.ts

@ -282,7 +282,7 @@ describe('UserManagementService', () => {
))
.verifiable(Times.once());
let user: UserCreatedDto | null = null;
let user: UserDto | null = null;
userManagementService.postUser(dto).subscribe(result => {
user = result;

6
src/Squidex/app/shared/services/webhooks.service.spec.ts

@ -36,12 +36,12 @@ describe('WebhooksService', () => {
body: [{
id: 'id1',
schemaId: 'schemaId1',
securityToken: 'token1',
sharedSecret: 'token1',
url: 'http://squidex.io/1'
}, {
id: 'id2',
schemaId: 'schemaId2',
securityToken: 'token2',
sharedSecret: 'token2',
url: 'http://squidex.io/2'
}]
})
@ -73,7 +73,7 @@ describe('WebhooksService', () => {
body: {
id: 'id1',
schemaId: 'schemaId1',
securityToken: 'token1',
sharedSecret: 'token1',
url: 'http://squidex.io/1'
}
})

6
src/Squidex/app/shared/services/webhooks.service.ts

@ -17,7 +17,7 @@ export class WebhookDto {
constructor(
public readonly id: string,
public readonly schemaId: string,
public readonly securityToken: string,
public readonly sharedSecret: string,
public readonly url: string
) {
}
@ -50,7 +50,7 @@ export class WebhooksService {
return new WebhookDto(
item.id,
item.schemaId,
item.securityToken,
item.sharedSecret,
item.url);
});
})
@ -66,7 +66,7 @@ export class WebhooksService {
return new WebhookDto(
response.id,
response.schemaId,
response.securityToken,
response.sharedSecret,
response.url);
})
.catchError('Failed to create webhook. Please reload.');

44
src/Squidex/package.json

@ -15,15 +15,15 @@
"build:clean": "rimraf wwwroot/build"
},
"dependencies": {
"@angular/animations": "4.1.3",
"@angular/common": "4.1.3",
"@angular/compiler": "4.1.3",
"@angular/core": "4.1.3",
"@angular/forms": "4.1.3",
"@angular/http": "4.1.3",
"@angular/platform-browser": "4.1.3",
"@angular/platform-browser-dynamic": "4.1.3",
"@angular/router": "4.1.3",
"@angular/animations": "4.2.2",
"@angular/common": "4.2.2",
"@angular/compiler": "4.2.2",
"@angular/core": "4.2.2",
"@angular/forms": "4.2.2",
"@angular/http": "4.2.2",
"@angular/platform-browser": "4.2.2",
"@angular/platform-browser-dynamic": "4.2.2",
"@angular/router": "4.2.2",
"angular2-chartjs": "^0.2.0",
"angular-progress-http": "0.5.0",
"babel-polyfill": "6.23.0",
@ -31,18 +31,18 @@
"core-js": "2.4.1",
"moment": "2.18.1",
"mousetrap": "1.6.1",
"ng2-dnd": "4.0.2",
"ng2-dnd": "4.2.0",
"oidc-client": "1.3.0",
"pikaday": "1.5.1",
"pikaday": "1.6.0",
"progressbar.js": "1.0.1",
"redoc": "1.16.0",
"rxjs": "5.4.0",
"zone.js": "0.8.11"
"zone.js": "0.8.12"
},
"devDependencies": {
"@angular/compiler-cli": "4.1.3",
"@angular/tsc-wrapped": "4.1.3",
"@ngtools/webpack": "1.3.1",
"@angular/compiler-cli": "4.2.2",
"@angular/tsc-wrapped": "4.2.2",
"@ngtools/webpack": "1.4.1",
"@types/core-js": "0.9.35",
"@types/jasmine": "2.5.43",
"@types/mousetrap": "1.5.33",
@ -51,14 +51,14 @@
"angular2-template-loader": "0.6.2",
"awesome-typescript-loader": "3.1.3",
"cpx": "1.5.0",
"css-loader": "0.28.3",
"css-loader": "0.28.4",
"exports-loader": "0.6.4",
"extract-text-webpack-plugin": "2.1.0",
"file-loader": "0.11.1",
"extract-text-webpack-plugin": "2.1.2",
"file-loader": "0.11.2",
"html-loader": "0.4.5",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-core": "2.6.2",
"jasmine-core": "2.6.3",
"karma": "1.7.0",
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
@ -76,11 +76,11 @@
"rimraf": "2.6.1",
"sass-lint": "1.10.2",
"sass-loader": "6.0.5",
"style-loader": "0.18.1",
"style-loader": "0.18.2",
"tslint": "4.5.1",
"tslint-loader": "3.5.3",
"typemoq": "1.6.0",
"typescript": "2.3.3",
"typemoq": "1.7.0",
"typescript": "2.3.4",
"underscore": "1.8.3",
"webpack": "2.6.1",
"webpack-dev-server": "2.4.5",

4
tests/Squidex.Write.Tests/Schemas/SchemaDomainObjectTests.cs

@ -709,7 +709,7 @@ namespace Squidex.Write.Schemas
sut.GetUncomittedEvents()
.ShouldHaveSameEvents(
CreateEvent(new WebhookAdded { Id = command.Id, Url = command.Url, SecurityToken = command.SecurityToken })
CreateEvent(new WebhookAdded { Id = command.Id, Url = command.Url, SharedSecret = command.SharedSecret })
);
}
@ -757,7 +757,7 @@ namespace Squidex.Write.Schemas
sut.GetUncomittedEvents()
.ShouldHaveSameEvents(
CreateEvent(new WebhookAdded { Id = createCommand.Id, Url = createCommand.Url, SecurityToken = createCommand.SecurityToken }),
CreateEvent(new WebhookAdded { Id = createCommand.Id, Url = createCommand.Url, SharedSecret = createCommand.SharedSecret }),
CreateEvent(new WebhookDeleted { Id = createCommand.Id })
);
}

Loading…
Cancel
Save