Merge branch 'next' into develop

This commit is contained in:
nocobase[bot] 2024-12-06 06:49:05 +00:00
commit c70bc40f0f
2 changed files with 13 additions and 7 deletions

View File

@ -2,9 +2,7 @@
"version": "1.6.0-alpha.2", "version": "1.6.0-alpha.2",
"npmClient": "yarn", "npmClient": "yarn",
"useWorkspaces": true, "useWorkspaces": true,
"npmClientArgs": [ "npmClientArgs": ["--ignore-engines"],
"--ignore-engines"
],
"command": { "command": {
"version": { "version": {
"forcePublish": true, "forcePublish": true,

View File

@ -20,6 +20,7 @@ import {
FormItem, FormItem,
Checkbox, Checkbox,
VariablesProvider, VariablesProvider,
useApp,
} from '@nocobase/client'; } from '@nocobase/client';
import { Breadcrumb, Button, Dropdown, Space, Spin, Switch, Input, message, Popover, QRCode } from 'antd'; import { Breadcrumb, Button, Dropdown, Space, Spin, Switch, Input, message, Popover, QRCode } from 'antd';
import React, { useState } from 'react'; import React, { useState } from 'react';
@ -30,11 +31,14 @@ import { usePublicSubmitActionProps } from '../hooks';
import { usePublicFormTranslation, NAMESPACE } from '../locale'; import { usePublicFormTranslation, NAMESPACE } from '../locale';
const PublicFormQRCode = () => { const PublicFormQRCode = () => {
const params = useParams();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const baseURL = window.location.origin;
const { t } = usePublicFormTranslation(); const { t } = usePublicFormTranslation();
const link = `${baseURL}/public-forms/${params.name}`; const baseURL = window.location.origin;
const params = useParams();
const isUnderSubApp = window.location.pathname.startsWith('/apps');
const app = useApp();
const link =
baseURL + (isUnderSubApp ? `/apps/${app.name}/public-forms/${params.name}` : `/public-forms/${params.name}`);
const handleQRCodeOpen = (newOpen: boolean) => { const handleQRCodeOpen = (newOpen: boolean) => {
setOpen(newOpen); setOpen(newOpen);
}; };
@ -54,6 +58,7 @@ export function AdminPublicFormPage() {
const { t } = usePublicFormTranslation(); const { t } = usePublicFormTranslation();
const { theme } = useGlobalTheme(); const { theme } = useGlobalTheme();
const apiClient = useAPIClient(); const apiClient = useAPIClient();
const app = useApp();
const { data, loading, refresh } = useRequest<any>({ const { data, loading, refresh } = useRequest<any>({
url: `publicForms:get/${params.name}`, url: `publicForms:get/${params.name}`,
}); });
@ -101,7 +106,10 @@ export function AdminPublicFormPage() {
const handleCopyLink = () => { const handleCopyLink = () => {
const baseURL = window.location.origin; const baseURL = window.location.origin;
const link = `${baseURL}/public-forms/${params.name}`; const isUnderSubApp = window.location.pathname.startsWith('/apps');
const link =
baseURL + (isUnderSubApp ? `/apps/${app.name}/public-forms/${params.name}` : `/public-forms/${params.name}`);
console.log(link);
navigator.clipboard.writeText(link); navigator.clipboard.writeText(link);
message.success(t('Link copied successfully')); message.success(t('Link copied successfully'));
}; };