Skip to content

Commit 004f5d4

Browse files
committed
Viewer paths page improvements
1 parent 2d172aa commit 004f5d4

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Added Manage button to deactivate and reactivate task groups (\#640);
99
* Removed usage of DB_ENGINE and SQLITE_PATH variables (\#643);
1010
* Displayed `timestamp_last_used` property in task-group info modal (\#643);
11+
* Viewer paths page improvements (\#643);
1112

1213
# 1.10.1
1314

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCurrentUserViewerPaths } from '$lib/server/api/auth_api.js';
1+
import { getCurrentUserSettings, getCurrentUserViewerPaths } from '$lib/server/api/auth_api.js';
22
import { getLogger } from '$lib/server/logger.js';
33

44
const logger = getLogger('viewer paths page');
@@ -7,8 +7,10 @@ export async function load({ fetch }) {
77
logger.trace('Load viewer paths page');
88

99
const viewerPaths = await getCurrentUserViewerPaths(fetch);
10+
const settings = await getCurrentUserSettings(fetch);
1011

1112
return {
12-
viewerPaths
13+
viewerPaths,
14+
settings
1315
};
1416
}

src/routes/viewer-paths/+page.svelte

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,40 @@
22
import { page } from '$app/stores';
33
44
/** @type {string[]} */
5-
let viewerPaths = $page.data.viewerPaths;
5+
const viewerPaths = $page.data.viewerPaths;
6+
/** @type {import('$lib/types').UserSettings} */
7+
const settings = $page.data.settings;
68
</script>
79

810
<h1 class="fw-light mb-3">Viewer paths</h1>
911

12+
<p>
13+
This Fractal instance includes an online viewer for OME-Zarrs, based on
14+
<a href="https://github.com/hms-dbmi/vizarr" target="_blank">vizarr</a>. Browse to a dataset page,
15+
and you will find links to view the available images in the browser.
16+
</p>
17+
18+
<p>
19+
Note that access to image data is restricted to OME-Zarrs within certain paths (and their
20+
subfolders).
21+
{#if settings.project_dir || viewerPaths.length > 0}
22+
The list of paths accessible to the current user includes:
23+
{:else}
24+
The list of paths accessible to the current user is empty.
25+
{/if}
26+
</p>
27+
1028
<ul>
29+
{#if settings.project_dir}
30+
<li><code>{settings.project_dir}</code></li>
31+
{/if}
1132
{#each viewerPaths as viewerPath}
1233
<li><code>{viewerPath}</code></li>
1334
{/each}
1435
</ul>
36+
37+
<p>
38+
Depending on the Fractal configuration, you may also have access to additional paths.<br />
39+
Please contact an admin if you see an error message like <code>403 Forbidden</code> when opening the
40+
image viewer.
41+
</p>

tests/v2/viewer_paths.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ test('Viewer paths', async ({ page }) => {
4343
await addUserToGroup(page, randomEmail);
4444
});
4545

46+
await test.step('Add project dir to the group', async () => {
47+
await page.getByRole('textbox', { name: 'Project dir' }).fill('/path/to/project_dir');
48+
await page.getByRole('button', { name: 'Save' }).nth(1).click();
49+
});
50+
4651
await test.step('Add viewer paths', async () => {
4752
const addViewerPathBtn = page.getByRole('button', { name: 'Add viewer path' });
4853
await addViewerPathBtn.click();
@@ -79,6 +84,7 @@ test('Viewer paths', async ({ page }) => {
7984
await page.getByRole('link', { name: 'Viewer paths' }).click();
8085
await waitPageLoading(page);
8186
await expect(page.getByText('/path/to/1')).toBeVisible();
87+
await expect(page.getByText('/path/to/project_dir')).toBeVisible();
8288
await logout(page, randomEmail);
8389
});
8490
});

0 commit comments

Comments
 (0)