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",
"npmClient": "yarn",
"useWorkspaces": true,
"npmClientArgs": [
"--ignore-engines"
],
"npmClientArgs": ["--ignore-engines"],
"command": {
"version": {
"forcePublish": true,

View File

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