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

Group comparison: update group exclusion message #3709

Merged
merged 1 commit into from
May 6, 2021
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 11 additions & 6 deletions src/pages/groupComparison/OverlapExclusionIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,17 @@ export default class OverlapExclusionIndicator extends React.Component<
summary = (
<span>
{groupNames}
{` ${is} completely overlapping with other selected groups, so `}
{this.props.overlapTabMode
? `${is} excluded from analysis in other tabs.`
: `${
excludedGroups.length === 1 ? 'has' : 'have'
} been excluded from this analysis.`}
{` ${is} completely overlapping with other selected groups and ${is} ${
this.props.store.overlapStrategy ===
OverlapStrategy.EXCLUDE
? 'excluded'
: 'included'
} in ${
this.props.overlapTabMode
? 'other tabs'
: 'the analysis below'
}`}
.
</span>
);
}
Expand Down
58 changes: 48 additions & 10 deletions src/pages/groupComparison/OverlapUtils.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ describe('OverlapUtils', () => {
<>
(<strong>1</strong>)&nbsp;
</>
nameA
<span style={{ fontWeight: 'bold', fontStyle: 'italic' }}>
nameA
</span>
</span>
);
expect(
Expand All @@ -63,14 +65,22 @@ describe('OverlapUtils', () => {
<>
(<strong>1</strong>)&nbsp;
</>
nameA
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameA
</span>
</span>{' '}
and{' '}
<span>
<>
(<strong>B</strong>)&nbsp;
</>
nameB
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameB
</span>
</span>
</span>
);
Expand All @@ -89,21 +99,33 @@ describe('OverlapUtils', () => {
<>
(<strong>1</strong>)&nbsp;
</>
nameA
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameA
</span>
</span>
,{' '}
<span>
<>
(<strong>2</strong>)&nbsp;
</>
nameB
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameB
</span>
</span>
, and{' '}
<span>
<>
(<strong>3</strong>)&nbsp;
</>
nameC
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameC
</span>
</span>
</span>
);
Expand All @@ -123,28 +145,44 @@ describe('OverlapUtils', () => {
<>
(<strong>1</strong>)&nbsp;
</>
nameA
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameA
</span>
</span>
,{' '}
<span>
<>
(<strong>2</strong>)&nbsp;
</>
nameB
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameB
</span>
</span>
,{' '}
<span>
<>
(<strong>3</strong>)&nbsp;
</>
nameC
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameC
</span>
</span>
, and{' '}
<span>
<>
(<strong>4</strong>)&nbsp;
</>
nameD
<span
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
>
nameD
</span>
</span>
</span>
);
Expand Down
12 changes: 9 additions & 3 deletions src/pages/groupComparison/OverlapUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export function getExcludedIndexes(
}

export function renderGroupNameWithOrdinal(
group: Pick<ComparisonGroup, 'name' | 'ordinal'>
group: Pick<ComparisonGroup, 'name' | 'ordinal'>,
highlight?: boolean
) {
return (
<span>
Expand All @@ -61,7 +62,12 @@ export function renderGroupNameWithOrdinal(
(<strong>{group.ordinal}</strong>)&nbsp;
</>
)}
{group.name}
{highlight && (
<span style={{ fontWeight: 'bold', fontStyle: 'italic' }}>
{group.name}
</span>
)}
{!highlight && group.name}
</span>
);
}
Expand All @@ -70,7 +76,7 @@ export function joinGroupNames(
groups: Pick<ComparisonGroup, 'name' | 'ordinal'>[],
conj: string
) {
const names = groups.map(renderGroupNameWithOrdinal);
const names = groups.map(group => renderGroupNameWithOrdinal(group, true));
switch (names.length) {
case 0:
return <span></span>;
Expand Down