Skip to content

Commit

Permalink
manual refresh fixes (#4070)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis authored and petrjasek committed Feb 23, 2022
1 parent 0105851 commit 9fedca0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions scripts/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ if (appConfig.ui == null) {
}
}

if (appConfig.features == null) {
appConfig.features = {};
}

if (appConfig.features.autorefreshContent == null) {
appConfig.features.autorefreshContent = true; // default to true
}

export const dashboardRoute = '/workspace';
export const IDENTITY_KEY = 'sess:user';

Expand Down
9 changes: 8 additions & 1 deletion scripts/apps/monitoring/directives/MonitoringGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,14 @@ export function MonitoringGroup(
});

// refreshes the list for matching group or view type only or if swimlane view is ON.
scope.$on('refresh:list', (event, group) => {
scope.$on('refresh:list', (event, group, options) => {
/**
* When manual refreshing is enabled, scrolling should not automatically refresh the list.
*/
if (scope.showRefresh === true && options.event_origin === 'scroll') {
return;
}

const currentScope: IScope = event.currentScope as IScope;
const _viewType = currentScope.viewType || '';
const viewTypeMatches = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/apps/search/directives/ItemList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export function ItemList(
.some((item) => item.selected === true);

if (elem[0].scrollTop === 0 && !multiSelectInProgress) {
$rootScope.$broadcast('refresh:list', scope.group);
$rootScope.$broadcast('refresh:list', scope.group, {event_origin: 'scroll'});
}

if (scope.rendering) { // ignore
Expand Down

0 comments on commit 9fedca0

Please sign in to comment.