topic-legend: select fields and subfields separately
This commit is contained in:
@@ -23,7 +23,8 @@ import {
|
||||
getTopicLegendSubfieldId,
|
||||
TopicLegendGroup,
|
||||
TopicLegendSubfieldSelection,
|
||||
toggleTopicLegendSelection,
|
||||
toggleTopicLegendFieldSelection,
|
||||
toggleTopicLegendSubfieldSelection,
|
||||
} from '../../shared/utils/topic-legend';
|
||||
|
||||
interface InterestTag {
|
||||
@@ -154,18 +155,25 @@ export class PersonInterestingComponent implements OnInit {
|
||||
}
|
||||
|
||||
onLegendFieldToggle(group: TopicLegendGroup): void {
|
||||
this.activeLegendFieldIds.set(
|
||||
toggleTopicLegendSelection(this.activeLegendFieldIds(), group.id),
|
||||
const selection = toggleTopicLegendFieldSelection(
|
||||
this.activeLegendFieldIds(),
|
||||
this.activeLegendSubfieldIds(),
|
||||
group,
|
||||
);
|
||||
|
||||
this.activeLegendFieldIds.set(selection.fieldIds);
|
||||
this.activeLegendSubfieldIds.set(selection.subfieldIds);
|
||||
}
|
||||
|
||||
onLegendSubfieldToggle(selection: TopicLegendSubfieldSelection): void {
|
||||
this.activeLegendSubfieldIds.set(
|
||||
toggleTopicLegendSelection(
|
||||
this.activeLegendSubfieldIds(),
|
||||
selection.item.id,
|
||||
),
|
||||
const nextSelection = toggleTopicLegendSubfieldSelection(
|
||||
this.activeLegendFieldIds(),
|
||||
this.activeLegendSubfieldIds(),
|
||||
selection,
|
||||
);
|
||||
|
||||
this.activeLegendFieldIds.set(nextSelection.fieldIds);
|
||||
this.activeLegendSubfieldIds.set(nextSelection.subfieldIds);
|
||||
}
|
||||
|
||||
isTagActive(tag: InterestTag): boolean {
|
||||
|
||||
+14
-5
@@ -21,7 +21,8 @@ import {
|
||||
getTopicLegendSubfieldId,
|
||||
TopicLegendGroup,
|
||||
TopicLegendSubfieldSelection,
|
||||
toggleTopicLegendSelection,
|
||||
toggleTopicLegendFieldSelection,
|
||||
toggleTopicLegendSubfieldSelection,
|
||||
} from '../../../../shared/utils/topic-legend';
|
||||
import { buildTopicHierarchyTooltip } from '../../../../shared/utils/topic-tooltip';
|
||||
|
||||
@@ -430,17 +431,25 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
|
||||
}
|
||||
|
||||
onLegendFieldToggle(group: TopicLegendGroup): void {
|
||||
this.activeLegendFieldIds = toggleTopicLegendSelection(
|
||||
const selection = toggleTopicLegendFieldSelection(
|
||||
this.activeLegendFieldIds,
|
||||
group.id,
|
||||
this.activeLegendSubfieldIds,
|
||||
group,
|
||||
);
|
||||
|
||||
this.activeLegendFieldIds = selection.fieldIds;
|
||||
this.activeLegendSubfieldIds = selection.subfieldIds;
|
||||
}
|
||||
|
||||
onLegendSubfieldToggle(selection: TopicLegendSubfieldSelection): void {
|
||||
this.activeLegendSubfieldIds = toggleTopicLegendSelection(
|
||||
const nextSelection = toggleTopicLegendSubfieldSelection(
|
||||
this.activeLegendFieldIds,
|
||||
this.activeLegendSubfieldIds,
|
||||
selection.item.id,
|
||||
selection,
|
||||
);
|
||||
|
||||
this.activeLegendFieldIds = nextSelection.fieldIds;
|
||||
this.activeLegendSubfieldIds = nextSelection.subfieldIds;
|
||||
}
|
||||
|
||||
isTopicActiveByLegend(topic: TopicTimelineTopic): boolean {
|
||||
|
||||
Reference in New Issue
Block a user