UBER-726: Ask to update if manual update is required (#3602)

This commit is contained in:
Maksim Karmatskikh 2023-08-18 07:28:16 +06:00 committed by GitHub
parent 3f0b785ebb
commit 4cb103f636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 12 deletions

View File

@ -25,6 +25,9 @@
"AccessWorkspaceSettings": "Access your workspace settings", "AccessWorkspaceSettings": "Access your workspace settings",
"HowToWorkFaster": "Learn how to work faster", "HowToWorkFaster": "Learn how to work faster",
"HiddenApplication": "Hidden application", "HiddenApplication": "Hidden application",
"OpenInNewTab": "Open in a new tab" "OpenInNewTab": "Open in a new tab",
"NewVersionAvailable": "New version is available",
"PleaseUpdate": "Please update",
"ServerUnderMaintenance": "Server is under maintenance"
} }
} }

View File

@ -25,6 +25,9 @@
"AccessWorkspaceSettings": "Открыть настройки рабочего пространства", "AccessWorkspaceSettings": "Открыть настройки рабочего пространства",
"HowToWorkFaster": "Узнайте как работать эффективнее", "HowToWorkFaster": "Узнайте как работать эффективнее",
"HiddenApplication": "Скрытое приложение", "HiddenApplication": "Скрытое приложение",
"OpenInNewTab": "Открыть в новой вкладке" "OpenInNewTab": "Открыть в новой вкладке",
"NewVersionAvailable": "Доступна новая версия",
"PleaseUpdate": "Пожалуйста, обновите приложение",
"ServerUnderMaintenance": "Обслуживание сервера"
} }
} }

View File

@ -14,11 +14,13 @@
--> -->
<script lang="ts"> <script lang="ts">
import { getMetadata } from '@hcengineering/platform' import { getMetadata } from '@hcengineering/platform'
import { Component, Loading, Notifications, location } from '@hcengineering/ui' import { Component, Label, Loading, Notifications, location } from '@hcengineering/ui'
import { connect, versionError } from '../connect' import { connect, versionError } from '../connect'
import { workbenchId } from '@hcengineering/workbench' import { workbenchId } from '@hcengineering/workbench'
import workbench from '../plugin' import workbench from '../plugin'
const isNeedUpgrade = window.location.host === ''
</script> </script>
{#if $location.path[0] === workbenchId || $location.path[0] === workbench.component.WorkbenchApp} {#if $location.path[0] === workbenchId || $location.path[0] === workbench.component.WorkbenchApp}
@ -27,10 +29,17 @@
<Loading /> <Loading />
{:then client} {:then client}
{#if !client && versionError} {#if !client && versionError}
<div class="version-wrapper">
<div class="antiPopup version-popup"> <div class="antiPopup version-popup">
<h1>Server is under maintenance.</h1> {#if isNeedUpgrade}
<h1><Label label={workbench.string.NewVersionAvailable} /></h1>
<span class="please-update"><Label label={workbench.string.PleaseUpdate} /></span>
{:else}
<h1><Label label={workbench.string.ServerUnderMaintenance} /></h1>
{/if}
{versionError} {versionError}
</div> </div>
</div>
{:else if client} {:else if client}
<Notifications> <Notifications>
<Component is={workbench.component.Workbench} /> <Component is={workbench.component.Workbench} />
@ -43,14 +52,19 @@
{/if} {/if}
<style lang="scss"> <style lang="scss">
.version-wrapper {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.please-update {
margin-bottom: 1rem;
}
.version-popup { .version-popup {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: fixed; padding: 2rem;
left: 25%;
right: 25%;
top: 25%;
bottom: 25%;
} }
</style> </style>

View File

@ -44,7 +44,10 @@ export default mergeIds(workbenchId, workbench, {
OpenPlatformGuide: '' as IntlString, OpenPlatformGuide: '' as IntlString,
AccessWorkspaceSettings: '' as IntlString, AccessWorkspaceSettings: '' as IntlString,
HowToWorkFaster: '' as IntlString, HowToWorkFaster: '' as IntlString,
OpenInNewTab: '' as IntlString OpenInNewTab: '' as IntlString,
NewVersionAvailable: '' as IntlString,
PleaseUpdate: '' as IntlString,
ServerUnderMaintenance: '' as IntlString
}, },
component: { component: {
SpacePanel: '' as AnyComponent, SpacePanel: '' as AnyComponent,