Skip to content

Commit

Permalink
tslint, fix apm jest test, update time filter icon when disabling app…
Browse files Browse the repository at this point in the history
…lyGlobalTime
  • Loading branch information
nreese committed Nov 9, 2020
1 parent 526d120 commit a97a4cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export const mockLayerList = [
{
leftField: 'iso2',
right: {
applyGlobalQuery: true,
applyGlobalTime: true,
type: 'ES_TERM_SOURCE',
id: '3657625d-17b0-41ef-99ba-3a2b2938655c',
indexPatternTitle: 'apm-*',
Expand All @@ -38,15 +40,13 @@ export const mockLayerList = [
},
],
indexPatternId: 'apm_static_index_pattern_id',
applyGlobalQuery: true,
},
},
],
sourceDescriptor: {
type: 'EMS_FILE',
id: 'world_countries',
tooltipProperties: ['name'],
applyGlobalQuery: true,
},
style: {
type: 'VECTOR',
Expand Down Expand Up @@ -96,6 +96,8 @@ export const mockLayerList = [
{
leftField: 'region_iso_code',
right: {
applyGlobalQuery: true,
applyGlobalTime: true,
type: 'ES_TERM_SOURCE',
id: 'e62a1b9c-d7ff-4fd4-a0f6-0fdc44bb9e41',
indexPatternTitle: 'apm-*',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class ESTermSource extends AbstractESAggSource {
}
return {
...normalizedDescriptor,
term: descriptor!.term,
term: descriptor.term!,
type: SOURCE_TYPES.ES_TERM_SOURCE,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ export class TOCEntryButton extends Component<Props, State> {
this._loadIsFilteredByGlobalTime();
}

componentDidUpdate() {
this._loadIsFilteredByGlobalTime();
}

componentWillUnmount() {
this._isMounted = false;
}

async _loadIsFilteredByGlobalTime() {
const isFilteredByGlobalTime = await this.props.layer.isFilteredByGlobalTime();
if (this._isMounted) {
if (this._isMounted && isFilteredByGlobalTime !== this.state.isFilteredByGlobalTime) {
this.setState({ isFilteredByGlobalTime });
}
}
Expand Down

0 comments on commit a97a4cd

Please sign in to comment.