15672: Merge branch 'master' into 15672-subprocess-list-v2
[arvados-workbench2.git] / src / views / project-panel / project-panel.tsx
index b8811476668fea67ef2abc23422759af88176086..df8f22e75e2b5f7e41a7228f6487e80d2d780dde 100644 (file)
@@ -61,7 +61,7 @@ export const projectPanelColumns: DataColumns<string> = [
         name: ProjectPanelColumnNames.NAME,
         selected: true,
         configurable: true,
-        sortDirection: SortDirection.ASC,
+        sortDirection: SortDirection.NONE,
         filters: createTree(),
         render: uuid => <ResourceName uuid={uuid} />
     },
@@ -97,7 +97,7 @@ export const projectPanelColumns: DataColumns<string> = [
         name: ProjectPanelColumnNames.LAST_MODIFIED,
         selected: true,
         configurable: true,
-        sortDirection: SortDirection.NONE,
+        sortDirection: SortDirection.DESC,
         filters: createTree(),
         render: uuid => <ResourceLastModifiedDate uuid={uuid} />
     }
@@ -105,7 +105,7 @@ export const projectPanelColumns: DataColumns<string> = [
 
 export const PROJECT_PANEL_ID = "projectPanel";
 
-const DEFAUL_VIEW_MESSAGES = [
+const DEFAULT_VIEW_MESSAGES = [
     'Your project is empty.',
     'Please create a project or create a collection and upload a data.',
 ];
@@ -113,6 +113,7 @@ const DEFAUL_VIEW_MESSAGES = [
 interface ProjectPanelDataProps {
     currentItemId: string;
     resources: ResourcesState;
+    isAdmin: boolean;
 }
 
 type ProjectPanelProps = ProjectPanelDataProps & DispatchProp
@@ -121,7 +122,8 @@ type ProjectPanelProps = ProjectPanelDataProps & DispatchProp
 export const ProjectPanel = withStyles(styles)(
     connect((state: RootState) => ({
         currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties),
-        resources: state.resources
+        resources: state.resources,
+        isAdmin: state.auth.user!.isAdmin
     }))(
         class extends React.Component<ProjectPanelProps> {
             render() {
@@ -136,7 +138,7 @@ export const ProjectPanel = withStyles(styles)(
                         dataTableDefaultView={
                             <DataTableDefaultView
                                 icon={ProjectIcon}
-                                messages={DEFAUL_VIEW_MESSAGES} />
+                                messages={DEFAULT_VIEW_MESSAGES} />
                         } />
                 </div>;
             }
@@ -146,7 +148,7 @@ export const ProjectPanel = withStyles(styles)(
             }
 
             handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
-                const menuKind = resourceKindToContextMenuKind(resourceUuid);
+                const menuKind = resourceKindToContextMenuKind(resourceUuid, this.props.isAdmin);
                 const resource = getResource<ProjectResource>(resourceUuid)(this.props.resources);
                 if (menuKind && resource) {
                     this.props.dispatch<any>(openContextMenu(event, {