mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
On a public share, MentionDocument and MentionCollection rendered a Link to the bare /doc/... or /collection/... path. That route is not part of the share, so the router fell through to the authenticated app and showed the login screen. Regular text links to the same documents were unaffected because they go through the editor's onClickLink handler, which already prefixes the share route. Scope mention paths with sharedModelPath when a shareId is in context. Moves the helper into shared/utils so the editor can use it; the app wrapper keeps the same signature and reads ROOT_SHARE_ID from env.
32 lines
861 B
TypeScript
32 lines
861 B
TypeScript
export function signin(service = "slack"): string {
|
|
return `/auth/${service}`;
|
|
}
|
|
|
|
export function settingsPath(section?: string): string {
|
|
return "/settings" + (section ? `/${section}` : "");
|
|
}
|
|
|
|
export function integrationSettingsPath(id: string): string {
|
|
return `/settings/integrations/${id}`;
|
|
}
|
|
|
|
/**
|
|
* Returns the public path for a shared model.
|
|
*
|
|
* @param shareId the identifier of the share.
|
|
* @param modelPath an optional path to the model within the share.
|
|
* @param rootShareId the workspace root share id, if the share is served from "/".
|
|
* @returns the path to the shared model.
|
|
*/
|
|
export function sharedModelPath(
|
|
shareId: string,
|
|
modelPath?: string,
|
|
rootShareId?: string
|
|
): string {
|
|
if (shareId === rootShareId) {
|
|
return modelPath ? modelPath : "/";
|
|
}
|
|
|
|
return modelPath ? `/s/${shareId}${modelPath}` : `/s/${shareId}`;
|
|
}
|