Skip to content

Commit

Permalink
Merge pull request #303 from atlassian/flag-cleanup
Browse files Browse the repository at this point in the history
removed new flow feature flag
  • Loading branch information
joshkay10 authored Apr 3, 2024
2 parents 242f0a1 + 6cb936f commit 0eea563
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
12 changes: 1 addition & 11 deletions app/jenkins-for-jira-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import styled from '@emotion/styled';
import { view } from '@forge/bridge';
import { token, setGlobalTheme } from '@atlaskit/tokens';
import { InstallJenkins } from './components/ConnectJenkins/InstallJenkins/InstallJenkins';
import { JenkinsServerList } from './components/JenkinsServerList/JenkinsServerList';
import { ConnectJenkins } from './components/ConnectJenkins/ConnectJenkins/ConnectJenkins';
import { ManageConnection } from './components/ManageConnection/ManageConnection';
import { spinnerHeight } from './common/styles/spinner.styles';
Expand Down Expand Up @@ -39,7 +38,6 @@ const GlobalContainer = styled.div`
const App: React.FC = () => {
const [history, setHistory] = useState<any>(null);
const [isFetchingFlag, setIsFetchingFlag] = useState<boolean>(false);
const [renovateConfigFlag, setRenovateConfigFlag] = useState<boolean>(false);
const [moduleKey, setModuleKey] = useState<string>('');
const [checkUserPermissionsFlag, setCheckUserPermissionsFlag] = useState<boolean>(false);

Expand All @@ -55,18 +53,13 @@ const App: React.FC = () => {
setIsFetchingFlag(true);

try {
const renovatedJenkinsFeatureFlag = await fetchFeatureFlagFromBackend(
FeatureFlags.RENOVATED_JENKINS_FOR_JIRA_CONFIG_FLOW
);

const checkUserPermissions = await fetchFeatureFlagFromBackend(
FeatureFlags.CHECK_USER_PERMISSIONS
);

getModuleKey();

if (isMounted) {
setRenovateConfigFlag(renovatedJenkinsFeatureFlag);
setCheckUserPermissionsFlag(checkUserPermissions);
setIsFetchingFlag(false);
}
Expand Down Expand Up @@ -118,10 +111,7 @@ const App: React.FC = () => {
<Router history={history}>
<Switch>
<Route exact path="/">
{renovateConfigFlag
? <ServerManagement />
: <JenkinsServerList />
}
<ServerManagement />
</Route>

{/* TODO - delete routes for old version post renovate rollout */}
Expand Down
1 change: 0 additions & 1 deletion app/jenkins-for-jira-ui/src/common/featureFlags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export enum FeatureFlags {
RENOVATED_JENKINS_FOR_JIRA_CONFIG_FLOW = 'renovated_jenkins_for_jira_config_flow',
CHECK_USER_PERMISSIONS = 'check_user_permissions'
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ describe('SharePage Component', () => {
jest.spyOn(getAllJenkinsServersModule, 'getAllJenkinsServers').mockResolvedValueOnce([testJenkinsServer]);
jest.spyOn(fetchGlobalPageUrlModule, 'fetchGlobalPageUrl').mockResolvedValueOnce('https://somesite.atlassian.net/blah');

await waitFor(() => render(<SharePage analyticsScreenEventNameEnum={AnalyticsScreenEventsEnum.JenkinsSetupScreenName}/>));
await waitFor(() => render(<SharePage analyticsScreenEventNameEnum={
AnalyticsScreenEventsEnum.JenkinsSetupScreenName
}/>));
await waitFor(() => fireEvent.click(screen.getByText('Share page')));
await waitFor(() => fireEvent.click(screen.getByText('Copy to clipboard')));
await waitFor(() => screen.getByText('Copied to clipboard'));
Expand All @@ -49,7 +51,9 @@ describe('SharePage Component', () => {
jest.spyOn(getAllJenkinsServersModule, 'getAllJenkinsServers').mockResolvedValueOnce([testJenkinsServer]);
jest.spyOn(fetchGlobalPageUrlModule, 'fetchGlobalPageUrl').mockResolvedValueOnce('https://somesite.atlassian.net/blah');

await waitFor(() => render(<SharePage analyticsScreenEventNameEnum={AnalyticsScreenEventsEnum.JenkinsSetupScreenName}/>));
await waitFor(() => render(<SharePage analyticsScreenEventNameEnum={
AnalyticsScreenEventsEnum.JenkinsSetupScreenName
}/>));
await waitFor(() => fireEvent.click(screen.getByText('Share page')));

expect(screen.getByText('Copy to clipboard')).toBeInTheDocument();
Expand Down

0 comments on commit 0eea563

Please sign in to comment.