mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-06-10 07:16:01 +00:00
corrige importacao de lancamentos compartilhados
This commit is contained in:
@@ -5,6 +5,13 @@ Todas as mudanças notáveis deste projeto serão documentadas neste arquivo.
|
||||
O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/),
|
||||
e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/).
|
||||
|
||||
## [2.7.4] - 2026-06-09
|
||||
|
||||
Esta versão corrige o fluxo de revisão de lançamentos compartilhados para que o acesso somente leitura proteja os dados originais sem impedir que a pessoa copie movimentos para a própria conta.
|
||||
|
||||
### Corrigido
|
||||
- Pessoas: lançamentos de uma pessoa compartilhada em modo somente leitura agora podem ser selecionados e importados para a conta do usuário logado, tanto individualmente quanto em lote, mantendo edição e remoção bloqueadas no lançamento original.
|
||||
|
||||
## [2.7.3] - 2026-06-05
|
||||
|
||||
Esta versão melhora pequenos pontos de leitura e configuração para o uso diário e self-hosted. As faturas pagas ficam mais fáceis de identificar na lista de cartões, a configuração de origins confiáveis do Better Auth passa a ficar documentada para Docker e túneis, o dashboard corrige a leitura de tempo dos pré-lançamentos e as dependências seguem atualizadas sem quebrar o build da imagem.
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
> **Não há versão online hospedada.** Você precisa clonar o repositório e rodar localmente ou no seu próprio servidor.
|
||||
|
||||
[](CHANGELOG.md)
|
||||
[](CHANGELOG.md)
|
||||
[](https://nextjs.org/)
|
||||
[](https://www.typescriptlang.org/)
|
||||
[](https://www.postgresql.org/)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openmonetis",
|
||||
"version": "2.7.3",
|
||||
"version": "2.7.4",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@11.1.3",
|
||||
"scripts": {
|
||||
|
||||
@@ -92,7 +92,7 @@ export function TransactionActionsMenu({
|
||||
</DropdownMenuItem>
|
||||
) : null}
|
||||
|
||||
{!item.readonly && !isOwnData ? (
|
||||
{!isOwnData ? (
|
||||
<DropdownMenuItem
|
||||
onSelect={() => onImport?.(item)}
|
||||
disabled={!onImport}
|
||||
|
||||
@@ -139,6 +139,7 @@ function buildColumns({
|
||||
cell: ({ row }) => (
|
||||
<Checkbox
|
||||
checked={row.getIsSelected()}
|
||||
disabled={!row.getCanSelect()}
|
||||
onCheckedChange={(value) => row.toggleSelected(!!value)}
|
||||
aria-label="Selecionar linha"
|
||||
/>
|
||||
|
||||
@@ -175,7 +175,10 @@ export function TransactionsTable({
|
||||
: getPaginationRowModel(),
|
||||
manualPagination: isServerPaginated,
|
||||
pageCount: serverPagination?.totalPages,
|
||||
enableRowSelection: (row) => !row.original.readonly,
|
||||
enableRowSelection: (row) =>
|
||||
row.original.userId === currentUserId
|
||||
? !row.original.readonly
|
||||
: Boolean(onBulkImport),
|
||||
});
|
||||
|
||||
const rowModel = table.getRowModel();
|
||||
@@ -184,11 +187,21 @@ export function TransactionsTable({
|
||||
? (serverPagination?.totalItems ?? 0)
|
||||
: table.getCoreRowModel().rows.length;
|
||||
const selectedRows = table.getFilteredSelectedRowModel().rows;
|
||||
const selectedOwnRows = selectedRows.filter(
|
||||
(row) => row.original.userId === currentUserId,
|
||||
);
|
||||
const selectedImportRows = selectedRows.filter(
|
||||
(row) => row.original.userId !== currentUserId,
|
||||
);
|
||||
const selectedCount = selectedRows.length;
|
||||
const selectedTotal = selectedRows.reduce(
|
||||
(total, row) => total + (row.original.amount ?? 0),
|
||||
0,
|
||||
);
|
||||
const selectedImportTotal = selectedImportRows.reduce(
|
||||
(total, row) => total + (row.original.amount ?? 0),
|
||||
0,
|
||||
);
|
||||
const currentPage = isServerPaginated
|
||||
? (serverPagination?.page ?? 1)
|
||||
: table.getState().pagination.pageIndex + 1;
|
||||
@@ -211,8 +224,8 @@ export function TransactionsTable({
|
||||
};
|
||||
|
||||
const handleBulkImport = () => {
|
||||
if (onBulkImport && selectedCount > 0) {
|
||||
onBulkImport(selectedRows.map((row) => row.original));
|
||||
if (onBulkImport && selectedImportRows.length > 0) {
|
||||
onBulkImport(selectedImportRows.map((row) => row.original));
|
||||
setRowSelection({});
|
||||
}
|
||||
};
|
||||
@@ -326,7 +339,7 @@ export function TransactionsTable({
|
||||
|
||||
{selectedCount > 0 &&
|
||||
onBulkDelete &&
|
||||
selectedRows.every((row) => row.original.userId === currentUserId) ? (
|
||||
selectedOwnRows.length === selectedCount ? (
|
||||
<TransactionsBulkBar
|
||||
selectedCount={selectedCount}
|
||||
selectedTotal={selectedTotal}
|
||||
@@ -335,12 +348,10 @@ export function TransactionsTable({
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{selectedCount > 0 &&
|
||||
onBulkImport &&
|
||||
selectedRows.some((row) => row.original.userId !== currentUserId) ? (
|
||||
{selectedCount > 0 && onBulkImport && selectedImportRows.length > 0 ? (
|
||||
<TransactionsBulkBar
|
||||
selectedCount={selectedCount}
|
||||
selectedTotal={selectedTotal}
|
||||
selectedCount={selectedImportRows.length}
|
||||
selectedTotal={selectedImportTotal}
|
||||
mode="import"
|
||||
onAction={handleBulkImport}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user