Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: prefer organization display name for workspaces table#14617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Parkreiner merged 3 commits intomainfrommes/org-name-fix
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletionssite/src/@types/storybook.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ import type {
DeploymentValues,
Experiments,
FeatureName,
Organization,
SerpentOption,
User,
} from "api/typesGenerated";
Expand All@@ -17,6 +18,7 @@ declare module "@storybook/react" {
features?: FeatureName[];
experiments?: Experiments;
showOrganizations?: boolean;
organizations?: Organization[];
queries?: { key: QueryKey; data: unknown }[];
webSocket?: WebSocketEvent[];
user?: User;
Expand Down
23 changes: 13 additions & 10 deletionssite/src/pages/WorkspacesPage/WorkspacesPageView.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,7 @@ import uniqueId from "lodash/uniqueId";
import type { ComponentProps } from "react";
import {
MockBuildInfo,
MockOrganization,
MockPendingProvisionerJob,
MockTemplate,
MockUser,
Expand DownExpand Up@@ -269,25 +270,27 @@ export const InvalidPageNumber: Story = {

export const ShowOrganizations: Story = {
args: {
workspaces: [
{
...MockWorkspace,
organization_name: "Limbus Co.",
},
],
workspaces: [{ ...MockWorkspace, organization_name: "limbus-co" }],
},

parameters: {
showOrganizations: true,
organizations: [
{
...MockOrganization,
name: "limbus-co",
display_name: "Limbus Company, LLC",
},
],
},

play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const accessibleTableCell = await canvas.findByRole("cell", {
//Need whitespace classes because different parts oftheelement
//are going in different spans, and Storybook doesn't consolidate
//these
name: /org\s?(?:anization)?\s?:\s?LimbusCo\./i,
//The organization label is always visually hidden, butthetest
//makes sure that there's a screen reader hook to give the table
//cell more structured output
name: /organization:LimbusCompany, LLC/i,
});

expect(accessibleTableCell).toBeDefined();
Expand Down
6 changes: 5 additions & 1 deletionsite/src/pages/WorkspacesPage/WorkspacesTable.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -115,6 +115,10 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
const checked = checkedWorkspaces.some(
(w) => w.id === workspace.id,
);
const activeOrg = dashboard.organizations.find(
(o) => o.id === workspace.organization_id,
);

return (
<WorkspacesRow
workspace={workspace}
Expand DownExpand Up@@ -208,7 +212,7 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
}}
>
<span css={{ ...visuallyHidden }}>Organization: </span>
{workspace.organization_name}
{activeOrg?.display_name ||workspace.organization_name}
</div>
)}
</TableCell>
Expand Down
5 changes: 3 additions & 2 deletionssite/src/testHelpers/storybook.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,7 @@ export const withDashboardProvider = (
features = [],
experiments = [],
showOrganizations = false,
organizations = [MockDefaultOrganization],
} = parameters;

const entitlements: Entitlements = {
Expand All@@ -44,9 +45,9 @@ export const withDashboardProvider = (
value={{
entitlements,
experiments,
appearance: MockAppearanceConfig,
organizations: [MockDefaultOrganization],
organizations,
showOrganizations,
appearance: MockAppearanceConfig,
}}
>
<Story />
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp