Skip to content

Commit c3aab46

Browse files
committed
Adding comments and removing _allp on navigation to issue details
1 parent a90335c commit c3aab46

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/sentry/static/sentry/app/components/eventOrGroupHeader.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ class EventOrGroupHeader extends React.Component {
4444
const basePath = `/organizations/${orgId}/issues/`;
4545

4646
if (includeLink) {
47-
const locationWithProject = {...browserHistory.getCurrentLocation()};
47+
const locationWithProject = {...this.props.location}
4848
const query =
4949
locationWithProject.query.project !== undefined
5050
? {
5151
query: this.props.query,
5252
}
53-
: {query: this.props.query, _allp: 1};
53+
: {query: this.props.query, _allp: 1}; //This appends _allp to the URL parameters if they have no project selected ("all" projects included in results). This is so that when we enter the issue details page and lock them to a project, we can properly take them back to the issue list page with no project selected (and not the locked project selected)
5454

5555
props.to = {
5656
pathname: `${basePath}${isEvent ? groupID : id}/${

src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,18 @@ const GroupDetails = createReactClass({
127127
Sentry.captureException(new Error('Project not found'));
128128
});
129129
} else {
130-
const locationWithProject = {...browserHistory.getCurrentLocation()};
130+
const locationWithProject = {...this.props.location};
131131
if (
132132
locationWithProject.query.project === undefined &&
133133
locationWithProject.query._allp === undefined
134134
) {
135+
//We use _allp as a temporary measure to know they came from the issue list page with no project selected (all projects included in filter).
136+
//If it is not defined, we add the locked project id to the URL (this is becayse uf someone navigates directly to an issue on single-project priveledges, then goes back - they were getting assigned to the first project).
137+
//If it is defined, we do not so that our back button will bring us to the issue list page with no project selected instead of the locked proejct.
135138
locationWithProject.query.project = project.id;
136-
browserHistory.replace(locationWithProject);
137139
}
140+
delete locationWithProject.query._allp; //We delete _allp from the URL to keep the hack a bit cleaner, but this is not an ideal solution and will ultimately be replaced with something smarter.
141+
browserHistory.replace(locationWithProject);
138142
}
139143

140144
this.setState({

0 commit comments

Comments
 (0)