Skip to content

Commit

Permalink
fix: show correct SAML Frontend URL on edit (#4462)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell authored Aug 7, 2024
1 parent a3368fe commit 13ad7ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/web/components/modals/CreateSAML.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const CreateSAML: FC<CreateSAML> = ({ organisationId, samlName }) => {
return regularExpresion.test(name)
}

const convetToXmlFile = (fileName: string, data: string) => {
const convertToXmlFile = (fileName: string, data: string) => {
const blob = new Blob([data], { type: 'application/xml' })
const link = document.createElement('a')
link.download = `${fileName}.xml`
Expand All @@ -82,7 +82,7 @@ const CreateSAML: FC<CreateSAML> = ({ organisationId, samlName }) => {
getSamlConfigurationMetadata(getStore(), { name: previousName })
.then((res) => {
if (res.error) {
convetToXmlFile(previousName, res.error.data)
convertToXmlFile(previousName, res.error.data)
}
})
.finally(() => {
Expand All @@ -92,7 +92,7 @@ const CreateSAML: FC<CreateSAML> = ({ organisationId, samlName }) => {

const downloadIDPMetadata = () => {
const name = data?.name || samlName
convetToXmlFile(`IDP metadata ${name!}`, data?.idp_metadata_xml || '')
convertToXmlFile(`IDP metadata ${name!}`, data?.idp_metadata_xml || '')
}

const Tab1 = (
Expand Down Expand Up @@ -123,7 +123,7 @@ const CreateSAML: FC<CreateSAML> = ({ organisationId, samlName }) => {
data-test='frontend-url'
tooltip='The base URL of the Flagsmith dashboard'
tooltipPlace='right'
value={frontendUrl}
value={data?.frontend_url || frontendUrl}
onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
setFrontendUrl(Utils.safeParseEventValue(event))
}}
Expand Down

0 comments on commit 13ad7ef

Please sign in to comment.