-
Notifications
You must be signed in to change notification settings - Fork 292
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
Unify breadcrumbs behaviour with other Grafana Apps and main core #3003
Changes from all commits
07bfc06
cf247ad
7a919ad
d291d4c
835e261
4f3c229
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,10 @@ import PagedUsers from './parts/PagedUsers'; | |
const cx = cn.bind(styles); | ||
const INTEGRATION_NAME_LENGTH_LIMIT = 30; | ||
|
||
interface IncidentPageProps extends WithStoreProps, PageProps, RouteComponentProps<{ id: string }> {} | ||
interface IncidentPageProps extends WithStoreProps, PageProps, RouteComponentProps<{ id: string }> { | ||
pageTitle: string; | ||
setPageTitle: (value: string) => void; | ||
} | ||
|
||
interface IncidentPageState extends PageBaseState { | ||
showIntegrationSettings?: boolean; | ||
|
@@ -89,6 +92,12 @@ class IncidentPage extends React.Component<IncidentPageProps, IncidentPageState> | |
store.alertGroupStore.updateSilenceOptions(); | ||
} | ||
|
||
componentWillUnmount(): void { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it be better to make a generic React component that handles this cleanup so that we rely on base class functionality strictly for context usage? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed context usage from this PR, I think it is redundant in this case |
||
const { setPageTitle } = this.props; | ||
|
||
setPageTitle(undefined); | ||
} | ||
|
||
componentDidUpdate(prevProps: IncidentPageProps) { | ||
if (this.props.match.params.id !== prevProps.match.params.id) { | ||
this.update(); | ||
|
@@ -103,10 +112,14 @@ class IncidentPage extends React.Component<IncidentPageProps, IncidentPageState> | |
match: { | ||
params: { id }, | ||
}, | ||
setPageTitle, | ||
} = this.props; | ||
|
||
store.alertGroupStore | ||
.getAlert(id) | ||
.then((alertGroup) => { | ||
setPageTitle(`#${alertGroup.inside_organization_number} ${alertGroup.render_for_web.title}`); | ||
}) | ||
.catch((error) => this.setState({ errorData: { ...getWrongTeamResponseInfo(error) } })); | ||
}; | ||
|
||
|
@@ -238,6 +251,7 @@ class IncidentPage extends React.Component<IncidentPageProps, IncidentPageState> | |
match: { | ||
params: { id }, | ||
}, | ||
pageTitle, | ||
} = this.props; | ||
|
||
const { alerts } = store.alertGroupStore; | ||
|
@@ -261,7 +275,7 @@ class IncidentPage extends React.Component<IncidentPageProps, IncidentPageState> | |
{/* @ts-ignore*/} | ||
<HorizontalGroup align="baseline"> | ||
<Text.Title level={3} data-testid="incident-title"> | ||
#{incident.inside_organization_number} {incident.render_for_web.title} | ||
{pageTitle} | ||
</Text.Title> | ||
{incident.root_alert_group && ( | ||
<Text type="secondary"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maskin25 can you retroactively update the
CHANGELOG
to remove this line? Seems to be duplicated, correct?