forked from git.gladyson/openmonetis
chore: remover páginas estabelecimentos e gastos-por-categoria
- Remove /estabelecimentos e todos seus componentes e actions - Remove /relatorios/gastos-por-categoria e seus arquivos - Remove tabela `estabelecimentos` do schema e migration 0019 - Remove nav items de ambas as features do sidebar - Reverte widget expenses-by-category ao estado original - Remove filtro de estabelecimento dos lançamentos (filters, table, page-helpers) - Reverte getRecentEstablishmentsAction para query apenas em lancamentos - Limpa CHANGELOG removendo entradas das features removidas
This commit is contained in:
@@ -386,7 +386,6 @@ export function LancamentosPage({
|
||||
pagadorFilterOptions={pagadorFilterOptions}
|
||||
categoriaFilterOptions={categoriaFilterOptions}
|
||||
contaCartaoFilterOptions={contaCartaoFilterOptions}
|
||||
estabelecimentosOptions={estabelecimentos}
|
||||
selectedPeriod={selectedPeriod}
|
||||
onCreate={allowCreate ? handleCreate : undefined}
|
||||
onMassAdd={allowCreate ? handleMassAdd : undefined}
|
||||
|
||||
@@ -122,7 +122,6 @@ interface LancamentosFiltersProps {
|
||||
pagadorOptions: LancamentoFilterOption[];
|
||||
categoriaOptions: LancamentoFilterOption[];
|
||||
contaCartaoOptions: ContaCartaoFilterOption[];
|
||||
estabelecimentosOptions?: string[];
|
||||
className?: string;
|
||||
exportButton?: ReactNode;
|
||||
hideAdvancedFilters?: boolean;
|
||||
@@ -132,7 +131,6 @@ export function LancamentosFilters({
|
||||
pagadorOptions,
|
||||
categoriaOptions,
|
||||
contaCartaoOptions,
|
||||
estabelecimentosOptions = [],
|
||||
className,
|
||||
exportButton,
|
||||
hideAdvancedFilters = false,
|
||||
@@ -237,16 +235,6 @@ export function LancamentosFilters({
|
||||
? contaCartaoOptions.find((option) => option.slug === contaCartaoValue)
|
||||
: null;
|
||||
|
||||
const estabelecimentoParam = searchParams.get("estabelecimento");
|
||||
const estabelecimentoOptionsForSelect = [
|
||||
...(estabelecimentoParam &&
|
||||
estabelecimentoParam.trim() &&
|
||||
!estabelecimentosOptions.includes(estabelecimentoParam.trim())
|
||||
? [estabelecimentoParam.trim()]
|
||||
: []),
|
||||
...estabelecimentosOptions,
|
||||
];
|
||||
|
||||
const [categoriaOpen, setCategoriaOpen] = useState(false);
|
||||
const [drawerOpen, setDrawerOpen] = useState(false);
|
||||
|
||||
@@ -256,8 +244,7 @@ export function LancamentosFilters({
|
||||
searchParams.get("pagamento") ||
|
||||
searchParams.get("pagador") ||
|
||||
searchParams.get("categoria") ||
|
||||
searchParams.get("contaCartao") ||
|
||||
searchParams.get("estabelecimento");
|
||||
searchParams.get("contaCartao");
|
||||
|
||||
const handleResetFilters = () => {
|
||||
handleReset();
|
||||
@@ -531,45 +518,6 @@ export function LancamentosFilters({
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{estabelecimentoOptionsForSelect.length > 0 ||
|
||||
estabelecimentoParam?.trim() ? (
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">Estabelecimento</label>
|
||||
<Select
|
||||
value={
|
||||
getParamValue("estabelecimento") || FILTER_EMPTY_VALUE
|
||||
}
|
||||
onValueChange={(value) =>
|
||||
handleFilterChange(
|
||||
"estabelecimento",
|
||||
value === FILTER_EMPTY_VALUE ? null : value,
|
||||
)
|
||||
}
|
||||
disabled={isPending}
|
||||
>
|
||||
<SelectTrigger
|
||||
className="w-full text-sm border-dashed"
|
||||
disabled={isPending}
|
||||
>
|
||||
<span className="truncate">
|
||||
{getParamValue("estabelecimento") !== FILTER_EMPTY_VALUE &&
|
||||
searchParams.get("estabelecimento")
|
||||
? searchParams.get("estabelecimento")
|
||||
: "Todos"}
|
||||
</span>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value={FILTER_EMPTY_VALUE}>Todos</SelectItem>
|
||||
{estabelecimentoOptionsForSelect.map((name) => (
|
||||
<SelectItem key={name} value={name}>
|
||||
{name}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<DrawerFooter>
|
||||
|
||||
@@ -715,7 +715,6 @@ type LancamentosTableProps = {
|
||||
pagadorFilterOptions?: LancamentoFilterOption[];
|
||||
categoriaFilterOptions?: LancamentoFilterOption[];
|
||||
contaCartaoFilterOptions?: ContaCartaoFilterOption[];
|
||||
estabelecimentosOptions?: string[];
|
||||
selectedPeriod?: string;
|
||||
onCreate?: (type: "Despesa" | "Receita") => void;
|
||||
onMassAdd?: () => void;
|
||||
@@ -742,7 +741,6 @@ export function LancamentosTable({
|
||||
pagadorFilterOptions = [],
|
||||
categoriaFilterOptions = [],
|
||||
contaCartaoFilterOptions = [],
|
||||
estabelecimentosOptions = [],
|
||||
selectedPeriod,
|
||||
onCreate,
|
||||
onMassAdd,
|
||||
@@ -923,7 +921,6 @@ export function LancamentosTable({
|
||||
pagadorOptions={pagadorFilterOptions}
|
||||
categoriaOptions={categoriaFilterOptions}
|
||||
contaCartaoOptions={contaCartaoFilterOptions}
|
||||
estabelecimentosOptions={estabelecimentosOptions}
|
||||
className="w-full lg:flex-1 lg:justify-end"
|
||||
hideAdvancedFilters={hasOtherUserData}
|
||||
exportButton={
|
||||
|
||||
Reference in New Issue
Block a user