diff --git a/ui/src/app/applications/components/application-details/application-details.tsx b/ui/src/app/applications/components/application-details/application-details.tsx index 56c3f634cb263..3ff44795a4a18 100644 --- a/ui/src/app/applications/components/application-details/application-details.tsx +++ b/ui/src/app/applications/components/application-details/application-details.tsx @@ -35,6 +35,7 @@ interface ApplicationDetailsState { groupedResources?: ResourceStatus[]; slidingPanelPage?: number; filteredGraph?: any[]; + truncateNameOnRight?: boolean; } interface FilterInput { @@ -69,7 +70,7 @@ export class ApplicationDetails extends React.Component) { super(props); - this.state = {page: 0, groupedResources: [], slidingPanelPage: 0, filteredGraph: []}; + this.state = {page: 0, groupedResources: [], slidingPanelPage: 0, filteredGraph: [], truncateNameOnRight: false}; } private get showOperationState() { @@ -225,6 +226,9 @@ export class ApplicationDetails extends React.Component { this.setState({filteredGraph: filterGraph}); }; + const toggleNameDirection = () => { + this.setState({truncateNameOnRight: !this.state.truncateNameOnRight}); + }; return (
+ { + toggleNameDirection(); + }} + title={this.state.truncateNameOnRight ? 'Truncate resource name right' : 'Truncate resource name left'}> + + {pref.view === 'tree' && ( openGroupNodeDetails(groupdedNodeIds)} zoom={pref.zoom} + nameDirection={this.state.truncateNameOnRight} filters={pref.resourceFilter} setTreeFilterGraph={setFilterGraph} /> diff --git a/ui/src/app/applications/components/application-resource-tree/application-resource-tree.scss b/ui/src/app/applications/components/application-resource-tree/application-resource-tree.scss index bf2c25ddd9276..206cc8fc81312 100644 --- a/ui/src/app/applications/components/application-resource-tree/application-resource-tree.scss +++ b/ui/src/app/applications/components/application-resource-tree/application-resource-tree.scss @@ -168,12 +168,20 @@ } &__node-content { - padding: 10px; + padding: 10px 20px 10px 10px; line-height: 0.95; + display: flex; + flex-direction: column; } &__node-title { font-size: 0.8em; + padding-bottom: 5px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: left; + } &__node-status-icon { @@ -182,4 +190,11 @@ margin-right: 2px; } } + &__direction-left { + direction: ltl; + } + &__direction-right { + direction: rtl; + } + } diff --git a/ui/src/app/applications/components/application-resource-tree/application-resource-tree.tsx b/ui/src/app/applications/components/application-resource-tree/application-resource-tree.tsx index 0a5438385eeb5..ef1ea4fa16e09 100644 --- a/ui/src/app/applications/components/application-resource-tree/application-resource-tree.tsx +++ b/ui/src/app/applications/components/application-resource-tree/application-resource-tree.tsx @@ -46,6 +46,7 @@ export interface ApplicationResourceTreeProps { zoom: number; filters?: string[]; setTreeFilterGraph?: (filterGraph: any[]) => void; + nameDirection: boolean; } interface Line { @@ -329,7 +330,12 @@ function renderResourceNode(props: ApplicationResourceTreeProps, id: string, nod 'application-resource-tree__node--orphaned': node.orphaned })} title={describeNode(node)} - style={{left: node.x, top: node.y, width: node.width, height: node.height}}> + style={{ + left: node.x, + top: node.y, + width: node.width, + height: node.height + }}> {!appNode && }
{ResourceLabel({kind: node.kind})}
}
- {node.name} -
- + {node.name} +
+
@@ -359,7 +370,7 @@ function renderResourceNode(props: ApplicationResourceTreeProps, id: string, nod )} - +
{node.createdAt || rootNode ? (