-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZKUI-403 // Federetate Certificate Button
Fix import and use of isPlatformAdmin function
- Loading branch information
1 parent
664a0d0
commit a6b047c
Showing
6 changed files
with
153 additions
and
113 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/react/next-architecture/ui/CertificateDownloadButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { FederatedComponent } from '@scality/module-federation'; | ||
import { useConfigRetriever, useDeployedApps } from './ConfigProvider'; | ||
|
||
export const CertificateDownloadButton = () => { | ||
const deployedApps = useDeployedApps(); | ||
const artescaUI = deployedApps.find( | ||
(app: { kind: string }) => app.kind === 'artesca-base-ui', | ||
); | ||
const { retrieveConfiguration } = useConfigRetriever(); | ||
|
||
if (artescaUI) { | ||
const url = | ||
artescaUI.url + | ||
retrieveConfiguration({ | ||
configType: 'build', | ||
name: artescaUI.name, | ||
}).spec.remoteEntryPath; | ||
|
||
return ( | ||
<FederatedComponent | ||
module={'./certificates/DownloadButton'} | ||
scope={'artesca'} | ||
url={url} | ||
app={artescaUI} | ||
props={{ | ||
filename: 'artesca-ca.pem', | ||
variant: 'outline', | ||
}} | ||
></FederatedComponent> | ||
); | ||
} | ||
|
||
return <></>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters