projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
16971: Added tests to cover more places
[arvados-workbench2.git]
/
src
/
views
/
shared-with-me-panel
/
shared-with-me-panel.tsx
diff --git
a/src/views/shared-with-me-panel/shared-with-me-panel.tsx
b/src/views/shared-with-me-panel/shared-with-me-panel.tsx
index 9106f870da9acde6fc2fb29853d52d7aaa066d5a..2bc72ba41e5c529d6dd0e8cd2b2890ef0c1ae98b 100644
(file)
--- a/
src/views/shared-with-me-panel/shared-with-me-panel.tsx
+++ b/
src/views/shared-with-me-panel/shared-with-me-panel.tsx
@@
-14,9
+14,11
@@
import { navigateTo } from "~/store/navigation/navigation-action";
import { loadDetailsPanel } from "~/store/details-panel/details-panel-action";
import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
import { SHARED_WITH_ME_PANEL_ID } from '~/store/shared-with-me-panel/shared-with-me-panel-actions';
import { loadDetailsPanel } from "~/store/details-panel/details-panel-action";
import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
import { SHARED_WITH_ME_PANEL_ID } from '~/store/shared-with-me-panel/shared-with-me-panel-actions';
-import { openContextMenu } from '~/store/context-menu/context-menu-actions';
-import { GroupResource } from '~/models/group';
-import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
+import {
+ openContextMenu,
+ resourceUuidToContextMenuKind
+} from '~/store/context-menu/context-menu-actions';
+import { GroupContentsResource } from '~/services/groups-service/groups-service';
type CssRules = "toolbar" | "button";
type CssRules = "toolbar" | "button";
@@
-32,13
+34,15
@@
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
interface SharedWithMePanelDataProps {
resources: ResourcesState;
interface SharedWithMePanelDataProps {
resources: ResourcesState;
+ userUuid: string;
}
type SharedWithMePanelProps = SharedWithMePanelDataProps & DispatchProp & WithStyles<CssRules>;
export const SharedWithMePanel = withStyles(styles)(
connect((state: RootState) => ({
}
type SharedWithMePanelProps = SharedWithMePanelDataProps & DispatchProp & WithStyles<CssRules>;
export const SharedWithMePanel = withStyles(styles)(
connect((state: RootState) => ({
- resources: state.resources
+ resources: state.resources,
+ userUuid: state.auth.user!.uuid,
}))(
class extends React.Component<SharedWithMePanelProps> {
render() {
}))(
class extends React.Component<SharedWithMePanelProps> {
render() {
@@
-52,17
+56,21
@@
export const SharedWithMePanel = withStyles(styles)(
}
handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
}
handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
- const resource = getResource<GroupResource>(resourceUuid)(this.props.resources);
- if (resource) {
+ const { resources } = this.props;
+ const resource = getResource<GroupContentsResource>(resourceUuid)(resources);
+ const menuKind = this.props.dispatch<any>(resourceUuidToContextMenuKind(resourceUuid));
+ if (menuKind && resource) {
this.props.dispatch<any>(openContextMenu(event, {
this.props.dispatch<any>(openContextMenu(event, {
- name:
''
,
+ name:
resource.name
,
uuid: resource.uuid,
uuid: resource.uuid,
+ description: resource.description,
ownerUuid: resource.ownerUuid,
ownerUuid: resource.ownerUuid,
- isTrashed:
resource.isTrashed
,
+ isTrashed:
('isTrashed' in resource) ? resource.isTrashed: false
,
kind: resource.kind,
kind: resource.kind,
- menuKind
: ContextMenuKind.PROJECT,
+ menuKind
}));
}
}));
}
+ this.props.dispatch<any>(loadDetailsPanel(resourceUuid));
}
handleRowDoubleClick = (uuid: string) => {
}
handleRowDoubleClick = (uuid: string) => {
@@
-70,7
+78,7
@@
export const SharedWithMePanel = withStyles(styles)(
}
handleRowClick = (uuid: string) => {
}
handleRowClick = (uuid: string) => {
- this.props.dispatch(loadDetailsPanel(uuid));
+ this.props.dispatch
<any>
(loadDetailsPanel(uuid));
}
}
)
}
}
)