mirror of https://github.com/apache/superset.git
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';
|
||||
import { DatabaseForm, DatabaseObject } from '../types';
|
||||
|
||||
export const DOCUMENTATION_LINK =
|
||||
'https://superset.apache.org/docs/databases/installing-database-drivers';
|
||||
|
||||
const supersetTextDocs = getDatabaseDocumentationLinks();
|
||||
|
||||
export const DOCUMENTATION_LINK = supersetTextDocs
|
||||
? supersetTextDocs.support
|
||||
: 'https://superset.apache.org/docs/databases/installing-database-drivers';
|
||||
|
||||
const irregularDocumentationLinks = {
|
||||
postgresql: 'https://superset.apache.org/docs/databases/postgres',
|
||||
mssql: 'https://superset.apache.org/docs/databases/sql-server',
|
||||
|
|
|
@ -559,7 +559,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||
onChange={setDatabaseModel}
|
||||
placeholder="Choose a database..."
|
||||
>
|
||||
{availableDbs?.databases
|
||||
{[...(availableDbs?.databases || [])]
|
||||
?.sort((a: DatabaseForm, b: DatabaseForm) =>
|
||||
a.name.localeCompare(b.name),
|
||||
)
|
||||
|
|
|
@ -631,7 +631,7 @@ export function useAvailableDatabases() {
|
|||
|
||||
const getAvailable = useCallback(() => {
|
||||
SupersetClient.get({
|
||||
endpoint: `/api/v1/database/available`,
|
||||
endpoint: `/api/v1/database/available/`,
|
||||
}).then(({ json }) => {
|
||||
setAvailableDbs(json);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue