Skip to content

Commit

Permalink
fix with boolean.
Browse files Browse the repository at this point in the history
  • Loading branch information
ihabzee committed Apr 14, 2023
1 parent 515c588 commit 7d6999d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions OnCoreIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ public function injectIntegrationUI($project_irb)
"oncore_integrations" => $integrations,
"has_oncore_integration" => $this->hasOnCoreIntegration() ,
"has_field_mappings" => !empty($this->getMapping()->getProjectFieldMappings()['pull']) && !empty($this->getMapping()->getProjectFieldMappings()['push']) ? true : false ,
"last_adjudication" => $last_adjudication,
"matching_library" => $matching_library
"last_adjudication" => $last_adjudication,
"matching_library" => $matching_library
);

$aa = ($this->escape(json_encode($notifs_config)));
Expand All @@ -641,6 +641,7 @@ public function injectIntegrationUI($project_irb)
$(function () {
const module = <?=$this->getJavascriptModuleObjectName()?>;
module.config = decode_object("<?=$this->escape(json_encode($notifs_config))?>");
console.log(module.config)
module.afterRender(<?=$this->getJavascriptModuleObjectName()?>.InitFunction);
})
</script>
Expand Down
5 changes: 4 additions & 1 deletion assets/scripts/oncore.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ function decode_object(obj) {
if (typeof parsedObj[key] === 'object') {
parsedObj[key] = decode_object(parsedObj[key])
} else {
parsedObj[key] = decode_string(parsedObj[key])
// ignore boolean because changing them to string will cause error.
if (typeof parsedObj[key] != 'boolean') {
parsedObj[key] = decode_string(parsedObj[key])
}
}
}
return parsedObj
Expand Down

0 comments on commit 7d6999d

Please sign in to comment.