Skip to content

Commit

Permalink
Fix: not working currency settings, reworked DataLoading for CreateAc…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
Volmarg committed Aug 31, 2020
1 parent be2166f commit f49e51f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion public/assets/app.js

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions src/assets/scripts/core/ui/Actions/CreateAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,13 @@ export default class CreateAction extends AbstractAction {
let processedEntityName = form.attr('data-entity');
let singleProcessedFormDefinitionName = form.attr('data-form-target');

let isEntityBasedForm = ("undefined" != typeof processedEntityName);

/**
* @description build data bag for request using either entity based form or single-target one
* and build callbacks used after receiving backend response
*/
var dataProcessorDto = null as DataProcessorDto;
if(isEntityBasedForm){
dataProcessorDto = DataProcessorLoader.getCreateDataProcessorDto(DataProcessorLoader.PROCESSOR_TYPE_ENTITY, processedEntityName);
}else{
let dataProcessorDto = DataProcessorLoader.getCreateDataProcessorDto(DataProcessorLoader.PROCESSOR_TYPE_ENTITY, processedEntityName);

if( !(dataProcessorDto instanceof DataProcessorDto) ){
dataProcessorDto = DataProcessorLoader.getCreateDataProcessorDto(DataProcessorLoader.PROCESSOR_TYPE_SPECIAL_ACTION, singleProcessedFormDefinitionName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="bgc-white bd bdrs-3 p-20 mB-20 d-flex flex-column">
<h4 class="c-grey-900 mB-20 align-self-center">{{ 'settings.finances.type.currencies.addCurrency' | trans }}</h4>
<div class="col-md-6 align-self-center add-record-form">
{{ form(currency_form, {'attr':{' data-entity':"settingsFinancesCurrencyForm"}})}}
{{ form(currency_form, {'attr':{'data-form-target':"settingsFinancesCurrencyForm"}})}}
</div>
</div>
</div>
Expand Down

0 comments on commit f49e51f

Please sign in to comment.