Skip to content

Commit

Permalink
Merge branch 'main' into delete-saas
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Anderson authored Jan 23, 2024
2 parents 0a151ec + f539554 commit b913bfb
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 46 deletions.
35 changes: 1 addition & 34 deletions coral/src/app/layout/main-navigation/MainNavigation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const navLinks = [
{ name: "My team's requests", linkTo: "/requests" },
{
name: "Activity log",
linkTo: isFeatureFlagActiveMock() ? "/activity-log" : "/activityLog",
linkTo: "/activity-log",
},
];

Expand Down Expand Up @@ -357,39 +357,6 @@ describe("MainNavigation.tsx", () => {
});
});

describe("renders links to activity log behind feature flag", () => {
afterEach(() => {
cleanup();
jest.resetAllMocks();
});

it("renders a link to the old UI when feature flag is false", async () => {
isFeatureFlagActiveMock.mockReturnValue(false);
customRender(<MainNavigation />, {
memoryRouter: true,
queryClient: true,
aquariumContext: true,
});

const link = screen.getByRole("link", { name: "Activity log" });
expect(link).toBeVisible();
expect(link).toHaveAttribute("href", "/activityLog");
});

it("renders a link to the activity log page when feature flag is true", async () => {
isFeatureFlagActiveMock.mockReturnValue(true);
customRender(<MainNavigation />, {
memoryRouter: true,
queryClient: true,
aquariumContext: true,
});

const link = screen.getByRole("link", { name: "Activity log" });
expect(link).toBeVisible();
expect(link).toHaveAttribute("href", "/activity-log");
});
});

describe("shows an toast error notification when fetching pending requests fails", () => {
const testError: KlawApiError = {
message: "Oh no, this did not work",
Expand Down
5 changes: 1 addition & 4 deletions coral/src/app/layout/main-navigation/MainNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ function MainNavigation() {
const { pathname } = useLocation();
const { TOTAL_NOTIFICATIONS } = usePendingRequests();
const dashBoardEnabled = useFeatureFlag(FeatureFlag.FEATURE_FLAG_DASHBOARD);
const activityLogEnabled = useFeatureFlag(
FeatureFlag.FEATURE_FLAG_ACTIVITY_LOG
);

return (
<Box
Expand Down Expand Up @@ -90,7 +87,7 @@ function MainNavigation() {
<li>
<MainNavigationLink
icon={list}
to={activityLogEnabled ? Routes.ACTIVITY_LOG : "/activityLog"}
to={Routes.ACTIVITY_LOG}
linkText={"Activity log"}
active={pathname.startsWith(Routes.ACTIVITY_LOG)}
/>
Expand Down
6 changes: 2 additions & 4 deletions coral/src/app/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,10 @@ const routes: Array<RouteObject> = [
},
],
},
createRouteBehindFeatureFlag({
{
path: Routes.ACTIVITY_LOG,
element: <ActivityLogPage />,
featureFlag: FeatureFlag.FEATURE_FLAG_ACTIVITY_LOG,
redirectRouteWithoutFeatureFlag: Routes.TOPICS,
}),
},
],
},
{
Expand Down
1 change: 0 additions & 1 deletion coral/src/services/feature-flags/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
enum FeatureFlag {
FEATURE_FLAG_DASHBOARD = "FEATURE_FLAG_DASHBOARD",
FEATURE_FLAG_ACTIVITY_LOG = "FEATURE_FLAG_ACTIVITY_LOG",
FEATURE_FLAG_TOPIC_TYPE_FILTER = "FEATURE_FLAG_TOPIC_TYPE_FILTER",
}

Expand Down
3 changes: 0 additions & 3 deletions coral/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ export default defineConfig(({ mode }) => {
FEATURE_FLAG_DASHBOARD: ["development", "remote-api"]
.includes(mode)
.toString(),
FEATURE_FLAG_ACTIVITY_LOG: ["development", "remote-api"]
.includes(mode)
.toString(),
FEATURE_FLAG_TOPIC_TYPE_FILTER: ["development", "remote-api"]
.includes(mode)
.toString(),
Expand Down

0 comments on commit b913bfb

Please sign in to comment.