Browse Source

UI: Synchronize validation rules for the mobile app configuration form with the API

pull/12457/head
Vladyslav_Prykhodko 2 years ago
parent
commit
6d76d32882
  1. 8
      ui-ngx/src/app/modules/home/pages/mobile/applications/mobile-app.component.html
  2. 2
      ui-ngx/src/app/modules/home/pages/mobile/applications/mobile-app.component.ts

8
ui-ngx/src/app/modules/home/pages/mobile/applications/mobile-app.component.html

@ -107,7 +107,7 @@
<mat-label translate>mobile.latest-version</mat-label>
<input matInput formControlName="latestVersion">
<mat-hint> </mat-hint>
<mat-error *ngIf="entityForm.get('versionInfo.minVersion').hasError('pattern')">
<mat-error *ngIf="entityForm.get('versionInfo.latestVersion').hasError('pattern')">
{{ 'mobile.invalid-version-pattern' | translate }}
</mat-error>
</mat-form-field>
@ -130,7 +130,7 @@
<mat-label>{{
(entityForm.get('platformType').value === PlatformType.ANDROID ? 'mobile.google-play-link' : 'mobile.app-store-link') | translate
}}</mat-label>
<input matInput [required]="entityForm.get('status').value === 'PUBLISHED'" formControlName="storeLink">
<input matInput [required]="entityForm.get('status').value === MobileAppStatus.PUBLISHED" formControlName="storeLink">
<tb-copy-button
matSuffix
miniButton="false"
@ -148,7 +148,7 @@
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="entityForm.get('platformType').value === PlatformType.ANDROID">
<mat-label translate>mobile.sha256-certificate-fingerprints</mat-label>
<input matInput [required]="entityForm.get('status').value !== MobileAppStatus.DRAFT" formControlName="sha256CertFingerprints">
<input matInput [required]="entityForm.get('status').value === MobileAppStatus.PUBLISHED" formControlName="sha256CertFingerprints">
<tb-copy-button
matSuffix
miniButton="false"
@ -166,7 +166,7 @@
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="entityForm.get('platformType').value === PlatformType.IOS">
<mat-label translate>mobile.app-id</mat-label>
<input matInput [required]="entityForm.get('status').value !== MobileAppStatus.DRAFT" formControlName="appId">
<input matInput [required]="entityForm.get('status').value === MobileAppStatus.PUBLISHED" formControlName="appId">
<tb-copy-button
matSuffix
miniButton="false"

2
ui-ngx/src/app/modules/home/pages/mobile/applications/mobile-app.component.ts

@ -101,7 +101,7 @@ export class MobileAppComponent extends EntityComponent<MobileApp> {
form.get('status').valueChanges.pipe(
takeUntilDestroyed()
).subscribe((value: MobileAppStatus) => {
if (value !== MobileAppStatus.DRAFT) {
if (value === MobileAppStatus.PUBLISHED) {
form.get('storeInfo.storeLink').addValidators(Validators.required);
form.get('storeInfo.sha256CertFingerprints')
.addValidators(Validators.required);

Loading…
Cancel
Save