Fork button disabled on View Query page for non-admin users (#4927)

This commit is contained in:
Levko Kravets 2020-05-29 11:41:07 +03:00 committed by GitHub
parent d1044c1963
commit d550427485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,6 @@ import routeWithUserSession from "@/components/ApplicationArea/routeWithUserSess
import EditInPlace from "@/components/EditInPlace";
import Parameters from "@/components/Parameters";
import DataSource from "@/services/data-source";
import { ExecutionStatus } from "@/services/query-result";
import useQueryResultData from "@/lib/useQueryResultData";
@ -23,6 +22,7 @@ import QueryExecutionMetadata from "./components/QueryExecutionMetadata";
import useVisualizationTabHandler from "./hooks/useVisualizationTabHandler";
import useQueryExecute from "./hooks/useQueryExecute";
import useQueryDataSources from "./hooks/useQueryDataSources";
import useUpdateQueryDescription from "./hooks/useUpdateQueryDescription";
import useQueryFlags from "./hooks/useQueryFlags";
import useQueryParameters from "./hooks/useQueryParameters";
@ -35,7 +35,7 @@ import "./QueryView.less";
function QueryView(props) {
const [query, setQuery] = useState(props.query);
const [dataSource, setDataSource] = useState();
const { dataSource } = useQueryDataSources(query);
const queryFlags = useQueryFlags(query, dataSource);
const [parameters, areParametersDirty, updateParametersDirtyFlag] = useQueryParameters(query);
const [selectedVisualization, setSelectedVisualization] = useVisualizationTabHandler(query.visualizations);
@ -81,10 +81,6 @@ function QueryView(props) {
document.title = query.name;
}, [query.name]);
useEffect(() => {
DataSource.get({ id: query.data_source_id }).then(setDataSource);
}, [query.data_source_id]);
return (
<div
className={cx("query-page-wrapper", {