Skip to content

A modern, feature-rich table custom field extension for Contentstack marketplace apps. This React-based application provides an intuitive table editing interface that integrates seamlessly with Contentstack's content management system.

License

Notifications You must be signed in to change notification settings

contentstack/marketplace-table-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

326 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Marketplace Table App

License: MIT TypeScript React Vite Playwright

A modern, feature-rich table custom field extension for Contentstack marketplace apps. This React-based application provides an intuitive table editing interface that integrates seamlessly with Contentstack's content management system.

🎨 Features

  • Interactive Table Editor: Full-featured table with row/column operations
  • Drag & Drop: Reorder rows and columns with drag and drop
  • CSV Import/Export: Import data from CSV files and export table data
  • Search & Sort: Search through table data and sort columns
  • Header Rows/Columns: Toggle header styling for rows and columns
  • Full Screen Mode: Expand table to full screen for better editing
  • Accessibility: Full keyboard navigation support
  • TypeScript: Fully typed for better development experience
  • Testing: Comprehensive test suite with Playwright for E2E testing
  • Modern UI: Clean, professional interface using Contentstack's Venus components

πŸ“‹ Prerequisites

  • Node.js (v20 or higher)
  • npm
  • Contentstack account (for marketplace deployment)

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/contentstack/marketplace-table-app.git
cd marketplace-table-app

# Install dependencies
npm install

Development

# Start development server
npm start

# Run linting
npm run lint

# Format code
npm run format

Testing

# Run unit tests
npm test

# Run E2E tests
npm run test:chrome
npm run test:firefox
npm run test:safari

# Run E2E tests in headed mode
npm run test:chrome-headed

Building for Production

# Build the application
npm run build

πŸ—οΈ Project Structure

marketplace-table-app/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/              # SVG icons and static assets
β”‚   β”œβ”€β”€ common/
β”‚   β”‚   β”œβ”€β”€ locale/          # Internationalization strings
β”‚   β”‚   β”œβ”€β”€ ui/              # Shared UI components
β”‚   β”‚   └── utils/           # Utility functions
β”‚   β”œβ”€β”€ components/          # Reusable React components
β”‚   β”‚   β”œβ”€β”€ csvImport/       # CSV import dialog
β”‚   β”‚   β”œβ”€β”€ ErrorBoundary/   # Error boundary component
β”‚   β”‚   β”œβ”€β”€ Home/            # Home page component
β”‚   β”‚   └── PageLayout/      # Page layout component
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useAnalytics.tsx # Analytics tracking hook
β”‚   β”‚   β”œβ”€β”€ useAppSdk.ts     # Contentstack App SDK hook
β”‚   β”‚   └── useJsErrorTracker.tsx # Error tracking hook
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   └── FieldExtension/  # Table field extension
β”‚   β”‚       β”œβ”€β”€ cell.tsx     # Table cell component
β”‚   β”‚       β”œβ”€β”€ header.tsx   # Table header component
β”‚   β”‚       β”œβ”€β”€ store.tsx    # Table state management
β”‚   β”‚       β”œβ”€β”€ table.tsx    # Main table component
β”‚   β”‚       └── fullScreenPage.tsx # Full screen modal
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   └── App/             # Main app router
β”‚   β”œβ”€β”€ styles/              # Global styles
β”‚   β”œβ”€β”€ main.tsx             # Application entry point
β”‚   └── vite-env.d.ts        # Vite type definitions
β”œβ”€β”€ tests/
β”‚   └── e2e/                 # End-to-end tests
β”‚       β”œβ”€β”€ pages/           # Page objects
β”‚       β”œβ”€β”€ test-spec/       # Test specifications
β”‚       └── utils/           # Test utilities
β”œβ”€β”€ .husky/                  # Git hooks
β”œβ”€β”€ index.html               # HTML entry point
β”œβ”€β”€ vite.config.ts           # Vite configuration
β”œβ”€β”€ tsconfig.json            # TypeScript configuration
β”œβ”€β”€ playwright.config.ts     # Playwright configuration
└── package.json             # Dependencies and scripts

πŸ§ͺ Testing

This project includes comprehensive testing:

Unit Tests

npm test                    # Run unit tests
npm run test:watch          # Run tests in watch mode

E2E Tests

npm run test:chrome         # Run E2E tests in Chrome
npm run test:firefox        # Run E2E tests in Firefox
npm run test:safari         # Run E2E tests in Safari
npm run show-report         # Show test report

Code Quality

npm run lint               # Run ESLint
npm run lint:check         # Check linting issues
npm run format             # Format code with Prettier
npm run format:check       # Check formatting
npm run typecheck          # TypeScript type checking

App Configuration

The app configuration is defined in update-app-info.json:

{
  "name": "Table",
  "target_type": "stack",
  "ui_location": {
    "locations": [
      {
        "type": "cs.cm.stack.custom_field",
        "meta": [
          {
            "signed": true,
            "path": "/field-extension",
            "data_type": "json"
          }
        ]
      }
    ]
  }
}

πŸ› οΈ Development

Adding New Features

  1. Create feature branch from main
  2. Implement your changes
  3. Add tests for new functionality
  4. Update documentation
  5. Submit pull request

Code Style

This project uses:

  • ESLint for code linting
  • Prettier for code formatting
  • Husky for git hooks
  • lint-staged for pre-commit checks

Commit Convention

This project follows Conventional Commits:

feat: add new table feature
fix: resolve table rendering issue
docs: update README with new features
test: add unit tests for cell component
refactor: improve table state management

πŸ“¦ Deployment

Contentstack Marketplace

  1. Build the application: npm run build
  2. Package the build directory
  3. Upload to Contentstack marketplace
  4. Install in your Contentstack stack

Local Development

For local development with Contentstack:

  1. npm install
  2. Run npm start for development server

🀝 Contributing

We welcome contributions!

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Install dependencies
npm install

# Start development
npm start

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ❀️ by the Contentstack team

About

A modern, feature-rich table custom field extension for Contentstack marketplace apps. This React-based application provides an intuitive table editing interface that integrates seamlessly with Contentstack's content management system.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10

Languages