mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
fix: show all templates in the menu (#7950)
* fetch all templates * websocket events for workspace templates
This commit is contained in:
@@ -11,7 +11,7 @@ const useTemplatesAction = () => {
|
||||
const { documents } = useStores();
|
||||
|
||||
React.useEffect(() => {
|
||||
void documents.fetchTemplates();
|
||||
void documents.fetchAllTemplates();
|
||||
}, [documents]);
|
||||
|
||||
const actions = React.useMemo(
|
||||
|
||||
@@ -368,6 +368,10 @@ export default class DocumentsStore extends Store<Document> {
|
||||
fetchTemplates = async (options?: PaginationParams): Promise<Document[]> =>
|
||||
this.fetchNamedPage("list", { ...options, template: true });
|
||||
|
||||
@action
|
||||
fetchAllTemplates = async (options?: PaginationParams): Promise<Document[]> =>
|
||||
this.fetchAll({ ...options, template: true });
|
||||
|
||||
@action
|
||||
fetchAlphabetical = async (options?: PaginationParams): Promise<Document[]> =>
|
||||
this.fetchNamedPage("list", {
|
||||
|
||||
@@ -852,6 +852,8 @@ export default class WebsocketsProcessor {
|
||||
channels.push(
|
||||
...this.getCollectionEventChannels(event, document.collection)
|
||||
);
|
||||
} else if (document.isWorkspaceTemplate) {
|
||||
channels.push(`team-${document.teamId}`);
|
||||
} else {
|
||||
channels.push(`collection-${document.collectionId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user