mirror of
https://github.com/ansible/awx.git
synced 2026-02-12 15:14:45 -03:30
move value by prop in providers to consistent interface
This commit is contained in:
@@ -15,7 +15,8 @@ class Provider extends Component {
|
||||
custom_virtualenvs: null,
|
||||
version: null,
|
||||
custom_logo: null,
|
||||
custom_login_info: null
|
||||
custom_login_info: null,
|
||||
...props.value
|
||||
}
|
||||
};
|
||||
|
||||
@@ -66,14 +67,12 @@ class Provider extends Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
const {
|
||||
value: stateValue
|
||||
} = this.state;
|
||||
const { value } = this.state;
|
||||
|
||||
const { value: propsValue, children } = this.props;
|
||||
const { children } = this.props;
|
||||
|
||||
return (
|
||||
<ConfigContext.Provider value={propsValue || stateValue}>
|
||||
<ConfigContext.Provider value={value}>
|
||||
{children}
|
||||
</ConfigContext.Provider>
|
||||
);
|
||||
|
||||
@@ -26,7 +26,8 @@ class Provider extends Component {
|
||||
this.handle404();
|
||||
}
|
||||
return (err.response.status === 401 || err.response.status === 404);
|
||||
}
|
||||
},
|
||||
...props.value
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -58,14 +59,12 @@ class Provider extends Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
const {
|
||||
value: stateValue
|
||||
} = this.state;
|
||||
const { value } = this.state;
|
||||
|
||||
const { value: propsValue, children } = this.props;
|
||||
const { children } = this.props;
|
||||
|
||||
return (
|
||||
<NetworkContext.Provider value={propsValue || stateValue}>
|
||||
<NetworkContext.Provider value={value}>
|
||||
{children}
|
||||
</NetworkContext.Provider>
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@ export class RootDialogProvider extends Component {
|
||||
const { value } = this.state;
|
||||
this.setState({ value: { ...value, title: null, bodyText: null, variant: null } });
|
||||
},
|
||||
...props.value,
|
||||
...props.value
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user