Skip to content

Commit

Permalink
Dev to release 4.0.2 (#1259)
Browse files Browse the repository at this point in the history
* https://myddleware.atlassian.net/browse/PROJ-585 set different id for rule search bar to not have same css properties (#1243)

* add second rule to not have empty space after create a new action (#1244)

* Hotfix 4.0.0-1 (#1242)

* Hotfix : fix error on RuleGroup because of description field
Signed-off-by: Stephane Faure <stephanefaure@myddleware.com>

* https://myddleware.atlassian.net/browse/PROJ-585 set different id for rule search bar to not have same css properties

* add second rule to not have empty space after create a new action

* Hotfix 21 jan 24 (#1246)

* Change the way to save the database credentials

* Moodle connector : add the user preference modification (#1249)

Signed-off-by: Stephane Faure <stephanefaure@myddleware.com>

* Set version 4.0.1-0

* remove unused function to avoid deprecation (#1248)

Deprecated: Optional parameter $page declared before required parameter $request is implicitly treated as a required parameter in /home/clients/449288e065b68a74f5cdfd53c83ad702/sites/demo.myd.myddleware.cloud/src/Controller/WorkflowController.php on line 232

* SuiteCRM connector : change the way the direct link is created

Signed-off-by: Stephane Faure <stephanefaure@myddleware.com>

* SuiteCRM connector : fix suiteCRM direct link

Signed-off-by: Stephane Faure <stephanefaure@myddleware.com>

* https://myddleware.atlassian.net/browse/PROJ-580 adjust color, and check icon position (#1255)

* Remove docs direcory

Signed-off-by: Stephane Faure <stephanefaure@myddleware.com>

* Add sub module docs

Signed-off-by: Stephane Faure <stephanefaure@myddleware.com>

* update docs to the latest submodule version

* Lookup rework (#1257)

* get two dropdowns

* get the correct value for the second dropdown, translations

* add lookup logic

* add 2 functions to get the material for lookup

* change frontend for lookup wizard, also put variables in both views because they both need the variables

* translations messages

* remove console.logs

* new logic for targets

* new dropdown for the  target

* values in step 3 too

* properly show the value not the group

* add the qtip in the function wizard

* improve the information messages, provide examples

* add dynamic info from the field in the formula

* function to get the info for the formula box

* add the dynamic path info in twig

* add margin to the buttons at the bottom of the fancy box

* insert function label, also put the tooltip at the bottom

* add little button to show or hide the tooltip

* have the labels for the rule and the field

* change padding of the dropdowns and minwidth to avoid overflow of the labels inside the dropdown

* keep field original

* use breakword instead of break-all to avoid date word break

* only show the box in which we have the tooltip once we have selected a function

* rule list: replace old switch button with new look

* switch css class to capture the new button

* detail view: use the new toggle instead of the old

* Bugfix : recalculate running instances (#1258)

Signed-off-by: Stephane Faure <stephanefaure@myddleware.com>

---------

Signed-off-by: Stephane Faure <stephanefaure@myddleware.com>
Co-authored-by: AlexMyddleware <106162060+AlexMyddleware@users.noreply.github.com>
Co-authored-by: AlexMyddleware <alexistroitzky@myddleware.com>
  • Loading branch information
3 people authored Feb 6, 2025
1 parent bd424d3 commit 4d12ad1
Show file tree
Hide file tree
Showing 231 changed files with 593 additions and 3,943 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs"]
path = docs
url = https://github.com/Myddleware/myddleware-docs.git
29 changes: 29 additions & 0 deletions assets/css/animation.css
Original file line number Diff line number Diff line change
Expand Up @@ -544,3 +544,32 @@ h2 { margin-top: 50px;}
cursor: not-allowed;
opacity: 0.6; /* Optional: makes it look disabled */
}


#area_confirm {
margin-top: 35px;
}

.function-wizard-title {
margin-left: 1em;
font-weight: bold;
}

.function-wizard-select {
display: flex;
flex-direction: row;
align-items: center;
}

.function-wizard-title-function-select {
font-weight: bold;
margin-left: 1em;
margin-right: 1em;
margin-bottom: 0;
}

#function-select {
height: auto;
margin-bottom: 0;
padding-right: 0.25rem;
}
15 changes: 13 additions & 2 deletions assets/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,22 @@ footer {
background: #f2dedf;
}

.success {
background: #19CA426E !important;
display: flex;
}

.success-custom-adjust {
margin-right: 10px;
margin-top: 5px;
}

#notification #zone_notification .success {
color: #9aa932;
background: white;
color: #000;
background: #19CA426E;
}


/* help content */
.help-content {
border-top: 1px solid #ccc;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/regle.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
min-width: 155px;
text-align: center!important;
vertical-align: middle;
word-break: break-all;
word-break: break-word;
}

.solution_block {
Expand Down
128 changes: 126 additions & 2 deletions assets/js/regle.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ $.fn.setCursorPosition = function(pos) {
var newContent =
content.substr(0, position) +
'"' +
$.trim($("select", "#source_info").val()) +
$.trim($("#source_value_select").val()) +
'"' +
content.substr(position);
$("#area_insert").val(newContent);
Expand All @@ -634,7 +634,7 @@ $.fn.setCursorPosition = function(pos) {
var newContent =
content.substr(0, position) +
'"' +
$.trim($("select", "#target_info").val()) +
$.trim($("#target_value_select").val()) +
'"' +
content.substr(position);
$("#area_insert").val(newContent);
Expand Down Expand Up @@ -2365,3 +2365,127 @@ document.addEventListener('DOMContentLoaded', function () {
new bootstrap.Tooltip(tooltipTriggerEl);
});
});

// Function wizard handling
$(document).ready(function() {
const functionSelect = $('#function-select');
const lookupOptions = $('#lookup-options');
const lookupRule = $('#lookup-rule');
const lookupField = $('#lookup-field');
const flagFunctionWizardEnd = $('#flag-function-wizard-end');
let tooltipVisible = true;

// Add tooltip container after the select and hide it initially
$('<div id="function-tooltip" class="tooltip-box" style="padding: 10px; background: #f9f9f9; border: 1px solid #ddd; border-radius: 4px; margin-top: 5px; display: none;"></div>')
.insertAfter(flagFunctionWizardEnd);

// Handle tooltip toggle button
$('#toggle-tooltip').on('click', function() {
tooltipVisible = !tooltipVisible;
const tooltipBox = $('#function-tooltip');

if (tooltipVisible) {
$(this).find('i').removeClass('fa-question').addClass('fa-question-circle');
// Only show if a function is selected AND tooltip is enabled
if (functionSelect.val()) {
tooltipBox.show();
}
} else {
$(this).find('i').removeClass('fa-question-circle').addClass('fa-question');
tooltipBox.hide();
}
});

// Show tooltip when option changes
functionSelect.on('change', function() {
const selectedOption = $(this).find('option:selected');
const tooltip = selectedOption.data('tooltip');
const tooltipBox = $('#function-tooltip');

// Only show tooltip if a function is selected AND tooltip is enabled
if (tooltip && tooltipVisible && $(this).val()) {
tooltipBox.text(tooltip).show();
} else {
tooltipBox.hide();
}

const selectedFunction = $(this).val();

if (selectedFunction === 'lookup') {
lookupOptions.show();

// Populate rules dropdown
$.ajax({
url: lookupgetrule,
method: 'GET',
success: function(rules) {
lookupRule.empty();
lookupRule.append('<option value="">' + translations.selectRule + '</option>');
rules.forEach(rule => {
lookupRule.append(`<option value="${rule.id}">${rule.name}</option>`);
});
lookupRule.prop('disabled', false);
}
});
} else {
lookupOptions.hide();
insertFunction(selectedFunction);
}
});

// When a rule is selected
lookupRule.on('change', function() {
const selectedRule = $(this).val();


if (selectedRule) {
// Get fields for selected rule
$.ajax({
url: lookupgetfieldroute,
method: 'GET',
success: function(fields) {
lookupField.empty();
lookupField.append('<option value="">' + translations.selectField + '</option>');
// Filter fields to only show those from the selected rule
const filteredFields = fields.filter(field => field.rule_id === selectedRule);
filteredFields.forEach(field => {
lookupField.append(`<option value="${field.id}">${field.name}</option>`);
});
lookupField.prop('disabled', false);
}
});
} else {
lookupField.prop('disabled', true);
}
});

// When a field is selected
lookupField.on('change', function() {
if ($(this).val()) {
// Get the selected field's name (without the rule part in parentheses)
const selectedOption = $(this).find('option:selected');
const fieldName = selectedOption.text().split(' (')[0];
const lookupFormula = `lookup({${fieldName}}, "${lookupRule.val()}"`;
insertFunction(lookupFormula);
}
});

function insertFunction(funcText) {
const areaInsert = $('#area_insert');
const position = areaInsert.getCursorPosition();
const content = areaInsert.val();

// Add parentheses only if not already part of the funcText
const suffix = funcText.endsWith('"') ? ' )' : '( ';

const newContent =
content.substr(0, position) +
funcText +
suffix +
content.substr(position);

areaInsert.val(newContent);
colorationSyntax();
theme(style_template);
}
});
4 changes: 2 additions & 2 deletions assets/js/rulelist.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const $ = require('jquery');

$(function(){
$( ".onoffswitch" ).on('change', function(e) {
path_fiche_update = $(this).children('input').attr('title');
$(".form-check-input.toggle-switch-rule").on('change', function(e) {
path_fiche_update = $(this).attr('title');
$.ajax({
type: "POST",
url: path_fiche_update,
Expand Down
1 change: 1 addition & 0 deletions docs
Submodule docs added at c21c7a
Empty file removed docs/.nojekyll
Empty file.
Loading

0 comments on commit 4d12ad1

Please sign in to comment.