refactor(forms): simplify form handling and button behavior (#10441)
Removed redundant handleSave and handleSubmit props in domain settings. Integrated form submission logic directly into form components, ensuring consistent behavior and reducing complexity. Updated button components to explicitly support the "type" attribute for improved accessibility and functionality. --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -30,6 +30,7 @@ const StyledLinkContainer = styled.div`
|
||||
const StyledButtonCopy = styled.div`
|
||||
align-items: end;
|
||||
display: flex;
|
||||
margin-bottom: ${({ theme }) => theme.spacing(1)};
|
||||
`;
|
||||
|
||||
export const SettingsSSOOIDCForm = () => {
|
||||
@ -70,6 +71,7 @@ export const SettingsSSOOIDCForm = () => {
|
||||
});
|
||||
navigator.clipboard.writeText(authorizedUrl);
|
||||
}}
|
||||
type="button"
|
||||
/>
|
||||
</StyledButtonCopy>
|
||||
</StyledContainer>
|
||||
@ -94,6 +96,7 @@ export const SettingsSSOOIDCForm = () => {
|
||||
});
|
||||
navigator.clipboard.writeText(redirectionUrl);
|
||||
}}
|
||||
type="button"
|
||||
/>
|
||||
</StyledButtonCopy>
|
||||
</StyledContainer>
|
||||
|
||||
@ -52,6 +52,7 @@ const StyledLinkContainer = styled.div`
|
||||
const StyledButtonCopy = styled.div`
|
||||
align-items: end;
|
||||
display: flex;
|
||||
margin-bottom: ${({ theme }) => theme.spacing(1)};
|
||||
`;
|
||||
|
||||
export const SettingsSSOSAMLForm = () => {
|
||||
@ -136,6 +137,7 @@ export const SettingsSSOSAMLForm = () => {
|
||||
Icon={IconUpload}
|
||||
onClick={handleUploadFileClick}
|
||||
title={t`Upload file`}
|
||||
type="button"
|
||||
></Button>
|
||||
{isXMLMetadataValid() && (
|
||||
<IconCheck
|
||||
@ -157,7 +159,8 @@ export const SettingsSSOSAMLForm = () => {
|
||||
Icon={IconDownload}
|
||||
onClick={downloadMetadata}
|
||||
title={t`Download file`}
|
||||
></Button>
|
||||
type="button"
|
||||
/>
|
||||
</StyledContainer>
|
||||
<HorizontalSeparator text={'Or'} />
|
||||
<StyledContainer>
|
||||
@ -181,6 +184,7 @@ export const SettingsSSOSAMLForm = () => {
|
||||
});
|
||||
navigator.clipboard.writeText(acsUrl);
|
||||
}}
|
||||
type="button"
|
||||
/>
|
||||
</StyledButtonCopy>
|
||||
</StyledContainer>
|
||||
@ -205,6 +209,7 @@ export const SettingsSSOSAMLForm = () => {
|
||||
});
|
||||
navigator.clipboard.writeText(entityID);
|
||||
}}
|
||||
type="button"
|
||||
/>
|
||||
</StyledButtonCopy>
|
||||
</StyledContainer>
|
||||
|
||||
Reference in New Issue
Block a user