Skip to content

Commit

Permalink
fix(sheets-data-validation): data-validation formula-error (#4606)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
weird94 and actions-user authored Feb 11, 2025
1 parent 1559708 commit 0d6c8b4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions mockdata/src/sheets/demo/default-workbook-data-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14027,6 +14027,9 @@ export const DEFAULT_WORKBOOK_DATA_DEMO: IWorkbookData = {
},
},
4: {
5: {
v: 2,
},
10: {
v: 123,
},
Expand Down
10 changes: 5 additions & 5 deletions packages/sheets-data-validation/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

import type { Dependency } from '@univerjs/core';
import type { IUniverSheetsDataValidationConfig } from './controllers/config.schema';
import {
DependentOn,
ICommandService,
IConfigService,
merge,
Plugin,
UniverInstanceType,
Inject,
Injector,
merge, Plugin, UniverInstanceType,
} from '@univerjs/core';
import { type Dependency, Inject, Injector } from '@univerjs/core';
import { UniverDataValidationPlugin } from '@univerjs/data-validation';
import {
AddSheetDataValidationCommand,
Expand Down Expand Up @@ -99,6 +99,7 @@ export class UniverSheetsDataValidationPlugin extends Plugin {

this._injector.get(DataValidationCacheService);
this._injector.get(SheetsDataValidationValidatorService);
this._injector.get(DataValidationController);
this._injector.get(DataValidationFormulaRefRangeController);
this._injector.get(DataValidationRefRangeController);
}
Expand All @@ -108,7 +109,6 @@ export class UniverSheetsDataValidationPlugin extends Plugin {
}

override onRendered(): void {
this._injector.get(DataValidationController);
this._injector.get(DataValidationFormulaController);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
import type { IRange, Nullable } from '@univerjs/core';
import type { IRemoveOtherFormulaMutationParams, ISetFormulaCalculationResultMutation, ISetOtherFormulaMutationParams } from '@univerjs/engine-formula';
import type { IOtherFormulaMarkDirtyParams } from '../commands/mutations/formula.mutation';
import type { IOtherFormulaResult } from './formula-common';
import { Disposable, ICommandService, Inject, LifecycleService, ObjectMatrix, Tools } from '@univerjs/core';
import { IActiveDirtyManagerService, RemoveOtherFormulaMutation, SetFormulaCalculationResultMutation, SetOtherFormulaMutation } from '@univerjs/engine-formula';
import { BehaviorSubject, bufferWhen, filter, Subject } from 'rxjs';
import { OtherFormulaMarkDirty } from '../commands/mutations/formula.mutation';
import { FormulaResultStatus, type IOtherFormulaResult } from './formula-common';
import { FormulaResultStatus } from './formula-common';

export class RegisterOtherFormulaService extends Disposable {
private _formulaCacheMap: Map<string, Map<string, Map<string, IOtherFormulaResult>>> = new Map();
Expand Down
6 changes: 3 additions & 3 deletions packages/sheets/src/facade/f-univer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type { IBeforeSheetCreateEventParams, ISheetCreatedEventParams } from './
import type { FRange } from './f-range';
import type { FWorksheet } from './f-worksheet';
import { CanceledError, FUniver, ICommandService, IUniverInstanceService, toDisposable, UniverInstanceType } from '@univerjs/core';
import { COMMAND_LISTENER_VALUE_CHANGE, getValueChangedEffectedRange, InsertSheetCommand, RemoveSheetCommand, SetGridlinesColorCommand, SetTabColorCommand, SetWorksheetActivateCommand, SetWorksheetHideCommand, SetWorksheetNameCommand, SetWorksheetOrderCommand, ToggleGridlinesCommand } from '@univerjs/sheets';
import { COMMAND_LISTENER_VALUE_CHANGE, getValueChangedEffectedRange, InsertSheetCommand, RemoveSheetCommand, SetGridlinesColorCommand, SetTabColorCommand, SetWorksheetActiveOperation, SetWorksheetHideCommand, SetWorksheetNameCommand, SetWorksheetOrderCommand, ToggleGridlinesCommand } from '@univerjs/sheets';
import { FDefinedNameBuilder } from './f-defined-name';
import { FPermission } from './f-permission';
import { FWorkbook } from './f-workbook';
Expand Down Expand Up @@ -237,7 +237,7 @@ export class FUniverSheetsMixin extends FUniver implements IFUniverSheetsMixin {
}
break;
}
case SetWorksheetActivateCommand.id: {
case SetWorksheetActiveOperation.id: {
if (!this._eventListend(this.Event.BeforeActiveSheetChange)) return;
const { subUnitId: sheetId, unitId } = commandInfo.params as ISetWorksheetActivateCommandParams;
const workbook = unitId ? this.getUniverSheet(unitId) : this.getActiveWorkbook?.();
Expand Down Expand Up @@ -358,7 +358,7 @@ export class FUniverSheetsMixin extends FUniver implements IFUniverSheetsMixin {
);
break;
}
case SetWorksheetActivateCommand.id: {
case SetWorksheetActiveOperation.id: {
if (!this._eventListend(this.Event.ActiveSheetChanged)) return;
const target = this.getActiveSheet();
if (!target) return;
Expand Down

0 comments on commit 0d6c8b4

Please sign in to comment.