Sort CT/ST in RBAC edit role

This commit is contained in:
mfrachet 2021-09-27 16:37:55 +02:00
parent 8245603a5d
commit b17bc9c7a1
2 changed files with 3 additions and 2 deletions

View File

@ -10,6 +10,8 @@ const StyledBox = styled(Box)`
`; `;
const ContentTypes = ({ isFormDisabled, kind, layout: { actions, subjects } }) => { const ContentTypes = ({ isFormDisabled, kind, layout: { actions, subjects } }) => {
const sortedSubjects = [...subjects].sort((a, b) => a.label > b.label);
return ( return (
<StyledBox background="neutral0"> <StyledBox background="neutral0">
<GlobalActions actions={actions} kind={kind} isFormDisabled={isFormDisabled} /> <GlobalActions actions={actions} kind={kind} isFormDisabled={isFormDisabled} />
@ -17,7 +19,7 @@ const ContentTypes = ({ isFormDisabled, kind, layout: { actions, subjects } }) =
actions={actions} actions={actions}
isFormDisabled={isFormDisabled} isFormDisabled={isFormDisabled}
pathToData={kind} pathToData={kind}
subjects={subjects} subjects={sortedSubjects}
/> />
</StyledBox> </StyledBox>
); );

View File

@ -457,7 +457,6 @@ const ListView = () => {
})} })}
action={ action={
<Button <Button
size="M"
variant="secondary" variant="secondary"
startIcon={<AddIcon />} startIcon={<AddIcon />}
onClick={() => (canCreate ? handleGoTo('create') : {})} onClick={() => (canCreate ? handleGoTo('create') : {})}