- onItemRouteChange={itemId => this.props.dispatch<any>(setProjectItem(itemId, ItemMode.ACTIVE))}
- onContextMenu={(event, item) => this.openContextMenu(event, item.uuid, ContextMenuKind.Project)}
- onDialogOpen={this.handleCreationDialogOpen}
+ onItemRouteChange={itemId => this.props.dispatch(setProjectItem(itemId, ItemMode.ACTIVE))}
+ onContextMenu={(event, item) => {
+ let kind: ContextMenuKind;
+
+ if (item.kind === ResourceKind.PROJECT) {
+ kind = ContextMenuKind.PROJECT;
+ } else if (item.kind === ResourceKind.COLLECTION) {
+ kind = ContextMenuKind.COLLECTION_RESOURCE;
+ } else {
+ kind = ContextMenuKind.RESOURCE;
+ }
+
+ this.openContextMenu(event, {
+ uuid: item.uuid,
+ name: item.name,
+ description: item.description,
+ kind
+ });
+ }}
+ onProjectCreationDialogOpen={this.handleProjectCreationDialogOpen}
+ onCollectionCreationDialogOpen={this.handleCollectionCreationDialogOpen}
+ onItemClick={item => {
+ this.props.dispatch(loadDetails(item.uuid, item.kind as ResourceKind));
+ }}
+ onItemDoubleClick={item => {
+ switch (item.kind) {
+ case ResourceKind.COLLECTION:
+ this.props.dispatch(loadCollection(item.uuid, item.kind as ResourceKind));
+ this.props.dispatch(push(getCollectionUrl(item.uuid)));
+ default:
+ this.props.dispatch(setProjectItem(item.uuid, ItemMode.ACTIVE));
+ this.props.dispatch(loadDetails(item.uuid, item.kind as ResourceKind));
+ }
+
+ }}
+ {...props} />
+
+ renderFavoritePanel = (props: RouteComponentProps<{ id: string }>) => <FavoritePanel
+ onItemRouteChange={() => this.props.dispatch(favoritePanelActions.REQUEST_ITEMS())}
+ onContextMenu={(event, item) => {
+ const kind = item.kind === ResourceKind.PROJECT ? ContextMenuKind.PROJECT : ContextMenuKind.RESOURCE;
+ this.openContextMenu(event, {
+ uuid: item.uuid,
+ name: item.name,
+ kind,
+ });
+ }}
+ onDialogOpen={this.handleProjectCreationDialogOpen}