projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
creating and deleting repos
[arvados-workbench2.git]
/
src
/
store
/
favorite-panel
/
favorite-panel-middleware-service.ts
diff --git
a/src/store/favorite-panel/favorite-panel-middleware-service.ts
b/src/store/favorite-panel/favorite-panel-middleware-service.ts
index 96f666479dc644b85bd4bd3adf3270f544897db2..d7d54dedb03ca5500cb0a5da269cbe7ed6c7fc18 100644
(file)
--- a/
src/store/favorite-panel/favorite-panel-middleware-service.ts
+++ b/
src/store/favorite-panel/favorite-panel-middleware-service.ts
@@
-16,10
+16,11
@@
import { OrderBuilder, OrderDirection } from "~/services/api/order-builder";
import { LinkResource } from "~/models/link";
import { GroupContentsResource, GroupContentsResourcePrefix } from "~/services/groups-service/groups-service";
import { resourcesActions } from "~/store/resources/resources-actions";
import { LinkResource } from "~/models/link";
import { GroupContentsResource, GroupContentsResourcePrefix } from "~/services/groups-service/groups-service";
import { resourcesActions } from "~/store/resources/resources-actions";
-import { snackbarActions } from '~/store/snackbar/snackbar-actions';
+import { snackbarActions
, SnackbarKind
} from '~/store/snackbar/snackbar-actions';
import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions.ts';
import { getDataExplorer } from "~/store/data-explorer/data-explorer-reducer";
import { loadMissingProcessesInformation } from "~/store/project-panel/project-panel-middleware-service";
import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions.ts';
import { getDataExplorer } from "~/store/data-explorer/data-explorer-reducer";
import { loadMissingProcessesInformation } from "~/store/project-panel/project-panel-middleware-service";
+import { getSortColumn } from "~/store/data-explorer/data-explorer-reducer";
export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareService {
constructor(private services: ServiceRepository, id: string) {
export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareService {
constructor(private services: ServiceRepository, id: string) {
@@
-32,7
+33,7
@@
export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareServic
api.dispatch(favoritesPanelDataExplorerIsNotSet());
} else {
const columns = dataExplorer.columns as DataColumns<string, FavoritePanelFilter>;
api.dispatch(favoritesPanelDataExplorerIsNotSet());
} else {
const columns = dataExplorer.columns as DataColumns<string, FavoritePanelFilter>;
- const sortColumn =
dataExplorer.columns.find(c => c.sortDirection !== SortDirection.NONE
);
+ const sortColumn =
getSortColumn(dataExplorer
);
const typeFilters = this.getColumnFilters(columns, FavoritePanelColumnNames.TYPE);
const linkOrder = new OrderBuilder<LinkResource>();
const typeFilters = this.getColumnFilters(columns, FavoritePanelColumnNames.TYPE);
const linkOrder = new OrderBuilder<LinkResource>();
@@
-50,7
+51,7
@@
export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareServic
.addOrder(direction, "name", GroupContentsResourcePrefix.PROJECT);
}
try {
.addOrder(direction, "name", GroupContentsResourcePrefix.PROJECT);
}
try {
- api.dispatch(progressIndicatorActions.START(this.getId()));
+ api.dispatch(progressIndicatorActions.START
_WORKING
(this.getId()));
const response = await this.services.favoriteService
.list(this.services.authService.getUuid()!, {
limit: dataExplorer.rowsPerPage,
const response = await this.services.favoriteService
.list(this.services.authService.getUuid()!, {
limit: dataExplorer.rowsPerPage,
@@
-62,7
+63,7
@@
export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareServic
.addILike("name", dataExplorer.searchValue)
.getFilters()
});
.addILike("name", dataExplorer.searchValue)
.getFilters()
});
- api.dispatch(progressIndicatorActions.PERSIST_STOP(this.getId()));
+ api.dispatch(progressIndicatorActions.PERSIST_STOP
_WORKING
(this.getId()));
api.dispatch(resourcesActions.SET_RESOURCES(response.items));
await api.dispatch<any>(loadMissingProcessesInformation(response.items));
api.dispatch(favoritePanelActions.SET_ITEMS({
api.dispatch(resourcesActions.SET_RESOURCES(response.items));
await api.dispatch<any>(loadMissingProcessesInformation(response.items));
api.dispatch(favoritePanelActions.SET_ITEMS({
@@
-73,13
+74,14
@@
export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareServic
}));
api.dispatch<any>(updateFavorites(response.items.map(item => item.uuid)));
} catch (e) {
}));
api.dispatch<any>(updateFavorites(response.items.map(item => item.uuid)));
} catch (e) {
- api.dispatch(progressIndicatorActions.PERSIST_STOP(this.getId()));
+ api.dispatch(progressIndicatorActions.PERSIST_STOP
_WORKING
(this.getId()));
api.dispatch(favoritePanelActions.SET_ITEMS({
items: [],
itemsAvailable: 0,
page: 0,
rowsPerPage: dataExplorer.rowsPerPage
}));
api.dispatch(favoritePanelActions.SET_ITEMS({
items: [],
itemsAvailable: 0,
page: 0,
rowsPerPage: dataExplorer.rowsPerPage
}));
+ api.dispatch(couldNotFetchFavoritesContents());
}
}
}
}
}
}
@@
-89,3
+91,9
@@
const favoritesPanelDataExplorerIsNotSet = () =>
snackbarActions.OPEN_SNACKBAR({
message: 'Favorites panel is not ready.'
});
snackbarActions.OPEN_SNACKBAR({
message: 'Favorites panel is not ready.'
});
+
+const couldNotFetchFavoritesContents = () =>
+ snackbarActions.OPEN_SNACKBAR({
+ message: 'Could not fetch favorites contents.',
+ kind: SnackbarKind.ERROR
+ });