michael-s-molina commented on code in PR #36644:
URL: https://github.com/apache/superset/pull/36644#discussion_r2630662408


##########
superset-frontend/src/SqlLab/contributions.ts:
##########
@@ -19,4 +19,6 @@
 export enum ViewContribution {
   RightSidebar = 'sqllab.rightSidebar',
   SouthPanels = 'sqllab.panels',

Review Comment:
   It would be nice to rename this to Panels to match the identifier as the 
other ones.



##########
superset-frontend/src/SqlLab/components/StatusBar/index.tsx:
##########
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { css, styled } from '@apache-superset/core';
+import { t } from '@superset-ui/core';
+import { Flex } from '@superset-ui/core/components';
+import { Timer } from '@superset-ui/core/components/Timer';
+import { useSelector } from 'react-redux';
+import {
+  SQL_EDITOR_STATUSBAR_HEIGHT,
+  STATE_TYPE_MAP,
+} from 'src/SqlLab/constants';
+import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor';
+import { SqlLabRootState } from 'src/SqlLab/types';
+
+const Container = styled(Flex)`
+  height: ${SQL_EDITOR_STATUSBAR_HEIGHT}px;
+  background-color: ${({ theme }) => theme.colorPrimary};
+  color: ${({ theme }) => theme.colorWhite};
+  padding: 0 ${({ theme }) => theme.sizeUnit * 4}px;
+
+  & .ant-tag {
+    color: ${({ theme }) => theme.colorWhite};
+    background-color: transparent;
+    border: 0;
+  }
+`;
+
+export interface StatusBarProps {
+  queryEditorId: string;
+}
+
+const StatusBar = ({ queryEditorId }: StatusBarProps) => {

Review Comment:
   The `StatusBar` component should not have any logic in itself part from 
rendering items on the left and right sides. It's a layout component that 
receives built-in and external extensions. One built-in extension is the Timer. 
It would also be nice to implement the Timer logic using the events from 
`@apache-superset/core` instead of depending on Redux.



##########
superset-frontend/src/SqlLab/components/SqlEditorTopBar/index.tsx:
##########
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { EmptyState, Flex, Space } from '@superset-ui/core/components';
+import { css } from '@apache-superset/core/ui';
+import { DatabaseSelector } from 'src/components';
+import { ViewContribution } from 'src/SqlLab/contributions';
+import ActionPanel, { type ActionPanelProps } from 
'src/components/ActionPanel';
+
+import useDatabaseSelector from './useDatabaseSelector';
+
+export interface SqlEditorTopBarProps {
+  queryEditorId: string;
+  defaultPrimaryActions: React.ReactNode;
+  defaultSecondaryActions: ActionPanelProps['defaultItems'];
+}
+
+const SqlEditorTopBar = ({
+  queryEditorId,
+  defaultPrimaryActions,
+  defaultSecondaryActions,
+}: SqlEditorTopBarProps) => {
+  const dbSelectorProps = useDatabaseSelector(queryEditorId);
+
+  return (
+    <Flex justify="space-between" gap="small">
+      <DatabaseSelector
+        {...dbSelectorProps}
+        emptyState={<EmptyState />}
+        sqlLabMode
+        horizontalMode
+      />
+      <Flex flex={1} gap="small" justify="end">
+        <ActionPanel
+          viewId={ViewContribution.Editor}
+          secondary
+          defaultItems={defaultSecondaryActions}
+        />
+        <Flex
+          gap="small"
+          css={css`
+            flex-direction: row-reverse;
+          `}
+        >
+          <ActionPanel viewId={ViewContribution.Editor} primary compactMode>
+            {defaultPrimaryActions}

Review Comment:
   I think primary actions should come before secondary actions like VSCode 
(different from what's in Kasia's prototype). We should also sort the actions 
based on their use. Run should be the first action on the left.



-- 
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.

To unsubscribe, e-mail: [email protected]

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