mirror of
https://github.com/outbackdingo/openapi-ui.git
synced 2026-01-27 10:19:49 +00:00
+ SEARCH_TABLE_CUSTOMIZATION_PREFIX
This commit is contained in:
2
.env
2
.env
@@ -31,3 +31,5 @@ VITE_REMOVE_BACKLINK=true
|
||||
VITE_REMOVE_BACKLINK_TEXT=true
|
||||
|
||||
VITE_DOCS_URL=https://in-cloud.io/docs/tech-docs/introduction/
|
||||
|
||||
VITE_SEARCH_TABLE_CUSTOMIZATION_PREFIX=stock-
|
||||
|
||||
@@ -33,3 +33,5 @@ REMOVE_BACKLINK=
|
||||
REMOVE_BACKLINK_TEXT=
|
||||
|
||||
DOCS_URL=
|
||||
|
||||
SEARCH_TABLE_CUSTOMIZATION_PREFIX=
|
||||
|
||||
@@ -35,3 +35,4 @@ This app can be configured through environment variables.
|
||||
| `REMOVE_BACKLINK` | `boolean` | Remove backlink arrow from right-side navigation |
|
||||
| `REMOVE_BACKLINK_TEXT` | `boolean` | Remove backlink text from right-side navigation |
|
||||
| `DOCS_URL` | `string` | URL to navigate from question mark |
|
||||
| `SEARCH_TABLE_CUSTOMIZATION_PREFIX` | `string` | Search tables Customization id prefix |
|
||||
|
||||
@@ -68,6 +68,11 @@ const REMOVE_BACKLINK_TEXT =
|
||||
|
||||
const DOCS_URL = process.env.LOCAL === 'true' ? options?.DOCS_URL : process.env.DOCS_URL
|
||||
|
||||
const SEARCH_TABLE_CUSTOMIZATION_PREFIX =
|
||||
process.env.LOCAL === 'true'
|
||||
? options?.SEARCH_TABLE_CUSTOMIZATION_PREFIX
|
||||
: process.env.SEARCH_TABLE_CUSTOMIZATION_PREFIX
|
||||
|
||||
const healthcheck = require('express-healthcheck')
|
||||
const promBundle = require('express-prom-bundle')
|
||||
|
||||
@@ -192,6 +197,7 @@ app.get(`${basePrefix ? basePrefix : ''}/env.js`, (_, res) => {
|
||||
LOGOUT_URL: ${JSON.stringify(LOGOUT_URL) || '"check envs"'},
|
||||
LOGIN_USERNAME_FIELD: ${JSON.stringify(LOGIN_USERNAME_FIELD) || '"check envs"'},
|
||||
DOCS_URL: ${JSON.stringify(DOCS_URL) || '"/docs"'},
|
||||
SEARCH_TABLE_CUSTOMIZATION_PREFIX: ${JSON.stringify(SEARCH_TABLE_CUSTOMIZATION_PREFIX) || '"search-"'},
|
||||
REMOVE_BACKLINK: ${!!REMOVE_BACKLINK ? JSON.stringify(REMOVE_BACKLINK).toLowerCase() : '"false"'},
|
||||
REMOVE_BACKLINK_TEXT: ${!!REMOVE_BACKLINK_TEXT ? JSON.stringify(REMOVE_BACKLINK_TEXT).toLowerCase() : '"false"'}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,10 @@ export const DOCS_URL = import.meta.env.DEV
|
||||
? window._env_.DOCS_URL || import.meta.env.VITE_DOCS_URL
|
||||
: window._env_.DOCS_URL
|
||||
|
||||
export const SEARCH_TABLE_CUSTOMIZATION_PREFIX = import.meta.env.DEV
|
||||
? window._env_.SEARCH_TABLE_CUSTOMIZATION_PREFIX || import.meta.env.VITE_SEARCH_TABLE_CUSTOMIZATION_PREFIX
|
||||
: window._env_.SEARCH_TABLE_CUSTOMIZATION_PREFIX
|
||||
|
||||
export const BASE_REMOVE_BACKLINK = import.meta.env.DEV
|
||||
? window._env_.REMOVE_BACKLINK === 'true' || import.meta.env.VITE_REMOVE_BACKLINK?.toString().toLowerCase() === 'true'
|
||||
: window._env_.REMOVE_BACKLINK === 'true'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { SEARCH_TABLE_CUSTOMIZATION_PREFIX } from 'constants/customizationApiGroupAndVersion'
|
||||
|
||||
export const getTableCustomizationIdPrefix = ({
|
||||
project,
|
||||
instance,
|
||||
@@ -16,7 +18,7 @@ export const getTableCustomizationIdPrefix = ({
|
||||
if (inside) {
|
||||
result = 'inside-'
|
||||
} else if (search) {
|
||||
result = 'search-'
|
||||
result = SEARCH_TABLE_CUSTOMIZATION_PREFIX
|
||||
} else {
|
||||
result = 'stock-'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user