N°3136 - Add creation and modification of n-n objects in object details (#378)

* Rebase onto develop

* Use exit condition instead of englobing condition

* Add informative modals that can be called from modal toolbox

* Refactor "apply_modify" and "apply_new" into own controller, handle ajax requests with a json response and handle these responses in linkset creation/edition

* Fix merge issues

* Remove inverted condition

* Move linkset create button to a better place, still needs to fix duplicate "New" button caused by a refactor

* Handle "Cancel" button in modals

* Do not display relations when editing an object in a modal

* More elegant way to add "New" button to relations lists

* Factorize vertical highlights in alerts and modal in a single mixin

* Replace button name with dict entry code

* Change route name to snake case

* More elegant way to add "Create in modal" button to relations lists

* Replace triple if with in_array

* Move listener to body

* Rename variable to match boolean rules

* Rename event

* Rename extra param

* Add phpdoc

* Revert changes

* Check indirect linkset rights before allowing creation in modal
This commit is contained in:
Stephen Abello
2023-01-18 13:35:48 +01:00
committed by GitHub
parent cc2881a7b0
commit e1ffa65d8b
21 changed files with 835 additions and 328 deletions

View File

@@ -1,5 +1,5 @@
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @copyright Copyright (C) 2010-2023 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -9,9 +9,6 @@ $ibo-alert--padding-x: 20px !default;
$ibo-alert--min-height: 30px !default;
$ibo-alert--border-radius: $ibo-border-radius-300 !default;
$ibo-alert--title--highlight--width: 4px !default;
$ibo-alert--title--highlight--height: 100% !default;
$ibo-alert--body--margin-top: $ibo-spacing-200 !default;
$ibo-alert-minimized--padding-y: 5px !default;
@@ -68,14 +65,7 @@ $ibo-alert-colors: (
@extend %ibo-font-size-150;
&::before {
display: block;
position: absolute;
top: 0;
left: 0;
content: '';
width: $ibo-alert--title--highlight--width;
height: $ibo-alert--title--highlight--height;
@include ibo-vertical-highlight;
}
.ibo-alert--title {

View File

@@ -1,11 +1,18 @@
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @copyright Copyright (C) 2010-2023 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/* SCSS variables */
$ibo-modal-option--do-not-show-again--margin-top: $ibo-spacing-500 !default;
$ibo-modal--is-informative--min-width: $ibo-size-700 !default;
$ibo-modal--is-informative--min-height: $ibo-size-300 !default;
$ibo-modal--is-informative--is-error--highlight--background-color: $ibo-color-red-600 !default;
$ibo-modal--is-informative--is-warning--highlight--background-color: $ibo-color-orange-600 !default;
$ibo-modal--is-informative--is-information--highlight--background-color: $ibo-color-blue-600 !default;
$ibo-modal--is-informative--is-success--highlight--background-color: $ibo-color-green-600 !default;
// Modal Option - Do not show again
.ibo-modal-option--do-not-show-again{
margin-top: $ibo-modal-option--do-not-show-again--margin-top;
@@ -15,4 +22,27 @@ $ibo-modal-option--do-not-show-again--margin-top: $ibo-spacing-500 !default;
display: inline-block;
width: auto;
}
}
.ibo-modal.ibo-is-informative{
display: flex;
align-items: center;
min-width: $ibo-modal--is-informative--min-width;
min-height: $ibo-modal--is-informative--min-height !important; // !important in order to overload jQueryUI CSS rule that's put directly on the element
&::before {
@include ibo-vertical-highlight;
}
&.ibo-is-error::before {
background-color: $ibo-modal--is-informative--is-error--highlight--background-color;
}
&.ibo-is-warning::before {
background-color: $ibo-modal--is-informative--is-warning--highlight--background-color;
}
&.ibo-is-information::before {
background-color: $ibo-modal--is-informative--is-information--highlight--background-color;
}
&.ibo-is-success::before {
background-color: $ibo-modal--is-informative--is-success--highlight--background-color;
}
}

View File

@@ -160,7 +160,7 @@ $ibo-tab-container--tab-container--last--min-height: 60vh !default;
.ibo-tab-container--tab-container {
min-height: $ibo-tab-container--tab-container--min-height;
}
.ibo-tab-container--tab-container:last-child {
.ibo-tab-container--tab-container:last-child:not(:only-child) {
min-height: $ibo-tab-container--tab-container--last--min-height;
}
}

View File

@@ -1,5 +1,6 @@
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @copyright Copyright (C) 2010-2023 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@import "highlight";

View File

@@ -0,0 +1,17 @@
/*
* @copyright Copyright (C) 2010-2023 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-vertical-highlight--width: $ibo-size-100;
$ibo-vertical-highlight--height: 100%;
@mixin ibo-vertical-highlight {
display: block;
position: absolute;
top: 0;
left: 0;
content: "";
width: $ibo-vertical-highlight--width;
height: $ibo-vertical-highlight--height;
}