Enhanced the refresh functionality in targets route (#2889)

* Enhanced the refresh functionality in targets and sessions route
This commit is contained in:
Sohail authored and GitHub committed 2025-06-23 09:08:59 +05:30
1 parent 746862a897
commit 96ff0ddf27
4 files changed
+16 -6

No files matched your search

@@ -150,7 +150,7 @@ export default class ScopesScopeProjectsSessionsIndexController extends Controll
* Refreshes the all data for the current page.
*/
@action
refresh() {
this.send('refreshAll');
async refresh() {
await this.currentRoute.refreshAll();
}
}
@@ -307,7 +307,7 @@ export default class ScopesScopeProjectsTargetsIndexController extends Controlle
* Refreshes the all data for the current page.
*/
@action
refresh() {
this.send('refreshAll');
async refresh() {
await this.currentRoute.refreshAll();
}
}
@@ -177,6 +177,11 @@ export default class ScopesScopeProjectsSessionsIndexRoute extends Route {
});
}
setupController(controller, model) {
super.setupController(controller, model);
controller.currentRoute = this;
}
resetController(controller, isExiting, transition) {
const fromScope = transition.from.find(
(routeInfo) => routeInfo.name === 'scopes.scope',
@@ -212,6 +217,6 @@ export default class ScopesScopeProjectsSessionsIndexRoute extends Route {
await this.store.query('scope', {});
// Refresh the proj scopes so our `modelFor` returns accurate data
this.router.refresh('scopes.scope.projects');
await this.router.refresh('scopes.scope.projects');
}
}
@@ -243,6 +243,11 @@ export default class ScopesScopeProjectsTargetsIndexRoute extends Route {
});
};
setupController(controller, model) {
super.setupController(controller, model);
controller.currentRoute = this;
}
resetController(controller, isExiting, transition) {
const fromScope = transition.from.find(
(routeInfo) => routeInfo.name === 'scopes.scope',
@@ -269,6 +274,6 @@ export default class ScopesScopeProjectsTargetsIndexRoute extends Route {
await this.store.query('scope', {});
// Refresh the proj scopes so our `modelFor` returns accurate data
this.router.refresh('scopes.scope.projects');
await this.router.refresh('scopes.scope.projects');
}
}