Skip to content

Commit

Permalink
fix: change permission collaborator (#2528)
Browse files Browse the repository at this point in the history
* fix: change permission collaborator

* fix: fix test

* chore: reset menu

* chore: reset menu
  • Loading branch information
ybzky committed Jun 15, 2024
1 parent 8a1bf8d commit 856cfb8
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 49 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "0.1.38-alpha.3",
"@univerjs/protocol": "0.1.38-alpha.4",
"nanoid": "5.0.7",
"numeral": "^2.0.6",
"ot-json1": "^1.0.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/data-validation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "0.1.38-alpha.3"
"@univerjs/protocol": "0.1.38-alpha.4"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-conditional-formatting-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
},
"dependencies": {
"@univerjs/icons": "^0.1.56",
"@univerjs/protocol": "0.1.38-alpha.3",
"@univerjs/protocol": "0.1.38-alpha.4",
"@univerjs/sheets-conditional-formatting": "workspace:*",
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-conditional-formatting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "0.1.38-alpha.3"
"@univerjs/protocol": "0.1.38-alpha.4"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-data-validation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"dependencies": {
"@univerjs/icons": "^0.1.56",
"@univerjs/protocol": "0.1.38-alpha.3"
"@univerjs/protocol": "0.1.38-alpha.4"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-find-replace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "0.1.38-alpha.3"
"@univerjs/protocol": "0.1.38-alpha.4"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-hyper-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"devDependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/protocol": "0.1.38-alpha.3",
"@univerjs/protocol": "0.1.38-alpha.4",
"@univerjs/shared": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@wendellhu/redi": "^0.15.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
},
"dependencies": {
"@univerjs/icons": "^0.1.56",
"@univerjs/protocol": "0.1.38-alpha.3"
"@univerjs/protocol": "0.1.38-alpha.4"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const SheetPermissionOpenPanelOperation: ICommand<IPermissionOpenPanelPar
showDetail,
fromSheetBar,
},
width: 320,
width: 330,
footer: {
label: UNIVER_SHEET_PERMISSION_PANEL_FOOTER,
showDetail,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { useDependency } from '@wendellhu/redi/react-bindings';
import React from 'react';
import { ISidebarService, useObservable } from '@univerjs/ui';
import { IAuthzIoService, ICommandService, LocaleService } from '@univerjs/core';
import { UnitAction, UnitObject, UnitRole } from '@univerjs/protocol';
import { CreateRequest_WorkSheetObjectScope, UnitAction, UnitObject, UnitRole } from '@univerjs/protocol';
import { AddRangeProtectionCommand } from '@univerjs/sheets';
import { SheetPermissionPanelModel, viewState } from '../../../services/permission/sheet-permission-panel.model';
import { SheetPermissionUserManagerService } from '../../../services/permission/sheet-permission-user-list.service';
Expand Down Expand Up @@ -79,6 +79,7 @@ export const SheetPermissionPanelDetailFooter = () => {
unitID: activeRule.unitId,
name: activeRule.name,
strategies: [{ role: UnitRole.Editor, action: UnitAction.Edit }, { role: UnitRole.Reader, action: UnitAction.View }],
scope: CreateRequest_WorkSheetObjectScope.SomeCollaborator,
},
objectType: UnitObject.Worksheet,
});
Expand Down Expand Up @@ -109,10 +110,11 @@ export const SheetPermissionPanelDetailFooter = () => {
unitID: activeRule.unitId,
name: activeRule.name,
strategies: [{ role: UnitRole.Editor, action: UnitAction.Edit }, { role: UnitRole.Reader, action: UnitAction.View }],
scope: CreateRequest_WorkSheetObjectScope.SomeCollaborator,
},
objectType: UnitObject.Worksheet,
});
const { ranges = [], ...sheetRule } = activeRule;
const { ranges: _range = [], ...sheetRule } = activeRule;
sheetRule.permissionId = permissionId;
commandService.executeCommand(AddWorksheetProtectionCommand.id, {
rule: sheetRule,
Expand Down Expand Up @@ -141,7 +143,7 @@ export const SheetPermissionPanelDetailFooter = () => {
label: UNIVER_SHEET_PERMISSION_PANEL,
showDetail: false,
},
width: 320,
width: 330,
footer: {
label: UNIVER_SHEET_PERMISSION_PANEL_FOOTER,
showDetail: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const SheetPermissionPanelAddFooter = () => {
label: UNIVER_SHEET_PERMISSION_PANEL,
showDetail: true,
},
width: 320,
width: 330,
footer: {
label: UNIVER_SHEET_PERMISSION_PANEL_FOOTER,
showDetail: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const SheetPermissionPanelList = () => {
label: UNIVER_SHEET_PERMISSION_PANEL,
showDetail: true,
},
width: 320,
width: 330,
footer: {
label: UNIVER_SHEET_PERMISSION_PANEL_FOOTER,
showDetail: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { IAuthzIoService, ICommandService, IPermissionService, IUniverInstanceSe
import { IDialogService } from '@univerjs/ui';
import { getAllWorksheetPermissionPoint, SetWorksheetPermissionPointsCommand, WorksheetProtectionPointModel } from '@univerjs/sheets';
import type { ICollaborator, UnitAction } from '@univerjs/protocol';
import { UnitObject, UnitRole } from '@univerjs/protocol';
import { CreateRequest_WorkSheetObjectScope, UnitObject, UnitRole } from '@univerjs/protocol';
import Spin from '../spin';
import { defaultWorksheetUnitActionList, subUnitPermissionTypeMap, UNIVER_SHEET_PERMISSION_DIALOG_ID } from '../../../basics/const/permission';
import styles from './index.module.less';
Expand Down Expand Up @@ -129,6 +129,7 @@ export const SheetPermissionDialog = () => {
collaborators,
name: '',
strategies: actions,
scope: CreateRequest_WorkSheetObjectScope.AllCollaborator,
},
});

Expand Down
2 changes: 1 addition & 1 deletion packages/sheets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "0.1.38-alpha.3"
"@univerjs/protocol": "0.1.38-alpha.4"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/thread-comment-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"dependencies": {
"@univerjs/icons": "^0.1.56",
"@univerjs/protocol": "0.1.38-alpha.3",
"@univerjs/protocol": "0.1.38-alpha.4",
"@univerjs/thread-comment": "workspace:*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/thread-comment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "0.1.38-alpha.3"
"@univerjs/protocol": "0.1.38-alpha.4"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/umd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@univerjs/facade": "workspace:*",
"@univerjs/find-replace": "workspace:*",
"@univerjs/network": "workspace:*",
"@univerjs/protocol": "0.1.38-alpha.3",
"@univerjs/protocol": "0.1.38-alpha.4",
"@univerjs/rpc": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-conditional-formatting": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/uniscript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "0.1.38-alpha.3",
"@univerjs/protocol": "0.1.38-alpha.4",
"@univerjs/sheets": "workspace:*"
},
"devDependencies": {
Expand Down
58 changes: 29 additions & 29 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 856cfb8

Please sign in to comment.