mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
fix: add link to manage access to edit project
This commit is contained in:
parent
e9d40ade85
commit
76f9cd0577
@ -10,8 +10,9 @@ import PageContent from '../common/PageContent/PageContent';
|
|||||||
import AccessContext from '../../contexts/AccessContext';
|
import AccessContext from '../../contexts/AccessContext';
|
||||||
import ConditionallyRender from '../common/ConditionallyRender';
|
import ConditionallyRender from '../common/ConditionallyRender';
|
||||||
import { CREATE_PROJECT } from '../AccessProvider/permissions';
|
import { CREATE_PROJECT } from '../AccessProvider/permissions';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
class AddContextComponent extends Component {
|
class ProjectFormComponent extends Component {
|
||||||
static contextType = AccessContext;
|
static contextType = AccessContext;
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -97,7 +98,21 @@ class AddContextComponent extends Component {
|
|||||||
const submitText = editMode ? 'Update' : 'Create';
|
const submitText = editMode ? 'Update' : 'Create';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent={`${submitText} Project`}>
|
<PageContent
|
||||||
|
headerContent={<div>
|
||||||
|
<span>{submitText} Project</span>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={hasAccess(CREATE_PROJECT) && editMode}
|
||||||
|
show={
|
||||||
|
<Link
|
||||||
|
to={`/projects/${project.id}/access`}
|
||||||
|
style={{float: 'right'}}
|
||||||
|
>
|
||||||
|
Manage access
|
||||||
|
</Link>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>}>
|
||||||
<Typography
|
<Typography
|
||||||
variant="subtitle1"
|
variant="subtitle1"
|
||||||
style={{ marginBottom: '0.5rem' }}
|
style={{ marginBottom: '0.5rem' }}
|
||||||
@ -154,6 +169,9 @@ class AddContextComponent extends Component {
|
|||||||
this.setValue('description', v.target.value)
|
this.setValue('description', v.target.value)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={hasAccess(CREATE_PROJECT)}
|
condition={hasAccess(CREATE_PROJECT)}
|
||||||
show={
|
show={
|
||||||
@ -171,7 +189,7 @@ class AddContextComponent extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddContextComponent.propTypes = {
|
ProjectFormComponent.propTypes = {
|
||||||
project: PropTypes.object.isRequired,
|
project: PropTypes.object.isRequired,
|
||||||
validateId: PropTypes.func.isRequired,
|
validateId: PropTypes.func.isRequired,
|
||||||
submit: PropTypes.func.isRequired,
|
submit: PropTypes.func.isRequired,
|
||||||
@ -179,4 +197,4 @@ AddContextComponent.propTypes = {
|
|||||||
editMode: PropTypes.bool.isRequired,
|
editMode: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddContextComponent;
|
export default ProjectFormComponent;
|
||||||
|
Loading…
Reference in New Issue
Block a user