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
2 changes: 1 addition & 1 deletion apps/admin/src/dunning/dunning-modal.acceptance.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ it.each(['Dismiss', 'Pay now'])(
fakeAdminEndpoint('GET', new RegExp(`^/tags/slug/${news.slug}/`), () => ({ tags: [news] }));
const response = configResponse();
await renderAdminApp('/tags/news', {
labs: { dunningWarnings: true, tagDetailsReact: true },
labs: { dunningWarnings: true },
boot: {
browseConfig: {
response: {
Expand Down
6 changes: 3 additions & 3 deletions apps/admin/src/ember-bridge/ember-bridge.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('useEmberFeatureFlag', () => {
mock.stateBridge.isFeatureEnabled = vi.fn(() => enabled);
window.EmberBridge = { state: mock.stateBridge };

const { result } = renderHook(() => useEmberFeatureFlag('tagDetailsReact'));
const { result } = renderHook(() => useEmberFeatureFlag('postsListReact'));
expect(result.current).toBe(false);

enabled = true;
Expand All @@ -112,7 +112,7 @@ describe('useEmberFeatureFlag', () => {
const mock = createMockStateBridge();
mock.stateBridge.isFeatureEnabled = vi.fn(() => true);

const { result } = renderHook(() => useEmberFeatureFlag('tagDetailsReact'));
const { result } = renderHook(() => useEmberFeatureFlag('postsListReact'));
expect(result.current).toBeUndefined();

window.EmberBridge = { state: mock.stateBridge };
Expand All @@ -129,7 +129,7 @@ describe('useEmberFeatureFlag', () => {
mock.stateBridge.isFeatureEnabled = vi.fn(() => undefined);
window.EmberBridge = { state: mock.stateBridge };

const { result } = renderHook(() => useEmberFeatureFlag('tagDetailsReact'));
const { result } = renderHook(() => useEmberFeatureFlag('postsListReact'));

expect(result.current).toBeNull();
});
Expand Down
12 changes: 2 additions & 10 deletions apps/admin/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import HomeRedirect from './home-redirect';
import { EmberListWithGiftLinks } from './gift-link-modal-host';
import { EditorGate } from './editor-gate';
import { PagesListGate, PostsListGate } from './posts-list-gate';
import { TagDetailGate } from './tag-detail-gate';
import { MemberActivityGate } from './member-activity-gate';
import { useFlagGatedRouteOwner } from './use-flag-gated-route-owner';
import { type AccessRouteHandle } from './route-access';
Expand All @@ -31,7 +30,7 @@ import { membersRouteChildren } from './members/api';
import { OnboardingRedirect, lazyOnboardingScreen } from './onboarding/api';
import { lazyPostAnalyticsRoot, postAnalyticsRouteChildren } from './posts/api';
import { canAccessSettingsRoute, lazySettingsScreen, settingsRouteChildren } from './settings/api';
import { lazyTagsScreen } from './tags/api';
import { lazyTagDetailScreen, lazyTagsScreen } from './tags/api';
import {
canManageAutomations,
canManageMembers,
Expand Down Expand Up @@ -105,12 +104,9 @@ const appRoutes: RouteObject[] = [
// Covers both edit (`:tagSlug`) and create (the sentinel `new`) —
// Ember's router declared `/tags/new` before `/tags/:tag_slug`, so a
// tag with the literal slug "new" was already unreachable.
//
// TagDetailGate serves Ember or React depending on the
// `tagDetailsReact` Labs flag.
path: '/tags/:tagSlug',
Component: TagDetailGate,
handle: { requiresAccess: canManageTags } satisfies AccessRouteHandle,
lazy: lazyComponent(lazyTagDetailScreen),
},
{
path: '/members',
Expand Down Expand Up @@ -232,17 +228,13 @@ export const routes: RouteObject[] = [
const EMBER_ROUTE_COMPONENTS = new Set<unknown>([EmberFallback, EmberListWithGiftLinks]);

export function useIsEmberOwnedRoute(pathname: string): boolean {
const tagDetailOwner = useFlagGatedRouteOwner('tagDetailsReact');
const postsListOwner = useFlagGatedRouteOwner('postsListReact');
const editorOwner = useFlagGatedRouteOwner('editorReact');
const memberActivityOwner = useFlagGatedRouteOwner('membersActivityReact');
const leaf = matchRoutes(routes, pathname)?.at(-1)?.route;
if (!leaf) {
return true;
}
if (leaf.Component === TagDetailGate) {
return tagDetailOwner !== 'react';
}
if (leaf.Component === PostsListGate || leaf.Component === PagesListGate) {
return postsListOwner !== 'react';
}
Expand Down
118 changes: 0 additions & 118 deletions apps/admin/src/tag-detail-gate.test.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions apps/admin/src/tag-detail-gate.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions apps/admin/src/tags/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* Public surface of the tags domain, consumed by the admin shell
* (apps/admin/src/routes.tsx and the tag detail gate). Everything else in
* this domain is internal.
* (apps/admin/src/routes.tsx). Everything else in this domain is internal.
*/

// Lazy entries, not component re-exports: the shell mounts these behind
Expand Down
Loading
Loading