Skip to content
Open
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: 1 addition & 1 deletion components/dashboard/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
The map preview could not be loaded.
</div>
<div v-else>
This workspace does not contain map data.
This workspace is empty.
</div>
</template>
</div>
Expand Down
30 changes: 30 additions & 0 deletions components/dashboard/WorkspaceInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
</div>
</div>

<div
v-if="!hasDatasetArea"
class="workspace-information-area-notice"
role="status"
>
<app-icon
variant="info"
size="20"
/>
No dataset area has been set for this workspace.
</div>

<dl class="workspace-information-grid">
<div
v-for="(column, columnIndex) in informationColumns"
Expand Down Expand Up @@ -88,6 +100,15 @@ const projectCountNoun = computed(() =>
);
const parsedMetadata = computed(() => parseMetadata(props.workspace.tdeiMetadata));
const datasetVersion = computed(() => getDatasetVersion(parsedMetadata.value));
const hasDatasetArea = computed(() => {
const metadataDetails = parsedMetadata.value?.metadata;
if (!isRecord(metadataDetails)) {
return false;
}

const datasetDetail = metadataDetails.dataset_detail;
return isRecord(datasetDetail) && isRecord(datasetDetail.dataset_area);
});

const roleLabel = computed(() => {
const labels: string[] = [];
Expand Down Expand Up @@ -236,6 +257,15 @@ $workspace-information-meta-size: 0.875rem;
font-weight: $font-weight-semibold;
}

.workspace-information-area-notice {
display: flex;
align-items: center;
gap: 0.35rem;
margin-bottom: 0.8rem;
color: $gray-600;
font-size: $workspace-information-meta-size;
}

.workspace-information-grid {
margin: 0;
display: grid;
Expand Down
17 changes: 16 additions & 1 deletion test/e2e/dashboard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect, seedAuthenticatedSession, seedProjectGroupSelection } from './fixtures';
import { recordContract } from './contract';
import { projectGroups, PROJECT_GROUP_ID, TEST_API_BASE } from '../mocks/fixtures';
import { aWorkspace, projectGroups, PROJECT_GROUP_ID, TEST_API_BASE } from '../mocks/fixtures';

// Generated from the @test outline in pages/dashboard.vue.
//
Expand Down Expand Up @@ -55,6 +55,21 @@ test.describe('dashboard', () => {
await expect(page.getByText('No workspaces exist in the selected project group.')).toBeVisible();
});

test('shows empty-workspace and missing-dataset-area notices', async ({ page }) => {
await seedAuthenticatedSession(page);
await seedProjectGroupSelection(page, { id: PROJECT_GROUP_ID, name: 'Puget Sound' });
await page.route('**/workspaces/mine', route =>
route.fulfill({ json: [{ ...aWorkspace, tdeiMetadata: null }] })
);
await page.route('**/project-group-roles/**', route => route.fulfill({ json: projectGroups }));
await page.route('**/workspaces/1/bbox', route => route.fulfill({ status: 204 }));

await page.goto('/dashboard');

await expect(page.getByText('This workspace is empty.')).toBeVisible();
await expect(page.getByText('No dataset area has been set for this workspace.')).toBeVisible();
});

test('clicking a failed import status loads the latest job and shows its failure response', async ({ page }) => {
const failedWorkspace = {
id: 1769,
Expand Down
Loading