mirror of
https://github.com/outline/outline.git
synced 2025-12-20 10:09:43 -06:00
* Split permissions for reading documents from updating collection * fix: Admins should have collection read permission, tests * tsc * Add admin option to permission selector * Combine publish and create permissions, update -> createDocuments where appropriate * Plural -> singular * wip * Quick version of collection structure loading, will revisit * Remove documentIds method * stash * fixing tests to account for admin creation * Add self-hosted migration * fix: Allow groups to have admin permission * Prefetch collection documents * fix: Document explorer (move/publish) not working with async documents * fix: Cannot re-parent document to collection by drag and drop * fix: Cannot drag to import into collection item without admin permission * Remove unused isEditor getter
22 lines
473 B
TypeScript
22 lines
473 B
TypeScript
import { observer } from "mobx-react";
|
|
import * as React from "react";
|
|
import Collection from "~/models/Collection";
|
|
|
|
type Props = {
|
|
enabled: boolean;
|
|
collection: Collection;
|
|
children: React.ReactNode;
|
|
};
|
|
|
|
function DocumentsLoader({ collection, enabled, children }: Props) {
|
|
React.useEffect(() => {
|
|
if (enabled) {
|
|
void collection.fetchDocuments();
|
|
}
|
|
}, [collection, enabled]);
|
|
|
|
return <>{children}</>;
|
|
}
|
|
|
|
export default observer(DocumentsLoader);
|