From 4cef55ded8fa19c1180b6d2fc557045c35a6560c Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Wed, 22 Jan 2020 16:10:30 +0900 Subject: [PATCH] check for updates is modified --- .../native/components/top-bar.component.html | 54 +++++++++---------- .../native/components/top-bar.component.scss | 2 +- .../native/components/top-bar.component.ts | 15 ++++-- .../src/assets/i18n/en.json | 4 +- .../src/assets/i18n/ko.json | 4 +- 5 files changed, 42 insertions(+), 37 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html index b15f3e50..3be622ae 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html @@ -309,10 +309,13 @@ -
- +
+ {{ 'information.checkForUpdates' | translate }}
@@ -432,39 +435,32 @@
-
- {{ 'information.version' | translate }}: {{ appVersion }} +
- + {{ 'information.installedVersion' | translate }}:{{ appVersion }} + +
+
+
- -
-
-
{{ 'information.checkForUpdatesInProgress' | translate }}
-
- {{ - 'information.updateIsExist' - | translate: { version: checkingUpdateAppVersion } - }} - -
-
- {{ 'information.updateIsNotExist' | translate }} + +
+ + {{ 'information.latestVersion' | translate }}:{{ + checkingUpdateAppVersion + }} + + + +
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.scss index 2ed72c8b..8314652e 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.scss +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.scss @@ -294,5 +294,5 @@ } .version-info-container { - width: 200px; + width: 250px; } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts index 85e859ec..b03ee6f8 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts @@ -110,6 +110,7 @@ export class TopBarComponent implements OnInit, OnDestroy { checkingUpdate = false; checkingUpdateIsProcessing = false; checkingUpdateAppVersion: string; + checkingUpdateIsExist = false; readonly awayTimeList = [10, 20, 30]; @@ -499,13 +500,20 @@ export class TopBarComponent implements OnInit, OnDestroy { ); } + onClickCheckForUpdates(event: Event) { + event.stopPropagation(); + + this.checkForUpdates(); + } + onClosedInformationMenu() { this.checkingUpdate = false; this.checkingUpdateIsProcessing = false; this.checkingUpdateAppVersion = undefined; + this.checkingUpdateIsExist = false; } - onClickCheckUpdate(event: Event) { + checkForUpdates() { this.checkingUpdate = true; this.checkingUpdateIsProcessing = true; @@ -524,10 +532,11 @@ export class TopBarComponent implements OnInit, OnDestroy { .pipe(take(1)) .subscribe( res => { + this.checkingUpdateAppVersion = res.appVersion; if (semver.lt(this.appVersion, res.appVersion)) { - this.checkingUpdateAppVersion = res.appVersion; + this.checkingUpdateIsExist = true; } else { - this.checkingUpdateAppVersion = undefined; + this.checkingUpdateIsExist = false; } }, error => {}, diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/en.json b/projects/ucap-webmessenger-app/src/assets/i18n/en.json index 9a21d932..2d97fa9c 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/en.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/en.json @@ -76,10 +76,10 @@ "information": { "label": "Information", "version": "Version", + "installedVersion": "Installed version", + "latestVersion": "Latest version", "checkForUpdates": "Check for updates", "checkForUpdatesInProgress": "Checking for updates", - "updateIsExist": "There is a new version [{{version}}].", - "updateIsNotExist": "The version of the app is up to date.", "applyUpdates": "Update" }, "settings": { diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json index 03a19034..c9b45b38 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json @@ -76,10 +76,10 @@ "information": { "label": "정보", "version": "버전", + "installedVersion": "설치된 버전", + "latestVersion": "최신 버전", "checkForUpdates": "업데이트 확인", "checkForUpdatesInProgress": "업데이트를 확인하고 있습니다.", - "updateIsExist": "새로운 버전[{{version}}]이 존재합니다.", - "updateIsNotExist": "최신 버전이 적용되어 있습니다.", "applyUpdates": "업데이트 설치" }, "settings": {