Merge pull request #12457 from vvlladd28/improvement/mobile-app/store-info-validation
Synchronize validation rules for the mobile app configuration form with the API
This commit is contained in:
		
						commit
						691dc4bbd1
					
				@ -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"
 | 
			
		||||
 | 
			
		||||
@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user