Rename pkgTitle to title
This commit is contained in:
parent
5a848477fc
commit
3a441567d9
@ -36,4 +36,4 @@ DROP INDEX IF EXISTS idx_widgets_bundle_external_id;
|
||||
|
||||
-- DROP INDEXES THAT DUPLICATE UNIQUE CONSTRAINT END
|
||||
|
||||
ALTER TABLE mobile_app ADD COLUMN IF NOT EXISTS pkg_title varchar(255);
|
||||
ALTER TABLE mobile_app ADD COLUMN IF NOT EXISTS title varchar(255);
|
||||
@ -44,8 +44,8 @@ public class MobileApp extends BaseData<MobileAppId> implements HasTenantId, Has
|
||||
@Length(fieldName = "pkgName")
|
||||
private String pkgName;
|
||||
@Schema(description = "Application package title")
|
||||
@Length(fieldName = "pkgTitle")
|
||||
private String pkgTitle;
|
||||
@Length(fieldName = "title")
|
||||
private String title;
|
||||
@Schema(description = "Application secret. The length must be at least 16 characters", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Length(fieldName = "appSecret", min = 16, max = 2048, message = "must be at least 16 and max 2048 characters")
|
||||
@ -75,7 +75,7 @@ public class MobileApp extends BaseData<MobileAppId> implements HasTenantId, Has
|
||||
super(mobile);
|
||||
this.tenantId = mobile.tenantId;
|
||||
this.pkgName = mobile.pkgName;
|
||||
this.pkgTitle = mobile.pkgTitle;
|
||||
this.title = mobile.title;
|
||||
this.appSecret = mobile.appSecret;
|
||||
this.platformType = mobile.platformType;
|
||||
this.status = mobile.status;
|
||||
|
||||
@ -457,7 +457,7 @@ public class ModelConstants {
|
||||
*/
|
||||
public static final String MOBILE_APP_TABLE_NAME = "mobile_app";
|
||||
public static final String MOBILE_APP_PKG_NAME_PROPERTY = "pkg_name";
|
||||
public static final String MOBILE_APP_PKG_TITLE_PROPERTY = "pkg_title";
|
||||
public static final String MOBILE_APP_TITLE_PROPERTY = "title";
|
||||
public static final String MOBILE_APP_APP_SECRET_PROPERTY = "app_secret";
|
||||
public static final String MOBILE_APP_PLATFORM_TYPE_PROPERTY = "platform_type";
|
||||
public static final String MOBILE_APP_STATUS_PROPERTY = "status";
|
||||
|
||||
@ -53,8 +53,8 @@ public class MobileAppEntity extends BaseSqlEntity<MobileApp> {
|
||||
@Column(name = ModelConstants.MOBILE_APP_PKG_NAME_PROPERTY)
|
||||
private String pkgName;
|
||||
|
||||
@Column(name = ModelConstants.MOBILE_APP_PKG_TITLE_PROPERTY)
|
||||
private String pkgTitle;
|
||||
@Column(name = ModelConstants.MOBILE_APP_TITLE_PROPERTY)
|
||||
private String title;
|
||||
|
||||
@Column(name = ModelConstants.MOBILE_APP_APP_SECRET_PROPERTY)
|
||||
private String appSecret;
|
||||
@ -85,7 +85,7 @@ public class MobileAppEntity extends BaseSqlEntity<MobileApp> {
|
||||
this.tenantId = mobile.getTenantId().getId();
|
||||
}
|
||||
this.pkgName = mobile.getPkgName();
|
||||
this.pkgTitle = mobile.getPkgTitle();
|
||||
this.title = mobile.getTitle();
|
||||
this.appSecret = mobile.getAppSecret();
|
||||
this.platformType = mobile.getPlatformType();
|
||||
this.status = mobile.getStatus();
|
||||
@ -102,7 +102,7 @@ public class MobileAppEntity extends BaseSqlEntity<MobileApp> {
|
||||
}
|
||||
mobile.setCreatedTime(createdTime);
|
||||
mobile.setPkgName(pkgName);
|
||||
mobile.setPkgTitle(pkgTitle);
|
||||
mobile.setTitle(title);
|
||||
mobile.setAppSecret(appSecret);
|
||||
mobile.setPlatformType(platformType);
|
||||
mobile.setStatus(status);
|
||||
|
||||
@ -626,7 +626,7 @@ CREATE TABLE IF NOT EXISTS mobile_app (
|
||||
created_time bigint NOT NULL,
|
||||
tenant_id uuid,
|
||||
pkg_name varchar(255),
|
||||
pkg_title varchar(255),
|
||||
title varchar(255),
|
||||
app_secret varchar(2048),
|
||||
platform_type varchar(32),
|
||||
status varchar(32),
|
||||
|
||||
@ -83,7 +83,7 @@ export class MobileAppTableConfigResolver {
|
||||
onAction: (_$event, entity) => entity.pkgName,
|
||||
type: CellActionDescriptorType.COPY_BUTTON
|
||||
}),
|
||||
new EntityTableColumn<MobileApp>('pkgTitle', 'mobile.mobile-package-title', '20%'),
|
||||
new EntityTableColumn<MobileApp>('title', 'mobile.mobile-package-title', '20%'),
|
||||
new EntityTableColumn<MobileApp>('appSecret', 'mobile.application-secret', '15%',
|
||||
(entity) => this.truncatePipe.transform(entity.appSecret, true, 10, '…'), () => ({}),
|
||||
true, () => ({}), () => undefined, false,
|
||||
|
||||
@ -40,9 +40,9 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
||||
<mat-label translate>mobile.mobile-package-title</mat-label>
|
||||
<input matInput formControlName="pkgTitle">
|
||||
<input matInput formControlName="title">
|
||||
<mat-hint></mat-hint>
|
||||
<mat-error *ngIf="entityForm.get('pkgName').hasError('maxlength')">
|
||||
<mat-error *ngIf="entityForm.get('title').hasError('maxlength')">
|
||||
{{ 'mobile.mobile-package-title-max-length' | translate }}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@ -65,7 +65,7 @@ export class MobileAppComponent extends EntityComponent<MobileApp> {
|
||||
const form = this.fb.group({
|
||||
pkgName: [entity?.pkgName ?? '', [Validators.required, Validators.maxLength(255),
|
||||
Validators.pattern(/^[a-zA-Z][a-zA-Z\d_]*(?:\.[a-zA-Z][a-zA-Z\d_]*)+$/)]],
|
||||
pkgTitle: [entity?.pkgTitle ?? '', [Validators.maxLength(255)]],
|
||||
title: [entity?.title ?? '', [Validators.maxLength(255)]],
|
||||
platformType: [entity?.platformType ?? PlatformType.ANDROID],
|
||||
appSecret: [entity?.appSecret ? entity.appSecret : btoa(randomAlphanumeric(64)), [Validators.required, this.base64Format]],
|
||||
status: [entity?.status ? entity.status : MobileAppStatus.DRAFT],
|
||||
|
||||
@ -23,6 +23,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { ActionPreferencesPutUserSettings } from '@core/auth/auth.actions';
|
||||
import { MobileApp } from '@shared/models/mobile-app.models';
|
||||
import { ImportExportService } from '@shared/import-export/import-export.service';
|
||||
import { isNotEmptyStr } from '@core/utils';
|
||||
|
||||
export interface MobileAppConfigurationDialogData {
|
||||
afterAdd: boolean;
|
||||
@ -75,13 +76,13 @@ export class MobileAppConfigurationDialogComponent extends DialogComponent<Mobil
|
||||
};
|
||||
if (!!this.data.androidApp) {
|
||||
settings.androidApplicationId = this.data.androidApp.pkgName;
|
||||
settings.androidApplicationName = this.data.androidApp.pkgTitle ?? this.data.bundleTitle;
|
||||
settings.androidApplicationName = isNotEmptyStr(this.data.androidApp.title) ? this.data.androidApp.title : this.data.bundleTitle;
|
||||
settings.thingsboardOAuth2CallbackUrlScheme = this.data.androidApp.pkgName + '.auth';
|
||||
settings.thingsboardAndroidAppSecret = this.data.androidApp.appSecret;
|
||||
}
|
||||
if (!!this.data.iosApp) {
|
||||
settings.iosApplicationId = this.data.iosApp.pkgName;
|
||||
settings.iosApplicationName = this.data.iosApp.pkgTitle ?? this.data.bundleTitle;
|
||||
settings.iosApplicationName = isNotEmptyStr(this.data.iosApp.title) ? this.data.iosApp.title : this.data.bundleTitle;
|
||||
settings.thingsboardIOSAppSecret = this.data.iosApp.appSecret;
|
||||
}
|
||||
this.importExportService.exportJson(settings, this.fileName);
|
||||
|
||||
@ -85,7 +85,7 @@ export interface StoreInfo {
|
||||
|
||||
export interface MobileApp extends BaseData<MobileAppId>, HasTenantId {
|
||||
pkgName: string;
|
||||
pkgTitle?: string;
|
||||
title?: string;
|
||||
appSecret: string;
|
||||
platformType: PlatformType;
|
||||
status: MobileAppStatus;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user