willbarrett commented on a change in pull request #10705:
URL: 
https://github.com/apache/incubator-superset/pull/10705#discussion_r482265897



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx
##########
@@ -85,6 +101,164 @@ function DatabaseList({ addDangerToast, addSuccessToast }: 
DatabaseListProps) {
     };
   }
 
+  const initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];
+  const columns = useMemo(
+    () => [
+      {
+        accessor: 'database_name',
+        Header: t('Database'),
+      },
+      {
+        accessor: 'backend',
+        Header: t('Backend'),
+        size: 'xxl',
+        disableSortBy: true, // TODO: api support for sorting by 'backend'
+      },
+      {
+        accessor: 'allow_run_async',
+        Header: (
+          <TooltipWrapper
+            label="allow-run-async-header"
+            tooltip={t('Asynchronous Query Execution')}
+            placement="top"
+          >
+            <span>{t('AQE')}</span>
+          </TooltipWrapper>
+        ),
+        Cell: ({
+          row: {
+            original: { allow_run_async: allowRunAsync },
+          },
+        }: any) =>
+          allowRunAsync ? (
+            <IconBlack name="check" />
+          ) : (
+            <IconBlack name="cancel-x" />
+          ),
+        size: 'md',
+      },
+      {
+        accessor: 'allow_dml',
+        Header: (
+          <TooltipWrapper
+            label="allow-dml-header"
+            tooltip={t('Allow Data Danipulation Language')}
+            placement="top"
+          >
+            <span>{t('DML')}</span>
+          </TooltipWrapper>
+        ),
+        Cell: ({
+          row: {
+            original: { allow_dml: allowDML },
+          },
+        }: any) =>
+          allowDML ? <IconBlack name="check" /> : <IconBlack name="cancel-x" 
/>,

Review comment:
       Nit: this ternary is repeated a number of times with the same display 
element. Is there an easy way to DRY it up?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to