From 60ac6ba232e14384761bf80b1dede2ef4c8820f7 Mon Sep 17 00:00:00 2001 From: Richard LT Date: Mon, 20 Mar 2023 11:31:12 +0100 Subject: [PATCH] fix(ui,api): redirect to homepage (#6511) --- engine/api/websocket.go | 8 +------- sdk/websocket.go | 2 -- ui/e2e/pages/login.ts | 2 +- ui/src/app/event.service.ts | 3 --- ui/src/app/model/websocket.model.ts | 2 -- ui/src/app/service/authentication/error.interceptor.ts | 2 +- ui/src/app/views/auth/callback/callback.component.ts | 2 +- ui/src/app/views/auth/signin/signin.ts | 4 ++-- .../views/project/show/admin/project.admin.component.ts | 2 +- 9 files changed, 7 insertions(+), 20 deletions(-) diff --git a/engine/api/websocket.go b/engine/api/websocket.go index 944f028e71..d551d7ae67 100644 --- a/engine/api/websocket.go +++ b/engine/api/websocket.go @@ -57,7 +57,7 @@ func (f webSocketFilters) HasOneKey(keys ...string) (found bool, needCheckPermis if keys[i] == filter.Key() { found = true switch filter.Type { - case sdk.WebsocketFilterTypeGlobal, sdk.WebsocketFilterTypeQueue, sdk.WebsocketFilterTypeTimeline, sdk.WebsocketFilterTypeDryRunRetentionWorkflow: + case sdk.WebsocketFilterTypeGlobal, sdk.WebsocketFilterTypeQueue, sdk.WebsocketFilterTypeDryRunRetentionWorkflow: needCheckPermission = true } // If we found a filter that don't need to check permission we can return directly @@ -393,12 +393,6 @@ func (a *API) websocketComputeEventKeys(event sdk.Event) []string { OperationUUID: event.OperationUUID, }.Key()) } - // Event that match timeline filter - if event.EventType == fmt.Sprintf("%T", sdk.EventRunWorkflow{}) { - keys = append(keys, sdk.WebsocketFilter{ - Type: sdk.WebsocketFilterTypeTimeline, - }.Key()) - } // Event that match as code event filter if event.EventType == fmt.Sprintf("%T", sdk.EventAsCodeEvent{}) { keys = append(keys, sdk.WebsocketFilter{ diff --git a/sdk/websocket.go b/sdk/websocket.go index f4a5cbbcb3..8d7ad29b5c 100644 --- a/sdk/websocket.go +++ b/sdk/websocket.go @@ -15,7 +15,6 @@ const ( WebsocketFilterTypeEnvironment WebsocketFilterType = "environment" WebsocketFilterTypeQueue WebsocketFilterType = "queue" WebsocketFilterTypeOperation WebsocketFilterType = "operation" - WebsocketFilterTypeTimeline WebsocketFilterType = "timeline" WebsocketFilterTypeAscodeEvent WebsocketFilterType = "ascode-event" WebsocketFilterTypeDryRunRetentionWorkflow WebsocketFilterType = "workflow-retention-dryrun" ) @@ -32,7 +31,6 @@ func (f WebsocketFilterType) IsValid() bool { WebsocketFilterTypeEnvironment, WebsocketFilterTypeQueue, WebsocketFilterTypeOperation, - WebsocketFilterTypeTimeline, WebsocketFilterTypeDryRunRetentionWorkflow, WebsocketFilterTypeAscodeEvent: return true diff --git a/ui/e2e/pages/login.ts b/ui/e2e/pages/login.ts index 7c2de64f95..3ef8ab835f 100644 --- a/ui/e2e/pages/login.ts +++ b/ui/e2e/pages/login.ts @@ -24,6 +24,6 @@ export default class LoginPage { .typeText(this.userNameInput, user) .typeText(this.passwordInput, password) .click(this.loginButton) - .expect(this.getLocation()).eql(config.baseUrl + '/home'); + .expect(this.getLocation()).eql(config.baseUrl); } } diff --git a/ui/src/app/event.service.ts b/ui/src/app/event.service.ts index fe714c5dc7..d5567564a9 100644 --- a/ui/src/app/event.service.ts +++ b/ui/src/app/event.service.ts @@ -100,9 +100,6 @@ export class EventService { let urlSplitted = url.substr(1, url.length - 1).split('/'); switch (urlSplitted[0]) { - case 'home': - fs.push({ type: WebsocketFilterType.TIMELINE }); - break; case 'settings': if (urlSplitted.length === 1) { // Ignore settings root page break; diff --git a/ui/src/app/model/websocket.model.ts b/ui/src/app/model/websocket.model.ts index df5be17386..3d74a6d6f2 100644 --- a/ui/src/app/model/websocket.model.ts +++ b/ui/src/app/model/websocket.model.ts @@ -12,9 +12,7 @@ export enum WebsocketFilterType { ENVIRONMENT = 'environment', QUEUE = 'queue', OPERATION = 'operation', - TIMELINE = 'timeline', ASCODE_EVENT = 'ascode-event' - } export class WebsocketFilter { diff --git a/ui/src/app/service/authentication/error.interceptor.ts b/ui/src/app/service/authentication/error.interceptor.ts index a4b06bea0f..cf1d1a7e23 100644 --- a/ui/src/app/service/authentication/error.interceptor.ts +++ b/ui/src/app/service/authentication/error.interceptor.ts @@ -60,7 +60,7 @@ export class ErrorInterceptor implements HttpInterceptor { }); }); } else { - this._router.navigate(['/home']); + this._router.navigate(['/']); } return observableThrowError(e); } diff --git a/ui/src/app/views/auth/callback/callback.component.ts b/ui/src/app/views/auth/callback/callback.component.ts index 5004d272f6..00ff43a2cd 100644 --- a/ui/src/app/views/auth/callback/callback.component.ts +++ b/ui/src/app/views/auth/callback/callback.component.ts @@ -144,7 +144,7 @@ export class CallbackComponent implements OnInit, OnDestroy { let dus = new DefaultUrlSerializer(); this._router.navigateByUrl(dus.parse(this.payloadData.redirect_uri)); } else { - this._router.navigate(['/home']); + this._router.navigate(['/']); } }, () => { this.showErrorMessage = true; diff --git a/ui/src/app/views/auth/signin/signin.ts b/ui/src/app/views/auth/signin/signin.ts index 0e4f798e8a..0efb5583e6 100644 --- a/ui/src/app/views/auth/signin/signin.ts +++ b/ui/src/app/views/auth/signin/signin.ts @@ -139,7 +139,7 @@ export class SigninComponent implements OnInit { if (this.redirect) { this._router.navigateByUrl(decodeURIComponent(this.redirect)); } else { - this._router.navigate(['home']); + this._router.navigate(['/']); } }); } @@ -149,7 +149,7 @@ export class SigninComponent implements OnInit { if (this.redirect) { this._router.navigateByUrl(decodeURIComponent(this.redirect)); } else { - this._router.navigate(['home']); + this._router.navigate(['/']); } }); } diff --git a/ui/src/app/views/project/show/admin/project.admin.component.ts b/ui/src/app/views/project/show/admin/project.admin.component.ts index 81663e3750..1d9c286cda 100644 --- a/ui/src/app/views/project/show/admin/project.admin.component.ts +++ b/ui/src/app/views/project/show/admin/project.admin.component.ts @@ -65,7 +65,7 @@ export class ProjectAdminComponent implements OnInit { })) .subscribe(() => { this._toast.success('', this._translate.instant('project_deleted')); - this._router.navigate(['/home']); + this._router.navigate(['/']); }); }