Skip to content

Commit e63091d

Browse files
authored
Don't display details button if message is empty (#1299)
* Don't display details button if message is empty * Lint the code * Fix check links * More robust integration tests
1 parent acb9a15 commit e63091d

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,5 @@ jobs:
168168
- uses: actions/checkout@v4
169169
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
170170
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
171+
with:
172+
ignore_links: https://www.linkedin.com/.*

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ The Jupyter Git extension is part of [Project Jupyter](http://jupyter.org/) and
316316
<tr>
317317
<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>
318318
<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>
319-
<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>
319+
<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>
320320
<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>
321321
<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>
322322
<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>
@@ -328,7 +328,7 @@ The Jupyter Git extension is part of [Project Jupyter](http://jupyter.org/) and
328328
<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>
329329
<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>
330330
<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>
331-
<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>
331+
<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>
332332
<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>
333333
</tr>
334334
<tr>

src/notifications.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,34 @@ export function showError(
2828
};
2929
}
3030

31+
/**
32+
* Display additional information in a dialog from a notification
33+
* button.
34+
*
35+
* Note: it will not add a button if the message is empty.
36+
*
37+
* @param message Details to display
38+
* @param trans Translation object
39+
* @returns Notification option to display the message
40+
*/
3141
export function showDetails(
3242
message: string,
3343
trans: TranslationBundle
3444
): Notification.IOptions<null> {
35-
return {
36-
autoClose: 5000,
37-
actions: [
38-
{
39-
label: trans.__('Details'),
40-
callback: () => {
41-
showErrorMessage(trans.__('Detailed message'), message, [
42-
Dialog.okButton({ label: trans.__('Dismiss') })
43-
]);
44-
},
45-
displayType: 'warn'
46-
} as Notification.IAction
47-
]
48-
};
45+
return message
46+
? {
47+
autoClose: 5000,
48+
actions: [
49+
{
50+
label: trans.__('Details'),
51+
callback: () => {
52+
showErrorMessage(trans.__('Detailed message'), message, [
53+
Dialog.okButton({ label: trans.__('Dismiss') })
54+
]);
55+
},
56+
displayType: 'warn'
57+
} as Notification.IAction
58+
]
59+
}
60+
: {};
4961
}

ui-tests/tests/merge-commit.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ test.describe('Merge commit tests', () => {
6767
.getByRole('tab', { name: 'hello-world.py' })
6868
.waitFor({ state: 'visible' });
6969

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

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

95-
await revertMergeCommit.waitFor({ state: 'visible' });
96-
97-
expect(revertMergeCommit).toBeTruthy();
95+
await expect(revertMergeCommit).toBeVisible();
9896
});
9997
});

0 commit comments

Comments
 (0)