Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to List Providers components #144

Open
nasdan opened this issue Jun 19, 2017 · 1 comment
Open

Migrate to List Providers components #144

nasdan opened this issue Jun 19, 2017 · 1 comment
Assignees

Comments

@nasdan
Copy link
Member

nasdan commented Jun 19, 2017

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

@nasdan
Copy link
Member Author

nasdan commented Jun 27, 2017

Assigned to @navass, pending on his confirmation joining the project to properly assign it to him.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants