mirror of
https://github.com/apache/superset.git
synced 2026-04-23 10:04:45 +00:00
feat: Move SQLAlchemy url reference to config (#13182)
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
import React, { FunctionComponent, useState, useEffect } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { styled, t, SupersetClient } from '@superset-ui/core';
|
||||
import InfoTooltip from 'src/common/components/InfoTooltip';
|
||||
import { useSingleViewResource } from 'src/views/CRUD/hooks';
|
||||
@@ -39,8 +40,17 @@ interface DatabaseModalProps {
|
||||
database?: DatabaseObject | null; // If included, will go into edit mode
|
||||
}
|
||||
|
||||
const DEFAULT_TAB_KEY = '1';
|
||||
// todo: define common type fully in types file
|
||||
interface RootState {
|
||||
common: {
|
||||
conf: {
|
||||
SQLALCHEMY_DOCS_URL: string;
|
||||
};
|
||||
};
|
||||
messageToast: Array<Object>;
|
||||
}
|
||||
|
||||
const DEFAULT_TAB_KEY = '1';
|
||||
const StyledIcon = styled(Icon)`
|
||||
margin: auto ${({ theme }) => theme.gridUnit * 2}px auto 0;
|
||||
`;
|
||||
@@ -132,6 +142,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
const [db, setDB] = useState<DatabaseObject | null>(null);
|
||||
const [isHidden, setIsHidden] = useState<boolean>(true);
|
||||
const [tabKey, setTabKey] = useState<string>(DEFAULT_TAB_KEY);
|
||||
const conf = useSelector((state: RootState) => state.common.conf);
|
||||
|
||||
const isEditMode = database !== null;
|
||||
const defaultExtra =
|
||||
@@ -402,7 +413,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
<div className="helper">
|
||||
{t('Refer to the ')}
|
||||
<a
|
||||
href="https://docs.sqlalchemy.org/en/rel_1_2/core/engines.html#"
|
||||
href={conf?.SQLALCHEMY_DOCS_URL ?? ''}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user