Skip to content

Commit

Permalink
Merge branch 'master' into skip_es_tls_verification
Browse files Browse the repository at this point in the history
  • Loading branch information
miyakelp committed Jun 23, 2021
2 parents 2c82257 + ff7c5e8 commit 430d38c
Show file tree
Hide file tree
Showing 201 changed files with 1,880 additions and 1,034 deletions.
21 changes: 13 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

ARG databricks_odbc_driver_url=https://databricks.com/wp-content/uploads/2.6.10.1010-2/SimbaSparkODBC-2.6.10.1010-2-Debian-64bit.zip
ADD $databricks_odbc_driver_url /tmp/simba_odbc.zip
RUN unzip /tmp/simba_odbc.zip -d /tmp/ \
RUN wget --quiet $databricks_odbc_driver_url -O /tmp/simba_odbc.zip \
&& chmod 600 /tmp/simba_odbc.zip \
&& unzip /tmp/simba_odbc.zip -d /tmp/ \
&& dpkg -i /tmp/SimbaSparkODBC-*/*.deb \
&& echo "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \
&& rm /tmp/simba_odbc.zip \
Expand All @@ -79,15 +80,19 @@ WORKDIR /app
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1

# Use legacy resolver to work around broken build due to resolver changes in pip
ENV PIP_USE_DEPRECATED=legacy-resolver
# rollback pip version to avoid legacy resolver problem
RUN pip install pip==20.2.4;

# We first copy only the requirements file, to avoid rebuilding on every file
# change.
COPY requirements.txt requirements_bundles.txt requirements_dev.txt requirements_all_ds.txt ./
RUN if [ "x$skip_dev_deps" = "x" ] ; then pip install -r requirements.txt -r requirements_dev.txt; else pip install -r requirements.txt; fi
# We first copy only the requirements file, to avoid rebuilding on every file change.
COPY requirements_all_ds.txt ./
RUN if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi

COPY requirements_bundles.txt requirements_dev.txt ./
RUN if [ "x$skip_dev_deps" = "x" ] ; then pip install -r requirements_dev.txt ; fi

COPY requirements.txt ./
RUN pip install -r requirements.txt

COPY . /app
COPY --from=frontend-builder /frontend/client/dist /app/client/dist
RUN chown -R redash /app
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help
- Shell Scripts
- Snowflake
- SQLite
- TiDB
- TreasureData
- Vertica
- Yandex AppMetrrica
Expand Down
17 changes: 15 additions & 2 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ module.exports = {
"react-app",
"plugin:compat/recommended",
"prettier",
"plugin:jsx-a11y/recommended",
// Remove any typescript-eslint rules that would conflict with prettier
"prettier/@typescript-eslint",
],
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint"],
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint", "jsx-a11y"],
settings: {
"import/resolver": "webpack",
},
Expand All @@ -19,7 +20,19 @@ module.exports = {
rules: {
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/anchor-is-valid": [
// TMP
"off",
{
components: ["Link"],
aspects: ["noHref", "invalidHref", "preferButton"],
},
],
"jsx-a11y/no-redundant-roles": "error",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/click-events-have-key-events": "off", // TMP
"jsx-a11y/no-static-element-interactions": "off", // TMP
"jsx-a11y/no-noninteractive-element-interactions": "off", // TMP
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-restricted-imports": [
"error",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
163 changes: 84 additions & 79 deletions client/app/assets/less/inc/schema-browser.less
Original file line number Diff line number Diff line change
@@ -1,102 +1,107 @@
div.table-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
padding: 2px 22px 2px 10px;
border-radius: @redash-radius;
position: relative;
height: 22px;

.copy-to-editor {
display: none;
}

&:hover {
background: fade(@redash-gray, 10%);

.copy-to-editor {
display: flex;
}
}
}

.schema-container {
height: 100%;
z-index: 10;
background-color: white;
}

.schema-browser {
overflow: hidden;
border: none;
padding-top: 10px;
position: relative;
height: 100%;

.schema-loading-state {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}

.collapse.in {
background: transparent;
}

.copy-to-editor {
color: fade(@redash-gray, 90%);
cursor: pointer;
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 20px;
display: flex;
align-items: center;
justify-content: center;
}

.table-open {
padding: 0 22px 0 26px;
.schema-browser {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border: none;
padding-top: 10px;
position: relative;
height: 18px;
height: 100%;

.column-type {
color: fade(@text-color, 80%);
font-size: 10px;
margin-left: 2px;
text-transform: uppercase;
.schema-loading-state {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}

.collapse.in {
background: transparent;
}

.copy-to-editor {
display: none;
visibility: hidden;
color: fade(@redash-gray, 90%);
width: 20px;
display: flex;
align-items: center;
justify-content: center;
transition: none;
}

&:hover {
background: fade(@redash-gray, 10%);
.schema-list-item {
display: flex;
border-radius: @redash-radius;
height: 22px;

.table-name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
padding: 2px 22px 2px 10px;
}

&:hover,
&:focus,
&:focus-within {
background: fade(@redash-gray, 10%);

.copy-to-editor {
.copy-to-editor {
visibility: visible;
}
}
}

.table-open {
.table-open-item {
display: flex;
height: 18px;
width: calc(100% - 22px);
padding-left: 22px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
transition: none;

div:first-child {
flex: 1;
}

.column-type {
color: fade(@text-color, 80%);
font-size: 10px;
margin-left: 2px;
text-transform: uppercase;
}

&:hover,
&:focus,
&:focus-within {
background: fade(@redash-gray, 10%);

.copy-to-editor {
visibility: visible;
}
}
}
}
}
}

.schema-control {
display: flex;
flex-wrap: nowrap;
padding: 0;
.schema-control {
display: flex;
flex-wrap: nowrap;
padding: 0;

.ant-btn {
height: auto;
.ant-btn {
height: auto;
}
}
}

.parameter-label {
display: block;
.parameter-label {
display: block;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useMemo } from "react";
import { first, includes } from "lodash";
import Menu from "antd/lib/menu";
import Link from "@/components/Link";
import PlainButton from "@/components/PlainButton";
import HelpTrigger from "@/components/HelpTrigger";
import CreateDashboardDialog from "@/components/dashboards/CreateDashboardDialog";
import { useCurrentRoute } from "@/components/ApplicationArea/Router";
Expand All @@ -15,8 +16,8 @@ import AlertOutlinedIcon from "@ant-design/icons/AlertOutlined";
import PlusOutlinedIcon from "@ant-design/icons/PlusOutlined";
import QuestionCircleOutlinedIcon from "@ant-design/icons/QuestionCircleOutlined";
import SettingOutlinedIcon from "@ant-design/icons/SettingOutlined";

import VersionInfo from "./VersionInfo";

import "./DesktopNavbar.less";

function NavbarSection({ children, ...props }) {
Expand Down Expand Up @@ -129,9 +130,9 @@ export default function DesktopNavbar() {
)}
{canCreateDashboard && (
<Menu.Item key="new-dashboard">
<a data-test="CreateDashboardMenuItem" onMouseUp={() => CreateDashboardDialog.showModal()}>
<PlainButton data-test="CreateDashboardMenuItem" onClick={() => CreateDashboardDialog.showModal()}>
New Dashboard
</a>
</PlainButton>
</Menu.Item>
)}
{canCreateAlert && (
Expand Down Expand Up @@ -182,9 +183,9 @@ export default function DesktopNavbar() {
)}
<Menu.Divider />
<Menu.Item key="logout">
<a data-test="LogOutButton" onClick={() => Auth.logout()}>
<PlainButton data-test="LogOutButton" onClick={() => Auth.logout()}>
Log out
</a>
</PlainButton>
</Menu.Item>
<Menu.Divider />
<Menu.Item key="version" role="presentation" disabled className="version-info">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ export function UserSessionWrapper<P>({ bodyClass, currentRoute, render }: UserS
{/* @ts-expect-error FIXME */}
<ErrorBoundary renderError={(error: Error) => <ErrorMessage error={error} />}>
<ErrorBoundaryContext.Consumer>
{({ handleError } /* : { handleError: UserSessionWrapperRenderChildrenProps<P>["onError"] } FIXME bring back type */) =>
render({ ...currentRoute.routeParams, pageTitle: currentRoute.title, onError: handleError })
}
{(
{
handleError,
} /* : { handleError: UserSessionWrapperRenderChildrenProps<P>["onError"] } FIXME bring back type */
) => render({ ...currentRoute.routeParams, pageTitle: currentRoute.title, onError: handleError })}
</ErrorBoundaryContext.Consumer>
</ErrorBoundary>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion client/app/components/CodeBlock.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import PropTypes from "prop-types";
import Button from "antd/lib/button";
import Tooltip from "antd/lib/tooltip";
import Tooltip from "@/components/Tooltip";
import CopyOutlinedIcon from "@ant-design/icons/CopyOutlined";
import "./CodeBlock.less";

Expand Down
9 changes: 6 additions & 3 deletions client/app/components/CreateSourceDialog.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import PropTypes from "prop-types";
import { isEmpty, toUpper, includes, get } from "lodash";
import { isEmpty, toUpper, includes, get, uniqueId } from "lodash";
import Button from "antd/lib/button";
import List from "antd/lib/list";
import Modal from "antd/lib/modal";
Expand Down Expand Up @@ -45,6 +45,8 @@ class CreateSourceDialog extends React.Component {
currentStep: StepEnum.SELECT_TYPE,
};

formId = uniqueId("sourceForm");

selectType = selectedType => {
this.setState({ selectedType, currentStep: StepEnum.CONFIGURE_IT });
};
Expand Down Expand Up @@ -82,6 +84,7 @@ class CreateSourceDialog extends React.Component {
<div className="m-t-10">
<Search
placeholder="Search..."
aria-label="Search"
onChange={e => this.setState({ searchText: e.target.value })}
autoFocus
data-test="SearchSource"
Expand Down Expand Up @@ -116,7 +119,7 @@ class CreateSourceDialog extends React.Component {
</HelpTrigger>
)}
</div>
<DynamicForm id="sourceForm" fields={fields} onSubmit={this.createSource} feedbackIcons hideSubmitButton />
<DynamicForm id={this.formId} fields={fields} onSubmit={this.createSource} feedbackIcons hideSubmitButton />
{selectedType.type === "databricks" && (
<small>
By using the Databricks Data Source you agree to the Databricks JDBC/ODBC{" "}
Expand Down Expand Up @@ -170,7 +173,7 @@ class CreateSourceDialog extends React.Component {
<Button
key="submit"
htmlType="submit"
form="sourceForm"
form={this.formId}
type="primary"
loading={savingSource}
data-test="CreateSourceSaveButton">
Expand Down
1 change: 1 addition & 0 deletions client/app/components/EditInPlace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default class EditInPlace extends React.Component {
return (
<InputComponent
defaultValue={value}
aria-label="Editing"
onBlur={e => this.stopEditing(e.target.value)}
onKeyDown={this.handleKeyDown}
autoFocus
Expand Down
Loading

0 comments on commit 430d38c

Please sign in to comment.