import { getCurrentGroupDetailsPanelUuid, GroupMembersPanelActions } from 'store/group-details-panel/group-details-panel-actions';
import { LinkClass } from 'models/link';
import { ResourceKind } from 'models/resource';
+import { progressIndicatorActions } from 'store/progress-indicator/progress-indicator-actions';
export class GroupDetailsPanelMembersMiddlewareService extends DataExplorerMiddlewareService {
const dataExplorer = getDataExplorer(api.getState().dataExplorer, this.getId());
const groupUuid = getCurrentGroupDetailsPanelUuid(api.getState().properties);
if (!dataExplorer || !groupUuid) {
- api.dispatch(groupsDetailsPanelDataExplorerIsNotSet());
+ // Noop if data explorer refresh is triggered from another panel
+ return;
} else {
try {
+ api.dispatch(progressIndicatorActions.START_WORKING(this.getId()));
const groupResource = await this.services.groupsService.get(groupUuid);
api.dispatch(updateResources([groupResource]));
api.dispatch(updateResources(projectsIn.items));
} catch (e) {
api.dispatch(couldNotFetchGroupDetailsContents());
+ } finally {
+ api.dispatch(progressIndicatorActions.STOP_WORKING(this.getId()));
}
}
}
}
-const groupsDetailsPanelDataExplorerIsNotSet = () =>
- snackbarActions.OPEN_SNACKBAR({
- message: 'Group members panel is not ready.',
- kind: SnackbarKind.ERROR
- });
-
const couldNotFetchGroupDetailsContents = () =>
snackbarActions.OPEN_SNACKBAR({
message: 'Could not fetch group members.',