Skip to content

Commit

Permalink
fix: fix resource key of filter
Browse files Browse the repository at this point in the history
  • Loading branch information
wzhudev committed May 16, 2024
1 parent 12d4aef commit e832ce3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
10 changes: 7 additions & 3 deletions docs/NAMING_CONVENTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const ILogService = createIdentifier<ILogService>('log-service');

## Plugins' Names

Plugin names should be all in capitalized letters and suffixed by `PLUGIN`. Words should be separated by underscores and suffixed. For example:
Plugin names should be all in format of `{BUSINESS_TYPE}_${PLUGIN_NAME}_PLUGIN`. Words should be separated by underscores and suffixed. For example:

```typescript
//
Expand All @@ -108,7 +108,7 @@ export class FilterPlugin extends Plugin {}

### Resource key

Resource keys should reuse the corresponding plugin's name.
Resource key should be identical to the corresponding plugin's name.

## Commands

Expand All @@ -135,4 +135,8 @@ export const SetSelectionFrozenCommand: ICommand<ISetSelectionFrozenCommandParam
export const SetSelectionFrozenCommand: ICommand<ISetSelectionFrozenCommandParams> = {
id: 'SetSelectionFrozenCommmand',
}
```
```

## Id

All IDs should be in pascal case: `id` or `Id`.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Inject, Injector } from '@wendellhu/redi';
import type { IInsertColCommandParams, IInsertRowCommandParams, IMoveColsCommandParams, IMoveRowsCommandParams, IRemoveRowColCommandParams, IRemoveSheetCommandParams, ISetSelectionsOperationParams } from '@univerjs/sheets';
import { InsertColCommand, InsertColMutation, InsertRowCommand, InsertRowMutation, MoveColsCommand, MoveColsMutation, MoveRowsCommand, MoveRowsMutation, NORMAL_SELECTION_PLUGIN_NAME, RefRangeService, RemoveColCommand, RemoveColMutation, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, RemoveSheetMutation, SelectionManagerService, SetSelectionsOperation, SheetInterceptorService } from '@univerjs/sheets';
import { SHEET_FILTER_SNAPSHOT_ID, SheetsFilterService } from '../../services/sheet-filter.service';
import { SheetsFilterController } from '../../controllers/sheets-fiter.controller';
import { SheetsFilterController } from '../../controllers/sheets-filter.controller';

describe('Test "Filter Interceptor"', () => {
let univer: Univer;
Expand Down
8 changes: 3 additions & 5 deletions packages/sheets-filter/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ import { Plugin, UniverInstanceType } from '@univerjs/core';
import type { Dependency } from '@wendellhu/redi';
import { Inject, Injector } from '@wendellhu/redi';

import { SheetsFilterService } from './services/sheet-filter.service';
import { SheetsFilterController } from './controllers/sheets-fiter.controller';

const NAME = 'UNIVER_SHEETS_FILTER_PLUGIN';
import { SHEET_FILTER_SNAPSHOT_ID, SheetsFilterService } from './services/sheet-filter.service';
import { SheetsFilterController } from './controllers/sheets-filter.controller';

export class UniverSheetsFilterPlugin extends Plugin {
static override type = UniverInstanceType.UNIVER_SHEET;
static override pluginName = NAME;
static override pluginName = SHEET_FILTER_SNAPSHOT_ID;

constructor(_config: unknown, @Inject(Injector) protected readonly _injector: Injector) {
super();
Expand Down

0 comments on commit e832ce3

Please sign in to comment.