fixed warning

This commit is contained in:
Artem Tarasov 2020-06-30 17:29:54 +03:00
parent 7326d54e96
commit 94ee712c0e
4 changed files with 28 additions and 23 deletions

View File

@ -325,23 +325,22 @@ class Body extends Component {
path: '',
emailValid: false,
email: '',
newEmail: '',
license: false,
selectLanguage: "",
selectTimezone: "",
valid: false
selectLanguage: props.languages[0],
selectTimezone: props.timezones[0]
}
this.inputRef = React.createRef();
}
componentDidMount() {
const { t, getParams } = this.props;
const { t } = this.props;
document.title = t('title');
getParams();
}
isValidPassHandler = val => {
this.setState({ isValidPass: val}, () => console.log(this.state.isValidPass));
this.setState({ isValidPass: val });
}
onChangePassword = e => {
@ -425,7 +424,7 @@ class Body extends Component {
onCloseModal = () => {
console.log('onClose modal');
this.setState({ visibleModal: false, errorLoading: false});
this.setState({ visibleModal: false, errorLoading: false });
}
onSelectTimezoneHandler = el => {
@ -440,7 +439,7 @@ class Body extends Component {
renderModalDialog = () => {
const { errorLoading, visibleModal } = this.state;
const { t, isOwner } = this.props;
const { t, isOwner, ownerEmail } = this.props;
let header, content, footer;
@ -463,7 +462,7 @@ class Body extends Component {
name="email-wizard"
placeholder={t('placeholderEmail')}
emailSettings={settings}
value={this.state.email}
value={ownerEmail}
onValidateInput={this.onEmailHandler}
/>;
@ -582,7 +581,7 @@ class Body extends Component {
? <Text className="settings-title">{t('email')}</Text>
: null
const email = isOwner
const contentEmail = isOwner
? <Link className="link value" type="action" onClick={this.onClickChangeEmail}>{ownerEmail}</Link>
: null
@ -596,8 +595,8 @@ class Body extends Component {
</Box>
<Box className="values">
<Text className="text value">{domain}</Text>
{email}
<GroupButton className="drop-down value" label={selectLanguage ? selectLanguage : languages[0]} isDropdown={true}>
{contentEmail}
<GroupButton className="drop-down value" label={selectLanguage} isDropdown={true}>
{
languages.map(el => (
<DropDownItem
@ -608,7 +607,7 @@ class Body extends Component {
))
}
</GroupButton>
<GroupButton className="drop-down value" label={selectTimezone ? selectTimezone : timezones[0]} isDropdown={true}>
<GroupButton className="drop-down value" label={selectTimezone} isDropdown={true}>
{
timezones.map(el => (
<DropDownItem
@ -687,5 +686,4 @@ function mapStateToProps(state) {
};
}
export default connect(mapStateToProps, { getParams, setOwnerToSrv, saveNewEmail })(withRouter(Wizard));
export default connect(mapStateToProps, { getParams, setOwnerToSrv, saveNewEmail })(withRouter(Wizard));

View File

@ -7,6 +7,8 @@ import App from "./App";
import * as serviceWorker from "./serviceWorker";
import { store as commonStore, constants, history, ErrorBoundary} from "asc-web-common";
import { getParams } from './store/wizard/actions';
const {
getUserInfo,
getPortalSettings,
@ -18,9 +20,13 @@ const { AUTH_KEY } = constants;
const token = localStorage.getItem(AUTH_KEY);
if (!token) {
store.dispatch(getParams());
history.push('/wizard');
/*
getPortalSettings(store.dispatch)
.then(() => store.dispatch(setIsLoaded(true)))
.catch(e => history.push('/wizard')); //`/login/error=${e}`
.catch(e => history.push(`/login/error=${e}`));
*/
} else if (!window.location.pathname.includes("confirm/EmailActivation")) {
getUserInfo(store.dispatch)
.then(() => store.dispatch(setIsLoaded(true)))

View File

@ -37,7 +37,6 @@ export function getParams() {
export function setOwnerToSrv(owner) {
return dispatch => {
return setTimeout(() => {
console.log(owner);
dispatch(setOwner(owner));
}, 3000);
}
@ -45,13 +44,16 @@ export function setOwnerToSrv(owner) {
export function saveNewEmail(newEmail) {
return dispatch => {
return dispatch(setNewEmail(newEmail));
return setTimeout(() => {
dispatch(setNewEmail(newEmail));
}, 3000)
}
}
const initParams = () => {
return {
isOwner: false,
isOwner: true,
ownerEmail: 'portaldomainname@mail.com',
domain: 'portaldomainname.com',
language: "ru-RU",

View File

@ -18,12 +18,11 @@ const ownerReducer = ( state = initState, action) => {
return Object.assign({}, state, action.params);
case SET_OWNER:
return Object.assign({}, state, {
isOwner: true,
owner: action.owner
});
console.log('SET_OWNER', action.owner);
return state;
case SET_NEW_EMAIL:
console.log('SET_NEW_EMAIL', action.newEmail);
return Object.assign({}, state, { ownerEmail: action.newEmail });
default: