fix(striker-ui): move suggest button and ensure help message fills width

main
Tsu-ba-me 2 years ago
parent 461fab597a
commit 5b74736769
  1. 28
      striker-ui/components/StrikerInitForm.tsx

@ -259,25 +259,29 @@ const StrikerInitGeneralForm: FC = () => {
onChange={handleOrganizationNameInputOnChange} onChange={handleOrganizationNameInputOnChange}
value={organizationNameInput} value={organizationNameInput}
/> />
<FlexBox row>
<OutlinedInputWithLabel <OutlinedInputWithLabel
helpMessageBoxProps={{ helpMessageBoxProps={{
text: "Alphanumberic short-form of the organization name. It's used as the prefix for host names.", text: "Alphanumberic short-form of the organization name. It's used as the prefix for host names.",
}} }}
id="striker-init-general-organization-prefix" id="striker-init-general-organization-prefix"
inputProps={{ inputProps={{
inputProps: { maxLength: MAX_ORGANIZATION_PREFIX_LENGTH }, endAdornment: (
<SuggestButton onClick={handleOrganizationPrefixSuggest} />
),
inputProps: {
maxLength: MAX_ORGANIZATION_PREFIX_LENGTH,
style: { width: '2.5em' },
},
onBlur: populateHostNameInputOnBlur, onBlur: populateHostNameInputOnBlur,
sx: { sx: {
width: '7em', minWidth: 'min-content',
width: 'fit-content',
}, },
}} }}
label="Prefix" label="Prefix"
onChange={handleOrganizationPrefixInputOnChange} onChange={handleOrganizationPrefixInputOnChange}
value={organizationPrefixInput} value={organizationPrefixInput}
/> />
<SuggestButton onClick={handleOrganizationPrefixSuggest} />
</FlexBox>
</FlexBox> </FlexBox>
<FlexBox> <FlexBox>
<OutlinedInputWithLabel <OutlinedInputWithLabel
@ -312,18 +316,26 @@ const StrikerInitGeneralForm: FC = () => {
onChange={handleHostNumberInputOnChange} onChange={handleHostNumberInputOnChange}
value={hostNumberInput} value={hostNumberInput}
/> />
<FlexBox row sx={{ '& > :first-child': { flexGrow: 1 } }}>
<OutlinedInputWithLabel <OutlinedInputWithLabel
helpMessageBoxProps={{ helpMessageBoxProps={{
text: "Host name for this striker. It's usually a good idea to use the auto-generated value.", text: "Host name for this striker. It's usually a good idea to use the auto-generated value.",
}} }}
id="striker-init-general-host-name" id="striker-init-general-host-name"
inputProps={{
endAdornment: <SuggestButton onClick={handlerHostNameSuggest} />,
inputProps: {
style: {
minWidth: '4em',
},
},
sx: {
minWidth: 'min-content',
},
}}
label="Host name" label="Host name"
onChange={handleHostNameInputOnChange} onChange={handleHostNameInputOnChange}
value={hostNameInput} value={hostNameInput}
/> />
<SuggestButton onClick={handlerHostNameSuggest} />
</FlexBox>
</FlexBox> </FlexBox>
</MUIBox> </MUIBox>
); );

Loading…
Cancel
Save