Skip to content

Commit

Permalink
Merge branch 'v2_15_1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Jul 18, 2023
2 parents 47fc0c0 + 236c8f7 commit 5b5c0f5
Show file tree
Hide file tree
Showing 18 changed files with 119 additions and 93 deletions.
4 changes: 2 additions & 2 deletions BudgetMasterServer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BudgetMaster</artifactId>
<groupId>de.deadlocker8</groupId>
<version>2.15.0</version>
<version>2.15.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -40,7 +40,7 @@
<vanilla-picker.version>2.12.1</vanilla-picker.version>
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
<opencsv.version>5.7.1</opencsv.version>
<datatables.version>1.13.4</datatables.version>
<datatables.version>1.13.5</datatables.version>
<jakarta.xml.bind-api.version>4.0.0</jakarta.xml.bind-api.version>
<junit-jupiter-engine.version>5.9.3</junit-jupiter-engine.version>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.LogoutConfigurer;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.DefaultRedirectStrategy;
import org.springframework.security.web.RedirectStrategy;
Expand All @@ -20,34 +21,30 @@ public BCryptPasswordEncoder passwordEncoder()
return new BCryptPasswordEncoder();
}


@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception
{
http
.csrf()
.and()

.authorizeHttpRequests()
.requestMatchers("/css/**", "/js/**", "/images/**", "/webjars/**", "/favicon.ico", "/touch_icon.png").permitAll()
.requestMatchers("/login").permitAll()
.requestMatchers("/**").authenticated()
.and()
.formLogin()
.loginPage("/login")
.successHandler((req, res, auth) -> {
Object preLoginURL = req.getSession().getAttribute("preLoginURL");
if(preLoginURL == null || preLoginUrlBlacklist.isBlacklisted(preLoginURL.toString()))
{
preLoginURL = "/";
}
redirectStrategy.sendRedirect(req, res, preLoginURL.toString());
})
.permitAll()
.and()

.logout()
.permitAll();
.csrf(csrf -> csrf.configure(http))
.authorizeHttpRequests(authorization -> authorization
.requestMatchers("/css/**", "/js/**", "/images/**", "/webjars/**", "/favicon.ico", "/touch_icon.png").permitAll()
.requestMatchers("/login").permitAll()
.requestMatchers("/**").authenticated())
.formLogin(formLogin -> formLogin
.loginPage("/login")
.permitAll()
.successHandler((req, res, auth) -> {
Object preLoginURL = req.getSession().getAttribute("preLoginURL");
if(preLoginURL == null || preLoginUrlBlacklist.isBlacklisted(preLoginURL.toString()))
{
preLoginURL = "/";
}
redirectStrategy.sendRedirect(req, res, preLoginURL.toString());
})
.permitAll()
)
.logout(LogoutConfigurer::permitAll
);

return http.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public String index(Model model)
public String whatsNewModal(Model model)
{
final List<NewsEntry> newsEntries = new ArrayList<>();
newsEntries.add(NewsEntry.createWithLocalizationKey("csvImportBugfixMultipleTimes"));
newsEntries.add(NewsEntry.createWithLocalizationKey("dockerImageSize"));
newsEntries.add(NewsEntry.createWithLocalizationKey("csvImportAvoidPageReload"));
newsEntries.add(NewsEntry.createWithLocalizationKey("csvImportBugfixFloatingPointPrecision"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ budgetmaster.database.password=budgetmaster
server.ssl.keyStoreType=PKCS12

# set to true if you want to use SSL (highly recommended)
security.require-ssl=false
server.ssl.enabled=false
# insert path to the keystore (relative to the location of BudgetMaster jar/exe or as absolute path)
server.ssl.key-store=<path_to_keystore>
server.ssl.key-store-password=<keystore_password>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locale=de

# DEFAULT
credits=Verwendete Schriftarten: Roboto<br>Verwendete Bibliotheken:<br>spring-boot-starter-parent 3.1.0<br>spring-boot-devtools 3.1.0<br>spring-boot-starter-web 3.1.0<br>spring-boot-starter-test 3.1.0<br>spring-boot-starter-security 3.1.0<br>spring-boot-starter-freemarker 3.1.0<br>spring-boot-starter-validation 3.1.0<br>spring-boot-starter-data-jpa 3.1.0<br>hibernate-jpamodelgen 6.1.7.Final<br>jakarta.xml.bind-api 4.0.0<br>maven-surefire-plugin 2.22.2<br>launch4j-maven-plugin 1.7.25<br>jquery 3.6.4<br>materialize 1.0.0<br>fontawesome 6.4.0<br>Google Material Icons<br>Vanilla-picker 2.12.1<br>SortableJS 1.15.0<br>jlibs 3.2.0<br>itextpdf 5.5.13.3<br>mousetrap 1.6.5<br>plotly 2.24.2<br>momentjs 2.29.4<br>codemirror 5.62.2<br>webjars-locator 0.46<br>libUtils 3.2.7<br>libStorage 3.2.3<br>natorder 1.1.3<br>jgit 6.6.0.202305301015-r<br>opencsv 5.7.1<br>datatables 1.13.4<br>
credits=Verwendete Schriftarten: Roboto<br>Verwendete Bibliotheken:<br>spring-boot-starter-parent 3.1.1<br>spring-boot-devtools 3.1.1<br>spring-boot-starter-web 3.1.1<br>spring-boot-starter-test 3.1.1<br>spring-boot-starter-security 3.1.1<br>spring-boot-starter-freemarker 3.1.1<br>spring-boot-starter-validation 3.1.1<br>spring-boot-starter-data-jpa 3.1.1<br>hibernate-jpamodelgen 6.1.7.Final<br>jakarta.xml.bind-api 4.0.0<br>maven-surefire-plugin 2.22.2<br>launch4j-maven-plugin 1.7.25<br>jquery 3.6.4<br>materialize 1.0.0<br>fontawesome 6.4.0<br>Google Material Icons<br>Vanilla-picker 2.12.1<br>SortableJS 1.15.0<br>jlibs 3.2.0<br>itextpdf 5.5.13.3<br>mousetrap 1.6.5<br>plotly 2.24.2<br>momentjs 2.29.4<br>codemirror 5.62.2<br>webjars-locator 0.46<br>libUtils 3.2.7<br>libStorage 3.2.3<br>natorder 1.1.3<br>jgit 6.6.0.202305301015-r<br>opencsv 5.7.1<br>datatables 1.13.5<br>
folder=Deadlocker/BudgetMaster
roadmap.url=https://roadmaps.thecodelabs.de/roadmap/1
github.url=https://github.com/deadlocker8/BudgetMaster
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locale=en

# DEFAULT
credits=Fonts used: Roboto<br>Libraries used:<br>spring-boot-starter-parent 3.1.0<br>spring-boot-devtools 3.1.0<br>spring-boot-starter-web 3.1.0<br>spring-boot-starter-test 3.1.0<br>spring-boot-starter-security 3.1.0<br>pring-boot-starter-freemarker 3.1.0<br>spring-boot-starter-validation 3.1.0<br>spring-boot-starter-data-jpa 3.1.0<br>hibernate-jpamodelgen 6.1.7.Final<br>jakarta.xml.bind-api 4.0.0<br>maven-surefire-plugin 2.22.2<br>launch4j-maven-plugin 1.7.25<br>jquery 3.6.4<br>materialize 1.0.0<br>fontawesome 6.4.0<br>Google Material Icons<br>Vanilla-picker 2.12.1<br>SortableJS 1.15.0<br>jlibs 3.2.0<br>itextpdf 5.5.13.3<br>mousetrap 1.6.5<br>plotly 2.24.2<br>momentjs 2.29.4<br>codemirror 5.62.2<br>webjars-locator 0.46<br>libUtils 3.2.7<br>libStorage 3.2.3<br>natorder 1.1.3<br>jgit 6.6.0.202305301015-r<br>opencsv 5.7.1<br>datatables 1.13.4<br>
credits=Fonts used: Roboto<br>Libraries used:<br>spring-boot-starter-parent 3.1.1<br>spring-boot-devtools 3.1.1<br>spring-boot-starter-web 3.1.1<br>spring-boot-starter-test 3.1.1<br>spring-boot-starter-security 3.1.1<br>pring-boot-starter-freemarker 3.1.1<br>spring-boot-starter-validation 3.1.1<br>spring-boot-starter-data-jpa 3.1.1<br>hibernate-jpamodelgen 6.1.7.Final<br>jakarta.xml.bind-api 4.0.0<br>maven-surefire-plugin 2.22.2<br>launch4j-maven-plugin 1.7.25<br>jquery 3.6.4<br>materialize 1.0.0<br>fontawesome 6.4.0<br>Google Material Icons<br>Vanilla-picker 2.12.1<br>SortableJS 1.15.0<br>jlibs 3.2.0<br>itextpdf 5.5.13.3<br>mousetrap 1.6.5<br>plotly 2.24.2<br>momentjs 2.29.4<br>codemirror 5.62.2<br>webjars-locator 0.46<br>libUtils 3.2.7<br>libStorage 3.2.3<br>natorder 1.1.3<br>jgit 6.6.0.202305301015-r<br>opencsv 5.7.1<br>datatables 1.13.5<br>
folder=Deadlocker/BudgetMaster
roadmap.url=https://roadmaps.thecodelabs.de/roadmap/2
github.url=https://github.com/deadlocker8/BudgetMaster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ news.further.information=Weitere Informationen
news.all.releases=Alle veröffentlichten und geplanten Versionen:
news.detailed=Ausführliches Changelog (nur auf Englisch):

news.csvImportBugfixMultipleTimes.headline=Bugfix: Buchungen werden nicht mehr doppelt gespeichert
news.csvImportBugfixMultipleTimes.description=Behebt einen Fehler, der dazu führte, dass Buchungen beim CSV-Import mehrfach gespeichert wurden.

news.dockerImageSize.headline=Größe des Docker-Images reduziert
news.dockerImageSize.description=Deutliche Reduzierung der Größe des Docker-Images.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ news.further.information=Further information
news.all.releases=All published and planned releases:
news.detailed=Detailed changelog (english only):

news.csvImportBugfixMultipleTimes.headline=Bugfix: Transactions are no longer saved multiple times
news.csvImportBugfixMultipleTimes.description=Fixed an error that caused transactions to be saved multiple times during CSV import.

news.dockerImageSize.headline=Improve docker image size
news.dockerImageSize.description=Drastically reduce the size of the docker image.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ $(document).ready(function()

$('#table-transaction-rows').DataTable({
paging: false,
order: [[1, 'desc']],
order: [[2, 'desc']],
info: false,
scrollX: true,
scrollY: false,
columnDefs: [
{ orderable: false, targets: 5}
{ orderable: false, targets: 6}
],
language: { search: '' , searchPlaceholder: localizedSearch},
});
Expand Down Expand Up @@ -56,34 +56,42 @@ function initCsvTransactionForms()
for(let i = 0; i < forms.length; i++)
{
let form = forms[i];
$(form).submit(function(event)
console.log(i)
console.log(form)
// form.removeEventListener('submit', submitTransactionInPlaceForm);
form.addEventListener('submit', submitTransactionInPlaceForm);
}
}

function submitTransactionInPlaceForm(event)
{
const form = event.target;
console.log('form ' + form)
const csvTransactionId = form.dataset.index;
console.log('go')

$.ajax({
type: 'POST',
url: $(this).attr('action'),
data: new FormData(form),
processData: false,
contentType: false,
success: function(response)
{
$('#transaction-import-row-' + csvTransactionId).replaceWith(response);
initCsvTransactions();
},
error: function(response)
{
const csvTransactionId = form.dataset.index;

$.ajax({
type: 'POST',
url: $(this).attr('action'),
data: new FormData(form),
processData: false,
contentType: false,
success: function(response)
{
$('#transaction-import-row-' + csvTransactionId).replaceWith(response);
initCsvTransactions();
},
error: function(response)
{
M.toast({
html: "Error saving transaction",
classes: 'red'
});
console.error(response);
}
M.toast({
html: "Error saving transaction",
classes: 'red'
});
console.error(response);
}
});

event.preventDefault();
});
}
event.preventDefault();
}

function initCsvTransactionButtons()
Expand All @@ -92,23 +100,29 @@ function initCsvTransactionButtons()
for(let i = 0; i < buttonsSkip.length; i++)
{
const button = buttonsSkip[i];
button.addEventListener('click', function()
{
performCsvTransactionGetRequestWithoutReload(button, 'Error skipping transaction');
});
button.removeEventListener('click', skipRow);
button.addEventListener('click', skipRow);
}

const buttonsUndoSkip = document.getElementsByClassName('button-request-transaction-import-undo-skip');
for(let i = 0; i < buttonsUndoSkip.length; i++)
{
const button = buttonsUndoSkip[i];
button.addEventListener('click', function()
{
performCsvTransactionGetRequestWithoutReload(button, 'Error undo skip transaction');
});
button.removeEventListener('click', undoSkipRow);
button.addEventListener('click', undoSkipRow);
}
}

function skipRow(event)
{
performCsvTransactionGetRequestWithoutReload(event.currentTarget, 'Error skipping transaction');
}

function undoSkipRow(event)
{
performCsvTransactionGetRequestWithoutReload(event.currentTarget, 'Error undo skip transaction');
}

function performCsvTransactionGetRequestWithoutReload(button, errorMessage)
{
const url = button.dataset.url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
</div>
</#macro>

<#macro customSelectEnd inputName selectedItem>
<input type="hidden" name="${inputName}" class="hidden-input-custom-select" <#if selectedItem??>value="${selectedItem.getID()?c}"</#if>/>
<#macro customSelectEnd inputName selectedItem form="">
<input type="hidden" name="${inputName}" class="hidden-input-custom-select" <#if selectedItem??>value="${selectedItem.getID()?c}"</#if> <#if form?has_content>form="${form}"</#if>/>
</div>
</div>
</div>
</#macro>

<#macro customCategorySelect categories selectedCategory inputClasses labelText id showName=true rowClasses="" disabled=false>
<#macro customCategorySelect categories selectedCategory inputClasses labelText id showName=true rowClasses="" disabled=false form="">
<@customSelectStart "category-select-wrapper" categories inputClasses labelText id "label" disabled rowClasses>
<div class="custom-select-trigger" tabindex="0">
<div class="custom-select-selected-item">
Expand Down Expand Up @@ -52,7 +52,7 @@
</#list>
</div>
</@customSelectStart>
<@customSelectEnd "category" selectedCategory/>
<@customSelectEnd "category" selectedCategory form/>
</#macro>

<#macro customAccountSelect selector inputName accounts selectedAccount inputClasses labelText id disabled=false>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
</a>
</#macro>

<#macro buttonSubmit name icon localizationKey id="" color="background-blue" classes="" disabled=false formaction="" value="" onclick="">
<button id="${id}" class="btn waves-effect waves-light ${color} ${classes}" type="submit" name="${name}" <#if disabled>disabled</#if> <#if formaction?has_content>formaction="<@s.url formaction/>"</#if> <#if value?has_content>value="${value}"</#if> <#if onclick?has_content>onclick="${onclick}"</#if>>
<#macro buttonSubmit name icon localizationKey id="" color="background-blue" classes="" disabled=false formaction="" value="" onclick="" form="">
<button <#if id?has_content>id="${id}"</#if> class="btn waves-effect waves-light ${color} ${classes}" type="submit" name="${name}" <#if disabled>disabled</#if> <#if formaction?has_content>formaction="<@s.url formaction/>"</#if> <#if value?has_content>value="${value}"</#if> <#if onclick?has_content>onclick="${onclick}" </#if> <#if form?has_content>form="${form}" </#if>>
<i class="material-icons left <#if !localizationKey?has_content>no-margin</#if>">${icon}</i><#if localizationKey?has_content>${locale.getString(localizationKey)}</#if>
</button>
</#macro>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<@header.style "transactionImport"/>
<@header.style "collapsible"/>
<#import "/spring.ftl" as s>
<link rel="stylesheet" href="<@s.url '/webjars/datatables/1.13.4/css/jquery.dataTables.min.css'/>"/>
<link rel="stylesheet" href="<@s.url '/webjars/datatables/1.13.5/css/jquery.dataTables.min.css'/>"/>
</head>
<@header.body>
<#import "../helpers/navbar.ftl" as navbar>
Expand All @@ -27,6 +27,10 @@
</div>
</div>

<script>
transactionNameSuggestions = {};
</script>

<@header.content>
<div class="container">
<#if csvRows??>
Expand Down Expand Up @@ -69,7 +73,7 @@
<!-- Scripts-->
<#import "../helpers/scripts.ftl" as scripts>
<@scripts.scripts/>
<script src="<@s.url '/webjars/datatables/1.13.4/js/jquery.dataTables.min.js'/>"></script>
<script src="<@s.url '/webjars/datatables/1.13.5/js/jquery.dataTables.min.js'/>"></script>
<script src="<@s.url '/js/transactionImport.js'/>"></script>
</@header.body>
</html>
Loading

0 comments on commit 5b5c0f5

Please sign in to comment.