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

AG-1451: Adjust pinning toast and tooltip messages #1308

Merged
merged 1 commit into from
May 16, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ <h1 class="gct-heading h2">Gene Comparison Tool</h1>
<div>
<button
(click)="onUnPinGeneClick(gene)"
pTooltip="Unpin this gene"
pTooltip="Unpin this row"
tooltipPosition="top"
tooltipStyleClass="tooltip"
>
Expand Down Expand Up @@ -410,7 +410,7 @@ <h1 class="gct-heading h2">Gene Comparison Tool</h1>
(click)="onPinAllClick()"
[pTooltip]="
getPinDisabledStatus()
? 'You have already pinned the maximum number of Ensembl identifiers (' +
? 'You have already pinned the maximum number of genes (' +
maxPinnedGenes +
'). You must unpin some genes before you can pin more.'
: 'Pin all matching rows to the top.'
Expand Down Expand Up @@ -478,7 +478,7 @@ <h1 class="gct-heading h2">Gene Comparison Tool</h1>
}"
[pTooltip]="
getPinDisabledStatus()
? 'You have already pinned the maximum number of Ensembl identifiers (' +
? 'You have already pinned the maximum number of genes (' +
maxPinnedGenes +
'). You must unpin some genes before you can pin more.'
: 'Pin this row to the top of the list'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,14 +752,14 @@
showMaxPinnedRowsErrorToast(rows: number) {
let message = '';
if (rows === 0) {
message = 'No rows were added because you reached the maximum of ' +
this.maxPinnedGenes + ' pinned Ensembl identifiers.';
message = 'No rows were pinned because you reached the maximum of ' +
this.maxPinnedGenes + ' pinned genes.';
} else if (rows === 1) {
message = 'Only ' + rows + ' row was added, because you reached the maximum of ' +
this.maxPinnedGenes + ' pinned Ensembl identifiers.';
message = 'Only ' + rows + ' row were pinned, because you reached the maximum of ' +
this.maxPinnedGenes + ' pinned genes.';
} else {
message = 'Only ' + rows + ' rows were added, because you reached the maximum of ' +
this.maxPinnedGenes + ' pinned Ensembl identifiers.';
message = 'Only ' + rows + ' rows were pinned, because you reached the maximum of ' +
this.maxPinnedGenes + ' pinned genes.';
}

const self = this;
Expand Down Expand Up @@ -807,9 +807,9 @@
sticky: true,
summary: '',
detail:
'Could not pin the requested item because you reached the maximum of ' +
'The row was not pinned because you reached the maximum of ' +
this.maxPinnedGenes +
' pinned Ensembl identifiers.',
' pinned genes.',
});
setTimeout(() => {
self.messageService.clear();
Expand Down Expand Up @@ -994,7 +994,7 @@
}

copyUrl() {
navigator.clipboard.writeText(window.location.href);

Check warning on line 997 in src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
const self = this;
this.messageService.clear();
this.messageService.add({
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/gct-pinning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const expectPinnedProteinsCountText = async (
export const expectTooManyPinnedGenesToast = async (page: Page) => {
const alert = page.getByRole('alert');
await expect(alert).toHaveText(
'Only 50 rows were added, because you reached the maximum of 50 pinned Ensembl identifiers.'
'Only 50 rows were pinned, because you reached the maximum of 50 pinned genes.'
);
};

Expand Down
Loading