-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show active tab name in status bar (#51108)
* Show active document in the status bar * Update reading breadcrumbs value in tests * Show db name first and then username * Add helpers for making documents * Show document icon in tabs and adjust styling * Update gateway title from the document title * Fix document helpers * Put breadcrumbs in title * Simplify breadcrumb key * Optimize `useActiveDocumentClusterBreadcrumbs` * Deprecate `isDocumentTshNodeWithLoginHost` and `isDocumentTshNodeWithServerId` * Remove `aria-label="breadcrumbs"` * Replace id with class * Reuse `makeAppGateway`, `makeDatabaseGateway` and `makeKubeGateway` helpers in docs helpers * Add a comment about updating gateway title * Re-update the format of db gateways title * Render entire TabHost instead of only tabs * Make comment more specific (cherry picked from commit d1862f3)
- Loading branch information
Showing
14 changed files
with
466 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* Teleport | ||
* Copyright (C) 2025 Gravitational, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Meta } from '@storybook/react'; | ||
import { createRef } from 'react'; | ||
|
||
import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; | ||
import { ResourcesContextProvider } from 'teleterm/ui/DocumentCluster/resourcesContext'; | ||
import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; | ||
import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; | ||
import { Document } from 'teleterm/ui/services/workspacesService'; | ||
import { | ||
makeDocumentAccessRequests, | ||
makeDocumentAuthorizeWebSession, | ||
makeDocumentCluster, | ||
makeDocumentConnectMyComputer, | ||
makeDocumentGatewayApp, | ||
makeDocumentGatewayCliClient, | ||
makeDocumentGatewayDatabase, | ||
makeDocumentGatewayKube, | ||
makeDocumentPtySession, | ||
makeDocumentTshNode, | ||
} from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; | ||
|
||
import { TabHostContainer } from './TabHost'; | ||
|
||
const meta: Meta = { | ||
title: 'Teleterm/TabHost', | ||
}; | ||
|
||
export default meta; | ||
|
||
const allDocuments: Document[] = [ | ||
makeDocumentCluster(), | ||
makeDocumentTshNode(), | ||
makeDocumentConnectMyComputer(), | ||
makeDocumentGatewayDatabase(), | ||
makeDocumentGatewayApp(), | ||
makeDocumentGatewayCliClient(), | ||
makeDocumentGatewayKube(), | ||
makeDocumentAccessRequests(), | ||
makeDocumentPtySession(), | ||
makeDocumentAuthorizeWebSession(), | ||
]; | ||
|
||
const cluster = makeRootCluster(); | ||
|
||
export function Story() { | ||
const ctx = new MockAppContext(); | ||
ctx.addRootClusterWithDoc(cluster, allDocuments); | ||
return ( | ||
<MockAppContextProvider appContext={ctx}> | ||
<ResourcesContextProvider> | ||
<TabHostContainer topBarContainerRef={createRef()} /> | ||
</ResourcesContextProvider> | ||
</MockAppContextProvider> | ||
); | ||
} |
Oops, something went wrong.