Skip to content

Commit

Permalink
fix(ui): Force refresh projects/teams on project creation (#28886)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored Sep 29, 2021
1 parent 6240eaf commit 5bb8200
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion static/app/views/organizationContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class OrganizationContextContainer extends React.Component<Props, State> {
this.props.api,
OrganizationContextContainer.getOrganizationSlug(this.props),
true,
true
false
);
}

Expand Down
17 changes: 12 additions & 5 deletions static/app/views/projectDetail/projectDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {RouteComponentProps} from 'react-router';
import styled from '@emotion/styled';

import {updateProjects} from 'app/actionCreators/globalSelection';
import {fetchOrganizationDetails} from 'app/actionCreators/organization';
import {fetchTagValues} from 'app/actionCreators/tags';
import Feature from 'app/components/acl/feature';
import Alert from 'app/components/alert';
import Breadcrumbs from 'app/components/breadcrumbs';
import Button from 'app/components/button';
import ButtonBar from 'app/components/buttonBar';
Expand All @@ -16,10 +16,11 @@ import GlobalSdkUpdateAlert from 'app/components/globalSdkUpdateAlert';
import IdBadge from 'app/components/idBadge';
import * as Layout from 'app/components/layouts/thirds';
import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage';
import LoadingError from 'app/components/loadingError';
import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader';
import MissingProjectMembership from 'app/components/projects/missingProjectMembership';
import TextOverflow from 'app/components/textOverflow';
import {IconSettings, IconWarning} from 'app/icons';
import {IconSettings} from 'app/icons';
import {t} from 'app/locale';
import {PageContent} from 'app/styles/organization';
import space from 'app/styles/space';
Expand Down Expand Up @@ -169,6 +170,11 @@ class ProjectDetail extends AsyncView<Props, State> {
}
}

onRetryProjects = () => {
const {params} = this.props;
fetchOrganizationDetails(this.api, params.orgId, true, false);
};

isProjectStabilized() {
const {selection, location} = this.props;
const projectId = this.project?.id;
Expand Down Expand Up @@ -197,9 +203,10 @@ class ProjectDetail extends AsyncView<Props, State> {
renderProjectNotFound() {
return (
<PageContent>
<Alert type="error" icon={<IconWarning />}>
{t('This project could not be found.')}
</Alert>
<LoadingError
message={t('This project could not be found.')}
onRetry={this.onRetryProjects}
/>
</PageContent>
);
}
Expand Down

0 comments on commit 5bb8200

Please sign in to comment.