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

Don't display details button if message is empty #1299

Merged
merged 4 commits into from
Nov 16, 2023
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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,5 @@ jobs:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
with:
ignore_links: https://www.linkedin.com/.*
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ The Jupyter Git extension is part of [Project Jupyter](http://jupyter.org/) and
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://dquach.dev"><img src="https://avatars.githubusercontent.com/u/6735818?v=4?s=100" width="100px;" alt="Dat Quach"/><br /><sub><b>Dat Quach</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=quachtridat" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/fcollonval"><img src="https://avatars1.githubusercontent.com/u/8435071?v=4?s=100" width="100px;" alt="Frédéric Collonval"/><br /><sub><b>Frédéric Collonval</b></sub></a><br /><a href="#maintenance-fcollonval" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/hzarea"><img src="https://avatars1.githubusercontent.com/u/27518229?v=4?s=100" width="100px;" alt="Hana Zarea"/><br /><sub><b>Hana Zarea</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=hzarea" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Ahzarea" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><img src="https://avatars1.githubusercontent.com/u/27518229?v=4?s=100" width="100px;" alt="Hana Zarea"/><br /><sub><b>Hana Zarea</b></sub><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=hzarea" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Ahzarea" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://ianhi.github.io"><img src="https://avatars0.githubusercontent.com/u/10111092?v=4?s=100" width="100px;" alt="Ian Hunt-Isaak"/><br /><sub><b>Ian Hunt-Isaak</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=ianhi" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Aianhi" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jaipreet-s"><img src="https://avatars1.githubusercontent.com/u/43826141?v=4?s=100" width="100px;" alt="Jaipreet Singh"/><br /><sub><b>Jaipreet Singh</b></sub></a><br /><a href="#projectManagement-jaipreet-s" title="Project Management">📆</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Ajaipreet-s" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=jaipreet-s" title="Code">💻</a> <a href="#design-jaipreet-s" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zzhangjii"><img src="https://avatars3.githubusercontent.com/u/11495372?v=4?s=100" width="100px;" alt="Ji Zhang"/><br /><sub><b>Ji Zhang</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=zzhangjii" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Azzhangjii" title="Reviewed Pull Requests">👀</a></td>
Expand All @@ -327,7 +327,7 @@ The Jupyter Git extension is part of [Project Jupyter](http://jupyter.org/) and
<td align="center" valign="top" width="14.28%"><a href="https://www.lindaful.com"><img src="https://avatars.githubusercontent.com/u/68607795?v=4?s=100" width="100px;" alt="Linda Ngoc Nguyen"/><br /><sub><b>Linda Ngoc Nguyen</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=iflinda" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://fellowship.mlh.io/"><img src="https://avatars.githubusercontent.com/u/65834464?s=200&v=4?s=100" width="100px;" alt="Major League Hacking"/><br /><sub><b>Major League Hacking</b></sub></a><br /><a href="#financial-mlh" title="">🤝</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/max-klein-b514419"><img src="https://avatars2.githubusercontent.com/u/2263641?v=4?s=100" width="100px;" alt="Max Klein"/><br /><sub><b>Max Klein</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=telamonian" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Atelamonian" title="Reviewed Pull Requests">👀</a> <a href="#projectManagement-telamonian" title="Project Management">📆</a> <a href="#design-telamonian" title="Design">🎨</a> <a href="#infra-telamonian" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://linkedin.com/in/michal-krassowski/"><img src="https://avatars.githubusercontent.com/u/5832902?v=4?s=100" width="100px;" alt="Michał Krassowski"/><br /><sub><b>Michał Krassowski</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=krassowski" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Akrassowski" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/jupyterlab/jupyterlab-git/issues?q=author%3Akrassowski" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/michal-krassowski/"><img src="https://avatars.githubusercontent.com/u/5832902?v=4?s=100" width="100px;" alt="Michał Krassowski"/><br /><sub><b>Michał Krassowski</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=krassowski" title="Code">💻</a> <a href="https://github.com/jupyterlab/jupyterlab-git/pulls?q=is%3Apr+reviewed-by%3Akrassowski" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/jupyterlab/jupyterlab-git/issues?q=author%3Akrassowski" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://navn.me"><img src="https://avatars.githubusercontent.com/u/59669957?v=4?s=100" width="100px;" alt="Navinn Ravindaran"/><br /><sub><b>Navinn Ravindaran</b></sub></a><br /><a href="https://github.com/jupyterlab/jupyterlab-git/commits?author=navn-r" title="Code">💻</a></td>
</tr>
<tr>
Expand Down
40 changes: 26 additions & 14 deletions src/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,34 @@ export function showError(
};
}

/**
* Display additional information in a dialog from a notification
* button.
*
* Note: it will not add a button if the message is empty.
*
* @param message Details to display
* @param trans Translation object
* @returns Notification option to display the message
*/
export function showDetails(
message: string,
trans: TranslationBundle
): Notification.IOptions<null> {
return {
autoClose: 5000,
actions: [
{
label: trans.__('Details'),
callback: () => {
showErrorMessage(trans.__('Detailed message'), message, [
Dialog.okButton({ label: trans.__('Dismiss') })
]);
},
displayType: 'warn'
} as Notification.IAction
]
};
return message
? {
autoClose: 5000,
actions: [
{
label: trans.__('Details'),
callback: () => {
showErrorMessage(trans.__('Detailed message'), message, [
Dialog.okButton({ label: trans.__('Dismiss') })
]);
},
displayType: 'warn'
} as Notification.IAction
]
}
: {};
}
6 changes: 2 additions & 4 deletions ui-tests/tests/merge-commit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test.describe('Merge commit tests', () => {
.getByRole('tab', { name: 'hello-world.py' })
.waitFor({ state: 'visible' });

expect(page.waitForSelector('.jp-git-diff-root')).toBeTruthy();
await expect(page.locator('.jp-git-diff-root')).toBeVisible();
});

test('should revert merge commit', async ({ page }) => {
Expand All @@ -92,8 +92,6 @@ test.describe('Merge commit tests', () => {
.locator('#jp-git-sessions')
.getByText("Revert 'Merge branch 'sort-names''");

await revertMergeCommit.waitFor({ state: 'visible' });

expect(revertMergeCommit).toBeTruthy();
await expect(revertMergeCommit).toBeVisible();
});
});
Loading