Contribute Data
Links
Use this Task Flow
Before continuing, make sure you have followed the instructions to install the strudel-cli.
From the root of your app, run the following on the command line:
strudel add-taskflow my-taskflow --template contribute-data
Generated Files
my-taskflow
├── _components
│ ├── DataFilesPanel.tsx
│ ├── DatasetView.tsx
│ ├── MetadataPanel.tsx
│ └── ValidationChecks.tsx
├── _config
│ ├── taskflow.config.ts
│ └── taskflow.types.ts
├── _context
│ ├── ContextProvider.tsx
│ ├── actions.ts
│ └── utils.ts
├── _layout.tsx
├── index.tsx
├── new.tsx
├── portal.tsx
└── review.tsx
Pages
index.tsx
URL Route: /
First page of the Contribute Data Task Flow. Displays a user registration form for users that want to contribute datasets.
portal.tsx
URL Route: /portal
User portal page of the Contribute Data Task Flow. Displays a list of the user's current uploaded datasets.
new.tsx
URL Route: /new
New dataset page of the Contribute Data Task Flow. Displays a metadata form and data upload panel for adding new data contributions.
review.tsx
URL Route: /review
Review new dataset page of the Contribute Data Task Flow. Displays a preview of the dataset information to be uploaded and performs standard validation checks on the data.
Configuration
This Task Flow can be configured from the taskflow.config.ts
file in the _config
directory of the generated template files.
import { ContributeDataConfig } from './taskflow.types';
export const taskflow: ContributeDataConfig = {
data: {
datasets: {
/**
* Source of the data for the initial list of datasets on the portal page.
*/
source: 'data/default/contribute-data/contributor_datasets.json',
/**
* Name of the field in the data that represents a unique identifier for each record.
*/
idField: 'id',
},
},
pages: {
index: {
/**
* Title to appear at the top of the register page.
*/
title: 'Register as a data contributor',
},
portal: {
/**
* Title to appear at the top of the portal page.
*/
title: 'Your Dataset Uploads',
/**
* List of column definition objects for the columns in the table on the portal page.
*/
tableColumns: [
{
field: 'title',
headerName: 'Dataset Title',
width: 200,
},
{
field: 'category',
headerName: 'Category',
width: 200,
},
{
field: 'summary',
headerName: 'Summary',
width: 200,
},
{
field: 'doi',
headerName: 'DOI',
width: 200,
},
{
field: 'publication_date',
headerName: 'Created Date',
width: 200,
},
{
field: 'status',
headerName: 'Status',
width: 200,
},
],
},
new: {
/**
* Title to appear at the top of the new dataset page.
*/
title: 'Upload a new dataset',
/**
* Text to appear underneath the title at the top of the new dataset page.
*/
description: 'Description of this app section',
},
review: {
/**
* Title to appear at the top of the review page.
*/
title: 'Review your new dataset',
},
},
};