UBERF-9165: Fix archived workspace select (#7712)

Fix workspace loading issue when click on archived

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2025-01-20 12:11:03 +07:00 committed by GitHub
parent 67ca63dace
commit 46084e0c82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 52 additions and 22 deletions

View File

@ -57,6 +57,7 @@
"Next": "Další",
"Skip": "Přeskočit",
"SignUpCompleted": "Registrace dokončena",
"StartUsingHuly": "Začněte používat Huly"
"StartUsingHuly": "Začněte používat Huly",
"WorkspaceIsArchived": "Pracovní prostor je archivován kvůli nečinnosti. Kontaktujte nás prosím pro obnovení..."
}
}

View File

@ -57,6 +57,7 @@
"Next": "Weiter",
"Skip": "Überspringen",
"SignUpCompleted": "Registrierung abgeschlossen",
"StartUsingHuly": "Starten Sie mit Huly"
"StartUsingHuly": "Starten Sie mit Huly",
"WorkspaceArchivedDesc": "Workspace wurde wegen Inaktivität archiviert. Bitte kontaktieren Sie uns zur Wiederherstellung..."
}
}

View File

@ -57,6 +57,7 @@
"Next": "Next",
"Skip": "Skip",
"SignUpCompleted": "Sign up completed",
"StartUsingHuly": "Start using Huly"
"StartUsingHuly": "Start using Huly",
"WorkspaceArchivedDesc": "Workspace is archived because of being unused, Please contact us to restore..."
}
}

View File

@ -57,6 +57,7 @@
"Next": "Siguiente",
"Skip": "Saltar",
"SignUpCompleted": "Registro completado",
"StartUsingHuly": "Comienza a usar Huly"
"StartUsingHuly": "Comienza a usar Huly",
"WorkspaceArchivedDesc": "El espacio de trabajo está archivado por no estar en uso, por favor contáctenos para restaurarlo..."
}
}

View File

@ -57,6 +57,7 @@
"Next": "Suivant",
"Skip": "Passer",
"SignUpCompleted": "Inscription terminée",
"StartUsingHuly": "Commencez à utiliser Huly"
"StartUsingHuly": "Commencez à utiliser Huly",
"WorkspaceArchivedDesc": "L'espace de travail est archivé en raison de son inactivité, veuillez nous contacter pour le restaurer..."
}
}

View File

@ -57,6 +57,7 @@
"Next": "Avanti",
"Skip": "Salta",
"SignUpCompleted": "Registrazione completata",
"StartUsingHuly": "Inizia a usare Huly"
"StartUsingHuly": "Inizia a usare Huly",
"WorkspaceArchivedDesc": "Il workspace è stato archiviato perché inutilizzato. Si prega di contattarci per ripristinarlo..."
}
}

View File

@ -57,6 +57,7 @@
"Next": "Seguinte",
"Skip": "Saltar",
"SignUpCompleted": "Registo concluído",
"StartUsingHuly": "Começar a usar Huly"
"StartUsingHuly": "Começar a usar Huly",
"WorkspaceArchivedDesc": "O espaço de trabalho está arquivado por estar inativo, por favor, entre em contato conosco para restaurá-lo..."
}
}

View File

@ -57,6 +57,7 @@
"Next": "Дальше",
"Skip": "Пропустить",
"SignUpCompleted": "Регистрация завершена",
"StartUsingHuly": "Начать использовать Huly"
"StartUsingHuly": "Начать использовать Huly",
"WorkspaceArchivedDesc": "Рабочее пространство архивировано из-за неиспользования, пожалуйста, свяжитесь с нами для восстановления..."
}
}

View File

@ -57,6 +57,7 @@
"Next": "下一个",
"Skip": "跳过",
"SignUpCompleted": "注册完成",
"StartUsingHuly": "开始使用 Huly"
"StartUsingHuly": "开始使用 Huly",
"WorkspaceArchivedDesc": "工作区因未使用而归档,请与我们联系以恢复..."
}
}

View File

@ -60,7 +60,8 @@
(it) =>
(it.workspaceName?.includes(search) ?? false) ||
(it.workspaceUrl?.includes(search) ?? false) ||
it.workspace?.includes(search)
it.workspace?.includes(search) ||
it.createdBy?.includes(search)
),
(it) => {
const lastUsageDays = Math.round((now - it.lastVisit) / (1000 * 3600 * 24))
@ -169,6 +170,9 @@
/>
</div>
</span>
<div class="ml-1" style:width={'12rem'}>
{workspace.createdBy}
</div>
<span class="label overflow-label" style:width={'8rem'}>
{workspace.region ?? ''}
</span>

View File

@ -14,24 +14,26 @@
// limitations under the License.
-->
<script lang="ts">
import { isArchivingMode } from '@hcengineering/core'
import { LoginInfo, Workspace } from '@hcengineering/login'
import { OK, Severity, Status } from '@hcengineering/platform'
import presentation, { NavLink, isAdminUser, reduceCalls } from '@hcengineering/presentation'
import MessageBox from '@hcengineering/presentation/src/components/MessageBox.svelte'
import {
Button,
Label,
Spinner,
Scroller,
SearchEdit,
Spinner,
deviceOptionsStore as deviceInfo,
setMetadataLocalStorage,
showPopup,
ticker
} from '@hcengineering/ui'
import { onMount } from 'svelte'
import login from '../plugin'
import { getAccount, getHref, getWorkspaces, goTo, navigateToWorkspace, selectWorkspace } from '../utils'
import StatusControl from './StatusControl.svelte'
import { isArchivingMode } from '@hcengineering/core'
export let navigateUrl: string | undefined = undefined
let workspaces: Workspace[] = []
@ -67,6 +69,17 @@
status = new Status(Severity.INFO, login.status.ConnectingToServer, {})
const [loginStatus, result] = await selectWorkspace(workspace)
if (isArchivingMode(result?.mode)) {
showPopup(MessageBox, {
label: login.string.SelectWorkspace,
message: login.string.WorkspaceArchivedDesc,
canSubmit: false,
params: {},
action: async () => {}
})
status = loginStatus
return
}
status = loginStatus
navigateToWorkspace(workspace, result, navigateUrl)
@ -139,17 +152,19 @@
{#if isArchivingMode(workspace.mode)}
- <Label label={presentation.string.Archived} />
{/if}
{#if workspace.mode !== 'active'}
{#if workspace.mode !== 'active' && workspace.mode !== 'archived'}
({workspace.progress}%)
{/if}
</span>
{#if isAdmin}
<span class="text-xs flex-row-center flex-center">
<span class="text-xs flex-row-center flex-center">
{#if isAdmin}
{workspace.workspace}
{#if workspace.region !== undefined}
at ({workspace.region})
{/if}
<div class="text-sm">
{/if}
<div class="text-sm">
{#if isAdmin}
{#if workspace.backupInfo != null}
{@const sz = workspace.backupInfo.dataSize + workspace.backupInfo.blobsSize}
{@const szGb = Math.round((sz * 100) / 1024) / 100}
@ -159,10 +174,10 @@
- {Math.round(sz)}Mb -
{/if}
{/if}
({lastUsageDays} days)
</div>
</span>
{/if}
{/if}
({lastUsageDays} days)
</div>
</span>
</div>
</div>
{/each}

View File

@ -85,7 +85,9 @@ export default plugin(loginId, {
LinkValidHours: '' as IntlString,
EmailMask: '' as IntlString,
NoLimit: '' as IntlString,
InviteLimit: '' as IntlString
InviteLimit: '' as IntlString,
WorkspaceArchived: '' as IntlString,
WorkspaceArchivedDesc: '' as IntlString
},
function: {
SendInvite: '' as Resource<(email: string, personId?: Ref<Doc>, role?: AccountRole) => Promise<void>>,

View File

@ -504,7 +504,7 @@ export async function selectWorkspace (
const result: WorkspaceLoginInfo = {
endpoint: '',
email,
token: '',
token: generateToken(email, getWorkspaceId(workspaceInfo.workspace), getExtra(accountInfo)),
workspace: workspaceUrl,
workspaceId: workspaceInfo.workspace,
mode: workspaceInfo.mode,