Browse Source

added length validation for version control name

pull/14335/head
Maksym Tsymbarov 10 months ago
parent
commit
e994a9d538
  1. 3
      ui-ngx/src/app/modules/home/components/vc/entity-version-create.component.html
  2. 2
      ui-ngx/src/app/modules/home/components/vc/entity-version-create.component.ts
  3. 3
      ui-ngx/src/assets/locale/locale.constant-en_US.json

3
ui-ngx/src/app/modules/home/components/vc/entity-version-create.component.html

@ -37,6 +37,9 @@
createVersionFormGroup.get('versionName').hasError('pattern')"> createVersionFormGroup.get('versionName').hasError('pattern')">
{{ 'version-control.version-name-required' | translate }} {{ 'version-control.version-name-required' | translate }}
</mat-error> </mat-error>
<mat-error *ngIf="createVersionFormGroup.get('versionName').hasError('maxlength')">
{{ 'version-control.version-name-max-length' | translate }}
</mat-error>
</mat-form-field> </mat-form-field>
<mat-checkbox *ngIf="entityId.entityType === entityTypes.DEVICE" formControlName="saveCredentials" style="margin-bottom: 16px;"> <mat-checkbox *ngIf="entityId.entityType === entityTypes.DEVICE" formControlName="saveCredentials" style="margin-bottom: 16px;">
{{ 'version-control.export-credentials' | translate }} {{ 'version-control.export-credentials' | translate }}

2
ui-ngx/src/app/modules/home/components/vc/entity-version-create.component.ts

@ -86,7 +86,7 @@ export class EntityVersionCreateComponent extends PageComponent implements OnIni
this.createVersionFormGroup = this.fb.group({ this.createVersionFormGroup = this.fb.group({
branch: [this.branch, [Validators.required]], branch: [this.branch, [Validators.required]],
versionName: [this.translate.instant('version-control.default-create-entity-version-name', versionName: [this.translate.instant('version-control.default-create-entity-version-name',
{entityName: this.entityName}), [Validators.required, Validators.pattern(/(?:.|\s)*\S(&:.|\s)*/)]], {entityName: this.entityName}), [Validators.required, Validators.pattern(/(?:.|\s)*\S(&:.|\s)*/), Validators.maxLength(256)]],
saveRelations: [false, []], saveRelations: [false, []],
saveAttributes: [true, []], saveAttributes: [true, []],
saveCredentials: [true, []], saveCredentials: [true, []],

3
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -6723,7 +6723,8 @@
"runtime-failed": "<b>Failed:</b> {{message}}", "runtime-failed": "<b>Failed:</b> {{message}}",
"auto-commit-settings-read-only-hint": "Auto-commit feature doesn't work with enabled read-only option in Repository settings.", "auto-commit-settings-read-only-hint": "Auto-commit feature doesn't work with enabled read-only option in Repository settings.",
"rollback-on-error": "Rollback on error", "rollback-on-error": "Rollback on error",
"rollback-on-error-hint": "If you have a large amount of entities to restore, consider disabling this option to increase performance.\n Note, if an error occurs over the course of version loading, already persisted entities (with relations, attributes, etc.) will stay as is" "rollback-on-error-hint": "If you have a large amount of entities to restore, consider disabling this option to increase performance.\n Note, if an error occurs over the course of version loading, already persisted entities (with relations, attributes, etc.) will stay as is",
"version-name-max-length": "Name should be less than 256"
}, },
"widget": { "widget": {
"widget-library": "Widgets library", "widget-library": "Widgets library",

Loading…
Cancel
Save