Skip to content

Commit

Permalink
Merge pull request #43 from TheAxelander/pre-release
Browse files Browse the repository at this point in the history
Merge changes for version 1.4
  • Loading branch information
TheAxelander authored Nov 14, 2021
2 parents bd3e6e5 + 4237350 commit 228fa22
Show file tree
Hide file tree
Showing 71 changed files with 6,149 additions and 5,883 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs

[*.cs]
guidelines = 120
24 changes: 24 additions & 0 deletions .github/workflows/docker-image-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Docker Image (latest)

on:
push:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker image
run: docker build . -t "axelander/openbudgeteer:latest" -f "OpenBudgeteer.Blazor/Dockerfile"

- name: Push Docker image
run: docker push axelander/openbudgeteer:latest
27 changes: 27 additions & 0 deletions .github/workflows/docker-image-pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Image (pre-release)

on:
push:
branches: [ pre-release ]

env:
DOTNET_VERSION: '6.0' # The .NET SDK version to use

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker image
run: docker build . -t "axelander/openbudgeteer:pre-release" -f "OpenBudgeteer.Blazor/Dockerfile"

- name: Push Docker image
run: docker push axelander/openbudgeteer:pre-release
30 changes: 30 additions & 0 deletions .github/workflows/test-cases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test Cases

on:
push:
branches: [ master, pre-release ]

env:
DOTNET_VERSION: '6.0' # The .NET SDK version to use

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Blazor dependencies
run: dotnet restore OpenBudgeteer.Blazor

- name: Build Blazor
run: dotnet build OpenBudgeteer.Blazor --configuration Release --no-restore

- name: Run Core Test Cases
run: dotnet test OpenBudgeteer.Core.Test

21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
### 1.4 (2021-11-14)

* [Add] Info Dialog during Bucket proposal and optimized proposal performance #21
* [Add] Filter on Transaction Page #25
* [Add] On Import Page final message box shows an option to clear the form #45
* [Changed] Core and Blazor Frontend updated to .Net 6.0
* [Changed] File Preview on Import Page now read-only
* [Changed] Misc small visual updates and fixes on Import Page
* [Changed] Consistent Chart Header styles on Report Page
* [Changed] Updated dependencies. Thanks @kekkon
* [Changed] Simplified dependency tree. Thanks @kekkon
* [Changed] Progress calculation for several scenarios #26 #28
* [Changed] Links and text due to switch to Github #46 #47
* [Fixed] Reworked UI update handling to fix issues on refreshing data #22
* [Fixed] Missing Target Account update for newly created or updated Import Profiles #23
* [Fixed] `MonthOutputConverter.Convert` not using Culture. Thanks @kekkon
* [Fixed] `OpenBudgeteer.Core.Test.ViewModelTest.YearMonthSelectorViewModelTest.Constructor_CheckDefaults` test using thread culture. Thanks @kekkon
* [Fixed] Added Validation checks before saving Bucket data to fix DivideByZeroException #29
* [Fixed] Trigger of `SelectedYearMonthChanged` passing `OpenBudgeteer.Core.Test.ViewModelTest.SelectedYearMonthChanged_CheckEventHasBeenInvoked` Test
* [Fixed] Wrong text in confirmation message box for deleting a Rule #44

### 1.3 (2020-12-15)

* [Add] Support for Sqlite databases #2
Expand Down
4 changes: 2 additions & 2 deletions OpenBudgeteer.Blazor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj", "OpenBudgeteer.Blazor/"]
COPY ["OpenBudgeteer.Core/OpenBudgeteer.Core.csproj", "OpenBudgeteer.Core/"]
Expand Down
14 changes: 4 additions & 10 deletions OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>c146cdfd-f78c-4fb3-8be0-4e15e589371a</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssemblyName>OpenBudgeteer</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ChartJs.Blazor" Version="1.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.8" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.2.1" />
<PackageReference Include="Tewr.Blazor.FileReader" Version="2.0.0.20242" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
<PackageReference Include="Tewr.Blazor.FileReader" Version="3.2.0.21211" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 7 additions & 8 deletions OpenBudgeteer.Blazor/Pages/Account.razor
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,7 @@
protected override void OnInitialized()
{
_dataContext = new AccountViewModel(DbContextOptions);
_dataContext.LoadData();
_dataContext.ViewModelReloadRequired += (sender, args) =>
{
_dataContext.LoadData();
StateHasChanged();
};
HandleResult(new ViewModelOperationResult(true));
HandleResult(_dataContext.LoadData());
}

private void CreateNewAccount()
Expand All @@ -102,7 +96,7 @@
private void CancelChanges()
{
_isEditAccountModalDialogVisible = false;
_dataContext.CancelEditMode();
HandleResult(_dataContext.LoadData());
}

private void CloseAccount(AccountViewModelItem account)
Expand All @@ -117,6 +111,11 @@
_errorModalDialogMessage = result.Message;
_isErrorModalDialogVisible = true;
}
if (result.ViewModelReloadRequired)
{
_dataContext.LoadData();
StateHasChanged();
}
}

async void DisplayAccountTransactions(AccountViewModelItem account)
Expand Down
52 changes: 26 additions & 26 deletions OpenBudgeteer.Blazor/Pages/Bucket.razor
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@
Title="Edit Bucket"
DataContext="@_editBucketDialogDataContext"
IsDialogVisible="@_isEditBucketModalDialogVisible"
OnCancelClickCallback="@(() => CancelEditBucketDialog())"
OnSaveClickCallback="@(() => SaveAndCloseEditBucketDialog())"/>
OnCancelClickCallback="@(CancelEditBucketDialog)"
OnSaveClickCallback="@(SaveAndCloseEditBucketDialog)"/>

<TransactionDialog
Title="Bucket Transactions"
Expand Down Expand Up @@ -337,28 +337,23 @@
{
_dataContext = new BucketViewModel(DbContextOptions, YearMonthDataContext);

HandleResult(await _dataContext.LoadDataAsync());
_dataContext.ViewModelReloadRequired += async (sender, args) =>
{
HandleResult(await _dataContext.LoadDataAsync());
StateHasChanged();
};

await HandleResult(await _dataContext.LoadDataAsync());

YearMonthDataContext.SelectedYearMonthChanged += async (sender, args) =>
{
HandleResult(await _dataContext.LoadDataAsync());
await HandleResult(await _dataContext.LoadDataAsync());
StateHasChanged();
};
}

void CreateGroup()
async void CreateGroup()
{
HandleResult(_dataContext.CreateGroup());
await HandleResult(_dataContext.CreateGroup());
}

void DistributeBudget()
async void DistributeBudget()
{
HandleResult(_dataContext.DistributeBudget());
await HandleResult(_dataContext.DistributeBudget());
}

void CreateBucket(BucketGroupViewModelItem bucketGroup)
Expand All @@ -373,51 +368,56 @@
_isEditBucketModalDialogVisible = true;
}

void SaveAndCloseEditBucketDialog()
async void SaveAndCloseEditBucketDialog()
{
_isEditBucketModalDialogVisible = false;
SaveChanges(_editBucketDialogDataContext);
await SaveChanges(_editBucketDialogDataContext);
}

async void CancelEditBucketDialog()
{
_isEditBucketModalDialogVisible = false;
HandleResult(await _dataContext.LoadDataAsync());
await HandleResult(await _dataContext.LoadDataAsync());
StateHasChanged();
}

void SaveChanges(BucketViewModelItem bucket)
async Task SaveChanges(BucketViewModelItem bucket)
{
HandleResult(_dataContext.SaveChanges(bucket));
await HandleResult(_dataContext.SaveChanges(bucket));
StateHasChanged();
}

void CloseBucket(BucketViewModelItem bucket)
async Task CloseBucket(BucketViewModelItem bucket)
{
HandleResult(_dataContext.CloseBucket(bucket));
await HandleResult(_dataContext.CloseBucket(bucket));
StateHasChanged();
}

void HandleResult(ViewModelOperationResult result)
async Task HandleResult(ViewModelOperationResult result)
{
if (!result.IsSuccessful)
{
_errorModalDialogMessage = result.Message;
_isErrorModalDialogVisible = true;
}
if (result.ViewModelReloadRequired)
{
await _dataContext.LoadDataAsync();
StateHasChanged();
}
}

void InOut_Changed(BucketViewModelItem bucket, KeyboardEventArgs args)
async void InOut_Changed(BucketViewModelItem bucket, KeyboardEventArgs args)
{
var result = bucket.HandleInOutInput(args.Key);
if (result.IsSuccessful)
{
HandleResult(_dataContext.UpdateBalanceFigures());
await HandleResult(_dataContext.UpdateBalanceFigures());
StateHasChanged();
}
else
{
HandleResult(result);
await HandleResult(result);
}
}

Expand All @@ -428,7 +428,7 @@

_transactionModalDialogDataContext = new TransactionViewModel(DbContextOptions, YearMonthDataContext);
_transactionModalDialogBucket = bucket.Bucket;
HandleResult(await _transactionModalDialogDataContext.LoadDataAsync(bucket.Bucket, true));
await HandleResult(await _transactionModalDialogDataContext.LoadDataAsync(bucket.Bucket, true));

_isTransactionModalDialogDataContextLoading = false;
StateHasChanged();
Expand Down
Loading

0 comments on commit 228fa22

Please sign in to comment.