This is an automated email from the ASF dual-hosted git repository. hugh pushed a commit to branch hugh/allow-imgs-via-s2text in repository https://gitbox.apache.org/repos/asf/superset.git
commit b8a54c7131721a431f48752d59bcf61e73c2727a Author: hughhhh <[email protected]> AuthorDate: Sat Jun 5 14:21:33 2021 -0400 saving this for now --- superset-frontend/src/components/IconButton/index.tsx | 3 ++- .../src/views/CRUD/data/database/DatabaseModal/index.tsx | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/components/IconButton/index.tsx b/superset-frontend/src/components/IconButton/index.tsx index fb10b77..711aee9 100644 --- a/superset-frontend/src/components/IconButton/index.tsx +++ b/superset-frontend/src/components/IconButton/index.tsx @@ -43,7 +43,8 @@ const StyledImage = styled.div` } img { - width: fit-content; + width: 100%; + height: 100%; &:first-of-type { margin-right: 0; diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx index 9527518..c001e3c 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -37,12 +37,15 @@ import { useDatabaseValidation, } from 'src/views/CRUD/hooks'; import { useCommonConf } from 'src/views/CRUD/data/database/state'; +import SupersetText from 'src/utils/textUtils'; import { DatabaseObject, DatabaseForm, CONFIGURATION_METHOD, } from 'src/views/CRUD/data/database/types'; import Label from 'src/components/Label'; +import supersetText from 'src/utils/textUtils'; +import { cos } from 'mathjs'; import ExtraOptions from './ExtraOptions'; import SqlAlchemyForm from './SqlAlchemyForm'; @@ -125,6 +128,13 @@ type DBReducerActionType = payload: { configuration_method: CONFIGURATION_METHOD }; }; +const getPreferredImage = async (engine) => { + const config = await SupersetText; + return config.DATABASE_CONNECTION.images[engine]; +}; + +getPreferredImage('postgresql'); + function dbReducer( state: Partial<DatabaseObject> | null, action: DBReducerActionType, @@ -341,6 +351,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({ className="preferred-item" onClick={() => setDatabaseModel(database.engine)} buttonText={database.name} + icon={getPreferredImage('postgresql')} /> ))} </div>
