mirror of
https://github.com/docmost/docmost.git
synced 2025-11-12 19:22:39 +10:00
Compare commits
4 Commits
v0.20.1
...
fix/page-e
| Author | SHA1 | Date | |
|---|---|---|---|
| bc6e9b686b | |||
| 31e5c0c660 | |||
| 33c314d4e8 | |||
| 08f223899a |
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "client",
|
||||
"private": true,
|
||||
"version": "0.20.1",
|
||||
"version": "0.20.2",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
|
||||
@ -14,7 +14,6 @@ import { AppHeader } from "@/components/layouts/global/app-header.tsx";
|
||||
import Aside from "@/components/layouts/global/aside.tsx";
|
||||
import classes from "./app-shell.module.css";
|
||||
import { useTrialEndAction } from "@/ee/hooks/use-trial-end-action.tsx";
|
||||
import { useClickOutside, useMergedRef } from "@mantine/hooks";
|
||||
import { useToggleSidebar } from "@/components/layouts/global/hooks/hooks/use-toggle-sidebar.ts";
|
||||
|
||||
export default function GlobalAppShell({
|
||||
@ -30,13 +29,6 @@ export default function GlobalAppShell({
|
||||
const [sidebarWidth, setSidebarWidth] = useAtom(sidebarWidthAtom);
|
||||
const [isResizing, setIsResizing] = useState(false);
|
||||
const sidebarRef = useRef(null);
|
||||
const navbarOutsideRef = useClickOutside(() => {
|
||||
if (mobileOpened) {
|
||||
toggleMobile();
|
||||
}
|
||||
});
|
||||
|
||||
const mergedRef = useMergedRef(sidebarRef, navbarOutsideRef);
|
||||
|
||||
const startResizing = React.useCallback((mouseDownEvent) => {
|
||||
mouseDownEvent.preventDefault();
|
||||
@ -112,7 +104,7 @@ export default function GlobalAppShell({
|
||||
<AppShell.Navbar
|
||||
className={classes.navbar}
|
||||
withBorder={false}
|
||||
ref={mergedRef}
|
||||
ref={sidebarRef}
|
||||
>
|
||||
<div className={classes.resizeHandle} onMouseDown={startResizing} />
|
||||
{isSpaceRoute && <SpaceSidebar />}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Alert } from "@mantine/core";
|
||||
import { useBillingQuery } from "@/ee/billing/queries/billing-query.ts";
|
||||
import useTrial from "@/ee/hooks/use-trial.tsx";
|
||||
import { getBillingTrialDays } from '@/lib/config.ts';
|
||||
|
||||
export default function BillingTrial() {
|
||||
const { data: billing, isLoading } = useBillingQuery();
|
||||
@ -15,14 +16,14 @@ export default function BillingTrial() {
|
||||
{trialDaysLeft > 0 && !billing && (
|
||||
<Alert title="Your Trial is Active 🎉" color="blue" radius="md">
|
||||
You have {trialDaysLeft} {trialDaysLeft === 1 ? "day" : "days"} left
|
||||
in your 7-day trial. Please subscribe to a plan before your trial
|
||||
in your {getBillingTrialDays()}-day free trial. Please subscribe to a paid plan before your trial
|
||||
ends.
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{trialDaysLeft === 0 && (
|
||||
<Alert title="Your Trial has ended" color="red" radius="md">
|
||||
Your 7-day trial has come to an end. Please subscribe to a plan to
|
||||
Your {getBillingTrialDays()}-day free trial has come to an end. Please subscribe to a paid plan to
|
||||
continue using this service.
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useEffect } from "react";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { isCloud } from "@/lib/config.ts";
|
||||
import { getBillingTrialDays, isCloud } from "@/lib/config.ts";
|
||||
import APP_ROUTE from "@/lib/app-route.ts";
|
||||
import useUserRole from "@/hooks/use-user-role.tsx";
|
||||
import { notifications } from "@mantine/notifications";
|
||||
@ -18,7 +18,7 @@ export const useTrialEndAction = () => {
|
||||
notifications.show({
|
||||
position: "top-right",
|
||||
color: "red",
|
||||
title: "Your 7-day trial has ended",
|
||||
title: `Your ${getBillingTrialDays()}-day trial has ended`,
|
||||
message:
|
||||
"Please upgrade to a paid plan or contact your workspace admin.",
|
||||
autoClose: false,
|
||||
|
||||
@ -74,6 +74,10 @@ export function getDrawioUrl() {
|
||||
return getConfigValue("DRAWIO_URL", "https://embed.diagrams.net");
|
||||
}
|
||||
|
||||
export function getBillingTrialDays() {
|
||||
return getConfigValue("BILLING_TRIAL_DAYS");
|
||||
}
|
||||
|
||||
function getConfigValue(key: string, defaultValue: string = undefined): string {
|
||||
const rawValue = import.meta.env.DEV
|
||||
? process?.env?.[key]
|
||||
|
||||
@ -12,6 +12,7 @@ export default defineConfig(({ mode }) => {
|
||||
CLOUD,
|
||||
SUBDOMAIN_HOST,
|
||||
COLLAB_URL,
|
||||
BILLING_TRIAL_DAYS,
|
||||
} = loadEnv(mode, envPath, "");
|
||||
|
||||
return {
|
||||
@ -23,6 +24,7 @@ export default defineConfig(({ mode }) => {
|
||||
CLOUD,
|
||||
SUBDOMAIN_HOST,
|
||||
COLLAB_URL,
|
||||
BILLING_TRIAL_DAYS,
|
||||
},
|
||||
APP_VERSION: JSON.stringify(process.env.npm_package_version),
|
||||
},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "0.20.1",
|
||||
"version": "0.20.2",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@ -244,7 +244,7 @@ export class PageRepo {
|
||||
'p.spaceId',
|
||||
'p.workspaceId',
|
||||
])
|
||||
.$if(opts?.includeContent, (qb) => qb.select('content'))
|
||||
.$if(opts?.includeContent, (qb) => qb.select('p.content'))
|
||||
.innerJoin('page_hierarchy as ph', 'p.parentPageId', 'ph.id'),
|
||||
),
|
||||
)
|
||||
|
||||
Submodule apps/server/src/ee updated: d3095f2d8b...4e7319ab01
@ -42,6 +42,9 @@ export class StaticModule implements OnModuleInit {
|
||||
? this.environmentService.getSubdomainHost()
|
||||
: undefined,
|
||||
COLLAB_URL: this.environmentService.getCollabUrl(),
|
||||
BILLING_TRIAL_DAYS: this.environmentService.isCloud()
|
||||
? this.environmentService.getBillingTrialDays()
|
||||
: undefined,
|
||||
};
|
||||
|
||||
const windowScriptContent = `<script>window.CONFIG=${JSON.stringify(configString)};</script>`;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "docmost",
|
||||
"homepage": "https://docmost.com",
|
||||
"version": "0.20.1",
|
||||
"version": "0.20.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "nx run-many -t build",
|
||||
|
||||
Reference in New Issue
Block a user