PCORE-2213: cosmetic changes on incident updates (#38)

* feat: minor cosmetic change in showing dates

* feat: minor cosmetic change in showing dates

* feat: scroll to input when editing incident

* fix: class to classname

* fix: added array check for api data

* feat: used created_at instead of updated_at

* feat: added empty message when no incident updates are there
pull/1113/head
Smit Patel 2022-08-16 12:50:22 +05:30 committed by GitHub
parent 14e6b69c6b
commit a51d42b2e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 42 additions and 31 deletions

View File

@ -36,8 +36,7 @@ const IncidentsBlock = ({ service, group }) => {
{incidents?.length > 0 ? (
incidents?.map((incident) => {
const { id, title, description, updates, updated_at } = incident;
const latestUpdate =
updates?.length > 0 && updates[0];
const latestUpdate = updates?.length > 0 && updates[0];
const updatedAt = latestUpdate
? latestUpdate.created_at
: updated_at;
@ -50,7 +49,6 @@ const IncidentsBlock = ({ service, group }) => {
className={`incident-title col-12 ${
incidentsShow[id] && "mb-3"
}`}>
{updates?.length > 0 && (
<>
{incidentsShow[id] ? (
<button
@ -68,7 +66,6 @@ const IncidentsBlock = ({ service, group }) => {
/>
)}
</>
)}
<div className="title-wrapper">
<span className="subtitle no-decoration">{title}</span>
@ -87,6 +84,8 @@ const IncidentsBlock = ({ service, group }) => {
{incidentsShow[id] && (
<div className="incident-updates-wrapper col-12">
{updates?.length > 0 ? (
<>
{updates?.map((update) => {
return (
<IncidentUpdate
@ -96,6 +95,18 @@ const IncidentsBlock = ({ service, group }) => {
/>
);
})}
</>
) : (
<div className="d-flex">
<div className="mr-2 d-flex align-items-center">
<span className="dot"></span>
</div>
<div className="font-14 text-muted">
No recent updates
</div>
</div>
)}
</div>
)}
</Fragment>