Skip to content

Commit 6acd844

Browse files
authored
preserve query params on cluster redirect (#539)
1 parent 7155ab0 commit 6acd844

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

client/containers/domain/connector.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const lifecycle = {
7272
// in some cases users have urls that are generic (with no cluster name specified) those are used when we want to auto redirect the user to one of the clusters by default without carring about which cluster.
7373
dispatch(ROUTE_REPLACE, {
7474
name: state.route.name,
75+
query: state.route.query,
7576
params: {
7677
...state.route.params,
7778
clusterName: this.activeCluster?.clusterName,

client/test/domain.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ describe('Domain ', () => {
9292
.withDomainDescription('ci-test', desc)
9393
.withWorkflows({ status: 'open' })
9494
.withWorkflows({ status: 'closed', startTimeOffset: 30 })
95-
.startingAt('/domains/ci-test')
95+
.startingAt('/domains/ci-test?t=test')
9696
.go();
9797

9898
return [testEl, scenario];
9999
}
100100

101-
it('should redirect to cluster if it is missing in the url in a cross region domain environment', async function test() {
101+
it('should redirect to cluster if it is missing in the url in a cross region domain environment while preserving queryParams', async function test() {
102102
// if clusterName is missing in the url and active cluser exists
103103
// make sure to redirect to add cluster to url
104104
// we make sure the activeCluster config exists by passing feature flags for crossRegion configs
@@ -108,6 +108,8 @@ describe('Domain ', () => {
108108

109109
await testEl.waitUntilExists('.feature-flag .active-status');
110110
scenario.location.should.contain('/ci-test-cluster');
111+
// query paramas should be preserveded
112+
scenario.location.should.contain('t=test');
111113
});
112114

113115
it('should not redirect to cluster if it is missing in the url in a non cross region domain environment', async function test() {

0 commit comments

Comments
 (0)