Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui,api): redirect to homepage #6511

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions engine/api/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 0 additions & 2 deletions sdk/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -32,7 +31,6 @@ func (f WebsocketFilterType) IsValid() bool {
WebsocketFilterTypeEnvironment,
WebsocketFilterTypeQueue,
WebsocketFilterTypeOperation,
WebsocketFilterTypeTimeline,
WebsocketFilterTypeDryRunRetentionWorkflow,
WebsocketFilterTypeAscodeEvent:
return true
Expand Down
2 changes: 1 addition & 1 deletion ui/e2e/pages/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
3 changes: 0 additions & 3 deletions ui/src/app/event.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ export class EventService {

let urlSplitted = url.substr(1, url.length - 1).split('/');
switch (urlSplitted[0]) {
case 'home':
fs.push(<WebsocketFilter>{ type: WebsocketFilterType.TIMELINE });
break;
case 'settings':
if (urlSplitted.length === 1) { // Ignore settings root page
break;
Expand Down
2 changes: 0 additions & 2 deletions ui/src/app/model/websocket.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export enum WebsocketFilterType {
ENVIRONMENT = 'environment',
QUEUE = 'queue',
OPERATION = 'operation',
TIMELINE = 'timeline',
ASCODE_EVENT = 'ascode-event'

}

export class WebsocketFilter {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/service/authentication/error.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ErrorInterceptor implements HttpInterceptor {
});
});
} else {
this._router.navigate(['/home']);
this._router.navigate(['/']);
}
return observableThrowError(e);
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/views/auth/callback/callback.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/views/auth/signin/signin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(['/']);
}
});
}
Expand All @@ -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(['/']);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(['/']);
});
}

Expand Down