-
Notifications
You must be signed in to change notification settings - Fork 18
feat: support cluster_domain in settings #3158
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import {getClusterPath} from '../../routes'; | ||
| import type {PreparedCluster} from '../../store/reducers/clusters/types'; | ||
| import {createDeveloperUIMonitoringPageHref} from '../../utils/developerUI/developerUI'; | ||
| import type {ClusterTab} from '../Cluster/utils'; | ||
|
|
||
| export function calculateClusterPath(row: PreparedCluster, activeTab?: ClusterTab): string { | ||
| const { | ||
| use_embedded_ui: useEmbeddedUi, | ||
| preparedBackend: backend, | ||
| name: clusterName, | ||
| clusterDomain, | ||
| settings, | ||
| } = row; | ||
|
|
||
| if (useEmbeddedUi && backend) { | ||
| return createDeveloperUIMonitoringPageHref(backend); | ||
| } | ||
|
|
||
| return getClusterPath( | ||
| { | ||
| activeTab, | ||
| environment: settings?.auth_service, | ||
| }, | ||
| {backend, clusterName}, | ||
| {withBasename: true}, | ||
| clusterDomain, | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,7 @@ export function createHref( | |
| params?: Record<string, string | number | undefined>, | ||
| query: Query = {}, | ||
| options: CreateHrefOptions = {}, | ||
| host = '', | ||
|
||
| ) { | ||
| let extendedQuery = query; | ||
| let extendedParams = params ?? {}; | ||
|
|
@@ -105,7 +106,8 @@ export function createHref( | |
| // It is needed for external links - <a> or uikit <Link> | ||
| return normalizePathSlashes(`${basename}/${compiledRoute}`); | ||
Raubzeug marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| return compiledRoute; | ||
|
|
||
| return `${host}${compiledRoute}`; | ||
| } | ||
|
|
||
| // embedded version could be located in some folder (e.g. host/some_folder/app_router_path) | ||
|
|
@@ -150,8 +152,9 @@ export const getClusterPath = ( | |
| params?: {activeTab?: ClusterTab; environment?: string}, | ||
| query = {}, | ||
| options?: CreateHrefOptions, | ||
| host?: string, | ||
| ) => { | ||
| return createHref(routes.cluster, params, query, options); | ||
| return createHref(routes.cluster, params, query, options, host); | ||
| }; | ||
|
|
||
| export const getTenantPath = (query: TenantQuery, options?: CreateHrefOptions) => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -69,6 +69,7 @@ export function parseLoggingUrls( | |||||
|
|
||||||
| const settingsSchema = z.object({ | ||||||
| use_meta_proxy: z.boolean().optional(), | ||||||
| cluster_domain: z.string().optional(), | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Field naming mismatch: issue #3157 specifies
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/store/reducers/cluster/parseFields.ts
Line: 72:72
Comment:
**logic:** Field naming mismatch: issue #3157 specifies `redirectDomain` but implementation uses `cluster_domain`
```suggestion
redirect_domain: z.string().optional(),
```
How can I resolve this? If you propose a fix, please make it concise.
Raubzeug marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| }); | ||||||
|
|
||||||
| export function parseSettingsField( | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.