Disable workbench for mobile (#4853)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-03-01 22:31:15 +06:00 committed by GitHub
parent fddf5270b6
commit 5cd8dca583
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 43 additions and 30 deletions

View File

@ -28,6 +28,7 @@
"OpenInNewTab": "Open in a new tab",
"NewVersionAvailable": "New version is available",
"PleaseUpdate": "Please update",
"ServerUnderMaintenance": "Server is under maintenance"
"ServerUnderMaintenance": "Server is under maintenance",
"MobileNotSupported": "Sorry, mobile devices support coming soon. In the meantime, please use Desktop"
}
}

View File

@ -28,6 +28,7 @@
"OpenInNewTab": "Abrir en una nueva pestaña",
"NewVersionAvailable": "Nueva versión disponible",
"PleaseUpdate": "Por favor, actualice",
"ServerUnderMaintenance": "El servidor está en mantenimiento"
"ServerUnderMaintenance": "El servidor está en mantenimiento",
"MobileNotSupported": "Disculpa, el soporte para dispositivos móviles estará disponible próximamente. Mientras tanto, por favor usa el escritorio."
}
}

View File

@ -28,6 +28,7 @@
"OpenInNewTab": "Abrir num novo separador",
"NewVersionAvailable": "Nova versão disponível",
"PleaseUpdate": "Atualize",
"ServerUnderMaintenance": "Servidor em manutenção"
"ServerUnderMaintenance": "Servidor em manutenção",
"MobileNotSupported": "Desculpe, o suporte para dispositivos móveis estará disponível em breve. Enquanto isso, por favor, use o Desktop."
}
}

View File

@ -28,6 +28,7 @@
"OpenInNewTab": "Открыть в новой вкладке",
"NewVersionAvailable": "Доступна новая версия",
"PleaseUpdate": "Пожалуйста, обновите приложение",
"ServerUnderMaintenance": "Обслуживание сервера"
"ServerUnderMaintenance": "Обслуживание сервера",
"MobileNotSupported": "Простите, поддержка мобильных устройств скоро будет доступна. Пока воспользуйтесь компьютером."
}
}

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import { getMetadata } from '@hcengineering/platform'
import { Component, Label, Loading, Notifications, location } from '@hcengineering/ui'
import { Component, Label, Loading, Notifications, deviceOptionsStore, location } from '@hcengineering/ui'
import { connect, versionError } from '../connect'
import { workbenchId } from '@hcengineering/workbench'
@ -24,31 +24,39 @@
</script>
{#if $location.path[0] === workbenchId || $location.path[0] === workbench.component.WorkbenchApp}
{#key $location.path[1]}
{#await connect(getMetadata(workbench.metadata.PlatformTitle) ?? 'Platform')}
<Loading />
{:then client}
{#if !client && versionError}
<div class="version-wrapper">
<div class="antiPopup version-popup">
{#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}
{#if $deviceOptionsStore.isMobile}
<div class="version-wrapper">
<div class="antiPopup version-popup">
<h1><Label label={workbench.string.MobileNotSupported} /></h1>
</div>
</div>
{:else}
{#key $location.path[1]}
{#await connect(getMetadata(workbench.metadata.PlatformTitle) ?? 'Platform')}
<Loading />
{:then client}
{#if !client && versionError}
<div class="version-wrapper">
<div class="antiPopup version-popup">
{#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}
</div>
</div>
</div>
{:else if client}
<Notifications>
<Component is={workbench.component.Workbench} />
</Notifications>
{/if}
{:catch error}
<div>{error} -- {error.stack}</div>
{/await}
{/key}
{:else if client}
<Notifications>
<Component is={workbench.component.Workbench} />
</Notifications>
{/if}
{:catch error}
<div>{error} -- {error.stack}</div>
{/await}
{/key}
{/if}
{/if}
<style lang="scss">

View File

@ -41,7 +41,8 @@ export default mergeIds(workbenchId, workbench, {
HowToWorkFaster: '' as IntlString,
OpenInNewTab: '' as IntlString,
NewVersionAvailable: '' as IntlString,
PleaseUpdate: '' as IntlString
PleaseUpdate: '' as IntlString,
MobileNotSupported: '' as IntlString
},
component: {
SpacePanel: '' as AnyComponent,