Currently, if we try to create a calendar day without one of the properties we get an error when we render the list of calendar days. Later we'll have a ticket to prevent submit a calendar day without all info, but nevertheless, we want this to be fixed. Page should not break if something is missing.
How to reproduce:
Be ware that we're using a Job but this also happens with People and Equipment.
1 - Create a Calendar day without a Job:
2 - Go to the calendar list page. A error will show up saying that it is impossible to read item.job.name.
What is really happening
Since we created a calendar day without a job, it is impossible to access item.job.name because there is no job.
To prevent this error we can make a condition to make sure we have a job before accessing the job.name.
On the calendar list:
Before:
<div>job: {item.job.name}</div>
After:
{item.job && <div>job: {item.job.name}</div>}
This means, if we have an item.job then create a div with a item.job.name.
After doing this, we should see the list of calendars. When there is no job associated with the calendar day, we will not show the job name.
After making sure this is fixed for the job object, add the same logic to the remaining objects: people and equipement. Make sure to test each one individually by creating a calendar day without them.
Currently, if we try to create a calendar day without one of the properties we get an error when we render the list of calendar days. Later we'll have a ticket to prevent submit a calendar day without all info, but nevertheless, we want this to be fixed. Page should not break if something is missing.
How to reproduce: Be ware that we're using a Job but this also happens with People and Equipment.
1 - Create a Calendar day without a Job:
2 - Go to the calendar list page. A error will show up saying that it is impossible to read
item.job.name
.What is really happening
Since we created a calendar day without a job, it is impossible to access
item.job.name
because there is no job.To prevent this error we can make a condition to make sure we have a
job
before accessing thejob.name
.On the calendar list: Before:
After:
This means, if we have an
item.job
then create a div with aitem.job.name
.After doing this, we should see the list of calendars. When there is no job associated with the calendar day, we will not show the job name.
After making sure this is fixed for the job object, add the same logic to the remaining objects:
people
andequipement
. Make sure to test each one individually by creating a calendar day without them.