Skip to content

Commit

Permalink
fix(filter): test with dirty range
Browse files Browse the repository at this point in the history
  • Loading branch information
Dushusir committed Dec 7, 2024
1 parent 533cd0f commit de32844
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/sheets-filter-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"dependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"@univerjs/icons": "^0.2.8",
"@univerjs/rpc": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import type { ISetRangeValuesCommandParams } from '@univerjs/sheets';
import type { FilterModel, ISetSheetsFilterRangeMutationParams } from '@univerjs/sheets-filter';
import type { ISetSheetsFilterCriteriaCommandParams } from '@univerjs/sheets-filter/commands/commands/sheets-filter.command.js';
import { AuthzIoLocalService, IAuthzIoService, ICommandService, Inject, Injector, IUniverInstanceService, LocaleType, Plugin, RANGE_TYPE, RedoCommand, UndoCommand, Univer, UniverInstanceType } from '@univerjs/core';
import { ActiveDirtyManagerService, IActiveDirtyManagerService } from '@univerjs/engine-formula';
import { RangeProtectionRuleModel, RefRangeService, SetRangeValuesCommand, SetRangeValuesMutation, SheetInterceptorService, SheetsSelectionsService, WorkbookPermissionService, WorksheetPermissionService, WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from '@univerjs/sheets';
import { SetSheetsFilterRangeMutation, SheetsFilterService, UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';

import { ClearSheetsFilterCriteriaCommand, ReCalcSheetsFilterCommand, RemoveSheetFilterCommand, SetSheetFilterRangeCommand, SetSheetsFilterCriteriaCommand, SmartToggleSheetsFilterCommand } from '@univerjs/sheets-filter/commands/commands/sheets-filter.command.js';
import { IMessageService } from '@univerjs/ui';

import { MockMessageService } from '@univerjs/ui/services/message/__testing__/mock-message.service.js';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';

Expand Down Expand Up @@ -100,6 +101,7 @@ function createFilterCommandTestBed() {
[WorksheetProtectionRuleModel],
[RangeProtectionRuleModel],
[IMessageService, { useClass: MockMessageService }],
[IActiveDirtyManagerService, { useClass: ActiveDirtyManagerService }],
] as Dependency[]).forEach((d) => this._injector.add(d));

this._injector.get(SheetInterceptorService);
Expand Down Expand Up @@ -149,7 +151,6 @@ describe('test sheets filter commands', () => {
});

afterEach(() => {
univer.dispose();
});

function select(range: IRange) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type { Dependency, IOperation, IWorkbookData, Workbook } from '@univerjs/
import type { ISetSheetsFilterRangeMutationParams } from '@univerjs/sheets-filter';
import type { IEditorBridgeServiceVisibleParam } from '@univerjs/sheets-ui';
import { CommandType, ICommandService, IContextService, Inject, Injector, LocaleService, LocaleType, Plugin, Univer, UniverInstanceType } from '@univerjs/core';
import { ActiveDirtyManagerService, IActiveDirtyManagerService } from '@univerjs/engine-formula';
import { RefRangeService, SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
import { SetSheetsFilterRangeMutation, UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
Expand Down Expand Up @@ -78,6 +79,7 @@ function createFilterOperationTestBed() {
[SheetsFilterPanelService],
[RefRangeService],
[SheetsSelectionsService],
[IActiveDirtyManagerService, { useClass: ActiveDirtyManagerService }],
] as Dependency[]).forEach((d) => this._injector.add(d));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import type { IWorkbookData, Workbook } from '@univerjs/core';
import type { ISetSheetsFilterCriteriaMutationParams, ISetSheetsFilterRangeMutationParams } from '@univerjs/sheets-filter';
import { AuthzIoLocalService, DisposableCollection, IAuthzIoService, ICommandService, Inject, Injector, LocaleType, Plugin, Univer, UniverInstanceType } from '@univerjs/core';
import { ActiveDirtyManagerService, IActiveDirtyManagerService } from '@univerjs/engine-formula';
import { ExclusiveRangeService, IExclusiveRangeService, RangeProtectionRuleModel, RefRangeService, SetWorksheetActiveOperation, SheetInterceptorService, SheetsSelectionsService, WorkbookPermissionService, WorksheetPermissionService, WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from '@univerjs/sheets';
import { RemoveSheetsFilterMutation, SetSheetsFilterCriteriaMutation, SetSheetsFilterRangeMutation, UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';
import { ClearSheetsFilterCriteriaCommand, ReCalcSheetsFilterCommand, SmartToggleSheetsFilterCommand } from '@univerjs/sheets-filter/commands/commands/sheets-filter.command.js';
Expand Down Expand Up @@ -77,6 +78,7 @@ function createSheetsFilterMenuTestBed() {
injector.add([SheetInterceptorService]);
injector.add([RangeProtectionRuleModel]);
injector.add([IExclusiveRangeService, { useClass: ExclusiveRangeService, deps: [SheetsSelectionsService] }]);
injector.add([IActiveDirtyManagerService, { useClass: ActiveDirtyManagerService }]);

const commandService = injector.get(ICommandService);
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { IOpenFilterPanelOperationParams } from '../../commands/operations/
import type { IFilterConditionFormParams } from '../../models/conditions';
import type { IFilterByValueWithTreeItem } from '../sheets-filter-panel.service';
import { CommandType, ICommandService, Inject, Injector, LocaleService, Plugin, Univer, UniverInstanceType } from '@univerjs/core';
import { ActiveDirtyManagerService, IActiveDirtyManagerService } from '@univerjs/engine-formula';
import { RefRangeService, SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
import { CustomFilterOperator, SheetsFilterService, UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';
import { SetSheetsFilterCriteriaCommand } from '@univerjs/sheets-filter/commands/commands/sheets-filter.command.js';
Expand Down Expand Up @@ -94,6 +95,7 @@ function createSheetsFilterPanelServiceTestBed(workbookData: IWorkbookData) {
[SheetsSelectionsService],
[SheetInterceptorService],
[SheetsFilterPanelService],
[IActiveDirtyManagerService, { useClass: ActiveDirtyManagerService }],
] as Dependency[]).forEach((d) => this._injector.add(d));
}
}
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de32844

Please sign in to comment.