Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: tenant-gate transaction insights, change selection order of workload insights #97256

Merged
merged 1 commit into from
Feb 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/ui/workspaces/cluster-ui/src/insights/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ export const getInsightFromCause = (
};

export const InsightExecOptions = new Map<string, string>([
[InsightExecEnum.TRANSACTION.toString(), "Transaction Executions"],
[InsightExecEnum.STATEMENT.toString(), "Statement Executions"],
[InsightExecEnum.TRANSACTION.toString(), "Transaction Executions"],
]);

export const InsightEnumToLabel = new Map<string, string>([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export type StatementInsightsViewStateProps = {
dropDownSelect?: React.ReactElement;
timeScale?: TimeScale;
maxSizeApiReached?: boolean;
isTenant?: boolean;
};

export type StatementInsightsViewDispatchProps = {
Expand Down Expand Up @@ -110,6 +111,7 @@ export const StatementInsightsView: React.FC<StatementInsightsViewProps> = ({
selectedColumnNames,
dropDownSelect,
maxSizeApiReached,
isTenant,
}: StatementInsightsViewProps) => {
const [pagination, setPagination] = useState<ISortedTablePagination>({
current: 1,
Expand Down Expand Up @@ -250,7 +252,7 @@ export const StatementInsightsView: React.FC<StatementInsightsViewProps> = ({
return (
<div className={cx("root")}>
<PageConfig>
<PageConfigItem>{dropDownSelect}</PageConfigItem>
{!isTenant && <PageConfigItem>{dropDownSelect}</PageConfigItem>}
<PageConfigItem>
<Search
placeholder="Search Statements"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ export const WorkloadInsightsRootControl = ({
}: WorkloadInsightsViewProps): React.ReactElement => {
const location = useLocation();
const history = useHistory();
let viewValue =
queryByName(location, viewAttr) || InsightExecEnum.TRANSACTION;
// Use the default Transaction page if an
let viewValue = queryByName(location, viewAttr) || InsightExecEnum.STATEMENT;
// Use the default Statement page if an
// unrecognized string was passed in from the URL
if (!InsightExecOptions.has(viewValue)) {
viewValue = InsightExecEnum.TRANSACTION;
viewValue = InsightExecEnum.STATEMENT;
}

const [selectedInsightView, setSelectedInsightView] = useState(viewValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { TimeScale } from "../../timeScaleDropdown";
import { StmtInsightsReq, TxnInsightsRequest } from "src/api";
import { selectTimeScale } from "../../store/utils/selectors";
import { actions as analyticsActions } from "../../store/analytics";
import { selectIsTenant } from "../../store/uiConfig";

const transactionMapStateToProps = (
state: AppState,
Expand Down Expand Up @@ -82,6 +83,7 @@ const statementMapStateToProps = (
timeScale: selectTimeScale(state),
isLoading: selectStmtInsightsLoading(state),
maxSizeApiReached: selectStmtInsightsMaxApiReached(state),
isTenant: selectIsTenant(state),
});

const TransactionDispatchProps = (
Expand Down