Skip to content

Migrate to List Providers components #144

@nasdan

Description

@nasdan

Use SubscriptionManager to migrate List components to providers.

  • Right now, when we create a List Component we are writing somethig like:
interface Props {
  trainingList: TrainingSummary[];
  fetchTrainings: (studentId: number) => void;
}

export class TrainingListPage extends React.Component<Props, {}> {
  public componentDidMount() {
     this.props.fetchTrainings(this.props.studentId);
  }

  public render() {
    return (
      <div>
        ...
      </div>
    );
  }
}
  • The idea is to use src/common/components/subscriptionManager component to avoid use componentDidMount in this Presentational component.

Steps:

  • Create a fork.

  • Create new branch called feature/<issue_number>_Migrate to List Providers components (where issue_number is the id of this issue given by Github).

  • You can see how this kind of Provider component is implemented in src/pages/trainer/training/list/trainingListProvider.tsx

  • Migrate to provider component all list components from Admin, Trainer and Student modules.

  • Important: Follow this work flow

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions