Skip to content
Merged
Show file tree
Hide file tree
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 @@ -81,7 +81,10 @@ describe('SeerNotices', function () {
it('shows fixability view step if automation is allowed and view not starred', () => {
const project = getProjectWithAutomation('high');
render(<SeerNotices groupId="123" hasGithubIntegration project={project} />, {
organization,
organization: {
...organization,
features: ['issue-stream-custom-views', 'trigger-autofix-on-issue-summary'],
},
});
expect(screen.getByText('Get Some Quick Wins')).toBeInTheDocument();
expect(screen.getByText('Star Recommended View')).toBeInTheDocument();
Expand All @@ -99,7 +102,12 @@ describe('SeerNotices', function () {
});
const project = getProjectWithAutomation('medium');
render(<SeerNotices groupId="123" hasGithubIntegration project={project} />, {
...{organization: {...organization, features: []}},
...{
organization: {
...organization,
features: [],
},
},
});
// Should not find any step titles
expect(screen.queryByText('Set Up the GitHub Integration')).not.toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export function SeerNotices({groupId, hasGithubIntegration, project}: SeerNotice
const isAutomationAllowed = organization.features.includes(
'trigger-autofix-on-issue-summary'
);
const isStarredViewAllowed = organization.features.includes(
'issue-stream-custom-views'
);

const unreadableRepos = repos.filter(repo => repo.is_readable === false);
const githubRepos = unreadableRepos.filter(repo => repo.provider.includes('github'));
Expand All @@ -113,10 +116,13 @@ export function SeerNotices({groupId, hasGithubIntegration, project}: SeerNotice
!codeMappingRepos?.length &&
!isLoadingPreferences;
const needsAutomation =
project.autofixAutomationTuning === 'off' && isAutomationAllowed;
(project.autofixAutomationTuning === 'off' ||
project.autofixAutomationTuning === undefined) &&
isAutomationAllowed;
const needsFixabilityView =
!views.some(view => view.query.includes(FieldKey.ISSUE_SEER_ACTIONABILITY)) &&
isAutomationAllowed;
isAutomationAllowed &&
isStarredViewAllowed;

// Warning conditions
const hasMultipleUnreadableRepos = unreadableRepos.length > 1;
Expand Down Expand Up @@ -300,7 +306,7 @@ export function SeerNotices({groupId, hasGithubIntegration, project}: SeerNotice
)}

{/* Step 4: Fixability View */}
{isAutomationAllowed && (
{isAutomationAllowed && isStarredViewAllowed && (
<GuidedSteps.Step
key="fixability-view"
stepKey="fixability-view"
Expand Down
Loading