fix: 🐛 resolve linters errors
This commit is contained in:
parent
365d57b4f8
commit
61e976e2da
83 changed files with 957 additions and 3039 deletions
|
|
@ -1,3 +1,2 @@
|
|||
#!/bin/sh
|
||||
|
||||
npx --no -- commitlint --config node_modules/@uwil/husky-config/commitlint.config.cjs --edit $1
|
||||
npx commitlint --config node_modules/@uwil/husky-config/commitlint.config.js --edit $1
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
"extends": [
|
||||
"stylelint-config-standard-scss",
|
||||
"stylelint-config-sass-guidelines",
|
||||
"stylelint-config-idiomatic-order"
|
||||
"stylelint-config-standard-scss"
|
||||
],
|
||||
"plugins": [
|
||||
"stylelint-scss",
|
||||
"stylelint-order"
|
||||
],
|
||||
"plugins": ["stylelint-scss"],
|
||||
"files": ["**/*.css", "**/*.scss"],
|
||||
"ignoreFiles": [
|
||||
"**/vendor/*.css",
|
||||
|
|
@ -48,7 +49,10 @@
|
|||
"variants",
|
||||
"responsive",
|
||||
"screen",
|
||||
"layer"
|
||||
"layer",
|
||||
"plugin",
|
||||
"theme",
|
||||
"custom-variant"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
module.exports = require('@uwil/husky-config/commitlint.config.cjs');
|
||||
1
commitlint.config.js
Normal file
1
commitlint.config.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
export default { extends: ["@uwil/husky-config/commitlint.config.js"] };
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
import eslintReact from "@eslint-react/eslint-plugin";
|
||||
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
||||
import importX from "eslint-plugin-import-x";
|
||||
import jsxA11y from "eslint-plugin-jsx-a11y";
|
||||
import prettier from "eslint-plugin-prettier/recommended";
|
||||
import react from "eslint-plugin-react";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
import globals from "globals";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
|
@ -40,14 +39,10 @@ export default tseslint.config(
|
|||
},
|
||||
},
|
||||
{
|
||||
...react.configs.flat.recommended,
|
||||
...react.configs.flat["jsx-runtime"],
|
||||
settings: {
|
||||
react: { version: "19.0" },
|
||||
},
|
||||
rules: {
|
||||
...react.configs.flat.recommended.rules,
|
||||
...react.configs.flat["jsx-runtime"].rules,
|
||||
"react/jsx-filename-extension": "off",
|
||||
"react/prop-types": "off",
|
||||
"react/require-default-props": "off",
|
||||
|
|
@ -55,11 +50,10 @@ export default tseslint.config(
|
|||
},
|
||||
reactHooks.configs.flat.recommended,
|
||||
{
|
||||
plugins: { "jsx-a11y": jsxA11y },
|
||||
rules: { ...jsxA11y.configs.recommended.rules },
|
||||
},
|
||||
{
|
||||
plugins: { "import-x": importX },
|
||||
plugins: {
|
||||
"import-x": importX,
|
||||
"@eslint-react": eslintReact,
|
||||
},
|
||||
settings: {
|
||||
"import-x/resolver-next": [
|
||||
createTypeScriptImportResolver({
|
||||
|
|
@ -68,6 +62,7 @@ export default tseslint.config(
|
|||
],
|
||||
},
|
||||
rules: {
|
||||
...eslintReact.configs.recommended.rules,
|
||||
...importX.configs.recommended.rules,
|
||||
...importX.configs.typescript.rules,
|
||||
"import-x/extensions": [
|
||||
|
|
|
|||
3535
package-lock.json
generated
3535
package-lock.json
generated
File diff suppressed because it is too large
Load diff
22
package.json
22
package.json
|
|
@ -13,6 +13,7 @@
|
|||
"stylelint-ci": "node ./node_modules/.bin/stylelint --config './.stylelintrc.json' --max-warnings 0 'resources/sass/**/*.scss' -f json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint-react/eslint-plugin": "^5.13.1",
|
||||
"@headlessui/react": "^2.2.10",
|
||||
"@radix-ui/react-accordion": "^1.2.16",
|
||||
"@radix-ui/react-checkbox": "^1.3.7",
|
||||
|
|
@ -38,18 +39,15 @@
|
|||
"@types/react-color": "^3.0.13",
|
||||
"@typescript-eslint/eslint-plugin": "^8.63.0",
|
||||
"@typescript-eslint/parser": "^8.63.0",
|
||||
"@uwil/husky-config": "^1.1.0",
|
||||
"@uwil/husky-config": "file:packages/uwil-husky-config",
|
||||
"@vitejs/plugin-react": "^6.0.3",
|
||||
"autoprefixer": "^10.5.2",
|
||||
"concurrently": "^9.2.3",
|
||||
"eslint": "^10.6.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.5",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-import-x": "^4.17.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-prettier": "^5.5.6",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"flag-icons": "^7.5.0",
|
||||
"pluralize": "^8.0.0",
|
||||
|
|
@ -57,18 +55,17 @@
|
|||
"react": "^19.2.7",
|
||||
"react-day-picker": "^9.14.0",
|
||||
"react-dom": "^19.2.7",
|
||||
"rollup-plugin-copy": "^3.5.0",
|
||||
"sass-embedded": "^1.100.0",
|
||||
"stylelint": "^17.14.0",
|
||||
"stylelint-config-idiomatic-order": "github:ream88/stylelint-config-idiomatic-order",
|
||||
"stylelint-config-sass-guidelines": "^13.0.0",
|
||||
"stylelint-config-standard-scss": "^17.0.0",
|
||||
"stylelint-order": "^8.1.1",
|
||||
"stylelint-scss": "^7.2.0",
|
||||
"tailwindcss": "^4.3.2",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"typescript-eslint": "^8.63.0",
|
||||
"vite": "^8.1.3",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vite-plugin-static-copy": "^4.1.1",
|
||||
"vite-plugin-stylelint": "^6.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -127,17 +124,6 @@
|
|||
"zod": "^4.4.3",
|
||||
"zustand": "^5.0.14"
|
||||
},
|
||||
"overrides": {
|
||||
"eslint-plugin-jsx-a11y": {
|
||||
"eslint": "^10.4.1"
|
||||
},
|
||||
"eslint-plugin-react": {
|
||||
"eslint": "^10.4.1"
|
||||
},
|
||||
"eslint-plugin-import": {
|
||||
"eslint": "^10.4.1"
|
||||
}
|
||||
},
|
||||
"trustedDependencies": [
|
||||
"@uwil/husky-config"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@
|
|||
|
||||
@theme inline {
|
||||
--font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
|
||||
|
||||
--color-background: hsl(var(--background));
|
||||
--color-foreground: hsl(var(--foreground));
|
||||
--color-muted: hsl(var(--muted));
|
||||
|
|
@ -118,13 +117,11 @@
|
|||
--color-preventive: hsl(var(--preventive));
|
||||
--color-preventive-foreground: hsl(var(--preventive-foreground));
|
||||
--color-ring: hsl(var(--ring));
|
||||
|
||||
--color-chart-1: hsl(var(--chart-1));
|
||||
--color-chart-2: hsl(var(--chart-2));
|
||||
--color-chart-3: hsl(var(--chart-3));
|
||||
--color-chart-4: hsl(var(--chart-4));
|
||||
--color-chart-5: hsl(var(--chart-5));
|
||||
|
||||
--color-sidebar: hsl(var(--sidebar-background));
|
||||
--color-sidebar-foreground: hsl(var(--sidebar-foreground));
|
||||
--color-sidebar-primary: hsl(var(--sidebar-primary));
|
||||
|
|
@ -133,11 +130,9 @@
|
|||
--color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
|
||||
--color-sidebar-border: hsl(var(--sidebar-border));
|
||||
--color-sidebar-ring: hsl(var(--sidebar-ring));
|
||||
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
|
||||
--animate-accordion-down: accordion-down 0.2s ease-out;
|
||||
--animate-accordion-up: accordion-up 0.2s ease-out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
/* stylelint-disable-next-line custom-property-pattern */
|
||||
gap: var(--spacing-1_5, 0.375rem);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
@use "tailwindcss";
|
||||
|
||||
@plugin "tailwindcss-animate";
|
||||
@plugin "@tailwindcss/typography";
|
||||
@plugin "@tailwindcss/forms";
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
@theme inline {
|
||||
--font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
|
||||
|
||||
--color-background: hsl(var(--background));
|
||||
--color-foreground: hsl(var(--foreground));
|
||||
--color-muted: hsl(var(--muted));
|
||||
|
|
@ -59,7 +58,6 @@
|
|||
--color-preventive: hsl(var(--preventive));
|
||||
--color-preventive-foreground: hsl(var(--preventive-foreground));
|
||||
--color-ring: hsl(var(--ring));
|
||||
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import logoUwilCMSDark from "&/images/logos/uwil-cms-dark.svg";
|
|||
import logoTinyUwilCMS from "&/images/logos/uwil-cms-light-icon.svg";
|
||||
import logoUwilCMSLight from "&/images/logos/uwil-cms-light.svg";
|
||||
import { useTheme } from "@/back/providers/ThemeProvider";
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
|
||||
interface ApplicationLogoProps {
|
||||
forceLight?: boolean;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { type ReactNode } from "react";
|
||||
|
||||
import { type ConfigField } from "@/back/types/dynamic-pages";
|
||||
import type { ConfigField } from "@/back/types/dynamic-pages";
|
||||
|
||||
export interface DynamicInputProps {
|
||||
fieldName: string;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ import SimpleVimeoId from "@/back/Components/Inputs/SimpleVimeoId";
|
|||
import SimpleYoutubeId from "@/back/Components/Inputs/SimpleYoutubeId";
|
||||
import StaticRouteSelect from "@/back/Components/Inputs/StaticRouteSelect";
|
||||
import SimpleWysiwyg from "@/back/Components/Inputs/Wysiwyg/SimpleWysiwyg";
|
||||
import {
|
||||
type ConfigField,
|
||||
type DynamicFieldType,
|
||||
type DynamicInternalField,
|
||||
import type {
|
||||
ConfigField,
|
||||
DynamicFieldType,
|
||||
DynamicInternalField,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
extractLaravelValidationValue,
|
||||
|
|
@ -51,7 +51,6 @@ export default function DynamicInputs({
|
|||
reset,
|
||||
parentErrors,
|
||||
}: DynamicInputsProps) {
|
||||
return <p>test</p>;
|
||||
// Enums.
|
||||
const enumDynamicFieldTypes = usePage().props
|
||||
.enumDynamicFieldTypes as DynamicFieldType;
|
||||
|
|
@ -272,6 +271,7 @@ export default function DynamicInputs({
|
|||
case enumDynamicFieldTypes.vimeoid.value:
|
||||
return (
|
||||
<SimpleVimeoId
|
||||
key={id}
|
||||
name={fieldName}
|
||||
setData={setData}
|
||||
value={toStr(fieldValue)}
|
||||
|
|
@ -282,6 +282,7 @@ export default function DynamicInputs({
|
|||
case enumDynamicFieldTypes.youtubeid.value:
|
||||
return (
|
||||
<SimpleYoutubeId
|
||||
key={id}
|
||||
name={fieldName}
|
||||
setData={setData}
|
||||
value={toStr(fieldValue)}
|
||||
|
|
@ -292,6 +293,7 @@ export default function DynamicInputs({
|
|||
case enumDynamicFieldTypes.date.value:
|
||||
return (
|
||||
<SimpleDatePicker
|
||||
key={id}
|
||||
name={fieldName}
|
||||
setData={setData}
|
||||
date={fieldValue as Date}
|
||||
|
|
@ -303,6 +305,7 @@ export default function DynamicInputs({
|
|||
case enumDynamicFieldTypes.color.value:
|
||||
return (
|
||||
<SimpleColorPicker
|
||||
key={id}
|
||||
name={fieldName}
|
||||
setData={setData}
|
||||
value={toStr(fieldValue)}
|
||||
|
|
@ -314,6 +317,7 @@ export default function DynamicInputs({
|
|||
case enumDynamicFieldTypes.model.value:
|
||||
return (
|
||||
<DynamicWrapperModelSelect
|
||||
key={id}
|
||||
field={field}
|
||||
fieldName={fieldName}
|
||||
fieldValue={fieldValue}
|
||||
|
|
@ -325,6 +329,7 @@ export default function DynamicInputs({
|
|||
case enumDynamicFieldTypes.staticroute.value:
|
||||
return (
|
||||
<StaticRouteSelect
|
||||
key={id}
|
||||
name={fieldName}
|
||||
label={getTrans(field.label)}
|
||||
selected={fieldValue as number}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ import { useState } from "react";
|
|||
import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithTooltip";
|
||||
import DynamicInputs from "@/back/Components/DynamicPages/DynamicInputs";
|
||||
import AddNewFieldBtn from "@/back/Components/PageConfigs/AddNewFieldBtn";
|
||||
import {
|
||||
type ConfigField,
|
||||
type DynamicInternalField,
|
||||
import type {
|
||||
ConfigField,
|
||||
DynamicInternalField,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
Accordion,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { type ReactNode } from "react";
|
||||
|
||||
import { type ConfigField } from "@/back/types/dynamic-pages";
|
||||
import type { ConfigField } from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { usePage } from "@inertiajs/react";
|
|||
import { CheckIcon, PencilLineIcon, XIcon } from "lucide-react";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { type LaravelEnum } from "@/types/global";
|
||||
|
||||
interface DynamicStatusBadgeProps {
|
||||
value: number;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useRef } from "react";
|
||||
|
||||
import { ModelSelect } from "@/back/Components/Inputs/ModelSelect";
|
||||
import { type ConfigField } from "@/back/types/dynamic-pages";
|
||||
import type { ConfigField } from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
extractExcludedIdFromExists,
|
||||
extractRequiredValidation,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import EnumSelect from "@/back/Components/Inputs/EnumSelect";
|
||||
import AddFilterToUrl from "@/back/lib/filters";
|
||||
import { type LaravelEnum } from "@/types/global";
|
||||
|
||||
interface Props {
|
||||
enums: LaravelEnum;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import {
|
|||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
interface GoToFrontViewProps {
|
||||
/** Model Name used to translate the helper */
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import "react-image-crop/dist/ReactCrop.css";
|
||||
import { usePage } from "@inertiajs/react";
|
||||
import { FileCheck, RefreshCwIcon, Trash, UploadIcon } from "lucide-react";
|
||||
import { type ReactNode, useCallback, useEffect, useState } from "react";
|
||||
import { ErrorCode, type FileWithPath, useDropzone } from "react-dropzone";
|
||||
import "react-image-crop/dist/ReactCrop.css";
|
||||
|
||||
import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithTooltip";
|
||||
import InputError from "@/back/Components/InputError";
|
||||
|
|
@ -13,7 +13,6 @@ import str from "@/hooks/use-string";
|
|||
import { useToast } from "@/hooks/use-toast";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
type FileWithPreview = FileWithPath & {
|
||||
preview: string;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import {
|
|||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
interface EnumSelectProps {
|
||||
name: string;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import "react-image-crop/dist/ReactCrop.css";
|
||||
import { usePage } from "@inertiajs/react";
|
||||
import {
|
||||
ChevronDownIcon,
|
||||
|
|
@ -23,9 +24,8 @@ import {
|
|||
} from "react";
|
||||
import { type FileWithPath } from "react-dropzone";
|
||||
import ReactCrop, { type Crop, type PixelCrop } from "react-image-crop";
|
||||
import "react-image-crop/dist/ReactCrop.css";
|
||||
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Collapsible,
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ import {
|
|||
|
||||
import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithTooltip";
|
||||
import InputError from "@/back/Components/InputError";
|
||||
import {
|
||||
type DefaultModel,
|
||||
type Paginator,
|
||||
type ConfigBackend,
|
||||
import type {
|
||||
DefaultModel,
|
||||
Paginator,
|
||||
ConfigBackend,
|
||||
} from "@/back/types/global";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
|
@ -52,7 +52,6 @@ import { Separator } from "@/components/ui/separator";
|
|||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import str from "@/hooks/use-string";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
/**
|
||||
* Animation types and configurations
|
||||
|
|
@ -1326,6 +1325,7 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
</Badge>
|
||||
) : (
|
||||
<p
|
||||
key={value}
|
||||
className={cn(
|
||||
"flex items-center overflow-hidden whitespace-nowrap max-w-[180px]",
|
||||
singleLine && "shrink-0",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import { useEffect } from "react";
|
|||
import EnumSelect from "@/back/Components/Inputs/EnumSelect";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { type LaravelEnum } from "@/types/global";
|
||||
|
||||
interface Props {
|
||||
name: string;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import { parseStyleString } from "@/hooks/use-inline-style";
|
|||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
export type AllowedAligns = "left" | "center" | "right";
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import EnumSelect from "@/back/Components/Inputs/EnumSelect";
|
|||
import { ModelSelect } from "@/back/Components/Inputs/ModelSelect";
|
||||
import SimpleString from "@/back/Components/Inputs/SimpleString";
|
||||
import SimpleSwitch from "@/back/Components/Inputs/SimpleSwitch";
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
|
|
@ -25,7 +25,6 @@ import {
|
|||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv, type LaravelEnum } from "@/types/global";
|
||||
|
||||
// Custom type for axios error.
|
||||
interface AxiosErrorResponse {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import { Link } from "@/back/Components/Inputs/Wysiwyg/Extensions/Link/Link";
|
|||
import ShortcutBoundary from "@/back/Components/Inputs/Wysiwyg/Extensions/ShortCuts/ShortcutBoundary";
|
||||
import Toolbar from "@/back/Components/Inputs/Wysiwyg/Toolbar";
|
||||
import WordCounter from "@/back/Components/WordCounter";
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { usePage } from "@inertiajs/react";
|
|||
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import str from "@/hooks/use-string";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
export default function AppFooter() {
|
||||
const appName = (usePage().props.appEnv as AppEnv).name;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { CircleUserRoundIcon, LogOutIcon, UserIcon } from "lucide-react";
|
|||
import CustomSidebarTrigger from "@/back/Components/CustomSidebarTrigger";
|
||||
import AppBreadcrumbs from "@/back/Components/Layout/AppBreadcrumbs";
|
||||
import AppSettings from "@/back/Components/Layout/Settings/AppSettings";
|
||||
import { type AuthProp, type ConfigBackend } from "@/back/types/global";
|
||||
import type { AuthProp, ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { usePage } from "@inertiajs/react";
|
|||
import { SettingsIcon } from "lucide-react";
|
||||
|
||||
import SettingRegistry from "@/back/Components/Layout/Settings/SettingRegistry";
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
|
|
@ -11,7 +11,6 @@ import {
|
|||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
interface AppSettingsProps {
|
||||
className?: string;
|
||||
|
|
@ -36,10 +35,10 @@ export default function AppSettings({ className = "" }: AppSettingsProps) {
|
|||
<DropdownMenuContent side="bottom" className="w-fit me-1">
|
||||
{SettingRegistry.getAll(appEnv, configBackend).map(
|
||||
(Section, index, arr) => (
|
||||
<>
|
||||
<template key={index}>
|
||||
{Section}
|
||||
{Section && index < arr.length - 1 && <DropdownMenuSeparator />}
|
||||
</>
|
||||
</template>
|
||||
),
|
||||
)}
|
||||
</DropdownMenuContent>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import { useForm } from "@inertiajs/react";
|
||||
import { type SubmitEvent } from "react";
|
||||
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
export default function Languages(
|
||||
appEnv: AppEnv,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { MoonIcon, SunIcon } from "lucide-react";
|
||||
|
||||
import { useTheme } from "@/back/providers/ThemeProvider";
|
||||
import { type Theme } from "@/back/types/global";
|
||||
import type { Theme } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { type ReactNode } from "react";
|
||||
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
|
||||
type SettingResolver = (
|
||||
appEnv: AppEnv,
|
||||
|
|
|
|||
|
|
@ -11,11 +11,7 @@ import { type ElementType, type ReactNode, useEffect, useRef } from "react";
|
|||
import ApplicationLogo from "@/back/Components/ApplicationLogo";
|
||||
import { SidebarRegistry } from "@/back/Components/Layout/Sidebar/SidebarRegistry";
|
||||
import Views from "@/back/lib/actions";
|
||||
import {
|
||||
type AuthProp,
|
||||
type UserModel,
|
||||
type ConfigBackend,
|
||||
} from "@/back/types/global";
|
||||
import type { AuthProp, UserModel, ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Collapsible,
|
||||
|
|
@ -49,7 +45,6 @@ import {
|
|||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
export interface NavListLinksProps {
|
||||
/** Title of the button. */
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { HistoryIcon } from "lucide-react";
|
|||
|
||||
import { type NavListLinksProps } from "@/back/Components/Layout/Sidebar/AppSidebar";
|
||||
import { type SidebarGroupLink } from "@/back/Components/Layout/Sidebar/SidebarRegistry";
|
||||
import { type AuthProp } from "@/back/types/global";
|
||||
import type { AuthProp } from "@/back/types/global";
|
||||
import str from "@/hooks/use-string";
|
||||
import { GetTranslation } from "@/lib/utils";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from "@/back/Components/Layout/Sidebar/AppSidebar";
|
||||
import { type SidebarGroupLink } from "@/back/Components/Layout/Sidebar/SidebarRegistry";
|
||||
import Views from "@/back/lib/actions";
|
||||
import { type AuthProp, type ConfigBackend } from "@/back/types/global";
|
||||
import type { AuthProp, ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import str from "@/hooks/use-string";
|
||||
|
|
@ -62,7 +62,7 @@ export default function DynamicPages(
|
|||
</DropdownMenuItem>
|
||||
),
|
||||
auth.policies.dynamicPages.viewTrash && (
|
||||
<DropdownMenuItem className="p-0">
|
||||
<DropdownMenuItem key="trash" className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link
|
||||
href={route(`${configBackend.routes.name}${model}.trash`)}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from "@/back/Components/Layout/Sidebar/AppSidebar";
|
||||
import { type SidebarGroupLink } from "@/back/Components/Layout/Sidebar/SidebarRegistry";
|
||||
import Views from "@/back/lib/actions";
|
||||
import { type AuthProp, type ConfigBackend } from "@/back/types/global";
|
||||
import type { AuthProp, ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import str from "@/hooks/use-string";
|
||||
|
|
@ -62,7 +62,7 @@ export default function PageConfigs(
|
|||
</DropdownMenuItem>
|
||||
),
|
||||
auth.policies.pageConfigs.viewTrash && (
|
||||
<DropdownMenuItem className="p-0">
|
||||
<DropdownMenuItem key="trash" className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link
|
||||
href={route(`${configBackend.routes.name}${model}.trash`)}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from "@/back/Components/Layout/Sidebar/AppSidebar";
|
||||
import { type SidebarGroupLink } from "@/back/Components/Layout/Sidebar/SidebarRegistry";
|
||||
import Views from "@/back/lib/actions";
|
||||
import { type AuthProp, type ConfigBackend } from "@/back/types/global";
|
||||
import type { AuthProp, ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import str from "@/hooks/use-string";
|
||||
|
|
@ -62,7 +62,7 @@ export default function Users(
|
|||
</DropdownMenuItem>
|
||||
),
|
||||
auth.policies.pageConfigs.viewTrash && (
|
||||
<DropdownMenuItem className="p-0">
|
||||
<DropdownMenuItem key="trash" className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link
|
||||
href={route(`${configBackend.routes.name}${model}.trash`)}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { type NavListLinksProps } from "@/back/Components/Layout/Sidebar/AppSidebar";
|
||||
import { type AuthProp, type ConfigBackend } from "@/back/types/global";
|
||||
import type { AuthProp, ConfigBackend } from "@/back/types/global";
|
||||
|
||||
export type SidebarGroupType = "pages" | "admin" | "modules";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ import {
|
|||
} from "react";
|
||||
|
||||
import Views from "@/back/lib/actions";
|
||||
import {
|
||||
type DefaultModel,
|
||||
type Views as ViewsType,
|
||||
type ConfigBackend,
|
||||
import type {
|
||||
DefaultModel,
|
||||
Views as ViewsType,
|
||||
ConfigBackend,
|
||||
} from "@/back/types/global";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { type VariantProps } from "class-variance-authority";
|
||||
import { PlusIcon } from "lucide-react";
|
||||
|
||||
import {
|
||||
type ConfigInternalField,
|
||||
type DynamicInternalField,
|
||||
import type {
|
||||
ConfigInternalField,
|
||||
DynamicInternalField,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import { Button, type buttonVariants } from "@/components/ui/button";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
import { usePage } from "@inertiajs/react";
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
import {
|
||||
type ConfigField,
|
||||
type DynamicFieldType,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import type { ConfigField, DynamicFieldType } from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ import { useState, useEffect, useMemo, useRef } from "react";
|
|||
import InputError from "@/back/Components/InputError";
|
||||
import AddNewFieldBtn from "@/back/Components/PageConfigs/AddNewFieldBtn";
|
||||
import FieldGroup from "@/back/Components/PageConfigs/FieldGroup";
|
||||
import {
|
||||
type ConfigField,
|
||||
type ConfigInternalField,
|
||||
type DynamicFieldType,
|
||||
import type {
|
||||
ConfigField,
|
||||
ConfigInternalField,
|
||||
DynamicFieldType,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import { Accordion } from "@/components/ui/accordion";
|
||||
import str from "@/hooks/use-string";
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithT
|
|||
import EnumSelect from "@/back/Components/Inputs/EnumSelect";
|
||||
import SimpleString from "@/back/Components/Inputs/SimpleString";
|
||||
import AddNewFieldBtn from "@/back/Components/PageConfigs/AddNewFieldBtn";
|
||||
import {
|
||||
type ConfigField,
|
||||
type ConfigInternalField,
|
||||
type DynamicFieldType,
|
||||
import type {
|
||||
ConfigField,
|
||||
ConfigInternalField,
|
||||
DynamicFieldType,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
Accordion,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Link } from "@inertiajs/react";
|
||||
|
||||
import { type PaginatorLink } from "@/back/types/global";
|
||||
import type { PaginatorLink } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Pagination,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import PaginationCustom from "@/back/Components/Pagination/PaginationCustom";
|
||||
import PaginationPerPage from "@/back/Components/Pagination/PaginationPerPage";
|
||||
import { type Paginator } from "@/back/types/global";
|
||||
import type { Paginator } from "@/back/types/global";
|
||||
import { GetTranslation } from "@/lib/utils";
|
||||
|
||||
export default function PaginationWrapper({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
// * Other
|
||||
import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithTooltip";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
|
|
|||
|
|
@ -11,11 +11,7 @@ import { useState } from "react";
|
|||
import ModelActions from "@/back/Components/ModelActions";
|
||||
import PaginationWrapper from "@/back/Components/Pagination/PaginationWrapper";
|
||||
import DataTableFilterButton from "@/back/Components/Table/DataTableFilterButton";
|
||||
import {
|
||||
type DefaultModel,
|
||||
type Resource,
|
||||
type Views,
|
||||
} from "@/back/types/global";
|
||||
import type { DefaultModel, Resource, Views } from "@/back/types/global";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { type ReactNode } from "react";
|
||||
|
||||
import { type DefaultModel } from "@/back/types/global";
|
||||
import type { DefaultModel } from "@/back/types/global";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { usePage } from "@inertiajs/react";
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
import { type TranslationField } from "@/back/types/i18n";
|
||||
import type { TranslationField } from "@/back/types/i18n";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
/**
|
||||
* Get a normalize preview of a target string.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
// * Other
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
export default function WordCounter({ value }: { value: string }) {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import { usePage } from "@inertiajs/react";
|
|||
import { motion } from "motion/react";
|
||||
import { type ReactNode, useEffect, useState } from "react";
|
||||
|
||||
import AppHead from "@/components/layout/AppHead";
|
||||
import AppFooter from "@/back/Components/Layout/AppFooter";
|
||||
import AppHeader from "@/back/Components/Layout/AppHeader";
|
||||
import AppSidebar from "@/back/Components/Layout/Sidebar/AppSidebar";
|
||||
import { ThemeProvider } from "@/back/providers/ThemeProvider";
|
||||
import AppHead from "@/components/layout/AppHead";
|
||||
import { SidebarProvider, useSidebar } from "@/components/ui/sidebar";
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { type ReactNode } from "react";
|
||||
|
||||
import AppHead from "@/components/layout/AppHead";
|
||||
import ApplicationLogo from "@/back/Components/ApplicationLogo";
|
||||
import AppFooter from "@/back/Components/Layout/AppFooter";
|
||||
import AppSettings from "@/back/Components/Layout/Settings/AppSettings";
|
||||
import { ThemeProvider } from "@/back/providers/ThemeProvider";
|
||||
import AppHead from "@/components/layout/AppHead";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import DataTableFilterButton from "@/back/Components/Table/DataTableFilterButton
|
|||
import DataTableSearch from "@/back/Components/Table/DataTableSearch";
|
||||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { Views } from "@/back/lib/actions";
|
||||
import { type ActivityLogModel } from "@/back/types/activity-logs";
|
||||
import { type ConfigBackend, type Resource } from "@/back/types/global";
|
||||
import type { ActivityLogModel } from "@/back/types/activity-logs";
|
||||
import type { ConfigBackend, Resource } from "@/back/types/global";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithT
|
|||
import ModelActions from "@/back/Components/ModelActions";
|
||||
import DetailsTable from "@/back/Components/Table/DetailsTable";
|
||||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { type ActivityLogModel } from "@/back/types/activity-logs";
|
||||
import {
|
||||
type DefaultModel,
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type SingleResource,
|
||||
import type { ActivityLogModel } from "@/back/types/activity-logs";
|
||||
import type {
|
||||
DefaultModel,
|
||||
AuthProp,
|
||||
ConfigBackend,
|
||||
SingleResource,
|
||||
} from "@/back/types/global";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import str from "@/hooks/use-string";
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import {
|
|||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
export default function Login({ tenantUUID }: { tenantUUID: string }) {
|
||||
const appName = (usePage().props.appEnv as AppEnv).name;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import {
|
|||
CardHeader,
|
||||
} from "@/components/ui/card";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
export default function Dashboard() {
|
||||
const appEnv = usePage().props.appEnv as AppEnv;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithT
|
|||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { Actions, Methods } from "@/back/lib/enums";
|
||||
import Form from "@/back/Pages/DynamicPages/Form";
|
||||
import { type DynamicPageModel } from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type SingleResource,
|
||||
import type { DynamicPageModel } from "@/back/types/dynamic-pages";
|
||||
import type {
|
||||
AuthProp,
|
||||
ConfigBackend,
|
||||
SingleResource,
|
||||
} from "@/back/types/global";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
|||
import { Views } from "@/back/lib/actions";
|
||||
import { Actions, Methods } from "@/back/lib/enums";
|
||||
import Form from "@/back/Pages/DynamicPages/Form";
|
||||
import { type DynamicPageModel } from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type SingleResource,
|
||||
import type { DynamicPageModel } from "@/back/types/dynamic-pages";
|
||||
import type {
|
||||
AuthProp,
|
||||
ConfigBackend,
|
||||
SingleResource,
|
||||
} from "@/back/types/global";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
|
|
|
|||
|
|
@ -21,16 +21,12 @@ import SimpleWysiwyg from "@/back/Components/Inputs/Wysiwyg/SimpleWysiwyg";
|
|||
import ConfigDetails from "@/back/Components/PageConfigs/ConfigDetails";
|
||||
import SubmitButton from "@/back/Components/SubmitButton";
|
||||
import useCrudSubmit from "@/back/hooks/use-crud-submit";
|
||||
import {
|
||||
type ConfigField,
|
||||
type DynamicPageModel,
|
||||
type PageConfigModel,
|
||||
import type {
|
||||
ConfigField,
|
||||
DynamicPageModel,
|
||||
PageConfigModel,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type UserModel,
|
||||
} from "@/back/types/global";
|
||||
import type { AuthProp, ConfigBackend, UserModel } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
|
|
@ -44,7 +40,6 @@ import {
|
|||
} from "@/components/ui/dialog";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { type AppEnv, type LaravelEnum } from "@/types/global";
|
||||
|
||||
export default function Form({
|
||||
model,
|
||||
|
|
@ -177,8 +172,6 @@ export default function Form({
|
|||
isRoot: model?.isRoot ?? false,
|
||||
});
|
||||
const defaultIsRootValue = !data.isRoot && data.page_id ? [data.page_id] : [];
|
||||
console.log(defaultIsRootValue, model?.id);
|
||||
|
||||
const submit = useCrudSubmit({
|
||||
method,
|
||||
modelRoute,
|
||||
|
|
@ -258,7 +251,7 @@ export default function Form({
|
|||
)}
|
||||
{!data.isRoot && (
|
||||
<div className="col-span-2 grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{/* <ModelSelect
|
||||
<ModelSelect
|
||||
name="page_id"
|
||||
targetModel="dynamic_pages"
|
||||
multiple={false}
|
||||
|
|
@ -271,7 +264,7 @@ export default function Form({
|
|||
required={false}
|
||||
setData={setData}
|
||||
disabled={data.isRoot}
|
||||
/> */}
|
||||
/>
|
||||
<Slugifycator
|
||||
value={data.slug}
|
||||
targetValue={data.title}
|
||||
|
|
@ -307,7 +300,7 @@ export default function Form({
|
|||
>
|
||||
<div className="grid sm:grid-cols-2 gap-4 border-b border-input pb-4">
|
||||
<div className="flex justify-start items-end gap-1.5">
|
||||
{/* <ModelSelect
|
||||
<ModelSelect
|
||||
name="config_id"
|
||||
targetModel="page_configs"
|
||||
multiple={false}
|
||||
|
|
@ -335,7 +328,7 @@ export default function Form({
|
|||
: (value ?? defaultConfigId);
|
||||
setData("config_id", id);
|
||||
}}
|
||||
/> */}
|
||||
/>
|
||||
{isConceptor && data.config_id !== defaultConfigId && (
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
|
|
@ -370,7 +363,7 @@ export default function Form({
|
|||
)}
|
||||
</div>
|
||||
</div>
|
||||
{/* {!data.config_id || data.config_id === defaultConfigId ? (
|
||||
{!data.config_id || data.config_id === defaultConfigId ? (
|
||||
<SimpleWysiwyg
|
||||
name="content"
|
||||
tableName="dynamic_pages"
|
||||
|
|
@ -387,7 +380,7 @@ export default function Form({
|
|||
// @ts-expect-error Types diff between custom reset and useForm reset.
|
||||
reset={reset}
|
||||
/>
|
||||
)} */}
|
||||
)}
|
||||
</FieldsetWrapper>
|
||||
{isConceptor && (
|
||||
<FieldsetWrapper
|
||||
|
|
|
|||
|
|
@ -20,15 +20,11 @@ import DataTableSearch from "@/back/Components/Table/DataTableSearch";
|
|||
import RenderTranslationCell from "@/back/Components/Table/RenderTranslationCell";
|
||||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { Views } from "@/back/lib/actions";
|
||||
import {
|
||||
type PageConfigModel,
|
||||
type DynamicPageModel,
|
||||
import type {
|
||||
PageConfigModel,
|
||||
DynamicPageModel,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type Resource,
|
||||
} from "@/back/types/global";
|
||||
import type { AuthProp, ConfigBackend, Resource } from "@/back/types/global";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
Tooltip,
|
||||
|
|
@ -38,7 +34,6 @@ import {
|
|||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { GetFormatedDate, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
const getColumns = (
|
||||
appEnv: AppEnv,
|
||||
|
|
|
|||
|
|
@ -15,21 +15,20 @@ import DetailsTable from "@/back/Components/Table/DetailsTable";
|
|||
import RenderTranslationCell from "@/back/Components/Table/RenderTranslationCell";
|
||||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { Views } from "@/back/lib/actions";
|
||||
import {
|
||||
type DynamicPageModelWithRelations,
|
||||
type PageConfigModel,
|
||||
import type {
|
||||
DynamicPageModelWithRelations,
|
||||
PageConfigModel,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type SingleResource,
|
||||
import type {
|
||||
AuthProp,
|
||||
ConfigBackend,
|
||||
SingleResource,
|
||||
} from "@/back/types/global";
|
||||
import { type TranslationField } from "@/back/types/i18n";
|
||||
import type { TranslationField } from "@/back/types/i18n";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { GetFormatedDate, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
const getColumns = (
|
||||
appEnv: AppEnv,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Head, Link, usePage } from "@inertiajs/react";
|
|||
import ApplicationLogo from "@/back/Components/ApplicationLogo";
|
||||
import AppFooter from "@/back/Components/Layout/AppFooter";
|
||||
import { ThemeProvider } from "@/back/providers/ThemeProvider";
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithT
|
|||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { Actions, Methods } from "@/back/lib/enums";
|
||||
import Form from "@/back/Pages/PageConfigs/Form";
|
||||
import { type PageConfigModelWithRelations } from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type SingleResource,
|
||||
import type { PageConfigModelWithRelations } from "@/back/types/dynamic-pages";
|
||||
import type {
|
||||
AuthProp,
|
||||
ConfigBackend,
|
||||
SingleResource,
|
||||
} from "@/back/types/global";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
|||
import { Views } from "@/back/lib/actions";
|
||||
import { Actions, Methods } from "@/back/lib/enums";
|
||||
import Form from "@/back/Pages/PageConfigs/Form";
|
||||
import { type PageConfigModelWithRelations } from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type SingleResource,
|
||||
import type { PageConfigModelWithRelations } from "@/back/types/dynamic-pages";
|
||||
import type {
|
||||
AuthProp,
|
||||
ConfigBackend,
|
||||
SingleResource,
|
||||
} from "@/back/types/global";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,15 +10,11 @@ import ExportConfigJson from "@/back/Components/PageConfigs/ExportConfigJson";
|
|||
import ImportConfigJson from "@/back/Components/PageConfigs/ImportConfigJson";
|
||||
import SubmitButton from "@/back/Components/SubmitButton";
|
||||
import useCrudSubmit from "@/back/hooks/use-crud-submit";
|
||||
import {
|
||||
type PageConfigModelWithRelations,
|
||||
type ConfigField,
|
||||
import type {
|
||||
PageConfigModelWithRelations,
|
||||
ConfigField,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type UserModel,
|
||||
} from "@/back/types/global";
|
||||
import type { AuthProp, ConfigBackend, UserModel } from "@/back/types/global";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
|
|
@ -45,7 +41,6 @@ import {
|
|||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
export default function Form({
|
||||
model,
|
||||
|
|
|
|||
|
|
@ -10,12 +10,8 @@ import DataTableSearch from "@/back/Components/Table/DataTableSearch";
|
|||
import RenderTranslationCell from "@/back/Components/Table/RenderTranslationCell";
|
||||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { Views } from "@/back/lib/actions";
|
||||
import { type PageConfigModel } from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type Resource,
|
||||
} from "@/back/types/global";
|
||||
import type { PageConfigModel } from "@/back/types/dynamic-pages";
|
||||
import type { AuthProp, ConfigBackend, Resource } from "@/back/types/global";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
|
|
|||
|
|
@ -8,21 +8,17 @@ import DetailsTable from "@/back/Components/Table/DetailsTable";
|
|||
import RenderTranslationCell from "@/back/Components/Table/RenderTranslationCell";
|
||||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { Views } from "@/back/lib/actions";
|
||||
import {
|
||||
type ConfigField,
|
||||
type PageConfigModel,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import {
|
||||
type AuthProp,
|
||||
type ConfigBackend,
|
||||
type SingleResource,
|
||||
import type { ConfigField, PageConfigModel } from "@/back/types/dynamic-pages";
|
||||
import type {
|
||||
AuthProp,
|
||||
ConfigBackend,
|
||||
SingleResource,
|
||||
} from "@/back/types/global";
|
||||
import { type TranslationField } from "@/back/types/i18n";
|
||||
import type { TranslationField } from "@/back/types/i18n";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { GetFormatedDate, GetTranslation } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
const getColumns = (appEnv: AppEnv) => {
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithT
|
|||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import { Actions, Methods } from "@/back/lib/enums";
|
||||
import Form from "@/back/Pages/Users/Form";
|
||||
import {
|
||||
type AuthProp,
|
||||
type SingleResource,
|
||||
type UserModel,
|
||||
type ConfigBackend,
|
||||
import type {
|
||||
AuthProp,
|
||||
SingleResource,
|
||||
UserModel,
|
||||
ConfigBackend,
|
||||
} from "@/back/types/global";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
|||
import Views from "@/back/lib/actions";
|
||||
import { Actions, Methods } from "@/back/lib/enums";
|
||||
import Form from "@/back/Pages/Users/Form";
|
||||
import {
|
||||
type AuthProp,
|
||||
type SingleResource,
|
||||
type UserModel,
|
||||
type ConfigBackend,
|
||||
import type {
|
||||
AuthProp,
|
||||
SingleResource,
|
||||
UserModel,
|
||||
ConfigBackend,
|
||||
} from "@/back/types/global";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import SimpleString from "@/back/Components/Inputs/SimpleString";
|
|||
import SimpleSwitch from "@/back/Components/Inputs/SimpleSwitch";
|
||||
import SubmitButton from "@/back/Components/SubmitButton";
|
||||
import useCrudSubmit from "@/back/hooks/use-crud-submit";
|
||||
import { type AuthProp, type UserModel } from "@/back/types/global";
|
||||
import type { AuthProp, UserModel } from "@/back/types/global";
|
||||
import str from "@/hooks/use-string";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ import DataTableFilterButton from "@/back/Components/Table/DataTableFilterButton
|
|||
import DataTableSearch from "@/back/Components/Table/DataTableSearch";
|
||||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import Views from "@/back/lib/actions";
|
||||
import {
|
||||
type AuthProp,
|
||||
type Resource,
|
||||
type UserModel,
|
||||
type ConfigBackend,
|
||||
import type {
|
||||
AuthProp,
|
||||
Resource,
|
||||
UserModel,
|
||||
ConfigBackend,
|
||||
} from "@/back/types/global";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import str from "@/hooks/use-string";
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ import ModelActions from "@/back/Components/ModelActions";
|
|||
import DetailsTable from "@/back/Components/Table/DetailsTable";
|
||||
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
||||
import Views from "@/back/lib/actions";
|
||||
import {
|
||||
type AuthProp,
|
||||
type SingleResource,
|
||||
type UserModel,
|
||||
type ConfigBackend,
|
||||
import type {
|
||||
AuthProp,
|
||||
SingleResource,
|
||||
UserModel,
|
||||
ConfigBackend,
|
||||
} from "@/back/types/global";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import str from "@/hooks/use-string";
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
/* eslint-disable react-hooks/immutability */
|
||||
import type { VisitOptions } from "@inertiajs/core";
|
||||
import { usePage } from "@inertiajs/react";
|
||||
import { type SubmitEvent, useCallback } from "react";
|
||||
|
||||
import useCrudMessages from "@/back/hooks/use-crud-messages";
|
||||
import { Methods } from "@/back/lib/enums";
|
||||
import { type ConfigBackend } from "@/back/types/global";
|
||||
import type { ConfigBackend } from "@/back/types/global";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
interface CustomData {
|
||||
_method?: "post" | "put";
|
||||
|
|
@ -39,6 +37,7 @@ export default function useCrudSubmit<TFormData>({
|
|||
};
|
||||
const messages = useCrudMessages({ method, modelNameTrans });
|
||||
const { toast } = useToast();
|
||||
// eslint-disable-next-line react-hooks/immutability
|
||||
return useCallback(
|
||||
(e: SubmitEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
|
|
@ -47,6 +46,7 @@ export default function useCrudSubmit<TFormData>({
|
|||
throw new Error("The method must be post or patch");
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/immutability
|
||||
data._method = method === Methods.POST ? "post" : "put";
|
||||
data.locale = appEnv.locale;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
useState,
|
||||
} from "react";
|
||||
|
||||
import { type Theme } from "@/back/types/global";
|
||||
import type { Theme } from "@/back/types/global";
|
||||
|
||||
interface ThemeProviderProps {
|
||||
children: ReactNode;
|
||||
|
|
@ -66,8 +66,7 @@ export function ThemeProvider({
|
|||
|
||||
export const useTheme = () => {
|
||||
const context = useContext(ThemeProviderContext) as
|
||||
| ThemeProviderState
|
||||
| undefined;
|
||||
ThemeProviderState | undefined;
|
||||
|
||||
if (context === undefined) {
|
||||
throw new Error("useTheme must be used within a ThemeProvider");
|
||||
|
|
|
|||
2
resources/ts/back/types/activity-logs.d.ts
vendored
2
resources/ts/back/types/activity-logs.d.ts
vendored
|
|
@ -1,4 +1,4 @@
|
|||
import { type ModelPolicy, type UserModel } from "@/back/types/global";
|
||||
import type { ModelPolicy, UserModel } from "@/back/types/global";
|
||||
|
||||
interface ActivityLogModel {
|
||||
policies: ModelPolicy;
|
||||
|
|
|
|||
4
resources/ts/back/types/dynamic-pages.d.ts
vendored
4
resources/ts/back/types/dynamic-pages.d.ts
vendored
|
|
@ -1,5 +1,5 @@
|
|||
import { type DefaultModel } from "@/back/types/global";
|
||||
import { type TranslationField } from "@/back/types/i18n";
|
||||
import type { DefaultModel } from "@/back/types/global";
|
||||
import type { TranslationField } from "@/back/types/i18n";
|
||||
|
||||
// Dynamic Page type, with policies.
|
||||
type DynamicPageModel = DefaultModel & {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { usePage } from "@inertiajs/react";
|
||||
import { type ReactNode } from "react";
|
||||
import type React from "react";
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
|
|
|
|||
|
|
@ -2,16 +2,15 @@ import { usePage } from "@inertiajs/react";
|
|||
import { CheckIcon, XIcon } from "lucide-react";
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
import {
|
||||
type ConfigField,
|
||||
type DynamicFieldType,
|
||||
type DynamicPageModelWithRelations,
|
||||
import type {
|
||||
ConfigField,
|
||||
DynamicFieldType,
|
||||
DynamicPageModelWithRelations,
|
||||
} from "@/back/types/dynamic-pages";
|
||||
import AppLayout from "@/front/Layouts/AppLayout";
|
||||
import AppHead from "@/components/layout/AppHead";
|
||||
import AppLayout from "@/front/Layouts/AppLayout";
|
||||
import { useFormatedDate } from "@/hooks/use-formated-value";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { type AppEnv } from "@/types/global";
|
||||
|
||||
interface DynamicPageDefaultProps {
|
||||
dynamicPageModel: DynamicPageModelWithRelations;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import { type LaravelEnum } from "@/types/global";
|
||||
|
||||
type StringifiableValue = string | number;
|
||||
|
||||
export default function mapLaravelEnumOptions<
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { type DefaultModel } from "@/back/types/global";
|
||||
import type { DefaultModel } from "@/back/types/global";
|
||||
|
||||
/**
|
||||
* Extract ids from model relation pivot and format options
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import path from "path";
|
|||
|
||||
import react from "@vitejs/plugin-react";
|
||||
import laravel from "laravel-vite-plugin";
|
||||
import copy from "rollup-plugin-copy";
|
||||
import { defineConfig } from "vite";
|
||||
import eslint from "vite-plugin-eslint";
|
||||
import { viteStaticCopy } from "vite-plugin-static-copy";
|
||||
import stylelint from "vite-plugin-stylelint";
|
||||
|
||||
const debugMode = ["local", "development"].includes(process.env.NODE_ENV ?? "");
|
||||
|
|
@ -76,7 +76,7 @@ export default defineConfig({
|
|||
failOnWarning: false,
|
||||
failOnError: true,
|
||||
}),
|
||||
copy({
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: path.normalize("resources/favicons/front/*"),
|
||||
|
|
@ -88,9 +88,7 @@ export default defineConfig({
|
|||
},
|
||||
// [copy-files]
|
||||
],
|
||||
copyOnce: true,
|
||||
verbose: true,
|
||||
}),
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
alias: [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue