mirror of
https://github.com/outline/outline.git
synced 2026-12-01 09:22:14 +03:00
feat: Remove explicit edit
This commit is contained in:
1 parent
578d4c4517
commit
cf11ffb6d0
5 files changed
+13
-11
No files matched your search
@@ -325,7 +325,7 @@ function DocumentMenu({
|
||||
{
|
||||
title: t("Edit"),
|
||||
to: editDocumentUrl(document),
|
||||
visible: !!can.update,
|
||||
visible: !!can.update && !team.collaborativeEditing,
|
||||
icon: <EditIcon />,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -57,11 +57,7 @@ function RevisionMenu({ document, revisionId, className }: Props) {
|
||||
{...menu}
|
||||
/>
|
||||
<ContextMenu {...menu} aria-label={t("Revision options")}>
|
||||
<MenuItem
|
||||
{...menu}
|
||||
onClick={handleRestore}
|
||||
disabled={team.collaborativeEditing}
|
||||
>
|
||||
<MenuItem {...menu} onClick={handleRestore}>
|
||||
<MenuIconWrapper>
|
||||
<RestoreIcon />
|
||||
</MenuIconWrapper>
|
||||
|
||||
@@ -86,7 +86,10 @@ class DataLoader extends React.Component<Props> {
|
||||
}
|
||||
|
||||
get isEditing() {
|
||||
return this.props.match.path === matchDocumentEdit;
|
||||
return (
|
||||
this.props.match.path === matchDocumentEdit ||
|
||||
this.props.auth?.team?.collaborativeEditing
|
||||
);
|
||||
}
|
||||
|
||||
onSearchLink = async (term: string) => {
|
||||
@@ -258,7 +261,9 @@ class DataLoader extends React.Component<Props> {
|
||||
|
||||
return (
|
||||
<React.Fragment key={key}>
|
||||
{this.isEditing && <HideSidebar ui={ui} />}
|
||||
{this.isEditing && !team.collaborativeEditing && (
|
||||
<HideSidebar ui={ui} />
|
||||
)}
|
||||
{this.props.children({
|
||||
document,
|
||||
revision,
|
||||
|
||||
@@ -370,7 +370,8 @@ class DocumentScene extends React.Component<Props> {
|
||||
const headings = this.editor.current
|
||||
? this.editor.current.getHeadings()
|
||||
: [];
|
||||
const showContents = ui.tocVisible && readOnly;
|
||||
const showContents =
|
||||
ui.tocVisible && (readOnly || team?.collaborativeEditing);
|
||||
|
||||
const collaborativeEditing =
|
||||
team?.collaborativeEditing &&
|
||||
@@ -434,7 +435,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
shareId={shareId}
|
||||
isRevision={!!revision}
|
||||
isDraft={document.isDraft}
|
||||
isEditing={!readOnly}
|
||||
isEditing={!readOnly && !team?.collaborativeEditing}
|
||||
isSaving={this.isSaving}
|
||||
isPublishing={this.isPublishing}
|
||||
publishingIsDisabled={
|
||||
|
||||
@@ -230,7 +230,7 @@ function DocumentHeader({
|
||||
</Action>
|
||||
</>
|
||||
)}
|
||||
{canEdit && editAction}
|
||||
{canEdit && !team.collaborativeEditing && editAction}
|
||||
{canEdit && can.createChildDocument && !isMobile && (
|
||||
<Action>
|
||||
<NewChildDocumentMenu
|
||||
|
||||
Reference in new issue
Block a user