Skip to content
Snippets Groups Projects
Unverified Commit e736e6b2 authored by Alexander Lesnenko's avatar Alexander Lesnenko Committed by GitHub
Browse files

add missing prop-types to question audit (#16383)

parent 90f4fc94
No related branches found
No related tags found
No related merge requests found
import React from "react";
import PropTypes from "prop-types";
import _ from "underscore";
const DEBOUNCE_PERIOD = 300;
type AuditParameter = {
key: string,
placeholder: string,
};
type Props = {
parameters: AuditParameter[],
children?: (committedValues: { [key: string]: string }) => React.Element,
};
type State = {
inputValues: { [key: string]: string },
committedValues: { [key: string]: string },
const propTypes = {
parameters: PropTypes.arrayOf(
PropTypes.shape({
key: PropTypes.string.isRequired,
placeholder: PropTypes.string.isRequired,
}),
),
children: PropTypes.func,
};
export default class AuditParameters extends React.Component {
props: Props;
state: State;
constructor(props: Props) {
constructor(props) {
super(props);
this.state = {
inputValues: {},
......@@ -68,3 +61,5 @@ export default class AuditParameters extends React.Component {
);
}
}
AuditParameters.propTypes = propTypes;
/* eslint-disable react/prop-types */
import React from "react";
import PropTypes from "prop-types";
import { registerVisualization } from "metabase/visualizations/index";
......@@ -20,6 +20,19 @@ import cx from "classnames";
const getColumnName = column => column.remapped_to || column.name;
const propTypes = {
series: PropTypes.array,
visualizationIsClickable: PropTypes.func,
onVisualizationClick: PropTypes.func,
onSortingChange: PropTypes.func,
settings: PropTypes.object,
isSortable: PropTypes.bool,
sorting: PropTypes.shape({
column: PropTypes.string.isRequired,
isAscending: PropTypes.bool.isRequired,
}),
};
export default class AuditTableVisualization extends React.Component {
static identifier = "audit-table";
static noHeader = true;
......@@ -142,4 +155,6 @@ export default class AuditTableVisualization extends React.Component {
}
}
AuditTableVisualization.propTypes = propTypes;
registerVisualization(AuditTableVisualization);
......@@ -13,12 +13,10 @@ import * as Urls from "metabase/lib/urls";
import * as QuestionDetailCards from "../lib/cards/question_detail";
const tabPropTypes = {
questionId: PropTypes.number.isRequired,
};
AuditQuestionDetail.propTypes = {
params: PropTypes.shape(tabPropTypes),
const pagePropTypes = {
params: PropTypes.shape({
questionId: PropTypes.string,
}),
};
function AuditQuestionDetail({ params, ...props }) {
......@@ -38,7 +36,11 @@ function AuditQuestionDetail({ params, ...props }) {
);
}
AuditQuestionActivityTab.propTypes = tabPropTypes;
AuditQuestionDetail.propTypes = pagePropTypes;
const tabPropTypes = {
questionId: PropTypes.number,
};
function AuditQuestionActivityTab({ questionId }) {
return (
......@@ -57,18 +59,20 @@ function AuditQuestionActivityTab({ questionId }) {
);
}
AuditQuestionRevisionsTab.propTypes = tabPropTypes;
AuditQuestionActivityTab.propTypes = tabPropTypes;
function AuditQuestionRevisionsTab({ questionId }) {
return <AuditTable table={QuestionDetailCards.revisionHistory(questionId)} />;
}
AuditQuestionAuditLogTab.propTypes = tabPropTypes;
AuditQuestionRevisionsTab.propTypes = tabPropTypes;
function AuditQuestionAuditLogTab({ questionId }) {
return <AuditTable table={QuestionDetailCards.auditLog(questionId)} />;
}
AuditQuestionAuditLogTab.propTypes = tabPropTypes;
AuditQuestionDetail.tabs = [
{ path: "activity", title: "Activity", component: AuditQuestionActivityTab },
{ path: "details", title: "Details" },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment