Skip to content

Commit

Permalink
Delete PendingUpdatesButton and remove references to pending_updates_…
Browse files Browse the repository at this point in the history
…notification ff
  • Loading branch information
acelaya committed May 29, 2024
1 parent 1b9e8c7 commit 725de03
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 247 deletions.
7 changes: 1 addition & 6 deletions src/sidebar/components/NotebookView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useSidebarStore } from '../store';
import NotebookFilters from './NotebookFilters';
import NotebookResultCount from './NotebookResultCount';
import PaginatedThreadList from './PaginatedThreadList';
import PendingUpdatesButton from './PendingUpdatesButton';
import PendingUpdatesNotification from './PendingUpdatesNotification';
import { useRootThread } from './hooks/use-root-thread';

Expand All @@ -34,9 +33,6 @@ function NotebookView({ loadAnnotationsService, streamer }: NotebookViewProps) {
const hasAppliedFilter = store.hasAppliedFilter();
const isLoading = store.isLoading();
const resultCount = store.annotationResultCount();
const pendingUpdatesNotification = store.isFeatureEnabled(
'pending_updates_notification',
);

const { rootThread } = useRootThread();

Expand Down Expand Up @@ -143,14 +139,13 @@ function NotebookView({ loadAnnotationsService, streamer }: NotebookViewProps) {
'right-[4rem]',
)}
>
{pendingUpdatesNotification && <PendingUpdatesNotification />}
<PendingUpdatesNotification />
</div>
</div>
<div className="justify-self-start">
<NotebookFilters />
</div>
<div className="flex items-center lg:justify-self-end text-md font-medium">
{!pendingUpdatesNotification && <PendingUpdatesButton />}
<NotebookResultCount
forcedVisibleCount={forcedVisibleCount}
isFiltered={hasAppliedFilter}
Expand Down
66 changes: 0 additions & 66 deletions src/sidebar/components/PendingUpdatesButton.tsx

This file was deleted.

27 changes: 11 additions & 16 deletions src/sidebar/components/SidebarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ function SidebarView({
const focusedGroupId = store.focusedGroupId();
const isLoading = store.isLoading();
const isLoggedIn = store.isLoggedIn();
const pendingUpdatesNotification = store.isFeatureEnabled(
'pending_updates_notification',
);

const linkedAnnotationId = store.directLinkedAnnotationId();
const linkedAnnotation = linkedAnnotationId
Expand Down Expand Up @@ -133,19 +130,17 @@ function SidebarView({
return (
<div className="relative">
<h2 className="sr-only">Annotations</h2>
{pendingUpdatesNotification && (
<div
className={classnames(
'fixed z-1',
// Setting 9px to the right instead of some standard tailwind size,
// so that it matches the padding of the sidebar's container.
// DEFAULT `.container` padding is defined in tailwind.conf.js
'right-[9px] top-12',
)}
>
<PendingUpdatesNotification />
</div>
)}
<div
className={classnames(
'fixed z-1',
// Setting 9px to the right instead of some standard tailwind size,
// so that it matches the padding of the sidebar's container.
// DEFAULT `.container` padding is defined in tailwind.conf.js
'right-[9px] top-12',
)}
>
<PendingUpdatesNotification />
</div>
{showFilterControls && <FilterControls withCardContainer />}
<LoginPromptPanel onLogin={onLogin} onSignUp={onSignUp} />
{hasDirectLinkedAnnotationError && (
Expand Down
5 changes: 0 additions & 5 deletions src/sidebar/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { withServices } from '../service-context';
import type { FrameSyncService } from '../services/frame-sync';
import { useSidebarStore } from '../store';
import GroupList from './GroupList';
import PendingUpdatesButton from './PendingUpdatesButton';
import SortMenu from './SortMenu';
import TopBarToggleButton from './TopBarToggleButton';
import UserMenu from './UserMenu';
Expand Down Expand Up @@ -50,9 +49,6 @@ function TopBar({
const store = useSidebarStore();
const isLoggedIn = store.isLoggedIn();
const hasFetchedProfile = store.hasFetchedProfile();
const pendingUpdatesNotification = store.isFeatureEnabled(
'pending_updates_notification',
);

const toggleSharePanel = () => {
store.toggleSidebarPanel('shareGroupAnnotations');
Expand Down Expand Up @@ -96,7 +92,6 @@ function TopBar({
<div className="grow flex items-center justify-end">
{isSidebar && (
<>
{!pendingUpdatesNotification && <PendingUpdatesButton />}
<SearchIconButton />
<SortMenu />
<TopBarToggleButton
Expand Down
17 changes: 0 additions & 17 deletions src/sidebar/components/test/NotebookView-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('NotebookView', () => {
annotationResultCount: sinon.stub().returns(0),
setSortKey: sinon.stub(),
hasFetchedProfile: sinon.stub().returns(true),
isFeatureEnabled: sinon.stub().returns(false),
};

fakeStreamer = {
Expand Down Expand Up @@ -152,22 +151,6 @@ describe('NotebookView', () => {
assert.isTrue(wrapper.find('NotebookFilters').exists());
});

[true, false].forEach(pendingUpdatesNotificationEnabled => {
it('shows expected pending updates component', () => {
fakeStore.isFeatureEnabled.returns(pendingUpdatesNotificationEnabled);
const wrapper = createComponent();

assert.equal(
wrapper.exists('PendingUpdatesNotification'),
pendingUpdatesNotificationEnabled,
);
assert.equal(
wrapper.exists('PendingUpdatesButton'),
!pendingUpdatesNotificationEnabled,
);
});
});

describe('pagination', () => {
it('passes the current pagination page to `PaginatedThreadList`', () => {
const wrapper = createComponent();
Expand Down
111 changes: 0 additions & 111 deletions src/sidebar/components/test/PendingUpdatesButton-test.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/sidebar/components/test/SidebarView-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ describe('SidebarView', () => {
profile: sinon.stub().returns({ userid: null }),
searchUris: sinon.stub().returns([]),
toggleFocusMode: sinon.stub(),
isFeatureEnabled: sinon.stub().returns(false),
};

fakeTabsUtil = {
Expand Down Expand Up @@ -277,19 +276,6 @@ describe('SidebarView', () => {
});
});

context('when pending_updates_notification is enabled', () => {
[true, false].forEach(pendingUpdatesNotificationEnabled => {
it('shows PendingUpdatesNotification', () => {
fakeStore.isFeatureEnabled.returns(pendingUpdatesNotificationEnabled);
const wrapper = createComponent();
assert.equal(
wrapper.exists('PendingUpdatesNotification'),
pendingUpdatesNotificationEnabled,
);
});
});
});

it(
'should pass a11y checks',
checkAccessibility({
Expand Down
12 changes: 0 additions & 12 deletions src/sidebar/components/test/TopBar-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe('TopBar', () => {
isLoggedIn: sinon.stub().returns(false),
isSidebarPanelOpen: sinon.stub().returns(false),
toggleSidebarPanel: sinon.stub(),
isFeatureEnabled: sinon.stub().returns(true),
};

fakeFrameSync = {
Expand Down Expand Up @@ -194,17 +193,6 @@ describe('TopBar', () => {
});
});

[true, false].forEach(pendingUpdatesNotificationEnabled => {
it('renders PendingUpdatesButton when pending_updates_notification feature is not enabled', () => {
fakeStore.isFeatureEnabled.returns(pendingUpdatesNotificationEnabled);
const wrapper = createTopBar();
assert.equal(
wrapper.exists('PendingUpdatesButton'),
!pendingUpdatesNotificationEnabled,
);
});
});

it(
'should pass a11y checks',
checkAccessibility([
Expand Down

0 comments on commit 725de03

Please sign in to comment.