kopia lustrzana https://github.com/wagtail/wagtail
Feature/commenting disable on snippets (#7080)
* Default to comments disabled * Don't depend on window.comments being definedpull/7084/head
rodzic
feab09a6d6
commit
dba3a438c0
|
@ -6,7 +6,6 @@ import produce from 'immer';
|
|||
export interface SettingsState {
|
||||
user: Author | null;
|
||||
commentsEnabled: boolean;
|
||||
showResolvedComments: boolean;
|
||||
currentTab: string | null;
|
||||
}
|
||||
|
||||
|
@ -15,8 +14,7 @@ export type SettingsStateUpdate = Partial<SettingsState>;
|
|||
// Reducer with initial state
|
||||
export const INITIAL_STATE: SettingsState = {
|
||||
user: null,
|
||||
commentsEnabled: true,
|
||||
showResolvedComments: false,
|
||||
commentsEnabled: false,
|
||||
currentTab: null,
|
||||
};
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ describe('CommentableEditor', () => {
|
|||
commentApp = new CommentApp();
|
||||
});
|
||||
it('has control', () => {
|
||||
commentApp.setVisible(true);
|
||||
const editor = mount(getEditorComponent(commentApp));
|
||||
const controls = editor.findWhere(
|
||||
(n) => n.name() === 'ToolbarButton' && n.prop('name') === 'comment'
|
||||
|
|
|
@ -127,7 +127,7 @@ export class BaseSequenceChild {
|
|||
|
||||
// Inform the comment app that the content path of this block is no longer valid
|
||||
// This will hide any comments that were previously on the block
|
||||
const contentPath = window.comments.getContentPath(this.element);
|
||||
const contentPath = window.comments?.getContentPath(this.element);
|
||||
if (contentPath && window.comments.commentApp) {
|
||||
window.comments.commentApp.invalidateContentPath(contentPath);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue