-
Notifications
You must be signed in to change notification settings - Fork 701
Development Best Practices
Sahil edited this page Feb 20, 2024
·
1 revision
- Entry Point of a Page will be a
<Controller/>
-
<Controller/>
fetches the data using SDK/API and renders the<View/>
- It is preferred that
<View/>
contains only UI states -
<Controller/>
can pass data states to view if need be -
RouteDestinations
will import<Controller/>
- Component Name: WorkflowRunTable
- Controller Name: WorkflowRunTableController
- View Name: WorkflowRunTableView
src
|__controllers
|__WorkflowRunTable
|__ __tests__
|__WorkflowRunTable.test.tsx
|__WorkflowRunTable.tsx (<WorkflowRunTableController>)
|__index.ts
|__views
|__WorkflowRunTable
|__ __tests__
|__WorkflowRunTable.test.tsx
|__WorkflowRunTable.tsx (<WorkflowRunTableView>)
|__index.ts
- Exports will be done from index.ts using the following code pattern:
import WorkFlowRunTableView from './WorkflowRunTable';
export default WorkFlowRunTableView;
NOTE:
Please don’t use ‘@paths/’ while exporting.
Only default exports to be used, no named exports.
- Imports will always use ‘@paths/’ imports:
import WorkflowRunTableView from '@views/WorkflowRunTable';
TypeScript types for API will have the same name as documentation on the GraphQL Playground.
Components: Append Props
to the FC’s name
- FC Name: WorkflowRunTableView
- Props Name: WorkflowRunTableViewProps
- Append
to
to the FC name. - URL String should be in snake-case.
export const toHomePage = (): string => '/workflow-details';