various code quality fixes (#5792)

* various code quality fixes

* reduce duplicated code

* add safety check
This commit is contained in:
Denys Vuika
2020-06-18 17:57:46 +01:00
committed by GitHub
parent dc2060fe49
commit e9350bd297
54 changed files with 96 additions and 154 deletions

View File

@@ -71,8 +71,8 @@ export class LicenseModel {
this.remainingDays = obj.remainingDays || null;
this.holder = obj.holder || null;
this.mode = obj.mode || null;
this.isClusterEnabled = obj.isClusterEnabled ? true : false;
this.isCryptodocEnabled = obj.isCryptodocEnabled ? true : false;
this.isClusterEnabled = !!obj.isClusterEnabled;
this.isCryptodocEnabled = !!obj.isCryptodocEnabled;
}
}
}
@@ -85,10 +85,10 @@ export class VersionStatusModel {
constructor(obj?: any) {
if (obj) {
this.isReadOnly = obj.isReadOnly ? true : false;
this.isAuditEnabled = obj.isAuditEnabled ? true : false;
this.isQuickShareEnabled = obj.isQuickShareEnabled ? true : false;
this.isThumbnailGenerationEnabled = obj.isThumbnailGenerationEnabled ? true : false;
this.isReadOnly = !!obj.isReadOnly;
this.isAuditEnabled = !!obj.isAuditEnabled;
this.isQuickShareEnabled = !!obj.isQuickShareEnabled;
this.isThumbnailGenerationEnabled = !!obj.isThumbnailGenerationEnabled;
}
}
}