Browse Source

Format fixes

pull/271/head
Sebastian Stehle 8 years ago
parent
commit
ffdc7a6b5b
  1. 12
      src/Squidex/app/features/administration/pages/users/user-page.component.ts
  2. 9
      src/Squidex/app/features/rules/pages/rules/actions/algolia-action.component.ts
  3. 6
      src/Squidex/app/features/rules/pages/rules/actions/azure-queue-action.component.ts
  4. 9
      src/Squidex/app/features/rules/pages/rules/actions/elastic-search-action.component.ts
  5. 6
      src/Squidex/app/features/rules/pages/rules/actions/fastly-action.component.ts
  6. 5
      src/Squidex/app/features/rules/pages/rules/actions/slack-action.component.ts
  7. 5
      src/Squidex/app/features/rules/pages/rules/actions/webhook-action.component.ts
  8. 8
      src/Squidex/app/features/schemas/pages/schema/field-wizard.component.ts
  9. 6
      src/Squidex/app/features/schemas/pages/schema/schema-edit-form.component.ts
  10. 5
      src/Squidex/app/features/schemas/pages/schemas/schema-form.component.ts
  11. 2
      src/Squidex/app/features/settings/pages/backups/backups-page.component.html
  12. 29
      src/Squidex/app/features/settings/pages/backups/backups-page.component.ts
  13. 2
      src/Squidex/app/features/settings/pages/clients/client.component.html
  14. 20
      src/Squidex/app/features/settings/pages/clients/client.component.ts
  15. 2
      src/Squidex/app/features/settings/pages/clients/clients-page.component.html
  16. 35
      src/Squidex/app/features/settings/pages/clients/clients-page.component.ts
  17. 2
      src/Squidex/app/features/settings/pages/contributors/contributors-page.component.html
  18. 36
      src/Squidex/app/features/settings/pages/contributors/contributors-page.component.ts
  19. 4
      src/Squidex/app/features/settings/pages/languages/language.component.ts
  20. 2
      src/Squidex/app/features/settings/pages/languages/languages-page.component.html
  21. 41
      src/Squidex/app/features/settings/pages/languages/languages-page.component.ts
  22. 2
      src/Squidex/app/features/settings/pages/more/more-page.component.html
  23. 15
      src/Squidex/app/features/settings/pages/more/more-page.component.ts
  24. 6
      src/Squidex/app/features/settings/pages/patterns/pattern.component.ts
  25. 3
      src/Squidex/app/shared/components/app-form.component.ts
  26. 3
      src/Squidex/app/shared/components/asset.component.ts
  27. 2
      src/Squidex/app/shared/components/rich-editor.component.ts

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

@ -32,20 +32,24 @@ export class UserPageComponent implements OnDestroy, OnInit {
Validators.email,
Validators.required,
Validators.maxLength(100)
]],
]
],
displayName: ['',
[
Validators.required,
Validators.maxLength(100)
]],
]
],
password: ['',
[
Validators.nullValidator
]],
]
],
passwordConfirm: ['',
[
ValidatorsEx.match('password', 'Passwords must be the same.')
]]
]
]
});
public user: UserDto | null;

9
src/Squidex/app/features/rules/pages/rules/actions/algolia-action.component.ts

@ -26,15 +26,18 @@ export class AlgoliaActionComponent implements OnInit {
appId: ['',
[
Validators.required
]],
]
],
apiKey: ['',
[
Validators.required
]],
]
],
indexName: ['$SCHEMA_NAME',
[
Validators.required
]]
]
]
});
constructor(

6
src/Squidex/app/features/rules/pages/rules/actions/azure-queue-action.component.ts

@ -28,12 +28,14 @@ export class AzureQueueActionComponent implements OnInit {
connectionString: ['',
[
Validators.required
]],
]
],
queue: ['squidex',
[
Validators.required,
ValidatorsEx.pattern('[a-z][a-z0-9]{2,}(\-[a-z0-9]+)*', 'Name must be a valid azure queue name.')
]]
]
]
});
constructor(

9
src/Squidex/app/features/rules/pages/rules/actions/elastic-search-action.component.ts

@ -26,15 +26,18 @@ export class ElasticSearchActionComponent implements OnInit {
host: ['',
[
Validators.required
]],
]
],
indexName: ['$APP_NAME',
[
Validators.required
]],
]
],
indexType: ['$SCHEMA_NAME',
[
// Validators.required
]],
]
],
username: '',
password: ''
});

6
src/Squidex/app/features/rules/pages/rules/actions/fastly-action.component.ts

@ -26,11 +26,13 @@ export class FastlyActionComponent implements OnInit {
serviceId: ['',
[
Validators.required
]],
]
],
apiKey: ['',
[
Validators.required
]]
]
]
});
constructor(

5
src/Squidex/app/features/rules/pages/rules/actions/slack-action.component.ts

@ -26,8 +26,9 @@ export class SlackActionComponent implements OnInit {
webhookUrl: ['',
[
Validators.required
]],
text: ['']
]
],
text: ''
});
constructor(

5
src/Squidex/app/features/rules/pages/rules/actions/webhook-action.component.ts

@ -26,8 +26,9 @@ export class WebhookActionComponent implements OnInit {
url: ['',
[
Validators.required
]],
sharedSecret: ['']
]
],
sharedSecret: ''
});
constructor(

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

@ -44,14 +44,16 @@ export class FieldWizardComponent {
type: ['String',
[
Validators.required
]],
]
],
name: ['',
[
Validators.required,
Validators.maxLength(40),
ValidatorsEx.pattern('[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*', 'Name must be a valid javascript name in camel case.')
]],
isLocalizable: [false]
]
],
isLocalizable: false
});
@ViewChild('nameInput')

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

@ -30,11 +30,13 @@ export class SchemaEditFormComponent implements OnInit {
label: ['',
[
Validators.maxLength(100)
]],
]
],
hints: ['',
[
Validators.maxLength(1000)
]]
]
]
});
constructor(

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

@ -41,8 +41,9 @@ export class SchemaFormComponent implements OnInit {
Validators.required,
Validators.maxLength(40),
ValidatorsEx.pattern('[a-z0-9]+(\-[a-z0-9]+)*', 'Name can contain lower case letters (a-z), numbers and dashes only (not at the end).')
]],
import: [{}]
]
],
import: {}
});
public schemaName =

2
src/Squidex/app/features/settings/pages/backups/backups-page.component.html

@ -1,4 +1,4 @@
<sqx-title message="{app} | Backups | Settings" parameter1="app" [value1]="ctx.appName"></sqx-title>
<sqx-title message="{app} | Backups | Settings" parameter1="app" [value1]="appsState.appName"></sqx-title>
<sqx-panel desiredWidth="50rem">
<ng-container title>

29
src/Squidex/app/features/settings/pages/backups/backups-page.component.ts

@ -10,20 +10,18 @@ import { Observable, Subscription } from 'rxjs';
import {
ApiUrlConfig,
AppContext,
AppsState,
BackupDto,
BackupsService,
Duration,
DialogService,
ImmutableArray
} from '@app/shared';
@Component({
selector: 'sqx-backups-page',
styleUrls: ['./backups-page.component.scss'],
templateUrl: './backups-page.component.html',
providers: [
AppContext
]
templateUrl: './backups-page.component.html'
})
export class BackupsPageComponent implements OnInit, OnDestroy {
private loadSubscription: Subscription;
@ -31,9 +29,10 @@ export class BackupsPageComponent implements OnInit, OnDestroy {
public backups = ImmutableArray.empty<BackupDto>();
constructor(
public readonly ctx: AppContext,
public readonly appsState: AppsState,
private readonly apiUrl: ApiUrlConfig,
private readonly backupsService: BackupsService
private readonly backupsService: BackupsService,
private readonly dialogs: DialogService
) {
}
@ -44,32 +43,32 @@ export class BackupsPageComponent implements OnInit, OnDestroy {
public ngOnInit() {
this.loadSubscription =
Observable.timer(0, 2000)
.switchMap(t => this.backupsService.getBackups(this.ctx.appName))
.switchMap(t => this.backupsService.getBackups(this.appsState.appName))
.subscribe(dtos => {
this.backups = ImmutableArray.of(dtos);
});
}
public startBackup() {
this.backupsService.postBackup(this.ctx.appName)
this.backupsService.postBackup(this.appsState.appName)
.subscribe(() => {
this.ctx.notifyInfo('Backup started, it can take several minutes to complete.');
this.dialogs.notifyInfo('Backup started, it can take several minutes to complete.');
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public deleteBackup(backup: BackupDto) {
this.backupsService.deleteBackup(this.ctx.appName, backup.id)
this.backupsService.deleteBackup(this.appsState.appName, backup.id)
.subscribe(() => {
this.ctx.notifyInfo('Backup is about to be deleted.');
this.dialogs.notifyInfo('Backup is about to be deleted.');
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public getDownloadUrl(backup: BackupDto) {
return this.apiUrl.buildUrl(`api/apps/${this.ctx.appName}/backups/${backup.id}`);
return this.apiUrl.buildUrl(`api/apps/${this.appsState.appName}/backups/${backup.id}`);
}
public getDuration(backup: BackupDto) {

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

@ -44,7 +44,7 @@
Client Id:
</div>
<div class="col">
<input readonly class="form-control" value="{{ctx.appName}}:{{client.id}}" #inputName />
<input readonly class="form-control" value="{{appsState.appName}}:{{client.id}}" #inputName />
</div>
<div class="col col-auto cell-actions">
<button type="button" class="btn btn-primary btn-link" [sqxCopy]="inputName">

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

@ -10,11 +10,12 @@ import { FormBuilder, Validators } from '@angular/forms';
import {
AccessTokenDto,
AppContext,
AppClientDto,
AppClientsService,
DialogService,
fadeAnimation,
ModalView
ModalView,
AppsState
} from '@app/shared';
const ESCAPE_KEY = 27;
@ -23,9 +24,6 @@ const ESCAPE_KEY = 27;
selector: 'sqx-client',
styleUrls: ['./client.component.scss'],
templateUrl: './client.component.html',
providers: [
AppContext
],
animations: [
fadeAnimation
]
@ -53,7 +51,9 @@ export class ClientComponent {
public renameForm =
this.formBuilder.group({
name: ['',
Validators.required
[
Validators.required
]
]
});
@ -61,8 +61,10 @@ export class ClientComponent {
return this.renameForm.controls['name'].value !== this.client.name;
}
constructor(public readonly ctx: AppContext,
constructor(
public readonly appsState: AppsState,
private readonly appClientsService: AppClientsService,
private readonly dialogs: DialogService,
private readonly formBuilder: FormBuilder
) {
}
@ -84,12 +86,12 @@ export class ClientComponent {
}
public createToken(client: AppClientDto) {
this.appClientsService.createToken(this.ctx.appName, client)
this.appClientsService.createToken(this.appsState.appName, client)
.subscribe(dto => {
this.token = dto;
this.tokenDialog.show();
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
}

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

@ -1,4 +1,4 @@
<sqx-title message="{app} | Clients | Settings" parameter1="app" [value1]="ctx.appName"></sqx-title>
<sqx-title message="{app} | Clients | Settings" parameter1="app" [value1]="appsState.appName"></sqx-title>
<sqx-panel desiredWidth="44rem">
<ng-container title>

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

@ -12,8 +12,9 @@ import {
AppClientDto,
AppClientsDto,
AppClientsService,
AppContext,
AppsState,
CreateAppClientDto,
DialogService,
UpdateAppClientDto,
ValidatorsEx
} from '@app/shared';
@ -21,10 +22,7 @@ import {
@Component({
selector: 'sqx-clients-page',
styleUrls: ['./clients-page.component.scss'],
templateUrl: './clients-page.component.html',
providers: [
AppContext
]
templateUrl: './clients-page.component.html'
})
export class ClientsPageComponent implements OnInit {
public appClients: AppClientsDto;
@ -36,15 +34,18 @@ export class ClientsPageComponent implements OnInit {
[
Validators.maxLength(40),
ValidatorsEx.pattern('[a-z0-9]+(\-[a-z0-9]+)*', 'Name can contain lower case letters (a-z), numbers and dashes (not at the end).')
]]
]
]
});
public get hasName() {
return this.addClientForm.controls['name'].value && this.addClientForm.controls['name'].value.length > 0;
}
constructor(public readonly ctx: AppContext,
constructor(
public readonly appsState: AppsState,
private readonly appClientsService: AppClientsService,
private readonly dialogs: DialogService,
private readonly formBuilder: FormBuilder
) {
}
@ -54,42 +55,42 @@ export class ClientsPageComponent implements OnInit {
}
public load() {
this.appClientsService.getClients(this.ctx.appName)
this.appClientsService.getClients(this.appsState.appName)
.subscribe(dtos => {
this.updateClients(dtos);
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public revokeClient(client: AppClientDto) {
this.appClientsService.deleteClient(this.ctx.appName, client.id, this.appClients.version)
this.appClientsService.deleteClient(this.appsState.appName, client.id, this.appClients.version)
.subscribe(dto => {
this.updateClients(this.appClients.removeClient(client, dto.version));
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public renameClient(client: AppClientDto, name: string) {
const requestDto = new UpdateAppClientDto(name);
this.appClientsService.updateClient(this.ctx.appName, client.id, requestDto, this.appClients.version)
this.appClientsService.updateClient(this.appsState.appName, client.id, requestDto, this.appClients.version)
.subscribe(dto => {
this.updateClients(this.appClients.updateClient(client.rename(name), dto.version));
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public updateClient(client: AppClientDto, permission: string) {
const requestDto = new UpdateAppClientDto(undefined, permission);
this.appClientsService.updateClient(this.ctx.appName, client.id, requestDto, this.appClients.version)
this.appClientsService.updateClient(this.appsState.appName, client.id, requestDto, this.appClients.version)
.subscribe(dto => {
this.updateClients(this.appClients.updateClient(client.update(permission), dto.version));
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
@ -101,12 +102,12 @@ export class ClientsPageComponent implements OnInit {
const requestDto = new CreateAppClientDto(this.addClientForm.controls['name'].value);
this.appClientsService.postClient(this.ctx.appName, requestDto, this.appClients.version)
this.appClientsService.postClient(this.appsState.appName, requestDto, this.appClients.version)
.subscribe(dto => {
this.updateClients(this.appClients.addClient(dto.payload, dto.version));
this.resetClientForm();
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
this.resetClientForm();
});

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

@ -1,4 +1,4 @@
<sqx-title message="{app} | Contributors | Settings" parameter1="app" [value1]="ctx.appName"></sqx-title>
<sqx-title message="{app} | Contributors | Settings" parameter1="app" [value1]="appsState.appName"></sqx-title>
<sqx-panel desiredWidth="50rem">
<ng-container title>

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

@ -10,12 +10,13 @@ import { FormBuilder, Validators } from '@angular/forms';
import { Observable } from 'rxjs';
import {
AppContext,
AppContributorDto,
AppContributorsDto,
AppContributorsService,
AppsState,
AutocompleteSource,
UsersService
UsersService,
DialogService
} from '@app/shared';
export class UsersDataSource implements AutocompleteSource {
@ -43,10 +44,7 @@ export class UsersDataSource implements AutocompleteSource {
@Component({
selector: 'sqx-contributors-page',
styleUrls: ['./contributors-page.component.scss'],
templateUrl: './contributors-page.component.html',
providers: [
AppContext
]
templateUrl: './contributors-page.component.html'
})
export class ContributorsPageComponent implements OnInit {
public appContributors: AppContributorsDto;
@ -65,12 +63,16 @@ export class ContributorsPageComponent implements OnInit {
user: [null,
[
Validators.required
]]
]
]
});
constructor(public readonly ctx: AppContext, usersService: UsersService,
constructor(
public readonly appsState: AppsState,
private readonly appContributorsService: AppContributorsService,
private readonly formBuilder: FormBuilder
private readonly dialogs: DialogService,
private readonly formBuilder: FormBuilder,
usersService: UsersService
) {
this.usersDataSource = new UsersDataSource(usersService, this);
}
@ -80,43 +82,43 @@ export class ContributorsPageComponent implements OnInit {
}
public load() {
this.appContributorsService.getContributors(this.ctx.appName)
this.appContributorsService.getContributors(this.appsState.appName)
.subscribe(dto => {
this.updateContributorsFromDto(dto);
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public removeContributor(contributor: AppContributorDto) {
this.appContributorsService.deleteContributor(this.ctx.appName, contributor.contributorId, this.appContributors.version)
this.appContributorsService.deleteContributor(this.appsState.appName, contributor.contributorId, this.appContributors.version)
.subscribe(dto => {
this.updateContributors(this.appContributors.removeContributor(contributor, dto.version));
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public changePermission(contributor: AppContributorDto, permission: string) {
const requestDto = contributor.changePermission(permission);
this.appContributorsService.postContributor(this.ctx.appName, requestDto, this.appContributors.version)
this.appContributorsService.postContributor(this.appsState.appName, requestDto, this.appContributors.version)
.subscribe(dto => {
this.updateContributors(this.appContributors.updateContributor(contributor, dto.version));
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public assignContributor() {
const requestDto = new AppContributorDto(this.addContributorForm.controls['user'].value.id, 'Editor');
this.appContributorsService.postContributor(this.ctx.appName, requestDto, this.appContributors.version)
this.appContributorsService.postContributor(this.appsState.appName, requestDto, this.appContributors.version)
.subscribe(dto => {
this.updateContributors(this.appContributors.addContributor(requestDto, dto.version));
this.resetContributorForm();
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
this.resetContributorForm();
});

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

@ -45,8 +45,8 @@ export class LanguageComponent implements OnInit, OnChanges, OnDestroy {
public editFormSubmitted = false;
public editForm =
this.formBuilder.group({
isMaster: [false, []],
isOptional: [false, []]
isMaster: false,
isOptional: false
});
constructor(

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

@ -1,4 +1,4 @@
<sqx-title message="{app} | Languages | Settings" parameter1="app" [value1]="ctx.appName"></sqx-title>
<sqx-title message="{app} | Languages | Settings" parameter1="app" [value1]="appsState.appName"></sqx-title>
<sqx-panel desiredWidth="42rem">
<ng-container title>

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

@ -10,11 +10,11 @@ import { FormBuilder, Validators } from '@angular/forms';
import {
AddAppLanguageDto,
AppContext,
AppLanguageDto,
AppLanguagesDto,
AppLanguagesService,
HistoryChannelUpdated,
AppsState,
DialogService,
ImmutableArray,
LanguageDto,
LanguagesService
@ -23,10 +23,7 @@ import {
@Component({
selector: 'sqx-languages-page',
styleUrls: ['./languages-page.component.scss'],
templateUrl: './languages-page.component.html',
providers: [
AppContext
]
templateUrl: './languages-page.component.html'
})
export class LanguagesPageComponent implements OnInit {
public allLanguages: LanguageDto[] = [];
@ -36,14 +33,18 @@ export class LanguagesPageComponent implements OnInit {
public addLanguageForm =
this.formBuilder.group({
language: [null,
Validators.required
[
Validators.required
]
]
});
constructor(public readonly ctx: AppContext,
constructor(
public readonly appsState: AppsState,
private readonly appLanguagesService: AppLanguagesService,
private readonly languagesService: LanguagesService,
private readonly formBuilder: FormBuilder
private readonly dialogs: DialogService,
private readonly formBuilder: FormBuilder,
private readonly languagesService: LanguagesService
) {
}
@ -53,40 +54,40 @@ export class LanguagesPageComponent implements OnInit {
}
public load() {
this.appLanguagesService.getLanguages(this.ctx.appName)
this.appLanguagesService.getLanguages(this.appsState.appName)
.subscribe(dto => {
this.updateLanguages(dto);
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public removeLanguage(language: AppLanguageDto) {
this.appLanguagesService.deleteLanguage(this.ctx.appName, language.iso2Code, this.appLanguages.version)
this.appLanguagesService.deleteLanguage(this.appsState.appName, language.iso2Code, this.appLanguages.version)
.subscribe(dto => {
this.updateLanguages(this.appLanguages.removeLanguage(language, dto.version));
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public addLanguage() {
const requestDto = new AddAppLanguageDto(this.addLanguageForm.controls['language'].value.iso2Code);
this.appLanguagesService.postLanguages(this.ctx.appName, requestDto, this.appLanguages.version)
this.appLanguagesService.postLanguages(this.appsState.appName, requestDto, this.appLanguages.version)
.subscribe(dto => {
this.updateLanguages(this.appLanguages.addLanguage(dto.payload, dto.version));
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
public updateLanguage(language: AppLanguageDto) {
this.appLanguagesService.putLanguage(this.ctx.appName, language.iso2Code, language, this.appLanguages.version)
this.appLanguagesService.putLanguage(this.appsState.appName, language.iso2Code, language, this.appLanguages.version)
.subscribe(dto => {
this.updateLanguages(this.appLanguages.updateLanguage(language, dto.version));
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
@ -97,7 +98,7 @@ export class LanguagesPageComponent implements OnInit {
this.updateNewLanguages();
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
@ -115,8 +116,6 @@ export class LanguagesPageComponent implements OnInit {
}), appLanguages.version);
this.updateNewLanguages();
this.ctx.bus.emit(new HistoryChannelUpdated());
}
private updateNewLanguages() {

2
src/Squidex/app/features/settings/pages/more/more-page.component.html

@ -1,4 +1,4 @@
<sqx-title message="{app} | More | Settings" parameter1="app" [value1]="ctx.appName"></sqx-title>
<sqx-title message="{app} | More | Settings" parameter1="app" [value1]="appsState.appName"></sqx-title>
<sqx-panel desiredWidth="50rem">
<div class="panel-header">

15
src/Squidex/app/features/settings/pages/more/more-page.component.ts

@ -8,28 +8,27 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { AppContext } from '@app/shared';
import { AppsState, DialogService } from '@app/shared';
@Component({
selector: 'sqx-more-page',
styleUrls: ['./more-page.component.scss'],
templateUrl: './more-page.component.html',
providers: [
AppContext
]
templateUrl: './more-page.component.html'
})
export class MorePageComponent {
constructor(public readonly ctx: AppContext,
constructor(
public readonly appsState: AppsState,
private readonly dialogs: DialogService,
private readonly router: Router
) {
}
public archiveApp() {
this.ctx.appsState.deleteApp(this.ctx.appName)
this.appsState.deleteApp(this.appsState.appName)
.subscribe(() => {
this.router.navigate(['/app']);
}, error => {
this.ctx.notifyError(error);
this.dialogs.notifyError(error);
});
}
}

6
src/Squidex/app/features/settings/pages/patterns/pattern.component.ts

@ -39,16 +39,14 @@ export class PatternComponent implements OnInit {
public editFormSubmitted = false;
public editForm =
this.formBuilder.group({
name: [
'',
name: ['',
[
Validators.required,
Validators.maxLength(100),
ValidatorsEx.pattern('[A-z0-9]+[A-z0-9\- ]*[A-z0-9]', 'Name can only contain letters, numbers, dashes and spaces.')
]
],
pattern: [
'',
pattern: ['',
[
Validators.required
]

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

@ -38,7 +38,8 @@ export class AppFormComponent {
Validators.required,
Validators.maxLength(40),
ValidatorsEx.pattern('[a-z0-9]+(\-[a-z0-9]+)*', 'Name can contain lower case letters (a-z), numbers and dashes (not at the end).')
]]
]
]
});
public appName =

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

@ -71,7 +71,8 @@ export class AssetComponent implements OnInit {
name: ['',
[
Validators.required
]]
]
]
});
public progress = 0;

2
src/Squidex/app/shared/components/rich-editor.component.ts

@ -46,7 +46,7 @@ export class RichEditorComponent implements ControlValueAccessor, AfterViewInit,
public draggedOver = false;
public assetsForm = this.formBuilder.group({
name: ['']
name: ''
});
constructor(private readonly resourceLoader: ResourceLoaderService,

Loading…
Cancel
Save