fix(Build): Ajusta partes do sistema para ser possivel realizar a build do mesmo
This commit is contained in:
parent
0e77302b21
commit
634fe16331
10 changed files with 42 additions and 33 deletions
|
|
@ -14,7 +14,7 @@ import { useGTBRegimeBensRemoveHook } from "../../_hooks/g_tb_regimebens/useGTBR
|
|||
import ConfirmDialog from "@/app/_components/confirm_dialog/ConfirmDialog";
|
||||
import { useConfirmDialog } from "@/app/_components/confirm_dialog/useConfirmDialog";
|
||||
|
||||
import GTBRegimeComunhaoInterface from "../../_interfaces/GTBRegimeComunhaoInterface";
|
||||
import GTBRegimeBensInterface from "../../_interfaces/GTBRegimeBensInterface";
|
||||
import Header from "@/app/_components/structure/Header";
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
|
|
@ -24,11 +24,11 @@ export default function TTBAndamentoServico() {
|
|||
const { removeGTBRegimeComunhao } = useGTBRegimeBensRemoveHook();
|
||||
|
||||
// Estados
|
||||
const [selectedAndamento, setSelectedAndamento] = useState<GTBRegimeComunhaoInterface | null>(null);
|
||||
const [selectedAndamento, setSelectedAndamento] = useState<GTBRegimeBensInterface | null>(null);
|
||||
const [isFormOpen, setIsFormOpen] = useState(false);
|
||||
|
||||
// Estado para saber qual item será deletado
|
||||
const [itemToDelete, setItemToDelete] = useState<GTBRegimeComunhaoInterface | null>(null);
|
||||
const [itemToDelete, setItemToDelete] = useState<GTBRegimeBensInterface | null>(null);
|
||||
|
||||
/**
|
||||
* Hook do modal de confirmação
|
||||
|
|
@ -43,7 +43,7 @@ export default function TTBAndamentoServico() {
|
|||
/**
|
||||
* Abre o formulário no modo de edição ou criação
|
||||
*/
|
||||
const handleOpenForm = useCallback((data: GTBRegimeComunhaoInterface | null) => {
|
||||
const handleOpenForm = useCallback((data: GTBRegimeBensInterface | null) => {
|
||||
setSelectedAndamento(data);
|
||||
setIsFormOpen(true);
|
||||
}, []);
|
||||
|
|
@ -59,7 +59,7 @@ export default function TTBAndamentoServico() {
|
|||
/**
|
||||
* Salva os dados do formulário
|
||||
*/
|
||||
const handleSave = useCallback(async (formData: GTBRegimeComunhaoInterface) => {
|
||||
const handleSave = useCallback(async (formData: GTBRegimeBensInterface) => {
|
||||
|
||||
// Aguarda salvar o registro
|
||||
await saveGTBRegimeComunhao(formData);
|
||||
|
|
@ -72,7 +72,7 @@ export default function TTBAndamentoServico() {
|
|||
/**
|
||||
* Quando o usuário clica em "remover" na tabela
|
||||
*/
|
||||
const handleConfirmDelete = useCallback((item: GTBRegimeComunhaoInterface) => {
|
||||
const handleConfirmDelete = useCallback((item: GTBRegimeBensInterface) => {
|
||||
|
||||
// Define o item atual para remoção
|
||||
setItemToDelete(item);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export default function TMinutaForm({
|
|||
const form = useForm<FormValues>({
|
||||
resolver: zodResolver(TMinutaSchema),
|
||||
defaultValues: {
|
||||
t_minuta_id: 0,
|
||||
minuta_id: 0,
|
||||
natureza_id: undefined,
|
||||
descricao: '',
|
||||
situacao: 'A',
|
||||
|
|
@ -144,7 +144,7 @@ export default function TMinutaForm({
|
|||
</DialogFooter>
|
||||
|
||||
{/* Campos ocultos */}
|
||||
<input type="hidden" {...form.register("t_minuta_id")} />
|
||||
<input type="hidden" {...form.register("minuta_id")} />
|
||||
<input type="hidden" {...form.register("natureza_id")} />
|
||||
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -7,12 +7,10 @@ export const useTCensecNaturezaLitigioRemoveHook = () => {
|
|||
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
const [ tCensecNaturezaLitigio, setTCensecNaturezaLitigio ] = useState<TCensecNaturezaLitigioInterface>()
|
||||
const [tCensecNaturezaLitigio, setTCensecNaturezaLitigio] = useState<TCensecNaturezaLitigioInterface>()
|
||||
|
||||
const removeTCensecNaturezaLitigio = async (data: TCensecNaturezaLitigioInterface) => {
|
||||
|
||||
console.log(data.censec_naturezaltigio_id)
|
||||
|
||||
const response = await TCensecNaturezaLitigioRemoveData(data);
|
||||
|
||||
setTCensecNaturezaLitigio(data)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { z } from "zod";
|
||||
|
||||
export const TMinutaSchema = z.object({
|
||||
minuta_id: z.number().optional(),
|
||||
natureza_id: z.number().int(),
|
||||
descricao: z.string().min(1, "Descrição é obrigatória"),
|
||||
situacao: z.enum(["A", "I"]),
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ export default function CadastrosPage() {
|
|||
</div>
|
||||
<div className="grid grid-cols-5 gap-3">
|
||||
{items.map((item, key) => (
|
||||
<Card key={key} className="cursor-pointer hover:bg-muted transition-colors" asChild>
|
||||
<Link href={"/"}>
|
||||
<Link href={"/"}>
|
||||
<Card key={key} className="cursor-pointer hover:bg-muted transition-colors">
|
||||
<CardContent>
|
||||
<span className="inline-flex shrink-0 rounded-md border border-blue-300 bg-blue-100 p-2 dark:border-blue-300/10 dark:bg-blue-400/10 mb-2">
|
||||
<item.icon className="size-6 stroke-blue-700 dark:stroke-blue-500" />
|
||||
|
|
@ -64,8 +64,8 @@ export default function CadastrosPage() {
|
|||
{item.description}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Link>
|
||||
</Card>
|
||||
</Card>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -267,7 +267,11 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|||
|
||||
<SidebarFooter>
|
||||
|
||||
<NavUser user={userAuthenticated?.data} />
|
||||
{userAuthenticated?.data ? (
|
||||
<NavUser user={userAuthenticated.data} />
|
||||
) : (
|
||||
"Carregando..."
|
||||
)}
|
||||
|
||||
</SidebarFooter>
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export function NavUser({
|
|||
|
||||
<Avatar className="h-8 w-8 rounded-lg">
|
||||
|
||||
<AvatarImage src={user.avatar} alt={user.nome} />
|
||||
<AvatarImage src={user.sigla} alt={user.nome} />
|
||||
|
||||
<AvatarFallback className="rounded-lg">
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ export function NavUser({
|
|||
|
||||
<Avatar className="h-8 w-8 rounded-lg">
|
||||
|
||||
<AvatarImage src={user.avatar} alt={user.nome} />
|
||||
<AvatarImage src={user.sigla} alt={user.nome} />
|
||||
|
||||
<AvatarFallback className="rounded-lg">
|
||||
|
||||
|
|
|
|||
8
src/config/app_example.json
Normal file
8
src/config/app_example.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"state": "go",
|
||||
"api": {
|
||||
"url": "http://localhost:8000/",
|
||||
"prefix": "api/v1/",
|
||||
"content_type": "application/json"
|
||||
}
|
||||
}
|
||||
|
|
@ -4,12 +4,13 @@ import { useEffect, useState } from "react";
|
|||
import { jwtDecode } from "jwt-decode";
|
||||
import CookiesGet from "../../actions/cookies/CookiesGet";
|
||||
import GetSigla from "@/actions/text/GetSigla";
|
||||
import GUsuarioAuthenticatedInterface from "@/interfaces/GUsuarioAuthenticatedInterface";
|
||||
|
||||
interface JwtPayload {
|
||||
id: string;
|
||||
iat: number;
|
||||
exp: number;
|
||||
data?: string;
|
||||
data?: GUsuarioAuthenticatedInterface;
|
||||
}
|
||||
|
||||
export default function useGUsuarioGetJWTHook() {
|
||||
|
|
@ -41,10 +42,13 @@ export default function useGUsuarioGetJWTHook() {
|
|||
if (decoded.data && typeof decoded.data === "string") {
|
||||
|
||||
// Decodifica os dados enviado via json
|
||||
decoded.data = JSON.parse(decoded.data);
|
||||
decoded.data = JSON.parse(decoded.data)
|
||||
|
||||
// Gera Sigla para o nome
|
||||
decoded.data.sigla = GetSigla(decoded.data.nome)
|
||||
if (decoded.data) {
|
||||
|
||||
// Gera Sigla para o nome
|
||||
decoded.data.sigla = GetSigla(decoded.data.nome || "");
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
export default interface GUsuarioAuthenticatedInterface {
|
||||
usuario_id?: number,
|
||||
login?: string,
|
||||
situacao?: string,
|
||||
nome_completo?: string,
|
||||
funcao?: string,
|
||||
assina?: string,
|
||||
sigla?: string,
|
||||
email?: string,
|
||||
assina_certidao?: string,
|
||||
foto?: string,
|
||||
cpf?: string,
|
||||
usuario_id?: number;
|
||||
login?: string;
|
||||
nome?: string;
|
||||
email?: string;
|
||||
sigla?: string;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue