Skip to content

Commit

Permalink
DEVPROD-8967 Remove feature flag and update documentation URL (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
malikchaya2 authored Aug 26, 2024
1 parent 1266eeb commit c093ebe
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 45 deletions.
6 changes: 2 additions & 4 deletions apps/spruce/src/constants/externalResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ export const githubChecksAliasesDocumentationUrl = `${projectDistroSettingsDocum
export const githubPermissionsDocumentationUrl =
"https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app";

/**
* TODO: Documentation must be written by app team. Update this URL in DEVPROD-8967.
*/
export const githubTokenPermissionRestrictionsUrl = "";
export const githubTokenPermissionRestrictionsUrl =
"https://docs.devprod.prod.corp.mongodb.com/evergreen/Project-Configuration/Project-Commands#githubgenerate_token";

export const githubAppCredentialsDocumentationUrl =
"https://wiki.corp.mongodb.com/x/tavkC";
Expand Down
1 change: 0 additions & 1 deletion apps/spruce/src/constants/featureFlags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isProduction } from "utils/environmentVariables";

export const showGitHubAccessTokenProject = !isProduction();
export const showImageVisibilityPage = !isProduction();
68 changes: 31 additions & 37 deletions apps/spruce/src/pages/projectSettings/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useEffect, useMemo } from "react";
import styled from "@emotion/styled";
import { Navigate, Route, Routes, useParams } from "react-router-dom";
import { showGitHubAccessTokenProject } from "constants/featureFlags";
import { ProjectSettingsTabRoutes, slugs } from "constants/routes";
import { ProjectSettingsQuery, RepoSettingsQuery } from "gql/generated/types";
import useScrollToAnchor from "hooks/useScrollToAnchor";
Expand Down Expand Up @@ -269,42 +268,37 @@ export const ProjectSettingsTabs: React.FC<Props> = ({
/>
}
/>
{showGitHubAccessTokenProject && (
<Route
path={ProjectSettingsTabRoutes.GithubAppSettings}
element={
<AppSettingsTab
projectData={
tabData[ProjectSettingsTabRoutes.GithubAppSettings]
.projectData
}
githubPermissionGroups={
projectData?.projectRef?.githubDynamicTokenPermissionGroups ??
[]
}
// @ts-expect-error: FIXME. This comment was added by an automated script.
identifier={identifier}
// @ts-expect-error: FIXME. This comment was added by an automated script.
projectId={projectId}
/>
}
/>
)}
{showGitHubAccessTokenProject && (
<Route
path={ProjectSettingsTabRoutes.GithubPermissionGroups}
element={
<PermissionGroupsTab
// @ts-expect-error: FIXME. This comment was added by an automated script.
identifier={identifier}
projectData={
tabData[ProjectSettingsTabRoutes.GithubPermissionGroups]
.projectData
}
/>
}
/>
)}
<Route
path={ProjectSettingsTabRoutes.GithubAppSettings}
element={
<AppSettingsTab
projectData={
tabData[ProjectSettingsTabRoutes.GithubAppSettings].projectData
}
githubPermissionGroups={
projectData?.projectRef?.githubDynamicTokenPermissionGroups ??
[]
}
// @ts-expect-error: FIXME. This comment was added by an automated script.
identifier={identifier}
// @ts-expect-error: FIXME. This comment was added by an automated script.
projectId={projectId}
/>
}
/>
<Route
path={ProjectSettingsTabRoutes.GithubPermissionGroups}
element={
<PermissionGroupsTab
// @ts-expect-error: FIXME. This comment was added by an automated script.
identifier={identifier}
projectData={
tabData[ProjectSettingsTabRoutes.GithubPermissionGroups]
.projectData
}
/>
}
/>
<Route
path={ProjectSettingsTabRoutes.EventLog}
element={
Expand Down
5 changes: 2 additions & 3 deletions apps/spruce/src/pages/projectSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
SideNavItem,
PageWrapper,
} from "components/styles";
import { showGitHubAccessTokenProject } from "constants/featureFlags";
import {
ProjectSettingsTabRoutes,
getProjectSettingsRoute,
Expand Down Expand Up @@ -259,13 +258,13 @@ const ProjectSettings: React.FC = () => {
{...sharedProps}
tab={ProjectSettingsTabRoutes.Plugins}
/>
{showGitHubAccessTokenProject && projectType !== ProjectType.Repo && (
{projectType !== ProjectType.Repo && (
<ProjectSettingsNavItem
{...sharedProps}
tab={ProjectSettingsTabRoutes.GithubAppSettings}
/>
)}
{showGitHubAccessTokenProject && projectType !== ProjectType.Repo && (
{projectType !== ProjectType.Repo && (
<ProjectSettingsNavItem
{...sharedProps}
tab={ProjectSettingsTabRoutes.GithubPermissionGroups}
Expand Down

0 comments on commit c093ebe

Please sign in to comment.