-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WOR-1821] Add requester pays to settings modal (#5111)
- Loading branch information
1 parent
18b4897
commit 3b981b7
Showing
6 changed files
with
258 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ExternalLink } from '@terra-ui-packages/components'; | ||
import React, { ReactNode } from 'react'; | ||
import Setting from 'src/workspaces/SettingsModal/Setting'; | ||
|
||
interface RequesterPaysProps { | ||
requesterPaysEnabled: boolean; | ||
setRequesterPaysEnabled: (enabled: boolean) => void; | ||
isOwner: boolean; | ||
} | ||
|
||
const RequesterPays = (props: RequesterPaysProps): ReactNode => { | ||
const { requesterPaysEnabled, setRequesterPaysEnabled, isOwner } = props; | ||
|
||
const settingToggled = (checked: boolean) => setRequesterPaysEnabled(checked); | ||
|
||
return ( | ||
<Setting | ||
settingEnabled={requesterPaysEnabled} | ||
setSettingEnabled={settingToggled} | ||
label='Requester Pays:' | ||
isOwner={isOwner} | ||
description={ | ||
<> | ||
When <ExternalLink href='https://cloud.google.com/storage/docs/requester-pays'>requester pays</ExternalLink>{' '} | ||
is enabled, requests for the bucket's data will be billed to the requester's project instead of the | ||
bucket owner. The requester will be prompted to select their own billing project.{' '} | ||
</> | ||
} | ||
/> | ||
); | ||
}; | ||
|
||
export default RequesterPays; |
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
Oops, something went wrong.