Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WOR-1821] Add requester pays to settings modal #5111

Merged
merged 4 commits into from
Sep 30, 2024
Merged

[WOR-1821] Add requester pays to settings modal #5111

merged 4 commits into from
Sep 30, 2024

Conversation

trholdridge
Copy link
Contributor

@trholdridge trholdridge commented Sep 26, 2024

Jira Ticket: https://broadworkbench.atlassian.net/browse/1821

Extends the workspace settings modal to include a new section for Requester Pays. The setting is represented by a simple toggle switch. This allows users to set requester pays on their workspaces without contacting Support.

Other setting types are implemented to be tolerant of receiving multiple settings of that type when getting the workspace settings. Requester pays is a more unambiguous on/off feature and it would not make sense for there to be multiple to preserve. This implementation still wouldn't error out if there were multiple requester pays settings, but it would silently discard them.

Screenshot 2024-09-27 at 3 07 38 PM
WOR-1456.mov

} as RequesterPaysSetting,
],
otherSettings
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarifying the overall behavior (partly for my own benefit):

  • Eventing only happens if the new setting is different from the old one
  • However, the array of new settings given to Rawls will include the new setting regardless of whether it is the same as the old one...
  • ...unless the old one doesn't exist (i.e. hasn't been set yet) and the new one is equivalent to the "default" setting of this type, in which case it will not be included in the new settings

@trholdridge trholdridge changed the title Add requester pays to settings modal [WOR-1456] Add requester pays to settings modal Sep 27, 2024
@@ -103,6 +109,10 @@ const SettingsModal = (props: SettingsModalProps): ReactNode => {
return undefined;
};

const getRequesterPaysSetting = (settings: WorkspaceSetting[]): RequesterPaysSetting | undefined => {
return settings.find((setting: WorkspaceSetting) => isRequesterPaysSetting(setting)) as RequesterPaysSetting;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced filter + index with find for requester pays getter.

@@ -196,13 +211,26 @@ const SettingsModal = (props: SettingsModalProps): ReactNode => {
) {
// If the bucket had no soft delete setting before, and the current one is the default retention, don't event.
} else if (!_.isEqual(originalSoftDeleteSetting, newSoftDeleteSetting)) {
// Event if an explicit setting existed before and it changed.
// Event if the setting changed.
Copy link
Contributor Author

@trholdridge trholdridge Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(changed the wording here--it also events if no explicit setting existed before and the new setting is non-default)

@trholdridge trholdridge marked this pull request as ready for review September 27, 2024 19:21
@trholdridge trholdridge requested a review from a team as a code owner September 27, 2024 19:21
@trholdridge trholdridge changed the title [WOR-1456] Add requester pays to settings modal [WOR-1821] Add requester pays to settings modal Sep 30, 2024
@admull
Copy link

admull commented Sep 30, 2024

I am not a fan of the description text here. It doesn't explain the impact to the user. Google's text is much clearer:

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.

Copy link

sonarcloud bot commented Sep 30, 2024

@trholdridge trholdridge added this pull request to the merge queue Sep 30, 2024
Merged via the queue into dev with commit 3b981b7 Sep 30, 2024
9 of 10 checks passed
@trholdridge trholdridge deleted the WOR-1456 branch September 30, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants