mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
fix: Database List Sorted (#15619)
* sorted the database list * revisions * cloned the array * one more time with feeling * added documentation link as well
This commit is contained in:
parent
600473ff72
commit
faf6fcd83e
@ -27,11 +27,12 @@ import {
|
|||||||
} from './styles';
|
} from './styles';
|
||||||
import { DatabaseForm, DatabaseObject } from '../types';
|
import { DatabaseForm, DatabaseObject } from '../types';
|
||||||
|
|
||||||
export const DOCUMENTATION_LINK =
|
|
||||||
'https://superset.apache.org/docs/databases/installing-database-drivers';
|
|
||||||
|
|
||||||
const supersetTextDocs = getDatabaseDocumentationLinks();
|
const supersetTextDocs = getDatabaseDocumentationLinks();
|
||||||
|
|
||||||
|
export const DOCUMENTATION_LINK = supersetTextDocs
|
||||||
|
? supersetTextDocs.support
|
||||||
|
: 'https://superset.apache.org/docs/databases/installing-database-drivers';
|
||||||
|
|
||||||
const irregularDocumentationLinks = {
|
const irregularDocumentationLinks = {
|
||||||
postgresql: 'https://superset.apache.org/docs/databases/postgres',
|
postgresql: 'https://superset.apache.org/docs/databases/postgres',
|
||||||
mssql: 'https://superset.apache.org/docs/databases/sql-server',
|
mssql: 'https://superset.apache.org/docs/databases/sql-server',
|
||||||
|
@ -559,7 +559,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||||||
onChange={setDatabaseModel}
|
onChange={setDatabaseModel}
|
||||||
placeholder="Choose a database..."
|
placeholder="Choose a database..."
|
||||||
>
|
>
|
||||||
{availableDbs?.databases
|
{[...(availableDbs?.databases || [])]
|
||||||
?.sort((a: DatabaseForm, b: DatabaseForm) =>
|
?.sort((a: DatabaseForm, b: DatabaseForm) =>
|
||||||
a.name.localeCompare(b.name),
|
a.name.localeCompare(b.name),
|
||||||
)
|
)
|
||||||
|
@ -631,7 +631,7 @@ export function useAvailableDatabases() {
|
|||||||
|
|
||||||
const getAvailable = useCallback(() => {
|
const getAvailable = useCallback(() => {
|
||||||
SupersetClient.get({
|
SupersetClient.get({
|
||||||
endpoint: `/api/v1/database/available`,
|
endpoint: `/api/v1/database/available/`,
|
||||||
}).then(({ json }) => {
|
}).then(({ json }) => {
|
||||||
setAvailableDbs(json);
|
setAvailableDbs(json);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user