Skip to content

Commit

Permalink
fixed rendering of normal response data after form submit
Browse files Browse the repository at this point in the history
removed console logs
  • Loading branch information
brainfoolong committed Apr 9, 2024
1 parent 87af9ce commit 112135c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions appdata/modules/Framelix/js/form/framelix-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,6 @@ class FramelixForm {
if (!(buttonData.additionalAttributes instanceof FramelixHtmlAttributes)) {
buttonData.additionalAttributes = FramelixObjectUtils.phpJsonToJs(buttonData.additionalAttributes)
}
console.log(buttonData)
buttonData.additionalAttributes.assignToElement(button)
}
button.attr('data-type', buttonData.type)
Expand Down Expand Up @@ -901,8 +900,9 @@ class FramelixForm {
}
FramelixToast.showNext()
}

if (typeof responseData.buffer === 'string' && responseData.buffer.length) {
if (typeof responseData === 'string') {
FramelixRequest.renderResponse(responseData, requestOptions, this.container[0])
} else if (typeof responseData.buffer === 'string' && responseData.buffer.length) {
FramelixRequest.renderResponse(responseData.buffer, requestOptions, this.container[0])
}
return true
Expand Down
1 change: 0 additions & 1 deletion appdata/modules/Framelix/js/framelix-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ class FramelixRequest {
}
}
}
console.log(requestOptions)
const isFixedResponse = !(request instanceof FramelixRequest)
if (!requestOptions.renderTarget || requestOptions.renderTarget === FramelixTypeDefJsRequestOptions.RENDER_TARGET_NONE_AND_CLOSE) {
if (!isFixedResponse) {
Expand Down
5 changes: 3 additions & 2 deletions appdata/modules/Framelix/public/dist/js/form.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ class FramelixForm {
if (!(buttonData.additionalAttributes instanceof FramelixHtmlAttributes)) {
buttonData.additionalAttributes = FramelixObjectUtils.phpJsonToJs(buttonData.additionalAttributes);
}
console.log(buttonData);
buttonData.additionalAttributes.assignToElement(button);
}
button.attr('data-type', buttonData.type);
Expand Down Expand Up @@ -606,7 +605,9 @@ class FramelixForm {
}
FramelixToast.showNext();
}
if (typeof responseData.buffer === 'string' && responseData.buffer.length) {
if (typeof responseData === 'string') {
FramelixRequest.renderResponse(responseData, requestOptions, this.container[0]);
} else if (typeof responseData.buffer === 'string' && responseData.buffer.length) {
FramelixRequest.renderResponse(responseData.buffer, requestOptions, this.container[0]);
}
return true;
Expand Down
1 change: 0 additions & 1 deletion appdata/modules/Framelix/public/dist/js/general.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,6 @@ class FramelixRequest {
}
}
}
console.log(requestOptions);
const isFixedResponse = !(request instanceof FramelixRequest);
if (!requestOptions.renderTarget || requestOptions.renderTarget === FramelixTypeDefJsRequestOptions.RENDER_TARGET_NONE_AND_CLOSE) {
if (!isFixedResponse) {
Expand Down
4 changes: 3 additions & 1 deletion appdata/modules/Framelix/src/Storable/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class User extends StorableExtended
private static array $cache = [];

/**
* Only used for unit tests to simulate specific roles without actually storing that in the database The check is cached by default, once it have been checked. Set true to flush the cache
* Only used for unit tests to simulate specific roles without actually storing that in the database The check is
* cached by default, once it have been checked. Set true to flush the cache
* @var string[]|null
*/
public ?array $simulateRoles = null;
Expand Down Expand Up @@ -217,4 +218,5 @@ public function delete(bool $force = false): void
self::deleteMultiple(UserWebAuthn::getByCondition('`user` = {0}', [$this]));
parent::delete($force);
}

}

0 comments on commit 112135c

Please sign in to comment.