Skip to content

Commit

Permalink
[MS] Renamed favorites to pinned
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-7 committed Jan 15, 2025
1 parent 0f7eaa7 commit bc2fec3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
6 changes: 3 additions & 3 deletions client/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@
"actionShare": "Sharing and roles",
"actionDetails": "Details",
"actionCopyLink": "Copy link",
"actionAddFavorite": "Add to favorites",
"actionRemoveFavorite": "Remove from favorites"
"actionAddFavorite": "Pin",
"actionRemoveFavorite": "Unpin"
},
"CreateWorkspaceModal": {
"pageTitle": "Create a new workspace",
Expand Down Expand Up @@ -699,7 +699,7 @@
"SideMenu": {
"workspaces": "Workspaces",
"recentWorkspaces": "Recent workspaces",
"favorites": "Favorites",
"favorites": "Pinned",
"noWorkspace": "No workspaces",
"users": "Users",
"storage": "Storage",
Expand Down
6 changes: 3 additions & 3 deletions client/src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@
"actionShare": "Partage et rôles",
"actionDetails": "Détails",
"actionCopyLink": "Copier le lien",
"actionAddFavorite": "Ajouter aux favoris",
"actionRemoveFavorite": "Retirer des favoris"
"actionAddFavorite": "Épingler",
"actionRemoveFavorite": "Désépingler"
},
"CreateWorkspaceModal": {
"pageTitle": "Créer un nouvel espace de travail",
Expand Down Expand Up @@ -699,7 +699,7 @@
"SideMenu": {
"workspaces": "Espaces de travail",
"recentWorkspaces": "Espaces récents",
"favorites": "Favoris",
"favorites": "Épinglés",
"noWorkspace": "Aucun espace de travail",
"users": "Utilisateurs",
"storage": "Stockage",
Expand Down
32 changes: 26 additions & 6 deletions client/src/views/sidebar-menu/SidebarMenuPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@
v-model:is-content-visible="workspacesMenuVisible"
@update:is-content-visible="onWorkspacesMenuVisibilityChanged"
>
<ion-text
class="body list-sidebar__no-workspace"
v-if="workspaces.length === 0"
>
{{ $msTranslate('SideMenu.noWorkspace') }}
</ion-text>
<sidebar-workspace-item
v-for="workspace in recentDocumentManager.getWorkspaces()"
:workspace="workspace"
Expand All @@ -210,6 +204,18 @@
"
/>
</sidebar-menu-list>
<div
class="current-workspace"
v-if="!workspacesMenuVisible && currentWorkspace"
>
<sidebar-workspace-item
:workspace="currentWorkspace"
@workspace-click="goToWorkspace"
@context-menu-requested="
openWorkspaceContextMenu($event, currentWorkspace, favorites, eventDistributor, informationManager, storageManager, true)
"
/>
</div>
</div>

<div
Expand Down Expand Up @@ -341,6 +347,7 @@ import {
currentRouteIs,
currentRouteIsOrganizationManagementRoute,
currentRouteIsUserRoute,
currentRouteIsWorkspaceRoute,
navigateTo,
navigateToWorkspace,
switchOrganization,
Expand Down Expand Up @@ -437,6 +444,15 @@ const watchSidebarWidthCancel = watch(computedWidth, async (value: number) => {

const isManagement = currentRouteIsOrganizationManagementRoute;

const currentWorkspace = computed(() => {
for (const wk of recentDocumentManager.getWorkspaces()) {
if (currentRouteIsWorkspaceRoute(wk.handle)) {
return wk;
}
}
return undefined;
});

async function goToWorkspace(workspace: WorkspaceInfo): Promise<void> {
recentDocumentManager.addWorkspace(workspace);
await recentDocumentManager.saveToStorage(storageManager);
Expand Down Expand Up @@ -811,6 +827,10 @@ async function onRecentFilesMenuVisibilityChanged(visible: boolean): Promise<voi
}
}

.current-workspace {
margin-bottom: 1rem;
}

.back-organization {
display: flex;
align-items: center;
Expand Down

0 comments on commit bc2fec3

Please sign in to comment.