@collabdt/core 0.0.54 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/components/AppSidebarContent.d.ts.map +1 -1
- package/dist/core/components/AppSidebarContent.js +29 -2
- package/dist/core/components/AppSidebarContent.js.map +1 -1
- package/dist/core/components/instance-not-found/src/OrganizationNotFoundSection.d.ts.map +1 -1
- package/dist/core/components/instance-not-found/src/OrganizationNotFoundSection.js +152 -156
- package/dist/core/components/instance-not-found/src/OrganizationNotFoundSection.js.map +1 -1
- package/dist/core/components/organizationConfig/src/organizationConfigContent.d.ts.map +1 -1
- package/dist/core/components/organizationConfig/src/organizationConfigContent.js +146 -150
- package/dist/core/components/organizationConfig/src/organizationConfigContent.js.map +1 -1
- package/dist/core/components/support/BugReportDialog.d.ts +7 -0
- package/dist/core/components/support/BugReportDialog.d.ts.map +1 -0
- package/dist/core/components/support/BugReportDialog.js +117 -0
- package/dist/core/components/support/BugReportDialog.js.map +1 -0
- package/dist/core/components/support/FeatureRequestDialog.d.ts +8 -0
- package/dist/core/components/support/FeatureRequestDialog.d.ts.map +1 -0
- package/dist/core/components/support/FeatureRequestDialog.js +116 -0
- package/dist/core/components/support/FeatureRequestDialog.js.map +1 -0
- package/dist/core/components/support/SupportMenu.d.ts +10 -0
- package/dist/core/components/support/SupportMenu.d.ts.map +1 -0
- package/dist/core/components/support/SupportMenu.js +78 -0
- package/dist/core/components/support/SupportMenu.js.map +1 -0
- package/dist/core/components/ui/Navbar.d.ts.map +1 -1
- package/dist/core/components/ui/Navbar.js +15 -23
- package/dist/core/components/ui/Navbar.js.map +1 -1
- package/dist/core/components/viewers/pointcloud/utils/potreeLoader.d.ts.map +1 -1
- package/dist/core/components/viewers/pointcloud/utils/potreeLoader.js +1 -1
- package/dist/core/components/viewers/pointcloud/utils/potreeLoader.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/core/components/instance-not-found/src/OrganizationNotFoundSection.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { motion } from 'framer-motion'\r\nimport { Button } from '../../ui/Button'\r\nimport { Card } from '../../ui/Card'\r\nimport { Input } from '../../ui/Input'\r\nimport { Textarea } from '../../ui/Textarea'\r\nimport { useTranslations } from 'next-intl'\r\nimport Link from 'next/link'\r\nimport Footer from '../../ui/Footer'\r\nimport { useState } from 'react'\r\n\r\ninterface OrganizationNotFoundSectionProps {\r\n organizationName: string\r\n onSubmit: (e: React.FormEvent<HTMLFormElement>) => void\r\n isSubmitting?: boolean\r\n}\r\n\r\nexport default function OrganizationNotFoundSection({ \r\n organizationName, \r\n onSubmit, \r\n isSubmitting = false\r\n}: OrganizationNotFoundSectionProps) {\r\n const t = useTranslations('OrganizationNotFound')\r\n const [redirectOrg, setRedirectOrg] = useState('')\r\n\r\n const handleRedirect = () => {\r\n if (redirectOrg.trim()) {\r\n window.location.href = `/${redirectOrg.trim()}`\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n <section className=\"min-h-screen py-32 relative flex items-center z-10\">\r\n <div className=\"container mx-auto px-6\">\r\n <motion.div\r\n initial={{ opacity: 0, y: 30 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n className=\"max-w-5xl mx-auto\"\r\n >\r\n {/* Header with Error Message */}\r\n <div className=\"text-center mb-16 space-y-6\">\r\n <h1 className=\"text-4xl md:text-5xl font-bold text-balance\">{t('title')}</h1>\r\n <div className=\"text-lg space-y-2\">\r\n <p className=\"text-muted-foreground\">\r\n {t('organizationLabel')}{' '}\r\n <span className=\"font-semibold text-foreground\">'{organizationName}'</span>{' '}\r\n {t('notCreatedYet')}\r\n </p>\r\n <div className=\"mt-6 mb-4\">\r\n <p className=\"text-sm text-muted-foreground mb-3\">{t('redirectPrompt')}</p>\r\n <div className=\"flex flex-col sm:flex-row gap-3 items-stretch justify-center max-w-md mx-auto\">\r\n <Input\r\n value={redirectOrg}\r\n onChange={(e) => setRedirectOrg(e.target.value)}\r\n placeholder={t('redirectPlaceholder')}\r\n className=\"flex-1\"\r\n onKeyDown={(e) => {\r\n if (e.key === 'Enter') {\r\n e.preventDefault()\r\n handleRedirect()\r\n }\r\n }}\r\n />\r\n <Button\r\n onClick={handleRedirect}\r\n variant=\"outline\"\r\n className=\"whitespace-nowrap\"\r\n disabled={!redirectOrg.trim()}\r\n >\r\n {t('redirectButton')}\r\n </Button>\r\n </div>\r\n </div>\r\n <p className=\"text-muted-foreground\">\r\n {t('contactMessage')}\r\n </p>\r\n </div>\r\n <div className=\"pt-4 flex flex-col sm:flex-row items-stretch justify-center gap-4\">\r\n <Link href=\"https://collabdt.org/\">\r\n <Button variant=\"outline\" size=\"lg\" className=\"text-base px-8 w-full sm:w-auto\">\r\n {t('backToHome')}\r\n </Button>\r\n </Link>\r\n <Button \r\n size=\"lg\" \r\n variant=\"outline\"\r\n className=\"text-base px-8 bg-primary-highlight border-secondary/40 hover:bg-orange-400 hover:border-secondary/60 transition-all whitespace-nowrap w-full sm:w-auto\"\r\n asChild\r\n >\r\n <a href=\"https://docs.google.com/forms/d/e/1FAIpQLScB12Qc7khiOk4a_E753jDccx6026AjO-_FINBKoZZZtkmqnA/viewform\" target=\"_blank\" rel=\"noopener noreferrer\">\r\n {t('betaButton')}\r\n </a>\r\n </Button>\r\n </div>\r\n </div>\r\n\r\n {/* Contact Form */}\r\n <div className=\"grid lg:grid-cols-3 gap-8\">\r\n <Card className=\"lg:col-span-2 p-8\">\r\n <h3 className=\"text-2xl font-bold mb-6\">{t('formTitle')}</h3>\r\n <p className=\"text-muted-foreground mb-8\">\r\n {t('formDescription')}\r\n </p>\r\n \r\n <form onSubmit={onSubmit} className=\"space-y-6\">\r\n <div className=\"grid sm:grid-cols-2 gap-4\">\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"firstName\" className=\"text-sm font-medium\">\r\n {t('firstName')}\r\n </label>\r\n <Input \r\n id=\"firstName\" \r\n name=\"firstName\" \r\n required \r\n className=\"bg-background\"\r\n />\r\n </div>\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"lastName\" className=\"text-sm font-medium\">\r\n {t('lastName')}\r\n </label>\r\n <Input \r\n id=\"lastName\" \r\n name=\"lastName\" \r\n required \r\n className=\"bg-background\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"email\" className=\"text-sm font-medium\">\r\n {t('email')}\r\n </label>\r\n <Input \r\n id=\"email\" \r\n name=\"email\" \r\n type=\"email\" \r\n required \r\n className=\"bg-background\"\r\n />\r\n </div>\r\n\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"organization\" className=\"text-sm font-medium\">\r\n {t('organization')}\r\n </label>\r\n <Input \r\n id=\"organization\" \r\n name=\"organization\" \r\n defaultValue={organizationName}\r\n className=\"bg-background\"\r\n />\r\n </div>\r\n\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"message\" className=\"text-sm font-medium\">\r\n {t('message')}\r\n </label>\r\n <Textarea \r\n id=\"message\" \r\n name=\"message\" \r\n required \r\n rows={5}\r\n className=\"bg-background resize-none\"\r\n />\r\n </div>\r\n\r\n <Button type=\"submit\" size=\"lg\" className=\"gradient-button w-full\" disabled={isSubmitting}>\r\n {isSubmitting ? t('sending') : t('sendButton')}\r\n </Button>\r\n\r\n <p className=\"text-sm text-muted-foreground text-center pt-2\">\r\n {t('orEmail')}{' '}\r\n <a href=\"mailto:info@collabdt.org\" className=\"text-primary hover:underline\">\r\n info@collabdt.org\r\n </a>\r\n </p>\r\n </form>\r\n </Card>\r\n\r\n {/* Contact Info Card */}\r\n <div className=\"space-y-6\">\r\n <Card className=\"p-6 hover-card\">\r\n <h3 className=\"text-lg font-bold mb-3\">{t('contactInfoTitle')}</h3>\r\n <div className=\"space-y-4\">\r\n <div>\r\n <p className=\"text-sm text-muted-foreground mb-1\">{t('emailLabel')}</p>\r\n <a \r\n href=\"mailto:info@collabdt.org\" \r\n className=\"text-primary hover:underline font-medium text-sm\"\r\n >\r\n info@collabdt.org\r\n </a>\r\n </div>\r\n <div>\r\n <p className=\"text-sm text-muted-foreground mb-1\">{t('websiteLabel')}</p>\r\n <a \r\n href=\"https://collabdt.org\" \r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className=\"text-primary hover:underline font-medium text-sm\"\r\n >\r\n collabdt.org\r\n </a>\r\n </div>\r\n </div>\r\n </Card>\r\n\r\n <Card className=\"p-6 hover-card bg-primary/5 border-primary/20\">\r\n <h3 className=\"text-lg font-bold mb-3\">{t('needHelpTitle')}</h3>\r\n <p className=\"text-sm text-muted-foreground mb-4\">\r\n {t('needHelpDescription')}\r\n </p>\r\n </Card>\r\n </div>\r\n </div>\r\n </motion.div>\r\n </div>\r\n </section>\r\n <Footer />\r\n </>\r\n )\r\n}\r\n"],"mappings":";AAoCI,mBAUQ,KAII,YAdZ;AA/BJ,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,OAAO,UAAU;AACjB,OAAO,YAAY;AACnB,SAAS,gBAAgB;AAQV,SAAR,4BAA6C;AAAA,EAClD;AAAA,EACA;AAAA,EACA,eAAe;AACjB,GAAqC;AACnC,QAAM,IAAI,gBAAgB,sBAAsB;AAChD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,EAAE;AAEjD,QAAM,iBAAiB,MAAM;AAC3B,QAAI,YAAY,KAAK,GAAG;AACtB,aAAO,SAAS,OAAO,IAAI,YAAY,KAAK,CAAC;AAAA,IAC/C;AAAA,EACF;AAEA,SACE,iCACE;AAAA,wBAAC,aAAQ,WAAU,sDACjB,8BAAC,SAAI,WAAU,0BACf;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACC,SAAS,EAAE,SAAS,GAAG,GAAG,GAAG;AAAA,QA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ACL,QAAO;AAAA,wBACP,KAAI;AAAA,wBACJ,WAAU;AAAA,wBACX;AAAA;AAAA,oBAED;AAAA,qBACF;AAAA,mBACF;AAAA,iBACF;AAAA,cAEA,qBAAC,QAAK,WAAU,iDACd;AAAA,oCAAC,QAAG,WAAU,0BAA0B,YAAE,eAAe,GAAE;AAAA,gBAC3D,oBAAC,OAAE,WAAU,sCACV,YAAE,qBAAqB,GAC1B;AAAA,iBACF;AAAA,eACF;AAAA,aACF;AAAA;AAAA;AAAA,IACF,GACF,GACA;AAAA,IACA,oBAAC,UAAO;AAAA,KACV;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/core/components/instance-not-found/src/OrganizationNotFoundSection.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { motion } from 'framer-motion'\r\nimport { Button } from '../../ui/Button'\r\nimport { Card } from '../../ui/Card'\r\nimport { Input } from '../../ui/Input'\r\nimport { Textarea } from '../../ui/Textarea'\r\nimport { useTranslations } from 'next-intl'\r\nimport Link from 'next/link'\r\nimport { useState } from 'react'\r\n\r\ninterface OrganizationNotFoundSectionProps {\r\n organizationName: string\r\n onSubmit: (e: React.FormEvent<HTMLFormElement>) => void\r\n isSubmitting?: boolean\r\n}\r\n\r\nexport default function OrganizationNotFoundSection({ \r\n organizationName, \r\n onSubmit, \r\n isSubmitting = false\r\n}: OrganizationNotFoundSectionProps) {\r\n const t = useTranslations('OrganizationNotFound')\r\n const [redirectOrg, setRedirectOrg] = useState('')\r\n\r\n const handleRedirect = () => {\r\n if (redirectOrg.trim()) {\r\n window.location.href = `/${redirectOrg.trim()}`\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n <section className=\"min-h-screen py-32 relative flex items-center z-10\">\r\n <div className=\"container mx-auto px-6\">\r\n <motion.div\r\n initial={{ opacity: 0, y: 30 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n className=\"max-w-5xl mx-auto\"\r\n >\r\n {/* Header with Error Message */}\r\n <div className=\"text-center mb-16 space-y-6\">\r\n <h1 className=\"text-4xl md:text-5xl font-bold text-balance\">{t('title')}</h1>\r\n <div className=\"text-lg space-y-2\">\r\n <p className=\"text-muted-foreground\">\r\n {t('organizationLabel')}{' '}\r\n <span className=\"font-semibold text-foreground\">'{organizationName}'</span>{' '}\r\n {t('notCreatedYet')}\r\n </p>\r\n <div className=\"mt-6 mb-4\">\r\n <p className=\"text-sm text-muted-foreground mb-3\">{t('redirectPrompt')}</p>\r\n <div className=\"flex flex-col sm:flex-row gap-3 items-stretch justify-center max-w-md mx-auto\">\r\n <Input\r\n value={redirectOrg}\r\n onChange={(e) => setRedirectOrg(e.target.value)}\r\n placeholder={t('redirectPlaceholder')}\r\n className=\"flex-1\"\r\n onKeyDown={(e) => {\r\n if (e.key === 'Enter') {\r\n e.preventDefault()\r\n handleRedirect()\r\n }\r\n }}\r\n />\r\n <Button\r\n onClick={handleRedirect}\r\n variant=\"outline\"\r\n className=\"whitespace-nowrap\"\r\n disabled={!redirectOrg.trim()}\r\n >\r\n {t('redirectButton')}\r\n </Button>\r\n </div>\r\n </div>\r\n <p className=\"text-muted-foreground\">\r\n {t('contactMessage')}\r\n </p>\r\n </div>\r\n <div className=\"pt-4 flex flex-col sm:flex-row items-stretch justify-center gap-4\">\r\n <Link href=\"https://collabdt.org/\">\r\n <Button variant=\"outline\" size=\"lg\" className=\"text-base px-8 w-full sm:w-auto\">\r\n {t('backToHome')}\r\n </Button>\r\n </Link>\r\n <Button \r\n size=\"lg\" \r\n variant=\"outline\"\r\n className=\"text-base px-8 bg-primary-highlight border-secondary/40 hover:bg-orange-400 hover:border-secondary/60 transition-all whitespace-nowrap w-full sm:w-auto\"\r\n asChild\r\n >\r\n <a href=\"https://docs.google.com/forms/d/e/1FAIpQLScB12Qc7khiOk4a_E753jDccx6026AjO-_FINBKoZZZtkmqnA/viewform\" target=\"_blank\" rel=\"noopener noreferrer\">\r\n {t('betaButton')}\r\n </a>\r\n </Button>\r\n </div>\r\n </div>\r\n\r\n {/* Contact Form */}\r\n <div className=\"grid lg:grid-cols-3 gap-8\">\r\n <Card className=\"lg:col-span-2 p-8\">\r\n <h3 className=\"text-2xl font-bold mb-6\">{t('formTitle')}</h3>\r\n <p className=\"text-muted-foreground mb-8\">\r\n {t('formDescription')}\r\n </p>\r\n \r\n <form onSubmit={onSubmit} className=\"space-y-6\">\r\n <div className=\"grid sm:grid-cols-2 gap-4\">\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"firstName\" className=\"text-sm font-medium\">\r\n {t('firstName')}\r\n </label>\r\n <Input \r\n id=\"firstName\" \r\n name=\"firstName\" \r\n required \r\n className=\"bg-background\"\r\n />\r\n </div>\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"lastName\" className=\"text-sm font-medium\">\r\n {t('lastName')}\r\n </label>\r\n <Input \r\n id=\"lastName\" \r\n name=\"lastName\" \r\n required \r\n className=\"bg-background\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"email\" className=\"text-sm font-medium\">\r\n {t('email')}\r\n </label>\r\n <Input \r\n id=\"email\" \r\n name=\"email\" \r\n type=\"email\" \r\n required \r\n className=\"bg-background\"\r\n />\r\n </div>\r\n\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"organization\" className=\"text-sm font-medium\">\r\n {t('organization')}\r\n </label>\r\n <Input \r\n id=\"organization\" \r\n name=\"organization\" \r\n defaultValue={organizationName}\r\n className=\"bg-background\"\r\n />\r\n </div>\r\n\r\n <div className=\"space-y-2\">\r\n <label htmlFor=\"message\" className=\"text-sm font-medium\">\r\n {t('message')}\r\n </label>\r\n <Textarea \r\n id=\"message\" \r\n name=\"message\" \r\n required \r\n rows={5}\r\n className=\"bg-background resize-none\"\r\n />\r\n </div>\r\n\r\n <Button type=\"submit\" size=\"lg\" className=\"gradient-button w-full\" disabled={isSubmitting}>\r\n {isSubmitting ? t('sending') : t('sendButton')}\r\n </Button>\r\n\r\n <p className=\"text-sm text-muted-foreground text-center pt-2\">\r\n {t('orEmail')}{' '}\r\n <a href=\"mailto:info@collabdt.org\" className=\"text-primary hover:underline\">\r\n info@collabdt.org\r\n </a>\r\n </p>\r\n </form>\r\n </Card>\r\n\r\n {/* Contact Info Card */}\r\n <div className=\"space-y-6\">\r\n <Card className=\"p-6 hover-card\">\r\n <h3 className=\"text-lg font-bold mb-3\">{t('contactInfoTitle')}</h3>\r\n <div className=\"space-y-4\">\r\n <div>\r\n <p className=\"text-sm text-muted-foreground mb-1\">{t('emailLabel')}</p>\r\n <a \r\n href=\"mailto:info@collabdt.org\" \r\n className=\"text-primary hover:underline font-medium text-sm\"\r\n >\r\n info@collabdt.org\r\n </a>\r\n </div>\r\n <div>\r\n <p className=\"text-sm text-muted-foreground mb-1\">{t('websiteLabel')}</p>\r\n <a \r\n href=\"https://collabdt.org\" \r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className=\"text-primary hover:underline font-medium text-sm\"\r\n >\r\n collabdt.org\r\n </a>\r\n </div>\r\n </div>\r\n </Card>\r\n\r\n <Card className=\"p-6 hover-card bg-primary/5 border-primary/20\">\r\n <h3 className=\"text-lg font-bold mb-3\">{t('needHelpTitle')}</h3>\r\n <p className=\"text-sm text-muted-foreground mb-4\">\r\n {t('needHelpDescription')}\r\n </p>\r\n </Card>\r\n </div>\r\n </div>\r\n </motion.div>\r\n </div>\r\n </section>\r\n \r\n </>\r\n )\r\n}\r\n"],"mappings":";AAmCI,mBAUQ,KAII,YAdZ;AA9BJ,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,OAAO,UAAU;AACjB,SAAS,gBAAgB;AAQV,SAAR,4BAA6C;AAAA,EAClD;AAAA,EACA;AAAA,EACA,eAAe;AACjB,GAAqC;AACnC,QAAM,IAAI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C,SAAI,WAAU,aACb;AAAA,qCAAC,SACC;AAAA,sCAAC,OAAE,WAAU,sCAAsC,YAAE,YAAY,GAAE;AAAA,kBACnE;AAAA,oBAAC;AAAA;AAAA,sBACC,MAAK;AAAA,sBACL,WAAU;AAAA,sBACX;AAAA;AAAA,kBAED;AAAA,mBACF;AAAA,gBACA,qBAAC,SACC;AAAA,sCAAC,OAAE,WAAU,sCAAsC,YAAE,cAAc,GAAE;AAAA,kBACrE;AAAA,oBAAC;AAAA;AAAA,sBACC,MAAK;AAAA,sBACL,QAAO;AAAA,sBACP,KAAI;AAAA,sBACJ,WAAU;AAAA,sBACX;AAAA;AAAA,kBAED;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,YAEA,qBAAC,QAAK,WAAU,iDACd;AAAA,kCAAC,QAAG,WAAU,0BAA0B,YAAE,eAAe,GAAE;AAAA,cAC3D,oBAAC,OAAE,WAAU,sCACV,YAAE,qBAAqB,GAC1B;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF,GACA,GAEF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizationConfigContent.d.ts","sourceRoot":"","sources":["../../../../../src/core/components/organizationConfig/src/organizationConfigContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organizationConfigContent.d.ts","sourceRoot":"","sources":["../../../../../src/core/components/organizationConfig/src/organizationConfigContent.tsx"],"names":[],"mappings":"AAeA,MAAM,CAAC,OAAO,UAAU,yBAAyB,gCAsQhD"}
|
|
@@ -8,7 +8,6 @@ import { Button } from "../../ui/Button";
|
|
|
8
8
|
import { Card } from "../../ui/Card";
|
|
9
9
|
import { Input } from "../../ui/Input";
|
|
10
10
|
import { Textarea } from "../../ui/Textarea";
|
|
11
|
-
import Footer from "../../ui/Footer";
|
|
12
11
|
function OrganizationConfigContent() {
|
|
13
12
|
const t = useTranslations("OrganizationConfig");
|
|
14
13
|
const router = useRouter();
|
|
@@ -54,174 +53,171 @@ function OrganizationConfigContent() {
|
|
|
54
53
|
setLoading(false);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */ jsxs(
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */ jsxs("
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Organization Name / Slug" }),
|
|
76
|
-
/* @__PURE__ */ jsx(
|
|
77
|
-
Input,
|
|
78
|
-
{
|
|
79
|
-
name: "orgName",
|
|
80
|
-
placeholder: "my-org",
|
|
81
|
-
required: true,
|
|
82
|
-
minLength: 3,
|
|
83
|
-
maxLength: 63,
|
|
84
|
-
pattern: "^[a-z0-9.-]+$"
|
|
85
|
-
}
|
|
86
|
-
),
|
|
87
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "3\u201363 characters. Lowercase letters, numbers, dots, and hyphens only." })
|
|
88
|
-
] }),
|
|
89
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
90
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Organization Title" }),
|
|
91
|
-
/* @__PURE__ */ jsx(
|
|
92
|
-
Input,
|
|
93
|
-
{
|
|
94
|
-
name: "orgTitle",
|
|
95
|
-
placeholder: "Organization Title",
|
|
96
|
-
required: true
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
] }),
|
|
100
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
101
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Organization Description" }),
|
|
102
|
-
/* @__PURE__ */ jsx(
|
|
103
|
-
Textarea,
|
|
104
|
-
{
|
|
105
|
-
name: "orgDescription",
|
|
106
|
-
placeholder: "Organization Description",
|
|
107
|
-
rows: 4,
|
|
108
|
-
required: true
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
] }),
|
|
112
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
113
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Languages" }),
|
|
114
|
-
/* @__PURE__ */ jsxs(
|
|
115
|
-
"select",
|
|
116
|
-
{
|
|
117
|
-
name: "orgLanguages",
|
|
118
|
-
multiple: true,
|
|
119
|
-
defaultValue: ["En"],
|
|
120
|
-
className: "w-full rounded-md border border-input bg-background px-3 py-2 min-h-[100px]",
|
|
121
|
-
children: [
|
|
122
|
-
/* @__PURE__ */ jsx("option", { value: "En", children: "English" }),
|
|
123
|
-
/* @__PURE__ */ jsx("option", { value: "Fr", children: "French" }),
|
|
124
|
-
/* @__PURE__ */ jsx("option", { value: "Es", children: "Spanish" })
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Hold Ctrl (Windows) / Cmd (Mac) to select multiple languages" })
|
|
129
|
-
] }),
|
|
130
|
-
/* @__PURE__ */ jsxs("div", { className: "border-t pt-6", children: [
|
|
131
|
-
/* @__PURE__ */ jsx("h4", { className: "font-semibold mb-4", children: "Administrator Account" }),
|
|
132
|
-
/* @__PURE__ */ jsxs("div", { className: "grid sm:grid-cols-2 gap-4", children: [
|
|
133
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
134
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Admin Name" }),
|
|
135
|
-
/* @__PURE__ */ jsx(
|
|
136
|
-
Input,
|
|
137
|
-
{
|
|
138
|
-
name: "adminName",
|
|
139
|
-
placeholder: "Admin Name",
|
|
140
|
-
required: true
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
] }),
|
|
144
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
145
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Admin Email" }),
|
|
146
|
-
/* @__PURE__ */ jsx(
|
|
147
|
-
Input,
|
|
148
|
-
{
|
|
149
|
-
name: "adminEmail",
|
|
150
|
-
type: "email",
|
|
151
|
-
placeholder: "admin@example.com",
|
|
152
|
-
required: true
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
] })
|
|
156
|
-
] }),
|
|
157
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-col gap-2", children: [
|
|
158
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Password" }),
|
|
159
|
-
/* @__PURE__ */ jsx(
|
|
160
|
-
Input,
|
|
161
|
-
{
|
|
162
|
-
name: "adminPassword",
|
|
163
|
-
type: "password",
|
|
164
|
-
placeholder: "Password",
|
|
165
|
-
minLength: 8,
|
|
166
|
-
required: true
|
|
167
|
-
}
|
|
168
|
-
)
|
|
169
|
-
] })
|
|
170
|
-
] }),
|
|
171
|
-
error && /* @__PURE__ */ jsx("div", { className: "rounded-md border border-red-500/20 bg-red-500/10 p-4 text-sm text-red-500", children: error }),
|
|
56
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("section", { className: "min-h-screen py-32 relative flex items-center z-10", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-6", children: /* @__PURE__ */ jsxs(
|
|
57
|
+
motion.div,
|
|
58
|
+
{
|
|
59
|
+
initial: { opacity: 0, y: 30 },
|
|
60
|
+
animate: { opacity: 1, y: 0 },
|
|
61
|
+
className: "max-w-5xl mx-auto",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center mb-16 space-y-6", children: [
|
|
64
|
+
/* @__PURE__ */ jsx("h1", { className: "text-4xl md:text-5xl font-bold", children: t("title") }),
|
|
65
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg text-muted-foreground max-w-3xl mx-auto", children: t("description") })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { className: "grid lg:grid-cols-3 gap-8", children: [
|
|
68
|
+
/* @__PURE__ */ jsxs(Card, { className: "lg:col-span-2 p-8", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold mb-6", children: t("setupTitle") }),
|
|
70
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-8", children: t("setupDescription") }),
|
|
71
|
+
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Organization Name" }),
|
|
172
74
|
/* @__PURE__ */ jsx(
|
|
173
|
-
|
|
75
|
+
Input,
|
|
174
76
|
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
77
|
+
name: "orgName",
|
|
78
|
+
placeholder: "my-org",
|
|
79
|
+
required: true,
|
|
80
|
+
minLength: 3,
|
|
81
|
+
maxLength: 63,
|
|
82
|
+
pattern: "^[a-z0-9.-]+$"
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "3\u201363 characters. Lowercase letters, numbers, dots, and hyphens only." })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
88
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Organization Title" }),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
Input,
|
|
91
|
+
{
|
|
92
|
+
name: "orgTitle",
|
|
93
|
+
placeholder: "Organization Title",
|
|
94
|
+
required: true
|
|
180
95
|
}
|
|
181
96
|
)
|
|
182
|
-
] })
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
99
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Organization Description" }),
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
Textarea,
|
|
102
|
+
{
|
|
103
|
+
name: "orgDescription",
|
|
104
|
+
placeholder: "Organization Description",
|
|
105
|
+
rows: 4,
|
|
106
|
+
required: true
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
111
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Languages" }),
|
|
112
|
+
/* @__PURE__ */ jsxs(
|
|
113
|
+
"select",
|
|
114
|
+
{
|
|
115
|
+
name: "orgLanguages",
|
|
116
|
+
multiple: true,
|
|
117
|
+
defaultValue: ["En"],
|
|
118
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 min-h-[100px]",
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ jsx("option", { value: "En", children: "English" }),
|
|
121
|
+
/* @__PURE__ */ jsx("option", { value: "Fr", children: "French" }),
|
|
122
|
+
/* @__PURE__ */ jsx("option", { value: "Es", children: "Spanish" })
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Hold Ctrl (Windows) / Cmd (Mac) to select multiple languages" })
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ jsxs("div", { className: "border-t pt-6", children: [
|
|
129
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold mb-4", children: "Administrator Account" }),
|
|
130
|
+
/* @__PURE__ */ jsxs("div", { className: "grid sm:grid-cols-2 gap-4", children: [
|
|
131
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
132
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Admin Name" }),
|
|
190
133
|
/* @__PURE__ */ jsx(
|
|
191
|
-
|
|
134
|
+
Input,
|
|
192
135
|
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
136
|
+
name: "adminName",
|
|
137
|
+
placeholder: "Admin Name",
|
|
138
|
+
required: true
|
|
196
139
|
}
|
|
197
140
|
)
|
|
198
141
|
] }),
|
|
199
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
200
|
-
/* @__PURE__ */ jsx("
|
|
142
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
143
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Admin Email" }),
|
|
201
144
|
/* @__PURE__ */ jsx(
|
|
202
|
-
|
|
145
|
+
Input,
|
|
203
146
|
{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
children: "collabdt.org"
|
|
147
|
+
name: "adminEmail",
|
|
148
|
+
type: "email",
|
|
149
|
+
placeholder: "admin@example.com",
|
|
150
|
+
required: true
|
|
209
151
|
}
|
|
210
152
|
)
|
|
211
153
|
] })
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-col gap-2", children: [
|
|
156
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Password" }),
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
Input,
|
|
159
|
+
{
|
|
160
|
+
name: "adminPassword",
|
|
161
|
+
type: "password",
|
|
162
|
+
placeholder: "Password",
|
|
163
|
+
minLength: 8,
|
|
164
|
+
required: true
|
|
165
|
+
}
|
|
166
|
+
)
|
|
212
167
|
] })
|
|
213
168
|
] }),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
|
|
216
|
-
|
|
169
|
+
error && /* @__PURE__ */ jsx("div", { className: "rounded-md border border-red-500/20 bg-red-500/10 p-4 text-sm text-red-500", children: error }),
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
Button,
|
|
172
|
+
{
|
|
173
|
+
type: "submit",
|
|
174
|
+
size: "lg",
|
|
175
|
+
className: "gradient-button w-full",
|
|
176
|
+
disabled: loading,
|
|
177
|
+
children: loading ? "Initializing Instance..." : "Initialize Instance"
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
] })
|
|
181
|
+
] }),
|
|
182
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
183
|
+
/* @__PURE__ */ jsxs(Card, { className: "p-6 hover-card", children: [
|
|
184
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-bold mb-3", children: t("contactInfoTitle") }),
|
|
185
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
186
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
187
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-1", children: t("emailLabel") }),
|
|
188
|
+
/* @__PURE__ */ jsx(
|
|
189
|
+
"a",
|
|
190
|
+
{
|
|
191
|
+
href: "mailto:info@collabdt.org",
|
|
192
|
+
className: "text-primary hover:underline font-medium text-sm",
|
|
193
|
+
children: "info@collabdt.org"
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
198
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-1", children: t("websiteLabel") }),
|
|
199
|
+
/* @__PURE__ */ jsx(
|
|
200
|
+
"a",
|
|
201
|
+
{
|
|
202
|
+
href: "https://collabdt.org",
|
|
203
|
+
target: "_blank",
|
|
204
|
+
rel: "noopener noreferrer",
|
|
205
|
+
className: "text-primary hover:underline font-medium text-sm",
|
|
206
|
+
children: "collabdt.org"
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
] })
|
|
217
210
|
] })
|
|
211
|
+
] }),
|
|
212
|
+
/* @__PURE__ */ jsxs(Card, { className: "p-6 hover-card bg-primary/5 border-primary/20", children: [
|
|
213
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-bold mb-3", children: t("needHelpTitle") }),
|
|
214
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4", children: t("needHelpDescription") })
|
|
218
215
|
] })
|
|
219
216
|
] })
|
|
220
|
-
]
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
] });
|
|
217
|
+
] })
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
) }) }) });
|
|
225
221
|
}
|
|
226
222
|
export {
|
|
227
223
|
OrganizationConfigContent as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/core/components/organizationConfig/src/organizationConfigContent.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { motion } from 'framer-motion'\r\nimport { useState } from 'react'\r\nimport { useRouter } from 'next/navigation'\r\nimport { useTranslations } from 'next-intl'\r\n\r\nimport { Button } from '../../ui/Button'\r\nimport { Card } from '../../ui/Card'\r\nimport { Input } from '../../ui/Input'\r\nimport { Textarea } from '../../ui/Textarea'\r\nimport Footer from '../../ui/Footer'\r\n\r\nexport default function OrganizationConfigContent() {\r\n const t = useTranslations('OrganizationConfig')\r\n const router = useRouter()\r\n\r\n const [error, setError] = useState<string | null>(null)\r\n const [loading, setLoading] = useState(false)\r\n\r\n function validateOrgName(name: string) {\r\n const regex = /^[a-z0-9.-]{3,63}$/\r\n return regex.test(name)\r\n }\r\n\r\n async function handleSubmit(\r\n e: React.FormEvent<HTMLFormElement>\r\n ) {\r\n e.preventDefault()\r\n\r\n setError(null)\r\n setLoading(true)\r\n \r\n \r\n const formData = new FormData(e.currentTarget)\r\n \r\n const orgLanguages = formData\r\n .getAll('orgLanguages')\r\n .map(String)\r\n\r\n const data = {\r\n orgName: formData.get('orgName'),\r\n orgTitle: formData.get('orgTitle'),\r\n orgDescription: formData.get('orgDescription'),\r\n orgLanguages,\r\n adminName: formData.get('adminName'),\r\n adminEmail: formData.get('adminEmail'),\r\n adminPassword: formData.get('adminPassword'),\r\n }\r\n\r\n try {\r\n const res = await fetch('/api/setup', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n },\r\n body: JSON.stringify(data),\r\n })\r\n\r\n const json = await res.json()\r\n\r\n if (res.ok && json.success) {\r\n router.push(`/${data.orgName}/auth/signin`)\r\n return\r\n }\r\n\r\n setError(json.error ?? 'Failed to initialize instance.')\r\n } catch {\r\n setError('Network error. Please try again.')\r\n } finally {\r\n setLoading(false)\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n <section className=\"min-h-screen py-32 relative flex items-center z-10\">\r\n <div className=\"container mx-auto px-6\">\r\n <motion.div\r\n initial={{ opacity: 0, y: 30 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n className=\"max-w-5xl mx-auto\"\r\n >\r\n <div className=\"text-center mb-16 space-y-6\">\r\n <h1 className=\"text-4xl md:text-5xl font-bold\">\r\n {t('title')}\r\n </h1>\r\n\r\n <p className=\"text-lg text-muted-foreground max-w-3xl mx-auto\">\r\n {t('description')}\r\n </p>\r\n </div>\r\n\r\n <div className=\"grid lg:grid-cols-3 gap-8\">\r\n <Card className=\"lg:col-span-2 p-8\">\r\n <h3 className=\"text-2xl font-bold mb-6\">\r\n {t('setupTitle')}\r\n </h3>\r\n\r\n <p className=\"text-muted-foreground mb-8\">\r\n {t('setupDescription')}\r\n </p>\r\n\r\n <form onSubmit={handleSubmit} className=\"space-y-6\">\r\n\r\n {/* Org Name */}\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Organization Name / Slug\r\n </label>\r\n <Input\r\n name=\"orgName\"\r\n placeholder=\"my-org\"\r\n required\r\n minLength={3}\r\n maxLength={63}\r\n pattern=\"^[a-z0-9.-]+$\"\r\n />\r\n <p className=\"text-xs text-muted-foreground\">\r\n 3–63 characters. Lowercase letters, numbers, dots, and hyphens only.\r\n </p>\r\n </div>\r\n\r\n {/* Org Title */}\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Organization Title\r\n </label>\r\n <Input\r\n name=\"orgTitle\"\r\n placeholder=\"Organization Title\"\r\n required\r\n />\r\n </div>\r\n\r\n {/* Org Description */}\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Organization Description\r\n </label>\r\n <Textarea\r\n name=\"orgDescription\"\r\n placeholder=\"Organization Description\"\r\n rows={4}\r\n required\r\n />\r\n </div>\r\n\r\n {/* Languages */}\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Languages\r\n </label>\r\n\r\n <select\r\n name=\"orgLanguages\"\r\n multiple\r\n defaultValue={['En']}\r\n className=\"w-full rounded-md border border-input bg-background px-3 py-2 min-h-[100px]\"\r\n >\r\n <option value=\"En\">English</option>\r\n <option value=\"Fr\">French</option>\r\n <option value=\"Es\">Spanish</option>\r\n </select>\r\n\r\n <p className=\"text-xs text-muted-foreground\">\r\n Hold Ctrl (Windows) / Cmd (Mac) to select multiple languages\r\n </p>\r\n </div>\r\n\r\n {/* Admin Section */}\r\n <div className=\"border-t pt-6\">\r\n <h4 className=\"font-semibold mb-4\">\r\n Administrator Account\r\n </h4>\r\n\r\n <div className=\"grid sm:grid-cols-2 gap-4\">\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Admin Name\r\n </label>\r\n <Input\r\n name=\"adminName\"\r\n placeholder=\"Admin Name\"\r\n required\r\n />\r\n </div>\r\n\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Admin Email\r\n </label>\r\n <Input\r\n name=\"adminEmail\"\r\n type=\"email\"\r\n placeholder=\"admin@example.com\"\r\n required\r\n />\r\n </div>\r\n </div>\r\n\r\n <div className=\"mt-4 flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Password\r\n </label>\r\n <Input\r\n name=\"adminPassword\"\r\n type=\"password\"\r\n placeholder=\"Password\"\r\n minLength={8}\r\n required\r\n />\r\n </div>\r\n </div>\r\n\r\n {/* Error */}\r\n {error && (\r\n <div className=\"rounded-md border border-red-500/20 bg-red-500/10 p-4 text-sm text-red-500\">\r\n {error}\r\n </div>\r\n )}\r\n\r\n <Button\r\n type=\"submit\"\r\n size=\"lg\"\r\n className=\"gradient-button w-full\"\r\n disabled={loading}\r\n >\r\n {loading ? 'Initializing Instance...' : 'Initialize Instance'}\r\n </Button>\r\n </form>\r\n </Card>\r\n\r\n <div className=\"space-y-6\">\r\n <Card className=\"p-6 hover-card\">\r\n <h3 className=\"text-lg font-bold mb-3\">\r\n {t('contactInfoTitle')}\r\n </h3>\r\n\r\n <div className=\"space-y-4\">\r\n <div>\r\n <p className=\"text-sm text-muted-foreground mb-1\">\r\n {t('emailLabel')}\r\n </p>\r\n\r\n <a\r\n href=\"mailto:info@collabdt.org\"\r\n className=\"text-primary hover:underline font-medium text-sm\"\r\n >\r\n info@collabdt.org\r\n </a>\r\n </div>\r\n\r\n <div>\r\n <p className=\"text-sm text-muted-foreground mb-1\">\r\n {t('websiteLabel')}\r\n </p>\r\n\r\n <a\r\n href=\"https://collabdt.org\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className=\"text-primary hover:underline font-medium text-sm\"\r\n >\r\n collabdt.org\r\n </a>\r\n </div>\r\n </div>\r\n </Card>\r\n\r\n <Card className=\"p-6 hover-card bg-primary/5 border-primary/20\">\r\n <h3 className=\"text-lg font-bold mb-3\">\r\n {t('needHelpTitle')}\r\n </h3>\r\n\r\n <p className=\"text-sm text-muted-foreground\">\r\n {t('needHelpDescription')}\r\n </p>\r\n </Card>\r\n </div>\r\n </div>\r\n </motion.div>\r\n </div>\r\n </section>\r\n\r\n <Footer />\r\n </>\r\n )\r\n}"],"mappings":";AA8EI,mBASU,KADF,YARR;AAzEJ,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAEhC,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,OAAO,YAAY;AAEJ,SAAR,4BAA6C;AAClD,QAAM,IAAI,gBAAgB,oBAAoB;AAC9C,QAAM,SAAS,UAAU;AAEzB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AACtD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAE5C,WAAS,gBAAgB,MAAc;AACvC,UAAM,QAAQ;AACd,WAAO,MAAM,KAAK,IAAI;AAAA,EACtB;AAEA,iBAAe,aACb,GACA;AA9BJ;AA+BI,MAAE,eAAe;AAEjB,aAAS,IAAI;AACb,eAAW,IAAI;AAGf,UAAM,WAAW,IAAI,SAAS,EAAE,aAAa;AAE7C,UAAM,eAAe,SAClB,OAAO,cAAc,EACrB,IAAI,MAAM;AAEb,UAAM,OAAO;AAAA,MACX,SAAS,SAAS,IAAI,SAAS;AAAA,MAC/B,UAAU,SAAS,IAAI,UAAU;AAAA,MACjC,gBAAgB,SAAS,IAAI,gBAAgB;AAAA,MAC7C;AAAA,MACA,WAAW,SAAS,IAAI,WAAW;AAAA,MACnC,YAAY,SAAS,IAAI,YAAY;AAAA,MACrC,eAAe,SAAS,IAAI,eAAe;AAAA,IAC7C;AAEA,QAAI;AACF,YAAM,MAAM,MAAM,MAAM,cAAc;AAAA,QACpC,QAAQ;AAAA,QACR,SAAS;AAAA,UACP,gBAAgB;AAA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AAC,QAAK,WAAU,iDACd;AAAA,oCAAC,QAAG,WAAU,0BACX,YAAE,eAAe,GACpB;AAAA,gBAEA,oBAAC,OAAE,WAAU,iCACV,YAAE,qBAAqB,GAC1B;AAAA,iBACF;AAAA,eACF;AAAA,aACA;AAAA;AAAA;AAAA,IACF,GACF,GACF;AAAA,IAEA,oBAAC,UAAO;AAAA,KACV;AAEJ;","names":["e"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/core/components/organizationConfig/src/organizationConfigContent.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { motion } from 'framer-motion'\r\nimport { useState } from 'react'\r\nimport { useRouter } from 'next/navigation'\r\nimport { useTranslations } from 'next-intl'\r\n\r\nimport { Button } from '../../ui/Button'\r\nimport { Card } from '../../ui/Card'\r\nimport { Input } from '../../ui/Input'\r\nimport { Textarea } from '../../ui/Textarea'\r\n\r\nexport default function OrganizationConfigContent() {\r\n const t = useTranslations('OrganizationConfig')\r\n const router = useRouter()\r\n\r\n const [error, setError] = useState<string | null>(null)\r\n const [loading, setLoading] = useState(false)\r\n\r\n function validateOrgName(name: string) {\r\n const regex = /^[a-z0-9.-]{3,63}$/\r\n return regex.test(name)\r\n }\r\n\r\n async function handleSubmit(\r\n e: React.FormEvent<HTMLFormElement>\r\n ) {\r\n e.preventDefault()\r\n\r\n setError(null)\r\n setLoading(true)\r\n \r\n \r\n const formData = new FormData(e.currentTarget)\r\n \r\n const orgLanguages = formData\r\n .getAll('orgLanguages')\r\n .map(String)\r\n\r\n const data = {\r\n orgName: formData.get('orgName'),\r\n orgTitle: formData.get('orgTitle'),\r\n orgDescription: formData.get('orgDescription'),\r\n orgLanguages,\r\n adminName: formData.get('adminName'),\r\n adminEmail: formData.get('adminEmail'),\r\n adminPassword: formData.get('adminPassword'),\r\n }\r\n\r\n try {\r\n const res = await fetch('/api/setup', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n },\r\n body: JSON.stringify(data),\r\n })\r\n\r\n const json = await res.json()\r\n\r\n if (res.ok && json.success) {\r\n router.push(`/${data.orgName}/auth/signin`)\r\n return\r\n }\r\n\r\n setError(json.error ?? 'Failed to initialize instance.')\r\n } catch {\r\n setError('Network error. Please try again.')\r\n } finally {\r\n setLoading(false)\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n <section className=\"min-h-screen py-32 relative flex items-center z-10\">\r\n <div className=\"container mx-auto px-6\">\r\n <motion.div\r\n initial={{ opacity: 0, y: 30 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n className=\"max-w-5xl mx-auto\"\r\n >\r\n <div className=\"text-center mb-16 space-y-6\">\r\n <h1 className=\"text-4xl md:text-5xl font-bold\">\r\n {t('title')}\r\n </h1>\r\n\r\n <p className=\"text-lg text-muted-foreground max-w-3xl mx-auto\">\r\n {t('description')}\r\n </p>\r\n </div>\r\n\r\n <div className=\"grid lg:grid-cols-3 gap-8\">\r\n <Card className=\"lg:col-span-2 p-8\">\r\n <h3 className=\"text-2xl font-bold mb-6\">\r\n {t('setupTitle')}\r\n </h3>\r\n\r\n <p className=\"text-muted-foreground mb-8\">\r\n {t('setupDescription')}\r\n </p>\r\n\r\n <form onSubmit={handleSubmit} className=\"space-y-6\">\r\n\r\n {/* Org Name */}\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Organization Name \r\n </label>\r\n <Input\r\n name=\"orgName\"\r\n placeholder=\"my-org\"\r\n required\r\n minLength={3}\r\n maxLength={63}\r\n pattern=\"^[a-z0-9.-]+$\"\r\n />\r\n <p className=\"text-xs text-muted-foreground\">\r\n 3–63 characters. Lowercase letters, numbers, dots, and hyphens only.\r\n </p>\r\n </div>\r\n\r\n {/* Org Title */}\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Organization Title\r\n </label>\r\n <Input\r\n name=\"orgTitle\"\r\n placeholder=\"Organization Title\"\r\n required\r\n />\r\n </div>\r\n\r\n {/* Org Description */}\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Organization Description\r\n </label>\r\n <Textarea\r\n name=\"orgDescription\"\r\n placeholder=\"Organization Description\"\r\n rows={4}\r\n required\r\n />\r\n </div>\r\n\r\n {/* Languages */}\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Languages\r\n </label>\r\n\r\n <select\r\n name=\"orgLanguages\"\r\n multiple\r\n defaultValue={['En']}\r\n className=\"w-full rounded-md border border-input bg-background px-3 py-2 min-h-[100px]\"\r\n >\r\n <option value=\"En\">English</option>\r\n <option value=\"Fr\">French</option>\r\n <option value=\"Es\">Spanish</option>\r\n </select>\r\n\r\n <p className=\"text-xs text-muted-foreground\">\r\n Hold Ctrl (Windows) / Cmd (Mac) to select multiple languages\r\n </p>\r\n </div>\r\n\r\n {/* Admin Section */}\r\n <div className=\"border-t pt-6\">\r\n <h4 className=\"font-semibold mb-4\">\r\n Administrator Account\r\n </h4>\r\n\r\n <div className=\"grid sm:grid-cols-2 gap-4\">\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Admin Name\r\n </label>\r\n <Input\r\n name=\"adminName\"\r\n placeholder=\"Admin Name\"\r\n required\r\n />\r\n </div>\r\n\r\n <div className=\"flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Admin Email\r\n </label>\r\n <Input\r\n name=\"adminEmail\"\r\n type=\"email\"\r\n placeholder=\"admin@example.com\"\r\n required\r\n />\r\n </div>\r\n </div>\r\n\r\n <div className=\"mt-4 flex flex-col gap-2\">\r\n <label className=\"text-sm font-medium\">\r\n Password\r\n </label>\r\n <Input\r\n name=\"adminPassword\"\r\n type=\"password\"\r\n placeholder=\"Password\"\r\n minLength={8}\r\n required\r\n />\r\n </div>\r\n </div>\r\n\r\n {/* Error */}\r\n {error && (\r\n <div className=\"rounded-md border border-red-500/20 bg-red-500/10 p-4 text-sm text-red-500\">\r\n {error}\r\n </div>\r\n )}\r\n\r\n <Button\r\n type=\"submit\"\r\n size=\"lg\"\r\n className=\"gradient-button w-full\"\r\n disabled={loading}\r\n >\r\n {loading ? 'Initializing Instance...' : 'Initialize Instance'}\r\n </Button>\r\n </form>\r\n </Card>\r\n {/* Contact Info Card */}\r\n <div className=\"space-y-6\">\r\n <Card className=\"p-6 hover-card\">\r\n <h3 className=\"text-lg font-bold mb-3\">{t('contactInfoTitle')}</h3>\r\n <div className=\"space-y-4\">\r\n <div>\r\n <p className=\"text-sm text-muted-foreground mb-1\">{t('emailLabel')}</p>\r\n <a \r\n href=\"mailto:info@collabdt.org\" \r\n className=\"text-primary hover:underline font-medium text-sm\"\r\n >\r\n info@collabdt.org\r\n </a>\r\n </div>\r\n <div>\r\n <p className=\"text-sm text-muted-foreground mb-1\">{t('websiteLabel')}</p>\r\n <a \r\n href=\"https://collabdt.org\" \r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className=\"text-primary hover:underline font-medium text-sm\"\r\n >\r\n collabdt.org\r\n </a>\r\n </div>\r\n </div>\r\n </Card>\r\n\r\n <Card className=\"p-6 hover-card bg-primary/5 border-primary/20\">\r\n <h3 className=\"text-lg font-bold mb-3\">{t('needHelpTitle')}</h3>\r\n <p className=\"text-sm text-muted-foreground mb-4\">\r\n {t('needHelpDescription')}\r\n </p>\r\n </Card>\r\n </div>\r\n </div>\r\n </motion.div>\r\n </div>\r\n </section>\r\n\r\n \r\n </>\r\n )\r\n}"],"mappings":";AA6EI,mBASU,KADF,YARR;AAxEJ,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAEhC,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AAEV,SAAR,4BAA6C;AAClD,QAAM,IAAI,gBAAgB,oBAAoB;AAC9C,QAAM,SAAS,U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,kBACC,MAAK;AAAA,kBACL,MAAK;AAAA,kBACL,WAAU;AAAA,kBACV,UAAU;AAAA,kBAET,oBAAU,6BAA6B;AAAA;AAAA,cAC1C;AAAA,eACF;AAAA,aACA;AAAA,UAEE,qBAAC,SAAI,WAAU,aACb;AAAA,iCAAC,QAAK,WAAU,kBACd;AAAA,kCAAC,QAAG,WAAU,0BAA0B,YAAE,kBAAkB,GAAE;AAAA,cAC9D,qBAAC,SAAI,WAAU,aACb;AAAA,qCAAC,SACC;AAAA,sCAAC,OAAE,WAAU,sCAAsC,YAAE,YAAY,GAAE;AAAA,kBACnE;AAAA,oBAAC;AAAA;AAAA,sBACC,MAAK;AAAA,sBACL,WAAU;AAAA,sBACX;AAAA;AAAA,kBAED;AAAA,mBACF;AAAA,gBACA,qBAAC,SACC;AAAA,sCAAC,OAAE,WAAU,sCAAsC,YAAE,cAAc,GAAE;AAAA,kBACrE;AAAA,oBAAC;AAAA;AAAA,sBACC,MAAK;AAAA,sBACL,QAAO;AAAA,sBACP,KAAI;AAAA,sBACJ,WAAU;AAAA,sBACX;AAAA;AAAA,kBAED;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,YAEA,qBAAC,QAAK,WAAU,iDACd;AAAA,kCAAC,QAAG,WAAU,0BAA0B,YAAE,eAAe,GAAE;AAAA,cAC3D,oBAAC,OAAE,WAAU,sCACV,YAAE,qBAAqB,GAC1B;AAAA,eACF;AAAA,aACF;AAAA,WACJ;AAAA;AAAA;AAAA,EACF,GACF,GACF,GAGF;AAEJ;","names":["e"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare function BugReportDialog({ open, onOpenChange, onCaptureScreenshot, }: {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (v: boolean) => void;
|
|
5
|
+
onCaptureScreenshot?: () => Promise<string | null>;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=BugReportDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BugReportDialog.d.ts","sourceRoot":"","sources":["../../../../src/core/components/support/BugReportDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,YAAY,EACZ,mBAAmB,GACpB,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACpD,qBAwGA"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogTitle
|
|
10
|
+
} from "../ui/Dialog";
|
|
11
|
+
import { Button } from "../ui/Button";
|
|
12
|
+
import { Textarea } from "../ui/Textarea";
|
|
13
|
+
import { Input } from "../ui/Input";
|
|
14
|
+
import * as LR from "lucide-react";
|
|
15
|
+
function BugReportDialog({
|
|
16
|
+
open,
|
|
17
|
+
onOpenChange,
|
|
18
|
+
onCaptureScreenshot
|
|
19
|
+
}) {
|
|
20
|
+
const t = useTranslations("supportDialog");
|
|
21
|
+
const [title, setTitle] = React.useState("");
|
|
22
|
+
const [description, setDescription] = React.useState("");
|
|
23
|
+
const [repro, setRepro] = React.useState("");
|
|
24
|
+
const [screenshot, setScreenshot] = React.useState(null);
|
|
25
|
+
const reset = () => {
|
|
26
|
+
setTitle("");
|
|
27
|
+
setDescription("");
|
|
28
|
+
setRepro("");
|
|
29
|
+
setScreenshot(null);
|
|
30
|
+
};
|
|
31
|
+
const capture = async () => {
|
|
32
|
+
if (!onCaptureScreenshot) return;
|
|
33
|
+
const img = await onCaptureScreenshot();
|
|
34
|
+
setScreenshot(img);
|
|
35
|
+
};
|
|
36
|
+
const submit = async () => {
|
|
37
|
+
await fetch("/api/github-issue", {
|
|
38
|
+
method: "POST",
|
|
39
|
+
headers: { "Content-Type": "application/json" },
|
|
40
|
+
body: JSON.stringify({
|
|
41
|
+
title,
|
|
42
|
+
description,
|
|
43
|
+
type: "bug",
|
|
44
|
+
labels: ["bug"],
|
|
45
|
+
meta: {
|
|
46
|
+
url: window.location.href,
|
|
47
|
+
userAgent: navigator.userAgent,
|
|
48
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
49
|
+
viewer: "Map"
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
reset();
|
|
54
|
+
onOpenChange(false);
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
Dialog,
|
|
58
|
+
{
|
|
59
|
+
open,
|
|
60
|
+
onOpenChange: (v) => {
|
|
61
|
+
onOpenChange(v);
|
|
62
|
+
if (!v) reset();
|
|
63
|
+
},
|
|
64
|
+
children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[520px]", children: [
|
|
65
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(DialogTitle, { className: "flex items-center gap-2", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(LR.Bug, { className: "h-5 w-5" }),
|
|
67
|
+
t("bugTitle")
|
|
68
|
+
] }) }),
|
|
69
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
Input,
|
|
72
|
+
{
|
|
73
|
+
placeholder: t("bugTitle"),
|
|
74
|
+
value: title,
|
|
75
|
+
onChange: (e) => setTitle(e.target.value)
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
Textarea,
|
|
80
|
+
{
|
|
81
|
+
placeholder: t("descriptionPlaceholder"),
|
|
82
|
+
value: description,
|
|
83
|
+
onChange: (e) => setDescription(e.target.value)
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ jsx(
|
|
87
|
+
Textarea,
|
|
88
|
+
{
|
|
89
|
+
placeholder: t("reproPlaceholder"),
|
|
90
|
+
value: repro,
|
|
91
|
+
onChange: (e) => setRepro(e.target.value)
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
95
|
+
/* @__PURE__ */ jsx(Button, { onClick: capture, variant: "secondary", children: t("captureScreenshot") }),
|
|
96
|
+
screenshot && /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: t("screenshotAttached") })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
Button,
|
|
101
|
+
{
|
|
102
|
+
variant: "secondary",
|
|
103
|
+
onClick: () => onOpenChange(false),
|
|
104
|
+
children: t("cancel")
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ jsx(Button, { onClick: submit, children: t("submit") })
|
|
108
|
+
] })
|
|
109
|
+
] })
|
|
110
|
+
] })
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
BugReportDialog
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=BugReportDialog.js.map
|