Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 2 additions & 35 deletions src/dashboard/B4aAdminPage/B4aAdminPage.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,14 @@ class B4aAdminPage extends DashboardView {
host: '',
adminURL: '',
isRoleCreated: false,
adminParams: {},
userVerified: true,
lastSuccess: '',
lastError: ''
adminParams: {}
}

this.legend = 'Admin App Setup'
this.description = 'Admin App is a web browser-based tool designed to manage the app data using a non-tech user interface.'
}

async componentDidMount() {
await this.checkPermission()
const adminParams = B4aAdminParams({ appName: this.context.currentApp.name })
await this.setState({ adminParams })

Expand Down Expand Up @@ -75,26 +71,6 @@ class B4aAdminPage extends DashboardView {
);
}

async resendEmail(){
try {
await axios.get(`${EMAIL_VERIFICATION_URL}/resend`, { withCredentials: true })
this.setState({lastSuccess: "The email has been sent!", lastError: ''})
} catch (error){
this.setState({lastError: "Something went wrong! Please reach us on the chat", lastSuccess: ''})
}
setTimeout(() => { this.setState({ lastSuccess: '', lastError: ''})},
5000);
}

async checkPermission(){
let response = await axios.get(`${EMAIL_VERIFICATION_URL}/activated`, { withCredentials: true })
if (response.data && response.data.isUserVerified){
this.setState({userVerified: response.data.isUserVerified})
} else {
this.setState({userVerified: false })
}
}

async checkRole() {
const { adminParams } = this.state

Expand Down Expand Up @@ -144,16 +120,7 @@ class B4aAdminPage extends DashboardView {
<Button value='Enable Admin App'
onClick={this.renderModal.bind(this)}
primary={true}
className={styles['input-child']}
disabled={!this.state.userVerified}/>
{!this.state.userVerified?
<div className={styles["box-email"]}>
<span>In order to enable this feature, you must confirm your account by email!</span>
<a href='javascript:;' onClick={() => this.resendEmail()}>Resend email</a>
</div>
:<div><span className={styles['message-error']}>Unauthorized!</span></div>}
{this.state.lastSuccess != '' ? this.displayMessage("green", this.state.lastSuccess) : null}
{this.state.lastError != '' ? this.displayMessage("red", this.state.lastError): null}
className={styles['input-child']}/>
</div>
</div>
)
Expand Down
14 changes: 2 additions & 12 deletions src/dashboard/Settings/GeneralSettings.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,6 @@ let AppInformationFields = ({
value={appName}
onChange={setAppName} />
} />
<Field
labelWidth={58}
label={<Label
text='In production?'
description='(On back4app, this switch is temporarily disabled)' />}
input={<Toggle
value={inProduction}
type={Toggle.Types.YES_NO}
onChange={() => {}} />
} />
</Fieldset>;

let CollaboratorsFields = ({
Expand Down Expand Up @@ -229,7 +219,7 @@ let ManageAppFields = ({
<Fieldset
legend='App Management'
description='These options will affect your entire app.' >
<Field
{/* <Field
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Clean up app'
Expand All @@ -238,7 +228,7 @@ let ManageAppFields = ({
</span>} />}
input={<FormButton
onClick={cleanUpFiles}
value='Clean Up Files'/>} />
value='Clean Up Files'/>} /> */}
{cleanUpFilesMessage ? <FormNote
show={true}
color={cleanUpMessageColor}>
Expand Down