|
@@ -4,7 +4,6 @@ import {Location, LocationDescriptorObject} from 'history';
|
|
|
|
|
|
import {addSuccessMessage} from 'app/actionCreators/indicator';
|
|
|
import {openModal} from 'app/actionCreators/modal';
|
|
|
-import {fetchLegacyKeyTransactionsCount} from 'app/actionCreators/performance';
|
|
|
import GuideAnchor from 'app/components/assistant/guideAnchor';
|
|
|
import GridEditable, {COL_WIDTH_UNDEFINED, GridColumn} from 'app/components/gridEditable';
|
|
|
import SortLink from 'app/components/gridEditable/sortLink';
|
|
@@ -63,7 +62,6 @@ type Props = {
|
|
|
|
|
|
type State = {
|
|
|
widths: number[];
|
|
|
- keyedTransactions: number | null;
|
|
|
transaction: string | undefined;
|
|
|
transactionThreshold: number | undefined;
|
|
|
transactionThresholdMetric: TransactionThresholdMetric | undefined;
|
|
@@ -71,26 +69,11 @@ type State = {
|
|
|
class Table extends React.Component<Props, State> {
|
|
|
state: State = {
|
|
|
widths: [],
|
|
|
- keyedTransactions: null,
|
|
|
transaction: undefined,
|
|
|
transactionThreshold: undefined,
|
|
|
transactionThresholdMetric: undefined,
|
|
|
};
|
|
|
|
|
|
- componentDidMount() {
|
|
|
- this.fetchKeyTransactionCount();
|
|
|
- }
|
|
|
-
|
|
|
- async fetchKeyTransactionCount() {
|
|
|
- const {organization} = this.props;
|
|
|
- try {
|
|
|
- const count = await fetchLegacyKeyTransactionsCount(organization.slug);
|
|
|
- this.setState({keyedTransactions: count});
|
|
|
- } catch (error) {
|
|
|
- this.setState({keyedTransactions: null});
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
handleCellAction = (column: TableColumn<keyof TableDataRow>, dataRow: TableDataRow) => {
|
|
|
return (action: Actions, value: React.ReactText) => {
|
|
|
const {eventView, location, organization, projects} = this.props;
|
|
@@ -334,7 +317,6 @@ class Table extends React.Component<Props, State> {
|
|
|
|
|
|
renderPrependCellWithData = (tableData: TableData | null) => {
|
|
|
const {eventView} = this.props;
|
|
|
- const {keyedTransactions} = this.state;
|
|
|
|
|
|
const keyTransactionColumn = eventView
|
|
|
.getColumns()
|
|
@@ -360,23 +342,13 @@ class Table extends React.Component<Props, State> {
|
|
|
} else if (teamKeyTransactionColumn) {
|
|
|
if (isHeader) {
|
|
|
const star = (
|
|
|
- <GuideAnchor
|
|
|
- target="team_key_transaction_header"
|
|
|
- position="top"
|
|
|
- disabled={keyedTransactions === null} // wait for the legacy counts to load
|
|
|
- >
|
|
|
- <GuideAnchor
|
|
|
- target="team_key_transaction_existing"
|
|
|
- position="top"
|
|
|
- disabled={!keyedTransactions}
|
|
|
- >
|
|
|
- <IconStar
|
|
|
- key="keyTransaction"
|
|
|
- color="yellow300"
|
|
|
- isSolid
|
|
|
- data-test-id="team-key-transaction-header"
|
|
|
- />
|
|
|
- </GuideAnchor>
|
|
|
+ <GuideAnchor target="team_key_transaction_header" position="top">
|
|
|
+ <IconStar
|
|
|
+ key="keyTransaction"
|
|
|
+ color="yellow300"
|
|
|
+ isSolid
|
|
|
+ data-test-id="team-key-transaction-header"
|
|
|
+ />
|
|
|
</GuideAnchor>
|
|
|
);
|
|
|
return [this.renderHeadCell(tableData?.meta, teamKeyTransactionColumn, star)];
|