Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 21d841d

Browse files
committed
fix: Form component sometimes has too-small TextInputs
Fixes #4036
1 parent 2003622 commit 21d841d

File tree

3 files changed

+3
-6
lines changed
  • plugins

3 files changed

+3
-6
lines changed

plugins/plugin-client-common/web/css/static/Form.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
grid-column-gap: 1em;
66
grid-row-gap: 1em;
77
grid-auto-flow: dense;
8-
grid-template-columns: repeat(10, minmax(min-content, 1fr));
8+
grid-template-columns: repeat(auto-fill, minmax(3em, auto));
99
flex: unset;
1010

1111
.bx--form-item {

plugins/plugin-kubectl/src/controller/kubectl/get.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export async function doGetAsEntity(
8080
try {
8181
// this is the raw data string we get from `kubectl`
8282
const data = response.content.stdout
83-
console.error('!!!!DDDD', data)
8483

8584
// parse the raw response; the parser we use depends on whether
8685
// the user asked for JSON or for YAML

plugins/plugin-kubectl/src/lib/view/modes/Form.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ import { Form, TextInput } from 'carbon-components-react'
1919

2020
/** @return a ReactElement */
2121
export default function SidecarForm({ map }: { map: Record<string, string> }) {
22-
const minWidth = Object.keys(map).reduce((min, key) => Math.min(min, map[key].length), 10000)
23-
2422
return (
2523
<Form className="page-content padding-content scrollable kui--placeholder-primary">
2624
{Object.keys(map).map((key, idx) => {
27-
const width = Math.max(map[key].length) / minWidth / 2.5
28-
const style = { gridColumn: `span ${~~width}` }
25+
const colspan = Math.max(Math.ceil(key.length / 5), Math.ceil(map[key].length / 3.5))
26+
const style = { gridColumn: `span ${colspan}` }
2927

3028
return (
3129
<div key={idx} style={style}>

0 commit comments

Comments
 (0)