search-for-data-table-and-small-improvements
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Fri, 10 May 2019 09:55:58 +0000 (11:55 +0200)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Fri, 10 May 2019 09:55:58 +0000 (11:55 +0200)
Feature #15020

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>

src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
src/views/collection-content-address-panel/collection-content-address-panel.tsx

index c1893f6da1022cc07c7fd7a369099cbd43fe5d73..fcc75340a006e6acc3c3d8ffdf7dae28356ca242 100644 (file)
@@ -18,6 +18,8 @@ import { GroupContentsResource, GroupContentsResourcePrefix } from '~/services/g
 import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions';
 import { collectionsContentAddressActions } from './collections-content-address-panel-actions';
 import { navigateTo } from '~/store/navigation/navigation-action';
+import { updateFavorites } from '~/store/favorites/favorites-actions';
+import { updatePublicFavorites } from '~/store/public-favorites/public-favorites-actions';
 
 export class CollectionsWithSameContentAddressMiddlewareService extends DataExplorerMiddlewareService {
     constructor(private services: ServiceRepository, id: string) {
@@ -50,8 +52,11 @@ export class CollectionsWithSameContentAddressMiddlewareService extends DataExpl
                     offset: dataExplorer.page * dataExplorer.rowsPerPage,
                     filters: new FilterBuilder()
                         .addEqual('portableDataHash', contentAddress)
+                        .addILike("name", dataExplorer.searchValue)
                         .getFilters()
                 });
+                api.dispatch<any>(updateFavorites(response.items.map(item => item.uuid)));
+                api.dispatch<any>(updatePublicFavorites(response.items.map(item => item.uuid)));
                 if (response.itemsAvailable === 1) {
                     api.dispatch<any>(navigateTo(response.items[0].uuid));
                     api.dispatch(progressIndicatorActions.PERSIST_STOP_WORKING(this.getId()));
index 5ca392feac7e781df75c2dd55aad2abd982c5a97..f2c6df346083fb797a86ce6368ca08d2fe55d006 100644 (file)
@@ -62,7 +62,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 enum CollectionContentAddressPanelColumnNames {
     COLLECTION_WITH_THIS_ADDRESS = "Collection with this address",
-    OWNER = "Owner",
+    LOCATION = "Location",
     LAST_MODIFIED = "Last modified"
 }
 
@@ -76,7 +76,7 @@ export const collectionContentAddressPanelColumns: DataColumns<string> = [
         render: uuid => <ResourceName uuid={uuid} />
     },
     {
-        name: CollectionContentAddressPanelColumnNames.OWNER,
+        name: CollectionContentAddressPanelColumnNames.LOCATION,
         selected: true,
         configurable: true,
         filters: createTree(),
@@ -92,13 +92,13 @@ export const collectionContentAddressPanelColumns: DataColumns<string> = [
     }
 ];
 
-export interface CollectionContentAddressMainCardActionProps {
+export interface CollectionContentAddressPanelActionProps {
     onContextMenu: (event: React.MouseEvent<any>, uuid: string) => void;
     onItemClick: (item: string) => void;
     onItemDoubleClick: (item: string) => void;
 }
 
-const mapDispatchToProps = (dispatch: Dispatch): CollectionContentAddressMainCardActionProps => ({
+const mapDispatchToProps = (dispatch: Dispatch): CollectionContentAddressPanelActionProps => ({
     onContextMenu: (event, resourceUuid) => {
         const isAdmin = dispatch<any>(getIsAdmin());
         const kind = resourceKindToContextMenuKind(resourceUuid, isAdmin);
@@ -123,12 +123,12 @@ const mapDispatchToProps = (dispatch: Dispatch): CollectionContentAddressMainCar
 
 export const CollectionsContentAddressPanel = withStyles(styles)(
     connect(null, mapDispatchToProps)(
-        class extends React.Component<CollectionContentAddressMainCardActionProps & WithStyles<CssRules>> {
+        class extends React.Component<CollectionContentAddressPanelActionProps & WithStyles<CssRules>> {
             render() {
                 return <Grid item xs={12}>
-                    {/* <Link to={`/collections/${this.props.collection.uuid}`} className={this.props.classes.backLink}>
+                    {/* <Link to={`/collections/${collectionUuid}`} className={this.props.classes.backLink}>
                         <BackIcon className={this.props.classes.backIcon} />
-                        Back test
+                        Back
                     </Link> */}
                     <DataExplorer
                         id={COLLECTIONS_CONTENT_ADDRESS_PANEL_ID}