q-shift / backstage-plugins

Apache License 2.0
3 stars 7 forks source link

Improve the display of the list of the quickstarts - QuarkusQuickstartPicker.tsx #11

Closed cmoulliard closed 10 months ago

cmoulliard commented 10 months ago

Issue

Improve the display of the list of the quickstarts using the QuarkusQuickstartPicker.tsx as currently longer quickstart names are truncated

Screenshot 2024-01-16 at 17 24 08

Better option could be to use a ComboBox: https://mui.com/material-ui/react-autocomplete/#combo-box

cmoulliard commented 10 months ago

Is there a reason why we use ?

    <FormControl
      margin="normal"
      required={required}
      error={rawErrors && rawErrors?.length > 0 && !formData}>
      <div>
          <div {...getRootProps()}>
            <label className={classes.label} {...getInputLabelProps()}>
              Quarkus Quickstart
            </label>
            <input className={classes.input} {...getInputProps()} />
          </div>
          {groupedOptions.length > 0 ? (
            <ul className={classes.listbox} {...getListboxProps()}>
              {groupedOptions.map((option, index) => (
                <li {...getOptionProps({ option, index })}>{option}</li>
              ))}
            </ul>
          ) : null}
      </div>
    </FormControl>

and not Select

<FormControl
        margin="normal"
        required
        error={rawErrors?.length > 0 && !organization}
      >
        {allowedOrganizations?.length ? (
          <Select
            native
            label="Organization"
            onChange={s =>
              onChange({ organization: String(Array.isArray(s) ? s[0] : s) })
            }
            disabled={allowedOrganizations.length === 1}
            selected={organization}
            items={organizationItems}
          />
        ) : (
          <>
            <InputLabel htmlFor="orgInput">Organization</InputLabel>
            <Input
              id="orgInput"
              onChange={e => onChange({ organization: e.target.value })}
              value={organization}
            />
          </>
        )}
        <FormHelperText>
          The Organization that this repo will belong to
        </FormHelperText>
      </FormControl>

@iocanel

cmoulliard commented 10 months ago

CSS change I did looks like this. WDYT ? @iocanel

Screenshot 2024-01-17 at 18 45 41

iocanel commented 10 months ago

@cmoulliard: I like it!

cmoulliard commented 10 months ago

Last proposition

Screenshot 2024-01-17 at 18 58 21