|
|
@@ -14,9 +14,24 @@ class SecuritySetting extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
|
|
|
+ this.state = {
|
|
|
+ retrieveError: null,
|
|
|
+ };
|
|
|
this.putSecuritySetting = this.putSecuritySetting.bind(this);
|
|
|
}
|
|
|
|
|
|
+ async componentDidMount() {
|
|
|
+ const { adminGeneralSecurityContainer } = this.props;
|
|
|
+
|
|
|
+ try {
|
|
|
+ await adminGeneralSecurityContainer.retriveSecurityData();
|
|
|
+ }
|
|
|
+ catch (err) {
|
|
|
+ toastError(err);
|
|
|
+ this.setState({ retrieveError: err });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
async putSecuritySetting() {
|
|
|
const { t } = this.props;
|
|
|
try {
|
|
|
@@ -32,10 +47,18 @@ class SecuritySetting extends React.Component {
|
|
|
const { t, adminGeneralSecurityContainer } = this.props;
|
|
|
const helpPageListingByOwner = { __html: t('security_setting.page_listing_1') };
|
|
|
const helpPageListingByGroup = { __html: t('security_setting.page_listing_2') };
|
|
|
+ const helpForceWikiMode = { __html: t('security_setting.Fixed by env var', 'FORCE_WIKI_MODE') };
|
|
|
+
|
|
|
+
|
|
|
return (
|
|
|
<React.Fragment>
|
|
|
<fieldset>
|
|
|
<legend className="alert-anchor">{ t('security_settings') }</legend>
|
|
|
+ {this.state.retrieveError != null && (
|
|
|
+ <div className="alert alert-danger">
|
|
|
+ <p>{t('Error occurred')} : {this.state.err}</p>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
{/* TODO adjust layout */}
|
|
|
<div className="row mb-5">
|
|
|
<strong className="col-xs-3 text-right"> { t('security_setting.Guest Users Access') } </strong>
|
|
|
@@ -82,9 +105,9 @@ class SecuritySetting extends React.Component {
|
|
|
<div className="row mb-5">
|
|
|
<div className="col-xs-6">
|
|
|
<p className="alert alert-warning mt-2">
|
|
|
- <i className="icon-exclamation icon-fw">
|
|
|
+ <i className="icon-exclamation icon-fw" dangerouslySetInnerHTML={helpForceWikiMode}>
|
|
|
</i><b>FIXED</b>
|
|
|
- { t('security_setting.Fixed by env var', 'FORCE_WIKI_MODE') }<br></br>
|
|
|
+ <br></br>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|