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

🐛 Fix double tab pane in issue incidents detail modal from PF upgrade #1104

Merged
merged 4 commits into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export const FileIncidentsDetailModal: React.FC<
// TODO render incident facts?
// TODO render documentation links? are those part of the markdown? where do we get them from the hub?

console.log({ activeTabIncidentId });

return (
<Modal
title={fileReport.file}
Expand All @@ -85,14 +87,14 @@ export const FileIncidentsDetailModal: React.FC<
})}
/>
) : (
<>
<Tabs
activeKey={activeTabIncidentId}
onSelect={(_event, tabKey) =>
setActiveTabIncidentId(tabKey as IncidentIdOrAll)
}
>
{firstFiveIncidents.map((incident, index) => (
<Tabs
activeKey={activeTabIncidentId}
onSelect={(_event, tabKey) =>
setActiveTabIncidentId(tabKey as IncidentIdOrAll)
}
>
{[
firstFiveIncidents.map((incident, index) => (
<Tab
key={incident.id}
eventKey={incident.id}
Expand Down Expand Up @@ -121,16 +123,10 @@ export const FileIncidentsDetailModal: React.FC<
</Grid>
) : null}
</Tab>
))}
</Tabs>
{totalNumIncidents > 5 ? (
<Tabs
activeKey="all"
onSelect={(_event, tabKey) =>
setActiveTabIncidentId(tabKey as IncidentIdOrAll)
}
>
)),
totalNumIncidents > 5 && [
<Tab
key="all"
eventKey="all"
title={`All incidents (${totalNumIncidents})`} // TODO i18n
>
Expand All @@ -141,10 +137,12 @@ export const FileIncidentsDetailModal: React.FC<
title="TODO"
/>
<FileAllIncidentsTable fileReport={fileReport} />
</Tab>
</Tabs>
) : null}
</>
</Tab>,
],
]
.flat(1)
.filter(Boolean)}
</Tabs>
)}
</Modal>
);
Expand Down