Merge remote-tracking branch 'origin/feat/checklists-e-automacoes'

This commit is contained in:
esdrasrenan 2025-12-13 21:26:53 -03:00
commit 74e64b2dba
11 changed files with 64 additions and 64 deletions

View file

@ -49,7 +49,7 @@
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"dotenv": "17.2.3", "dotenv": "17.2.3",
"lucide-react": "0.556.0", "lucide-react": "0.556.0",
"next": "16.0.8", "next": "16.0.10",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"pdfkit": "^0.17.2", "pdfkit": "^0.17.2",
"pg": "^8.16.3", "pg": "^8.16.3",
@ -86,7 +86,7 @@
"baseline-browser-mapping": "^2.9.2", "baseline-browser-mapping": "^2.9.2",
"cross-env": "^10.1.0", "cross-env": "^10.1.0",
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "16.0.8", "eslint-config-next": "16.0.10",
"eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-react-hooks": "7.0.0",
"jsdom": "^27.0.1", "jsdom": "^27.0.1",
"playwright": "^1.56.1", "playwright": "^1.56.1",
@ -398,25 +398,25 @@
"@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@0.2.12", "", { "dependencies": { "@emnapi/core": "^1.4.3", "@emnapi/runtime": "^1.4.3", "@tybys/wasm-util": "^0.10.0" } }, "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ=="], "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@0.2.12", "", { "dependencies": { "@emnapi/core": "^1.4.3", "@emnapi/runtime": "^1.4.3", "@tybys/wasm-util": "^0.10.0" } }, "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ=="],
"@next/env": ["@next/env@16.0.8", "", {}, "sha512-xP4WrQZuj9MdmLJy3eWFHepo+R3vznsMSS8Dy3wdA7FKpjCiesQ6DxZvdGziQisj0tEtCgBKJzjcAc4yZOgLEQ=="], "@next/env": ["@next/env@16.0.10", "", {}, "sha512-8tuaQkyDVgeONQ1MeT9Mkk8pQmZapMKFh5B+OrFUlG3rVmYTXcXlBetBgTurKXGaIZvkoqRT9JL5K3phXcgang=="],
"@next/eslint-plugin-next": ["@next/eslint-plugin-next@16.0.8", "", { "dependencies": { "fast-glob": "3.3.1" } }, "sha512-1miV0qXDcLUaOdHridVPCh4i39ElRIAraseVIbb3BEqyZ5ol9sPyjTP/GNTPV5rBxqxjF6/vv5zQTVbhiNaLqA=="], "@next/eslint-plugin-next": ["@next/eslint-plugin-next@16.0.10", "", { "dependencies": { "fast-glob": "3.3.1" } }, "sha512-b2NlWN70bbPLmfyoLvvidPKWENBYYIe017ZGUpElvQjDytCWgxPJx7L9juxHt0xHvNVA08ZHJdOyhGzon/KJuw=="],
"@next/swc-darwin-arm64": ["@next/swc-darwin-arm64@16.0.8", "", { "os": "darwin", "cpu": "arm64" }, "sha512-yjVMvTQN21ZHOclQnhSFbjBTEizle+1uo4NV6L4rtS9WO3nfjaeJYw+H91G+nEf3Ef43TaEZvY5mPWfB/De7tA=="], "@next/swc-darwin-arm64": ["@next/swc-darwin-arm64@16.0.10", "", { "os": "darwin", "cpu": "arm64" }, "sha512-4XgdKtdVsaflErz+B5XeG0T5PeXKDdruDf3CRpnhN+8UebNa5N2H58+3GDgpn/9GBurrQ1uWW768FfscwYkJRg=="],
"@next/swc-darwin-x64": ["@next/swc-darwin-x64@16.0.8", "", { "os": "darwin", "cpu": "x64" }, "sha512-+zu2N3QQ0ZOb6RyqQKfcu/pn0UPGmg+mUDqpAAEviAcEVEYgDckemOpiMRsBP3IsEKpcoKuNzekDcPczEeEIzA=="], "@next/swc-darwin-x64": ["@next/swc-darwin-x64@16.0.10", "", { "os": "darwin", "cpu": "x64" }, "sha512-spbEObMvRKkQ3CkYVOME+ocPDFo5UqHb8EMTS78/0mQ+O1nqE8toHJVioZo4TvebATxgA8XMTHHrScPrn68OGw=="],
"@next/swc-linux-arm64-gnu": ["@next/swc-linux-arm64-gnu@16.0.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-LConttk+BeD0e6RG0jGEP9GfvdaBVMYsLJ5aDDweKiJVVCu6sGvo+Ohz9nQhvj7EQDVVRJMCGhl19DmJwGr6bQ=="], "@next/swc-linux-arm64-gnu": ["@next/swc-linux-arm64-gnu@16.0.10", "", { "os": "linux", "cpu": "arm64" }, "sha512-uQtWE3X0iGB8apTIskOMi2w/MKONrPOUCi5yLO+v3O8Mb5c7K4Q5KD1jvTpTF5gJKa3VH/ijKjKUq9O9UhwOYw=="],
"@next/swc-linux-arm64-musl": ["@next/swc-linux-arm64-musl@16.0.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-JaXFAlqn8fJV+GhhA9lpg6da/NCN/v9ub98n3HoayoUSPOVdoxEEt86iT58jXqQCs/R3dv5ZnxGkW8aF4obMrQ=="], "@next/swc-linux-arm64-musl": ["@next/swc-linux-arm64-musl@16.0.10", "", { "os": "linux", "cpu": "arm64" }, "sha512-llA+hiDTrYvyWI21Z0L1GiXwjQaanPVQQwru5peOgtooeJ8qx3tlqRV2P7uH2pKQaUfHxI/WVarvI5oYgGxaTw=="],
"@next/swc-linux-x64-gnu": ["@next/swc-linux-x64-gnu@16.0.8", "", { "os": "linux", "cpu": "x64" }, "sha512-O7M9it6HyNhsJp3HNAsJoHk5BUsfj7hRshfptpGcVsPZ1u0KQ/oVy8oxF7tlwxA5tR43VUP0yRmAGm1us514ng=="], "@next/swc-linux-x64-gnu": ["@next/swc-linux-x64-gnu@16.0.10", "", { "os": "linux", "cpu": "x64" }, "sha512-AK2q5H0+a9nsXbeZ3FZdMtbtu9jxW4R/NgzZ6+lrTm3d6Zb7jYrWcgjcpM1k8uuqlSy4xIyPR2YiuUr+wXsavA=="],
"@next/swc-linux-x64-musl": ["@next/swc-linux-x64-musl@16.0.8", "", { "os": "linux", "cpu": "x64" }, "sha512-8+KClEC/GLI2dLYcrWwHu5JyC5cZYCFnccVIvmxpo6K+XQt4qzqM5L4coofNDZYkct/VCCyJWGbZZDsg6w6LFA=="], "@next/swc-linux-x64-musl": ["@next/swc-linux-x64-musl@16.0.10", "", { "os": "linux", "cpu": "x64" }, "sha512-1TDG9PDKivNw5550S111gsO4RGennLVl9cipPhtkXIFVwo31YZ73nEbLjNC8qG3SgTz/QZyYyaFYMeY4BKZR/g=="],
"@next/swc-win32-arm64-msvc": ["@next/swc-win32-arm64-msvc@16.0.8", "", { "os": "win32", "cpu": "arm64" }, "sha512-rpQ/PgTEgH68SiXmhu/cJ2hk9aZ6YgFvspzQWe2I9HufY6g7V02DXRr/xrVqOaKm2lenBFPNQ+KAaeveywqV+A=="], "@next/swc-win32-arm64-msvc": ["@next/swc-win32-arm64-msvc@16.0.10", "", { "os": "win32", "cpu": "arm64" }, "sha512-aEZIS4Hh32xdJQbHz121pyuVZniSNoqDVx1yIr2hy+ZwJGipeqnMZBJHyMxv2tiuAXGx6/xpTcQJ6btIiBjgmg=="],
"@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@16.0.8", "", { "os": "win32", "cpu": "x64" }, "sha512-jWpWjWcMQu2iZz4pEK2IktcfR+OA9+cCG8zenyLpcW8rN4rzjfOzH4yj/b1FiEAZHKS+5Vq8+bZyHi+2yqHbFA=="], "@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@16.0.10", "", { "os": "win32", "cpu": "x64" }, "sha512-E+njfCoFLb01RAFEnGZn6ERoOqhK1Gl3Lfz1Kjnj0Ulfu7oJbuMyvBKNj/bw8XZnenHDASlygTjZICQW+rYW1Q=="],
"@noble/ciphers": ["@noble/ciphers@2.0.1", "", {}, "sha512-xHK3XHPUW8DTAobU+G0XT+/w+JLM7/8k1UFdB5xg/zTFPnFCobhftzw8wl4Lw2aq/Rvir5pxfZV5fEazmeCJ2g=="], "@noble/ciphers": ["@noble/ciphers@2.0.1", "", {}, "sha512-xHK3XHPUW8DTAobU+G0XT+/w+JLM7/8k1UFdB5xg/zTFPnFCobhftzw8wl4Lw2aq/Rvir5pxfZV5fEazmeCJ2g=="],
@ -1286,7 +1286,7 @@
"eslint": ["eslint@9.39.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.1", "@eslint/config-helpers": "^0.4.2", "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "9.39.1", "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.4.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g=="], "eslint": ["eslint@9.39.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.1", "@eslint/config-helpers": "^0.4.2", "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "9.39.1", "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.4.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g=="],
"eslint-config-next": ["eslint-config-next@16.0.8", "", { "dependencies": { "@next/eslint-plugin-next": "16.0.8", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.32.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-react": "^7.37.0", "eslint-plugin-react-hooks": "^7.0.0", "globals": "16.4.0", "typescript-eslint": "^8.46.0" }, "peerDependencies": { "eslint": ">=9.0.0", "typescript": ">=3.3.1" }, "optionalPeers": ["typescript"] }, "sha512-8J5cOAboXIV3f8OD6BOyj7Fik6n/as7J4MboiUSExWruf/lCu1OPR3ZVSdnta6WhzebrmAATEmNSBZsLWA6kbg=="], "eslint-config-next": ["eslint-config-next@16.0.10", "", { "dependencies": { "@next/eslint-plugin-next": "16.0.10", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.32.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-react": "^7.37.0", "eslint-plugin-react-hooks": "^7.0.0", "globals": "16.4.0", "typescript-eslint": "^8.46.0" }, "peerDependencies": { "eslint": ">=9.0.0", "typescript": ">=3.3.1" }, "optionalPeers": ["typescript"] }, "sha512-BxouZUm0I45K4yjOOIzj24nTi0H2cGo0y7xUmk+Po/PYtJXFBYVDS1BguE7t28efXjKdcN0tmiLivxQy//SsZg=="],
"eslint-import-resolver-node": ["eslint-import-resolver-node@0.3.9", "", { "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", "resolve": "^1.22.4" } }, "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g=="], "eslint-import-resolver-node": ["eslint-import-resolver-node@0.3.9", "", { "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", "resolve": "^1.22.4" } }, "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g=="],
@ -1702,7 +1702,7 @@
"negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="], "negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="],
"next": ["next@16.0.8", "", { "dependencies": { "@next/env": "16.0.8", "@swc/helpers": "0.5.15", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "16.0.8", "@next/swc-darwin-x64": "16.0.8", "@next/swc-linux-arm64-gnu": "16.0.8", "@next/swc-linux-arm64-musl": "16.0.8", "@next/swc-linux-x64-gnu": "16.0.8", "@next/swc-linux-x64-musl": "16.0.8", "@next/swc-win32-arm64-msvc": "16.0.8", "@next/swc-win32-x64-msvc": "16.0.8", "sharp": "^0.34.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.51.1", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-LmcZzG04JuzNXi48s5P+TnJBsTGPJunViNKV/iE4uM6kstjTQsQhvsAv+xF6MJxU2Pr26tl15eVbp0jQnsv6/g=="], "next": ["next@16.0.10", "", { "dependencies": { "@next/env": "16.0.10", "@swc/helpers": "0.5.15", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "16.0.10", "@next/swc-darwin-x64": "16.0.10", "@next/swc-linux-arm64-gnu": "16.0.10", "@next/swc-linux-arm64-musl": "16.0.10", "@next/swc-linux-x64-gnu": "16.0.10", "@next/swc-linux-x64-musl": "16.0.10", "@next/swc-win32-arm64-msvc": "16.0.10", "@next/swc-win32-x64-msvc": "16.0.10", "sharp": "^0.34.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.51.1", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-RtWh5PUgI+vxlV3HdR+IfWA1UUHu0+Ram/JBO4vWB54cVPentCD0e+lxyAYEsDTqGGMg7qpjhKh6dc6aW7W/sA=="],
"next-themes": ["next-themes@0.4.6", "", { "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" } }, "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA=="], "next-themes": ["next-themes@0.4.6", "", { "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" } }, "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA=="],

View file

@ -167,8 +167,9 @@ export const create = mutation({
required: v.optional(v.boolean()), required: v.optional(v.boolean()),
}), }),
), ),
isArchived: v.optional(v.boolean()),
}, },
handler: async (ctx, { tenantId, actorId, name, description, companyId, items }) => { handler: async (ctx, { tenantId, actorId, name, description, companyId, items, isArchived }) => {
await requireAdmin(ctx, actorId, tenantId) await requireAdmin(ctx, actorId, tenantId)
const normalizedName = normalizeTemplateName(name) const normalizedName = normalizeTemplateName(name)
@ -185,6 +186,7 @@ export const create = mutation({
const normalizedItems = normalizeTemplateItems(items, {}) const normalizedItems = normalizeTemplateItems(items, {})
const normalizedDescription = normalizeTemplateDescription(description) const normalizedDescription = normalizeTemplateDescription(description)
const archivedFlag = typeof isArchived === "boolean" ? isArchived : false
const now = Date.now() const now = Date.now()
return ctx.db.insert("ticketChecklistTemplates", { return ctx.db.insert("ticketChecklistTemplates", {
@ -193,7 +195,7 @@ export const create = mutation({
description: normalizedDescription ?? undefined, description: normalizedDescription ?? undefined,
companyId: companyId ?? undefined, companyId: companyId ?? undefined,
items: normalizedItems, items: normalizedItems,
isArchived: false, isArchived: archivedFlag,
createdAt: now, createdAt: now,
updatedAt: now, updatedAt: now,
createdBy: actorId, createdBy: actorId,

View file

@ -1,12 +1,5 @@
import * as React from "react" import * as React from "react"
import { Body } from "@react-email/body" import { Body, Container, Head, Html, Img, Preview, Section, Text } from "@react-email/components"
import { Container } from "@react-email/container"
import { Head } from "@react-email/head"
import { Html } from "@react-email/html"
import { Img } from "@react-email/img"
import { Preview } from "@react-email/preview"
import { Section } from "@react-email/section"
import { Text } from "@react-email/text"
import { EMAIL_COLORS } from "./tokens" import { EMAIL_COLORS } from "./tokens"
import { getEmailAssetUrl } from "./utils" import { getEmailAssetUrl } from "./utils"

View file

@ -1,6 +1,5 @@
import * as React from "react" import * as React from "react"
import { Section } from "@react-email/section" import { Section, Text } from "@react-email/components"
import { Text } from "@react-email/text"
import { EMAIL_COLORS } from "./tokens" import { EMAIL_COLORS } from "./tokens"
import { formatPriority, formatStatus } from "./utils" import { formatPriority, formatStatus } from "./utils"

View file

@ -1,9 +1,5 @@
import * as React from "react" import * as React from "react"
import { Button } from "@react-email/button" import { Button, Heading, Hr, Section, Text } from "@react-email/components"
import { Heading } from "@react-email/heading"
import { Hr } from "@react-email/hr"
import { Section } from "@react-email/section"
import { Text } from "@react-email/text"
import { RavenEmailLayout } from "./_components/layout" import { RavenEmailLayout } from "./_components/layout"
import { EMAIL_COLORS } from "./_components/tokens" import { EMAIL_COLORS } from "./_components/tokens"

View file

@ -1,9 +1,5 @@
import * as React from "react" import * as React from "react"
import { Button } from "@react-email/button" import { Button, Heading, Hr, Section, Text } from "@react-email/components"
import { Heading } from "@react-email/heading"
import { Hr } from "@react-email/hr"
import { Section } from "@react-email/section"
import { Text } from "@react-email/text"
import { RavenEmailLayout } from "./_components/layout" import { RavenEmailLayout } from "./_components/layout"
import { EMAIL_COLORS } from "./_components/tokens" import { EMAIL_COLORS } from "./_components/tokens"

View file

@ -74,7 +74,7 @@
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"dotenv": "17.2.3", "dotenv": "17.2.3",
"lucide-react": "0.556.0", "lucide-react": "0.556.0",
"next": "16.0.8", "next": "16.0.10",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"pdfkit": "^0.17.2", "pdfkit": "^0.17.2",
"pg": "^8.16.3", "pg": "^8.16.3",
@ -111,7 +111,7 @@
"baseline-browser-mapping": "^2.9.2", "baseline-browser-mapping": "^2.9.2",
"cross-env": "^10.1.0", "cross-env": "^10.1.0",
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "16.0.8", "eslint-config-next": "16.0.10",
"eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-react-hooks": "7.0.0",
"jsdom": "^27.0.1", "jsdom": "^27.0.1",
"playwright": "^1.56.1", "playwright": "^1.56.1",

View file

@ -163,11 +163,13 @@ export function AutomationsManager() {
value={queryText} value={queryText}
onChange={(e) => setQueryText(e.target.value)} onChange={(e) => setQueryText(e.target.value)}
placeholder="Buscar automação..." placeholder="Buscar automação..."
className="w-full sm:w-64" className="h-8 w-full text-sm sm:w-64"
/> />
<Select value={triggerFilter} onValueChange={setTriggerFilter}> <Select value={triggerFilter} onValueChange={setTriggerFilter}>
<SelectTrigger className="w-full sm:w-44"> <SelectTrigger size="sm" className="w-full sm:w-52">
<SelectValue placeholder="Quando" /> <span className="truncate">
<span className="text-neutral-500">Quando:</span> <SelectValue />
</span>
</SelectTrigger> </SelectTrigger>
<SelectContent className="rounded-xl"> <SelectContent className="rounded-xl">
<SelectItem value="all">Todos</SelectItem> <SelectItem value="all">Todos</SelectItem>
@ -180,8 +182,10 @@ export function AutomationsManager() {
</SelectContent> </SelectContent>
</Select> </Select>
<Select value={statusFilter} onValueChange={setStatusFilter}> <Select value={statusFilter} onValueChange={setStatusFilter}>
<SelectTrigger className="w-full sm:w-40"> <SelectTrigger size="sm" className="w-full sm:w-44">
<SelectValue placeholder="Status" /> <span className="truncate">
<span className="text-neutral-500">Ativação:</span> <SelectValue />
</span>
</SelectTrigger> </SelectTrigger>
<SelectContent className="rounded-xl"> <SelectContent className="rounded-xl">
<SelectItem value="all">Todos</SelectItem> <SelectItem value="all">Todos</SelectItem>
@ -191,7 +195,7 @@ export function AutomationsManager() {
</Select> </Select>
<Dialog open={editorOpen} onOpenChange={setEditorOpen}> <Dialog open={editorOpen} onOpenChange={setEditorOpen}>
<DialogTrigger asChild> <DialogTrigger asChild>
<Button onClick={handleNew} className="gap-2"> <Button size="sm" onClick={handleNew} className="gap-2">
<Plus className="size-4" /> <Plus className="size-4" />
Nova automação Nova automação
</Button> </Button>

View file

@ -296,11 +296,8 @@ export function DashboardQueueInsights() {
) as QueueTrendResponse | undefined ) as QueueTrendResponse | undefined
return ( return (
<div className="grid gap-6 px-4 lg:grid-cols-2 lg:px-6"> <div className="px-4 lg:px-6">
<QueueSparklineRow <QueueSparklineRow data={queueTrend?.queues} isLoading={dashboardEnabled && queueTrend === undefined} />
data={queueTrend?.queues}
isLoading={dashboardEnabled && queueTrend === undefined}
/>
</div> </div>
) )
} }

View file

@ -16,7 +16,7 @@ import { Checkbox } from "@/components/ui/checkbox"
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog" import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"
import { Input } from "@/components/ui/input" import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label" import { Label } from "@/components/ui/label"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { SearchableCombobox, type SearchableComboboxOption } from "@/components/ui/searchable-combobox"
import { Switch } from "@/components/ui/switch" import { Switch } from "@/components/ui/switch"
import { Textarea } from "@/components/ui/textarea" import { Textarea } from "@/components/ui/textarea"
@ -76,6 +76,15 @@ function TemplateEditorDialog({
const [items, setItems] = useState<DraftItem[]>([{ id: crypto.randomUUID(), text: "", required: true }]) const [items, setItems] = useState<DraftItem[]>([{ id: crypto.randomUUID(), text: "", required: true }])
const [archived, setArchived] = useState<boolean>(false) const [archived, setArchived] = useState<boolean>(false)
const companyComboboxOptions = useMemo<SearchableComboboxOption[]>(() => {
const sortedCompanies = [...companies].sort((a, b) => a.name.localeCompare(b.name, "pt-BR"))
return [
{ value: NO_COMPANY_VALUE, label: "Global (todas)" },
...sortedCompanies.map((company) => ({ value: String(company.id), label: company.name })),
]
}, [companies])
useEffect(() => { useEffect(() => {
if (!open) return if (!open) return
setName(template?.name ?? "") setName(template?.name ?? "")
@ -148,19 +157,15 @@ function TemplateEditorDialog({
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<Label>Empresa</Label> <Label>Empresa</Label>
<Select value={companyValue} onValueChange={setCompanyValue}> <SearchableCombobox
<SelectTrigger> value={companyValue}
<SelectValue placeholder="Global" /> onValueChange={(nextValue) => setCompanyValue(nextValue ?? NO_COMPANY_VALUE)}
</SelectTrigger> options={companyComboboxOptions}
<SelectContent className="rounded-xl"> placeholder="Selecionar empresa"
<SelectItem value={NO_COMPANY_VALUE}>Global (todas)</SelectItem> searchPlaceholder="Buscar empresa..."
{companies.map((company) => ( triggerClassName="h-9 rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm font-medium text-neutral-800 shadow-sm"
<SelectItem key={company.id} value={String(company.id)}> contentClassName="rounded-xl"
{company.name} />
</SelectItem>
))}
</SelectContent>
</Select>
</div> </div>
</div> </div>
@ -317,7 +322,7 @@ export function ChecklistTemplatesManager() {
/> />
Exibir arquivados Exibir arquivados
</label> </label>
<Button type="button" onClick={handleNew} className="gap-2"> <Button type="button" size="sm" onClick={handleNew} className="gap-2">
<Plus className="size-4" /> <Plus className="size-4" />
Novo template Novo template
</Button> </Button>

View file

@ -33,6 +33,14 @@ if (typeof window === "undefined" || typeof document === "undefined") {
} }
} }
const globalTarget = globalThis as Record<string, unknown>
if (typeof globalTarget.Element === "undefined") {
const win = globalTarget.window as undefined | { Element?: unknown }
if (win?.Element) {
globalTarget.Element = win.Element
}
}
const applyFixedDate = () => { const applyFixedDate = () => {
if (fixedTimestamp === null) { if (fixedTimestamp === null) {
globalThis.Date = OriginalDate globalThis.Date = OriginalDate