Polish dataset catalog actions
This commit is contained in:
@@ -77,6 +77,19 @@ function datasetRoleLabel(role: string): string {
|
||||
return 'Source'
|
||||
}
|
||||
|
||||
function datasetActionHint(dataset: DatasetCreateResponse, role: string): string {
|
||||
if (role === 'reference') {
|
||||
return 'QA reference layer. Select it when comparing candidates against trusted geometry.'
|
||||
}
|
||||
if (role === 'candidate') {
|
||||
return 'QA candidate layer. Open on the map or send to Export / QA.'
|
||||
}
|
||||
if (dataset.dataset_type === 'raster') {
|
||||
return 'Raster source. Use the raster tools in the inspector after selecting it.'
|
||||
}
|
||||
return 'Source dataset. Inspect details before using it in downstream workflows.'
|
||||
}
|
||||
|
||||
export function DatasetPanel({
|
||||
selectedProjectId,
|
||||
selectedDatasetId,
|
||||
@@ -225,33 +238,44 @@ export function DatasetPanel({
|
||||
<span>features: {dataset.feature_count ?? dataset.vector_summary?.feature_count ?? 'n/a'}</span>
|
||||
<span>bbox: {formatBounds(dataset.bounds_json ?? dataset.vector_summary?.bounds_json)}</span>
|
||||
</div>
|
||||
<div className="button-row">
|
||||
<p className="dataset-action-hint">{datasetActionHint(dataset, datasetRole)}</p>
|
||||
<div className="dataset-action-grid">
|
||||
<button
|
||||
className="primary-action"
|
||||
className="primary-action dataset-action-button"
|
||||
type="button"
|
||||
onClick={() => onLoadDatasetDetails(selectedProjectId ?? '', dataset)}
|
||||
data-testid={`dataset-select-${dataset.id}`}
|
||||
>
|
||||
Select / details
|
||||
</button>
|
||||
<button className="secondary-action" type="button" onClick={() => onOpenDatasetInMap(dataset)}>
|
||||
Open in map
|
||||
<span>Inspect</span>
|
||||
<small>Select / details</small>
|
||||
</button>
|
||||
<button
|
||||
className="secondary-action"
|
||||
className="secondary-action dataset-action-button"
|
||||
type="button"
|
||||
onClick={() => onOpenDatasetInMap(dataset)}
|
||||
aria-label="Open in map"
|
||||
>
|
||||
<span>Map</span>
|
||||
<small>Open layer</small>
|
||||
</button>
|
||||
<button
|
||||
className="secondary-action dataset-action-button"
|
||||
type="button"
|
||||
onClick={() => onOpenDatasetExport(dataset)}
|
||||
disabled={!(dataset.dataset_type === 'vector' || dataset.dataset_type === 'geojson')}
|
||||
>
|
||||
Export / QA
|
||||
<span>Export / QA</span>
|
||||
<small>{dataset.dataset_type === 'vector' || dataset.dataset_type === 'geojson' ? 'Compare or export' : 'Vector/GeoJSON only'}</small>
|
||||
</button>
|
||||
<button
|
||||
className="secondary-action"
|
||||
className="secondary-action dataset-action-button"
|
||||
type="button"
|
||||
onClick={() => onRefreshMetadata(dataset.id)}
|
||||
disabled={dataset.dataset_type === 'raster'}
|
||||
aria-label="Refresh metadata"
|
||||
>
|
||||
Refresh metadata
|
||||
<span>Metadata</span>
|
||||
<small>{dataset.dataset_type === 'raster' ? 'Raster metadata is automatic' : 'Refresh vector stats'}</small>
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -1137,14 +1137,47 @@ button.entity-card {
|
||||
margin-top: 0.7rem;
|
||||
}
|
||||
|
||||
.dataset-card .button-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
|
||||
.dataset-action-hint {
|
||||
margin: 0.65rem 0 0;
|
||||
color: #36524b;
|
||||
font-size: 0.84rem;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.dataset-card .button-row button {
|
||||
.dataset-card .button-row,
|
||||
.dataset-action-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
|
||||
gap: 0.5rem;
|
||||
margin-top: 0.7rem;
|
||||
}
|
||||
|
||||
.dataset-action-button {
|
||||
display: grid;
|
||||
gap: 0.12rem;
|
||||
align-content: center;
|
||||
width: 100%;
|
||||
min-height: 3.25rem;
|
||||
margin-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.dataset-action-button span,
|
||||
.dataset-action-button small {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.dataset-action-button span {
|
||||
font-weight: 850;
|
||||
}
|
||||
|
||||
.dataset-action-button small {
|
||||
font-size: 0.73rem;
|
||||
font-weight: 750;
|
||||
line-height: 1.2;
|
||||
opacity: 0.78;
|
||||
}
|
||||
|
||||
.button-row {
|
||||
|
||||
Reference in New Issue
Block a user