diff --git a/datamodels/2.x/combodo-data-feature-removal/templates/AjaxCompile.html.twig b/datamodels/2.x/combodo-data-feature-removal/templates/AjaxCompile.html.twig new file mode 100644 index 0000000000..d256868cff --- /dev/null +++ b/datamodels/2.x/combodo-data-feature-removal/templates/AjaxCompile.html.twig @@ -0,0 +1,2 @@ +{# @copyright Copyright (C) 2010-2026 Combodo SARL #} +{# @license http://opensource.org/licenses/AGPL-3.0 #} diff --git a/datamodels/2.x/combodo-data-feature-removal/templates/AjaxRunAudit.html.twig b/datamodels/2.x/combodo-data-feature-removal/templates/AjaxRunAudit.html.twig new file mode 100644 index 0000000000..9a4baf349e --- /dev/null +++ b/datamodels/2.x/combodo-data-feature-removal/templates/AjaxRunAudit.html.twig @@ -0,0 +1,46 @@ +{# @copyright Copyright (C) 2010-2026 Combodo SARL #} +{# @license http://opensource.org/licenses/AGPL-3.0 #} + +{% if bDeletionNeeded %} + {% UIFieldSet Standard {sLegend:'DataFeatureRemoval:DeletionPlan:Title'|dict_s} %} + {% UIDataTable ForForm { sRef:'aDeletionPlanSummary', aColumns:aDeletionPlanSummary.Columns, aData:aDeletionPlanSummary.Data} %}{% EndUIDataTable %} + {% EndUIFieldSet %} + {% if bDeletionPossible %} + {% UIForm Standard {} %} + {% UIInput ForHidden { sName:'transaction_id', sValue:sTransactionId} %} + {% UIInput ForHidden { sName:'operation', sValue:'DoDeletion'} %} + {% for sKey, sClass in aClasses %} + {% UIInput ForHidden { sName:"classes[" ~ sKey ~ "]", sValue:sClass } %} + {% endfor %} + {% for sCode, sLabel in aAddedExtensions %} + {% UIInput ForHidden { sName:"aAddedExtensions[" ~ sCode ~ "]", sValue:sLabel } %} + {% endfor %} + {% for sCode, sLabel in aRemovedExtensions %} + {% UIInput ForHidden { sName:"aRemovedExtensions[" ~ sCode ~ "]", sValue:sLabel } %} + {% endfor %} + {% for sInputName, sValue in aHiddenInputs %} + {% UIInput ForHidden { sName:sInputName, sValue:sValue } %} + {% endfor %} + {% UIToolbar ForButton {} %} + {% UIButton ForPrimaryAction {sLabel:'UI:Button:DoDeletion'|dict_s, sName:'btn_deletion', sId:'btn_deletion', bIsSubmit:true} %} + {% EndUIToolbar %} + {% EndUIForm %} + {% else %} + {% UIAlert ForFailure { sTitle: 'aze', sContent: 'DataFeatureRemoval:DeletionPlan:Error:Issues'|dict_s } %}{% EndUIAlert %} + {% endif %} +{% else %} + {% UIAlert ForSuccess { sTitle:'DataFeatureRemoval:CleanupComplete:Title'|dict_s, sContent:'DataFeatureRemoval:CompilComplete'|dict_s } %}{% EndUIAlert %} + + {% UIForm Standard {sId:'launch-setup-form', Action:sLaunchSetupUrl, EncType: 'application/x-www-form-urlencoded'} %} + {% for sKey, sValue in aSetupParams %} + {% UIInput ForHidden { sName:sKey, sValue:sValue } %} + {% endfor %} + {% UIButton ForPrimaryAction {sLabel:'UI:Button:Setup'|dict_s, sName:'btn_setup', sId:'btn_setup', bIsSubmit:true} %} + {% EndUIForm %} +{% endif %} + +{% if bHasDeletionExecution %} + {% UIFieldSet Standard {sLegend:'DataFeatureRemoval:Execution:Title'|dict_s} %} + {% UIDataTable ForForm { sRef:'aDeletionExecutionSummary', aColumns:aDeletionExecutionSummary.Columns, aData:aDeletionExecutionSummary.Data} %}{% EndUIDataTable %} + {% EndUIFieldSet %} +{% endif %} diff --git a/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.ready.js.twig b/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.ready.js.twig new file mode 100644 index 0000000000..70c9a33b1a --- /dev/null +++ b/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.ready.js.twig @@ -0,0 +1,51 @@ +{# @copyright Copyright (C) 2010-2026 Combodo SARL #} +{# @license http://opensource.org/licenses/AGPL-3.0 #} + + +function ajax_run_audit() { + $('#ajax_run_audit_in_progress_msg').removeClass('ibo-is-hidden'); + $.post( + '{{ sAjaxURL|raw }}', + { operation: 'ajax_run_audit' }, + function (data) { + $('#ajax_run_audit_in_progress_msg').addClass('ibo-is-hidden'); + + if (data.error_message) { + $('#ajax_run_audit_error_msg .ibo-alert--title').html(data.error_message); + $('#ajax_run_audit_error_msg').removeClass('ibo-is-hidden'); + } else { + $('#ajax_run_audit_success_msg').removeClass('ibo-is-hidden'); + $('#ajax_run_audit').html(data); + } + } + ); +} + +function ajax_compile() { + $('#ajax_compile_in_progress_msg').removeClass('ibo-is-hidden'); + + $.post( + '{{ sAjaxURL|raw }}', + { operation: 'ajax_compile' }, + function (data) { + $('#ajax_compile_in_progress_msg').addClass('ibo-is-hidden'); + + if (data.error_message) { + $('#ajax_compile_error_msg .ibo-alert--title').html(data.error_message); + $('#ajax_compile_error_msg').removeClass('ibo-is-hidden'); + } else { + $('#ajax_compile_success_msg .ibo-alert--title').html(data.success_message); + $('#ajax_compile_success_msg').removeClass('ibo-is-hidden'); + + ajax_run_audit(); + } + }, + 'json' + ) + .fail(function() { + $('#ajax_compile_error_msg .ibo-alert--title').html('{{ 'DataFeatureRemoval:Ajax:Error'|dict_s }}'); + $('#ajax_compile_error_msg').removeClass('ibo-is-hidden'); + }); +} + +ajax_compile(); \ No newline at end of file