Merge remote-tracking branch 'origin/support/3.2' into develop

# Conflicts:
#	.doc/itop-version-history.md
This commit is contained in:
Molkobain
2024-06-28 15:08:31 +02:00
18 changed files with 152 additions and 238 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -178,10 +178,6 @@ class Editor extends ClassicEditor {
'resizeImage:50',
'resizeImage:original',
'|',
'imageStyle:alignLeft',
'imageStyle:alignCenter',
'imageStyle:alignRight',
'|',
'toggleImageCaption',
],
resizeOptions: [

View File

@@ -1,9 +0,0 @@
/* mention list ui customization */
:root {
--ck-color-list-button-on-background: #EFF0EF;
--ck-color-list-button-on-background-focus: #EFF0EF;
--ck-color-list-button-hover-background: #EFF0EF;
--ck-color-list-button-on-text: black;
--ck-z-default: 9999;
}

View File

@@ -1,9 +1,17 @@
/* mention list ui customization */
/**
* This file contains CKEditor 5 default theme styles.
* "Default theme" means common styles for all GUIs (backoffice, portal, ...)
*
* Any style specific for the backoffice should be in the backoffice theme (e.g. "css/backoffice/vendors/_ckeditor.scss)
* Any style specific for the portal should be in the portal theme (e.g. "datamodels/2.x/itop-portal-base/portal/public/css/portal.scss")
*/
:root {
--ck-color-list-button-on-background: #EFF0EF;
--ck-color-list-button-on-background-focus: #EFF0EF;
--ck-color-list-button-hover-background: #EFF0EF;
--ck-color-list-button-on-text: black;
--ck-color-image-caption-background: transparent;
/* Toolbar buttons / components downsize for better integration with UIs */
--ck-spacing-small: 0.35rem;
@@ -19,8 +27,7 @@
--ck-text-huge-font-size: 1.8rem;
}
/** text size classes */
/* Text size classes */
.text-tiny {
font-size: var(--ck-text-tiny-font-size);
}
@@ -37,8 +44,7 @@
font-size: var(--ck-text-huge-font-size);
}
/** marker classes */
/* Marker classes */
.marker-yellow {
background-color: var(--ck-highlight-marker-yellow);
}
@@ -53,4 +59,30 @@
.marker-blue {
background-color: var(--ck-highlight-marker-blue);
}
/* Editor base style */
/* - Fix editor base z-index to avoid its children (images, drop down buttons, ...) passing on top of other elements */
.ck-editor {
z-index: 0;
}
/* Figures / images */
/* - Avoid text being typed next to the image, only below */
.ck-content .image img {
min-width: inherit;
}
.ck-content .image-style-align-left,
.ck-content .image-style-align-right {
display: block;
float: unset;
}
.ck-content .image-style-align-left {
text-align: left;
margin-right: 0;
}
.ck-content .image-style-align-right {
text-align: right;
margin-left: 0;
}

View File

@@ -95,7 +95,14 @@ $(function()
value = $(oElem).val();
}
}
else if($(oElem).is(':checkbox') || $(oElem).is(':radio'))
else if( $(oElem).is(':radio'))
{
if($(oElem).is(':checked'))
{
value =$(oElem).val();
}
}
else if($(oElem).is(':checkbox'))
{
if(value === null)
{

View File

@@ -80,7 +80,7 @@ $(function() {
},
_bindEvents: async function () {
let me = this;
let CKEditorInstance = await this._GetCKEditorInstance();
let CKEditorInstance = this._GetCKEditorInstance();
// Handlers for the CKEditor itself
// Handle only the current CKEditor instance
// if (oEvent.editor.name !== me.options.text_input_id) {
@@ -91,7 +91,7 @@ $(function() {
// Note: That when images are uploaded, the "change" event is triggered before the image upload is complete, meaning that we don't have the <img> tag yet.
CKEditorInstance.model.document.on('change:data', async function () {
const bWasDraftBefore = me.is_draft;
const bIsDraftNow = !(await me._IsInputEmpty());
const bIsDraftNow = !(me._IsInputEmpty());
if (bWasDraftBefore !== bIsDraftNow) {
me.is_draft = bIsDraftNow;
me._UpdateEditingVisualHint();
@@ -198,12 +198,8 @@ $(function() {
this.element.trigger('requested_submission.caselog_entry_form.itop', oData);
},
// - Form
_GetCKEditorInstance: async function () {
// if(this.element.find('#' + this.options.text_input_id + ' ~ .ck .ck-editor__editable')[0] === undefined){
// return undefined;
// }
return await CombodoCKEditorHandler.GetInstance('#'+this.options.text_input_id);
//return this.element.find('#' + this.options.text_input_id + ' ~ .ck .ck-editor__editable')[0].ckeditorInstance;
_GetCKEditorInstance: function () {
return CombodoCKEditorHandler.GetInstanceSynchronous('#'+this.options.text_input_id);
},
_ShowEntryForm: function () {
this.element.closest(this.js_selectors.activity_panel).find(this.js_selectors.form).removeClass(this.css_classes.is_closed);
@@ -219,13 +215,13 @@ $(function() {
_EnableSubmission: function () {
this.element.find(this.js_selectors.save_button+', '+this.js_selectors.save_choices_picker).prop('disabled', false);
},
_EnterPendingSubmissionState: async function () {
(await this._GetCKEditorInstance()).enableReadOnlyMode('hi');
_EnterPendingSubmissionState: function () {
this._GetCKEditorInstance().enableReadOnlyMode('hi');
this.element.find(this.js_selectors.cancel_button).prop('disabled', true);
this._DisableSubmission();
},
_LeavePendingSubmissionState: async function () {
(await this._GetCKEditorInstance()).disableReadOnlyMode('hi');
_LeavePendingSubmissionState: function () {
this._GetCKEditorInstance().disableReadOnlyMode('hi');
this.element.find(this.js_selectors.cancel_button).prop('disabled', false);
this._EnableSubmission();
},
@@ -276,29 +272,27 @@ $(function() {
* @returns {void}
* @private
*/
_UpdateBridgeInput: async function () {
_UpdateBridgeInput: function () {
const sCaseLogAttCode = this.element.closest(this.js_selectors.activity_panel_toolbar).attr('data-caselog-attribute-code');
let oBridgeInputElem = this._GetGeneralFormElement().find('input[name="attr_'+sCaseLogAttCode+'"]');
oBridgeInputElem.val(await this._GetInputData());
oBridgeInputElem.val(this._GetInputData());
},
// - Input zone
_EmptyInput: function() {
this._GetCKEditorInstance().then((oEditor) => {
oEditor.setData('');
this._UpdateEditingVisualHint();
});
this._GetCKEditorInstance().setData('');
this._UpdateEditingVisualHint();
},
/**
* @returns {boolean} True if the input has no text
* @private
*/
_IsInputEmpty: async function () {
let sCKEditorValue = await this._GetInputData();
_IsInputEmpty: function () {
let sCKEditorValue = this._GetInputData();
return sCKEditorValue === '';
},
_GetInputData: async function () {
let oCKEditorInstance = await this._GetCKEditorInstance()
_GetInputData: function () {
let oCKEditorInstance = this._GetCKEditorInstance()
return (oCKEditorInstance === undefined) ? '' : oCKEditorInstance.getData();
},
_GetExtraInputs: function() {
@@ -334,20 +328,15 @@ $(function() {
this._UpdateSubmitButtonState();
},
_UpdateSubmitButtonState: function() {
this._IsInputEmpty().then((bIsEmpty) => {
if (bIsEmpty) {
this._DisableSubmission();
} else {
this._EnableSubmission();
}
});
if (this._IsInputEmpty()) {
this._DisableSubmission();
} else {
this._EnableSubmission();
}
},
_UpdateEditingVisualHint: function () {
this._IsInputEmpty().then((bIsEmpty) => {
const sEvent = bIsEmpty ? 'emptied' : 'draft';
this.element.trigger(sEvent+'.caselog_entry_form.itop', {attribute_code: this.options.attribute_code});
}
)
const sEvent = this._IsInputEmpty() ? 'emptied' : 'draft';
this.element.trigger(sEvent+'.caselog_entry_form.itop', {attribute_code: this.options.attribute_code});
}
});
});