Skip to content
forms-raw_singleitemedit-icon
navigation
modification_btn
docs
messages
flatprojectmap.handlebars
Table Browser Page
modificationbutton
docs_htmltables.handlebars

Task List Page

docs_html.handlebars
documentation.handlebars

Task Table Browser

The table browser provides a browser based CRUD interface for managing tasks within the ShiftBulk costing system. It works in tandem with the navigation panel and main panel, and it integrates tightly with the REST API to ensure that creating, editing and deleting tasks always triggers a recalculation of labour, non labour and overall totals.

Overview

When you navigate to /lynx in your Express application, the table browser displays a tabular list of existing tasks along with a form for creating a new one. Each row shows the task code, title, phase, work type, discipline and duration, and includes actions to edit or delete the task. The interface is purely declarative in this documentation: it describes the structure of the page without embedding interactive elements.

Prerequisites

  • You must have a Node.js/Express application connected to MongoDB, following the same structure as the ShiftBulk server.
  • The Lynx plugin should be copied into your project’s plugins/lynx folder and mounted in your app.js file.
  • A CSS framework such as Bootstrap 5 should be globally available to style tables and panels.

Installation & Setup

  1. Copy the plugins/lynx directory into your project.
  2. Mount the plugin in your Express application and register its Handlebars partials. For example:
    // app.js
                        const lynx = require('./plugins/lynx');
                        partialsDir.push('./plugins/lynx/views/partials');
                        app.use('/', lynx);
  3. Restart your server and navigate to /lynx to view the task browser.

UI Endpoints

The Lynx plugin exposes the following UI routes. These routes render Handlebars templates and interact with the REST API. They provide clear entry points for integrating the navigation panel and main panel with the underlying data model:

Method & PathPurpose
GET /lynxLanding page showing a table of tasks and a form to create new tasks.
POST /lynx/tasksProcesses the “Create New Task” form and recalculates totals.
GET /lynx/tasks/:id/editRenders the edit form for the specified task.
POST /lynx/tasks/:id/editSaves changes to a task and recomputes its cost totals.
POST /lynx/tasks/:id/deleteDeletes the specified task and returns to the listing.

REST API Endpoints

Alongside the UI routes, the plugin exposes REST endpoints that mirror the functionality of the Beaver costing API. Use these endpoints for programmatic access or integration with single page applications:

  • GET /api/projects/:id/catalogs — fetches phases, work types, disciplines, cost types and the project’s rate card.
  • POST /api/tasks, PATCH /api/tasks/:id — creates or updates tasks via JSON.
  • POST /api/tasks/:id/recalc — triggers a recalculation of labour and non‑labour totals.
  • GET /api/projects/:id/rollup — returns a hierarchical view of projects with aggregated totals.
  • GET /api/projects/:id/export.csv — produces a CSV export of all task data.

Using the Interface

  1. Navigate to /lynx. If tasks exist, they are listed in the table; otherwise, a message indicates that no tasks are available.
  2. To create a task, fill in the fields (code, title, phase, work type, discipline and duration) and submit the form. The server persists the task, recomputes all totals, and refreshes the list.
  3. To edit a task, click “Edit” in its row. Modify the desired fields and save changes. The server will recalculate costs and update the grand total.
  4. To delete a task, click “Delete”. A confirmation prompt ensures that you do not remove tasks accidentally. Once confirmed, the task is removed and the list refreshes.

Form Fields

The create and edit forms capture essential information for a task. You can extend the forms with additional inputs such as descriptions or cost items, but the core fields are:

FieldDescriptionTypeRequired
CodeShort identifier used in WBS codes and reports.TextYes
TitleDescriptive name of the task.TextYes
PhaseProject phase (e.g., Concept, Design, Build).DropdownNo
Work TypeGeneral category (e.g., PM, Engineering).DropdownNo
DisciplineSpecific discipline (e.g., Electrical, Mechanical).DropdownNo
Duration (weeks)Number of schedule buckets in the grid.NumberNo

Example Markup

Below is an example of the task table markup used in the Handlebars template. The server iterates over tasks to generate rows dynamically. The markup is intentionally simple and omits interactive bindings:

<table class="table table-striped">
                      <thead>
                        <tr><th>Code</th><th>Title</th><th>Phase</th><th>Work Type</th><th>Discipline</th><th>Duration (W)</th><th>Actions</th></tr>
                      </thead>
                      <tbody>
                        {{#each tasks}}
                        <tr>
                          <td>{{this.code}}</td>
                          <td>{{this.title}}</td>
                          <td>{{this.phase}}</td>
                          <td>{{this.workType}}</td>
                          <td>{{this.discipline}}</td>
                          <td>{{this.schedule.duration}}</td>
                          <td>
                            <a href="/lynx/tasks/{{this._id}}/edit">Edit</a>
                            <form action="/lynx/tasks/{{this._id}}/delete" method="POST" style="display:inline;">
                              <button type="submit">Delete</button>
                            </form>
                          </td>
                        </tr>
                        {{/each}}
                      </tbody>
                    </table>

Extending the Browser

The table browser is intentionally modular. You can add columns for additional task fields, integrate inline editing libraries such as Handsontable, or connect the table to client‑side filters. Always keep cost calculations on the server side via the REST API to ensure consistent results. When you extend the browser, co‑ordinate changes across the navigation panel, main panel and data structure to maintain a cohesive user experience.

This documentation is intended for informational purposes only. It omits interactive elements such as forms and accordions, and it assumes that your application layout already exists.

modal1
modal2
modal3
docs_javascript
new_issue_button.handlebars
shortcut_edit