| 'faveIcon'
| 'frozenIcon'
| 'contextMenuSection'
+ | 'toolbarSection'
| 'tag'
| 'description';
marginBottom: '1rem',
flex: '0 0 auto',
padding: 0,
- border: '2px solid transparent',
+ borderLeft: '2px solid transparent',
},
selected: {
- border: '2px solid #ccc',
+ border: '2pcx solid #ccc',
},
showMore: {
cursor: 'pointer',
alignItems: 'center',
paddingTop: '0.25rem',
},
+ toolbarSection: {
+ marginTop: '-1rem',
+ },
tag: {
marginRight: '1rem',
marginTop: '1rem',
},
});
-const mapStateToProps = (state: RootState) => {
- const currentRoute = state.router.location?.pathname.split('/') || [];
- const currentItemUuid = currentRoute[currentRoute.length - 1];
- const currentResource = getResource(currentItemUuid)(state.resources);
- const frozenByUser = currentResource && getResource((currentResource as ProjectResource).frozenByUuid as string)(state.resources);
+const mapStateToProps = ({auth, selectedResourceUuid, resources, properties}: RootState) => {
+ const currentResource = getResource(properties.currentRouteUuid)(resources);
+ const frozenByUser = currentResource && getResource((currentResource as ProjectResource).frozenByUuid as string)(resources);
const frozenByFullName = frozenByUser && (frozenByUser as Resource & { fullName: string }).fullName;
- const isSelected = currentItemUuid === state.detailsPanel.resourceUuid && state.detailsPanel.isOpened === true;
+ const isSelected = selectedResourceUuid === properties.currentRouteUuid;
return {
- isAdmin: state.auth.user?.isAdmin,
+ isAdmin: auth.user?.isAdmin,
currentResource,
frozenByFullName,
isSelected,
frozenByFullName: string | undefined;
isAdmin: boolean;
isSelected: boolean;
- handleContextMenu: (event: React.MouseEvent<HTMLElement>, resource: ContextMenuResource, isAdmin: boolean) => void;
handleCardClick: (resource: any) => void;
};
frozenByFullName={frozenByFullName}
isAdmin={isAdmin}
isSelected={isSelected}
- handleContextMenu={(ev) => handleContextMenu(ev, currentResource as any, isAdmin)}
handleCardClick={handleCardClick}
/>
);
);
};
-const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, frozenByFullName, handleContextMenu, handleCardClick, isAdmin, isSelected }) => {
+const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, frozenByFullName, handleCardClick, isSelected }) => {
const { name, description, uuid } = currentResource as ProjectResource;
const [showDescription, setShowDescription] = React.useState(false);
const [showProperties, setShowProperties] = React.useState(false);
</section>
}
action={
- <MultiselectToolbar inputSelectedUuid={currentResource.uuid} />
- // <section className={classes.contextMenuSection}>
- // <Tooltip
- // title='More options'
- // disableFocusListener
- // >
- // <IconButton
- // aria-label='More options'
- // onClick={(ev) => handleContextMenu(ev, currentResource as any, isAdmin)}
- // >
- // <MoreVerticalIcon data-cy='kebab-icon' />
- // </IconButton>
- // </Tooltip>
- // </section>
+ <section className={classes.toolbarSection}>
+ {isSelected && <MultiselectToolbar />}
+ </section>
}
/>
<section onClick={(ev) => ev.stopPropagation()}>
timeout='auto'
collapsedHeight='35px'
>
- <Typography
+ <div
className={classes.description}
data-cy='project-description'
>
)}
</Typography>
</CardContent>
- </Typography>
+ </div>
</Collapse>
</section>
</section>