mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge pull request #1366 from atmire/w2p-84385_tabbed-view-breaks-on-tab-change
84385: Tabbed search view breaks if switch away/back between tabs
This commit is contained in:
@@ -55,10 +55,4 @@ describe('ConfigurationSearchPageComponent', () => {
|
|||||||
expect(routeService.setParameter).toHaveBeenCalledWith('fixedFilterQuery', QUERY);
|
expect(routeService.setParameter).toHaveBeenCalledWith('fixedFilterQuery', QUERY);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should reset route parameters on destroy', () => {
|
|
||||||
fixture.destroy();
|
|
||||||
|
|
||||||
expect(routeService.setParameter).toHaveBeenCalledWith('configuration', undefined);
|
|
||||||
expect(routeService.setParameter).toHaveBeenCalledWith('fixedFilterQuery', undefined);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
@@ -6,7 +6,6 @@ import {
|
|||||||
Component,
|
Component,
|
||||||
Inject,
|
Inject,
|
||||||
Input,
|
Input,
|
||||||
OnDestroy,
|
|
||||||
OnInit
|
OnInit
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { pushInOut } from '../shared/animations/push';
|
import { pushInOut } from '../shared/animations/push';
|
||||||
@@ -34,7 +33,7 @@ import { Router } from '@angular/router';
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
export class ConfigurationSearchPageComponent extends SearchComponent implements OnInit, OnDestroy {
|
export class ConfigurationSearchPageComponent extends SearchComponent implements OnInit {
|
||||||
/**
|
/**
|
||||||
* The configuration to use for the search options
|
* The configuration to use for the search options
|
||||||
* If empty, the configuration will be determined by the route parameter called 'configuration'
|
* If empty, the configuration will be determined by the route parameter called 'configuration'
|
||||||
@@ -72,17 +71,4 @@ export class ConfigurationSearchPageComponent extends SearchComponent implements
|
|||||||
this.routeService.setParameter('fixedFilterQuery', this.fixedFilterQuery);
|
this.routeService.setParameter('fixedFilterQuery', this.fixedFilterQuery);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset the updated query/configuration set in ngOnInit()
|
|
||||||
*/
|
|
||||||
ngOnDestroy(): void {
|
|
||||||
super.ngOnDestroy();
|
|
||||||
if (hasValue(this.configuration)) {
|
|
||||||
this.routeService.setParameter('configuration', undefined);
|
|
||||||
}
|
|
||||||
if (hasValue(this.fixedFilterQuery)) {
|
|
||||||
this.routeService.setParameter('fixedFilterQuery', undefined);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user