Skip to content

Commit 8c2f868

Browse files
committed
Change AccountEmails to TeamEmails for consistency
DSET-3658
1 parent 98c7624 commit 8c2f868

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ dashboard using Scalyr data.
116116

117117
![PowerQuery](https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/master/src/img/PowerQuery.png)
118118

119-
7. **Cross Team Search** - The AccountEmails field is used to specify which
119+
7. **Cross Team Search** - The Team Emails field is used to specify which
120120
teams the query should be run against. Works the same as
121121
[Cross Team Search](https://app.scalyr.com/help/graphs#crossTeam) in the
122122
DataSet app. More information on teams can be found

pkg/plugin/lrq_types.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ type DistributionOptions struct {
7373
}
7474

7575
type LRQRequest struct {
76-
QueryType string `json:"queryType"`
77-
StartTime int64 `json:"startTime"`
78-
EndTime int64 `json:"endTime"`
79-
AccountEmails []string `json:"accountEmails"`
80-
Log *LogOptions `json:"log"`
81-
Facet *FacetOptions `json:"facetValues"`
82-
TopFacet *TopFacetOptions `json:"topFacets"`
83-
Pq *PQOptions `json:"pq"`
84-
Plot *PlotOptions `json:"plot"`
85-
Distribution *DistributionOptions `json:"distribution"`
76+
QueryType string `json:"queryType"`
77+
StartTime int64 `json:"startTime"`
78+
EndTime int64 `json:"endTime"`
79+
TeamEmails []string `json:"teamEmails"`
80+
Log *LogOptions `json:"log"`
81+
Facet *FacetOptions `json:"facetValues"`
82+
TopFacet *TopFacetOptions `json:"topFacets"`
83+
Pq *PQOptions `json:"pq"`
84+
Plot *PlotOptions `json:"plot"`
85+
Distribution *DistributionOptions `json:"distribution"`
8686
}
8787

8888
type ResolvedTimeRange struct {

pkg/plugin/plugin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type queryModel struct {
6262
Format string `json:"format"`
6363
BreakDownFacetValue *string `json:"breakDownFacetValue"`
6464
Label *string `json:"label"`
65-
AccountEmails []string `json:"accountEmails"`
65+
TeamEmails []string `json:"teamEmails"`
6666
}
6767

6868
func (d *DataSetDatasource) query(ctx context.Context, query backend.DataQuery) backend.DataResponse {
@@ -118,8 +118,8 @@ func (d *DataSetDatasource) query(ctx context.Context, query backend.DataQuery)
118118
}
119119
}
120120

121-
if qm.AccountEmails != nil && len(qm.AccountEmails) > 0 {
122-
request.AccountEmails = qm.AccountEmails
121+
if qm.TeamEmails != nil && len(qm.TeamEmails) > 0 {
122+
request.TeamEmails = qm.TeamEmails
123123
}
124124

125125
var result *LRQResult

src/QueryEditor.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export function QueryEditor(props: Props): ReactElement {
1212
const { datasource } = props;
1313
const { loading, topFacets } = useFacetsQuery(datasource);
1414
const query = defaults(props.query, defaultQuery);
15-
const [ accountEmails, setAccountEmails ] = useState<Array<SelectableValue<string>>>(
16-
(query.accountEmails || []).map(v => ({label: v, value: v})));
15+
const [ teamEmails, setTeamEmails ] = useState<Array<SelectableValue<string>>>(
16+
(query.teamEmails || []).map(v => ({label: v, value: v})));
1717

1818
const onExpressionChange = (event: ChangeEvent<HTMLInputElement>) => {
1919
const { onChange, query } = props;
@@ -39,10 +39,10 @@ export function QueryEditor(props: Props): ReactElement {
3939
onChange({ ...query, label: event.target.value });
4040
};
4141

42-
const onAccountEmailsChange = (values: Array<SelectableValue<string>>, actionMeta: ActionMeta) => {
42+
const onTeamEmailsChange = (values: Array<SelectableValue<string>>, actionMeta: ActionMeta) => {
4343
const { onChange, query, onRunQuery } = props;
44-
setAccountEmails(values);
45-
onChange({ ...query, accountEmails: values.length > 0 ? values.map((v) => {return v.value;}) : null });
44+
setTeamEmails(values);
45+
onChange({ ...query, teamEmails: values.length > 0 ? values.map((v) => {return v.value;}) : null });
4646
onRunQuery();
4747
};
4848

@@ -95,12 +95,12 @@ export function QueryEditor(props: Props): ReactElement {
9595
</InlineField>
9696
</InlineFieldRow>
9797
<InlineFieldRow>
98-
<InlineField label="AccountEmails" grow>
98+
<InlineField label="Team Emails" grow>
9999
<MultiSelect
100-
value={accountEmails}
100+
value={teamEmails}
101101
allowCustomValue
102102
isClearable
103-
onChange={onAccountEmailsChange}
103+
onChange={onTeamEmailsChange}
104104
/>
105105
</InlineField>
106106
</InlineFieldRow>

src/img/CrossTeamQuery.png

-18.7 KB
Loading

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface MyQuery extends DataQuery {
55
queryType: any;
66
breakDownFacetValue: string | undefined | null;
77
label: string | undefined | null;
8-
accountEmails: Array<string | undefined> | undefined | null;
8+
teamEmails: Array<string | undefined> | undefined | null;
99
}
1010

1111
export const defaultQuery: Partial<MyQuery> = {

0 commit comments

Comments
 (0)