Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update editingIsDisabled conditions #265

Merged
merged 8 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/app/components/document/sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

<div class="flex flex-col items-start space-y-2">
<Document::Sidebar::SectionHeader @title="Product/Area" />
{{#if this.isDraft}}
{{#if (and this.isDraft this.userHasEditPrivileges)}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tightening this now that we have the concept of Shareable Drafts (#261)

<div class="w-full relative">
<Inputs::ProductSelect
@selected={{this.product}}
Expand Down
4 changes: 3 additions & 1 deletion web/app/components/document/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ export default class DocumentSidebarComponent extends Component<DocumentSidebarC
if (!this.args.document.appCreated || this.docIsLocked) {
// true is the doc wasn't appCreated or is in a locked state
return true;
} else if (this.isDraft || this.docIsInReview || this.docIsApproved) {
} else if (this.isDraft) {
// true is the doc is a draft/in review/approved and the user is not an owner, contributor, or approver
return !this.userHasEditPrivileges;
} else if (this.docIsInReview || this.docIsApproved) {
return !this.isOwner;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important to note: This method is called editingIsDisabled.

} else {
// doc is obsolete or some unknown status..
return true;
Expand Down