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

Crash on projectMonth details #268

Closed
Laoujin opened this issue Oct 3, 2023 · 2 comments
Closed

Crash on projectMonth details #268

Laoujin opened this issue Oct 3, 2023 · 2 comments

Comments

@Laoujin
Copy link
Member

Laoujin commented Oct 3, 2023

http://itenium.synology.me:9100/projects/645a34a614d3f534fc304f67

@fatihozdemir61
Copy link

fatihozdemir61 commented Nov 6, 2023

ProjectMonthDetails

Steps to reproduce:

  1. Click in the open space of one of the projects (see screenshot above)
  2. Click on 'Ga naar details'
  3. A white screen is displayed

devtools

react-dom.production.min.js:189 TypeError: Cannot read properties of undefined (reading 'firstName')
at ProjectSelect.tsx:28:26
at a (ProjectSelect.tsx:35:51)
at ProjectSelect.tsx:39:21
at Array.sort ()
at ProjectSelect.tsx:39:6
at qi (react-dom.production.min.js:167:137)
at qs (react-dom.production.min.js:290:337)
at yu (react-dom.production.min.js:280:389)
at hu (react-dom.production.min.js:280:320)
at Ou (react-dom.production.min.js:280:180)
at iu (react-dom.production.min.js:271:88)
at uu (react-dom.production.min.js:273:300)
at Xo (react-dom.production.min.js:127:105)
at react-dom.production.min.js:267:273

@joriswijnant
Copy link
Contributor

This crash is caused by missing data in projects. specifically the 'consultantId' and 'client.clientId' properties.
which causes the crashes in the following funtions of ProjectSelectComponent

  const getConsultantFullName = (consultantId: string) => {
    const consultant = consultants.find(c => c._id === consultantId) as ConsultantModel;
    return `${consultant.firstName} ${consultant.name}`;
  };
  const getClientName = (clientId: string) => {
    const client = clients.find(c => c._id === clientId) as ClientModel;
    return client.name;
  };

@Laoujin Laoujin closed this as completed Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants