Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ exports[`test base/home/NotFoundProject should match snapshot 1`] = `
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand Down Expand Up @@ -294,7 +294,7 @@ exports[`test base/home/NotFoundProject should match snapshot 1`] = `
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { IBindProject } from './index.type';
import { FlagFilled, LockOutlined } from '@actiontech/icons';
import { useTypedNavigate } from '@actiontech/shared';
import { ROUTE_PATHS } from '@actiontech/dms-kit';
import { BasicTypographyEllipsis, ROUTE_PATHS } from '@actiontech/dms-kit';

const MockSelectItemOptions: React.FC<{
list: IBindProject[];
Expand Down Expand Up @@ -51,7 +51,11 @@
)}

<span className="project-selector-label-text">
{v.project_name}
<BasicTypographyEllipsis
tooltipsMaxWidth={400}
textCont={v.project_name ?? ''}

Check warning on line 56 in packages/base/src/page/Nav/SideMenu/ProjectSelector/MockSelectItemOptions.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
copyable={false}
/>
</span>
</ProjectSelectorLabelStyleWrapper>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand All @@ -28,7 +28,11 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
<span
class="project-selector-label-text"
>
test1
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test1
</div>
</span>
</div>
</div>
Expand All @@ -40,7 +44,7 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
class="project-flag-icon"
Expand All @@ -58,7 +62,11 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
<span
class="project-selector-label-text"
>
test2
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test2
</div>
</span>
</div>
</div>
Expand All @@ -81,7 +89,7 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand All @@ -96,7 +104,11 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
<span
class="project-selector-label-text"
>
test1
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test1
</div>
</span>
</div>
</div>
Expand All @@ -108,7 +120,7 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
class="project-flag-icon"
Expand All @@ -126,7 +138,11 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
<span
class="project-selector-label-text"
>
test2
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test2
</div>
</span>
</div>
</div>
Expand All @@ -149,7 +165,7 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand All @@ -164,7 +180,11 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
<span
class="project-selector-label-text"
>
test1
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test1
</div>
</span>
</div>
</div>
Expand All @@ -176,7 +196,7 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
class="project-flag-icon"
Expand All @@ -194,7 +214,11 @@ exports[`base/page/Nav/SideMenu/MockSelectItemOptions should render snap when ha
<span
class="project-selector-label-text"
>
test2
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test2
</div>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 2`] =
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand All @@ -818,7 +818,11 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 2`] =
<span
class="project-selector-label-text"
>
test1
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test1
</div>
</span>
</div>
</div>
Expand All @@ -830,7 +834,7 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 2`] =
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
class="project-flag-icon"
Expand All @@ -848,7 +852,11 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 2`] =
<span
class="project-selector-label-text"
>
test2
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test2
</div>
</span>
</div>
</div>
Expand Down Expand Up @@ -1104,7 +1112,7 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 3`] =
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand All @@ -1119,7 +1127,11 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 3`] =
<span
class="project-selector-label-text"
>
test1
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test1
</div>
</span>
</div>
</div>
Expand All @@ -1131,7 +1143,7 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 3`] =
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
class="project-flag-icon"
Expand All @@ -1149,7 +1161,11 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 3`] =
<span
class="project-selector-label-text"
>
test2
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test2
</div>
</span>
</div>
</div>
Expand Down Expand Up @@ -1405,7 +1421,7 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 4`] =
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand All @@ -1420,7 +1436,11 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 4`] =
<span
class="project-selector-label-text"
>
test1
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test1
</div>
</span>
</div>
</div>
Expand All @@ -1432,7 +1452,7 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 4`] =
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
class="project-flag-icon"
Expand All @@ -1450,7 +1470,11 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 4`] =
<span
class="project-selector-label-text"
>
test2
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test2
</div>
</span>
</div>
</div>
Expand Down Expand Up @@ -1665,7 +1689,7 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 5`] =
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
height="18"
Expand All @@ -1680,7 +1704,11 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 5`] =
<span
class="project-selector-label-text"
>
test1
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test1
</div>
</span>
</div>
</div>
Expand All @@ -1692,7 +1720,7 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 5`] =
class="ant-select-item-option-content"
>
<div
class="css-gmbytu"
class="css-1abqcxt"
>
<svg
class="project-flag-icon"
Expand All @@ -1710,7 +1738,11 @@ exports[`base/page/Nav/SideMenu/ProjectSelector render snap when has data 5`] =
<span
class="project-selector-label-text"
>
test2
<div
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line basic-typography-ellipsis css-wgj5gs"
>
test2
</div>
</span>
</div>
</div>
Expand Down
9 changes: 9 additions & 0 deletions packages/base/src/page/Nav/SideMenu/ProjectSelector/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export const ProjectSelectorStyleWrapper = styled(CustomSelect)`
export const ProjectSelectorLabelStyleWrapper = styled('div')`
display: flex;
align-items: center;
min-width: 0;
flex: 1 1 auto;
max-width: 100%;

& > svg,
& > .anticon {
flex-shrink: 0;
}

&:hover {
.project-flag-icon {
Expand All @@ -56,6 +64,7 @@ export const ProjectSelectorLabelStyleWrapper = styled('div')`

.project-selector-label-text {
margin-left: 8px;
max-width: 300px;
color: ${({ theme }) =>
theme.baseTheme.sideMenu.projectSelector.dropdown.labelColor};
}
Expand Down
Loading
Loading