From 0101fb27ffc44c3592cec18ddf181ce79c0fa846 Mon Sep 17 00:00:00 2001 From: Mikhail Rodichenko Date: Mon, 2 Dec 2024 13:21:48 +0100 Subject: [PATCH] Allow to skip bucket policy when registering new bucket (#3800) --- .../components/pipelines/browser/Folder.js | 2 +- .../browser/forms/DataStorageEditDialog.js | 31 ++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/client/src/components/pipelines/browser/Folder.js b/client/src/components/pipelines/browser/Folder.js index 0891680636..ba7614137c 100644 --- a/client/src/components/pipelines/browser/Folder.js +++ b/client/src/components/pipelines/browser/Folder.js @@ -765,7 +765,7 @@ export default class Folder extends localization.LocalizedReactComponent { } }; createStorage = async (storage) => { - const request = new CreateDataStorage(this.state.createNewStorageFlag); + const request = new CreateDataStorage(this.state.createNewStorageFlag, storage.skipPolicy); const hide = message.loading('Creating storage...', 0); let path = storage.path; let name = storage.name; diff --git a/client/src/components/pipelines/browser/forms/DataStorageEditDialog.js b/client/src/components/pipelines/browser/forms/DataStorageEditDialog.js index 1935c2410f..dd2d3684a5 100644 --- a/client/src/components/pipelines/browser/forms/DataStorageEditDialog.js +++ b/client/src/components/pipelines/browser/forms/DataStorageEditDialog.js @@ -83,7 +83,8 @@ export class DataStorageEditDialog extends React.Component { sensitive: false, restrictedAccess: true, restrictedAccessCheckInProgress: false, - omicsType: undefined + omicsType: undefined, + skipPolicy: false }; formItemLayout = { @@ -154,6 +155,9 @@ export class DataStorageEditDialog extends React.Component { if (!this.isNfsMount) { values.sensitive = this.state.sensitive; } + if (!this.isNfsMount && !this.omicsStore) { + values.skipPolicy = this.state.skipPolicy; + } values.shared = !this.isNfsMount && this.state.sharingEnabled; values.regionId = +values.regionId; const path = values.path; @@ -436,6 +440,7 @@ export class DataStorageEditDialog extends React.Component { resetFields(); this.setState({activeTab: 'info'}); }; + const skipPolicyFlagVisible = !this.props.dataStorage; return ( } + { + (!this.omicsStore && !this.isNfsMount && skipPolicyFlagVisible) && + + + + + this.setState({skipPolicy: e.target.checked})} + checked={this.state.skipPolicy}> + Skip policy + + + + + } {!this.omicsStore && !this.isNfsMount && this.props.policySupported && @@ -635,7 +656,7 @@ export class DataStorageEditDialog extends React.Component { this.setState({versioningEnabled: e.target.checked})} checked={this.state.versioningEnabled}> Enable versioning @@ -660,7 +681,7 @@ export class DataStorageEditDialog extends React.Component { })( + disabled={this.props.pending || isReadOnly || this.state.skipPolicy} /> )} )} @@ -764,7 +785,7 @@ export class DataStorageEditDialog extends React.Component { const sharingEnabled = !this.isNfsMount && this.props.dataStorage ? this.props.dataStorage.shared : false; - this.setState({mountDisabled, versioningEnabled, sharingEnabled, sensitive}); + this.setState({mountDisabled, versioningEnabled, sharingEnabled, sensitive, skipPolicy: false}); } }; @@ -774,7 +795,7 @@ export class DataStorageEditDialog extends React.Component { const versioningEnabled = false; const sensitive = false; const sharingEnabled = false; - this.setState({mountDisabled, versioningEnabled, sharingEnabled, sensitive}); + this.setState({mountDisabled, versioningEnabled, sharingEnabled, sensitive, skipPolicy: false}); } }