Merge pull request 'Add swals + Remove incompatible saves + add new tests' (#36) from dev.swal into dev
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.siklos-chaneru.duckdns.org/Siklos/svg-layout-designer-react/pulls/36
This commit is contained in:
commit
70863261aa
8 changed files with 8936 additions and 185 deletions
|
@ -6,6 +6,7 @@
|
|||
* If the contraints fails, an error message will be returned
|
||||
*/
|
||||
|
||||
import Swal from 'sweetalert2';
|
||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||
import { ISizePointer } from '../../../Interfaces/ISizePointer';
|
||||
|
||||
|
@ -126,8 +127,13 @@ export function constraintBodyInsideUnallocatedWidth(
|
|||
|
||||
// Check if there is still some space
|
||||
if (availableWidths.length === 0) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Not enough space!',
|
||||
text: 'Try to free the parent a little bit!'
|
||||
});
|
||||
throw new Error(
|
||||
'No available space found on the parent container. Try to free the parent a little before placing it inside.'
|
||||
'No available space found on the parent container. Try to free the parent a bit.'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -169,6 +175,14 @@ export function constraintBodyInsideUnallocatedWidth(
|
|||
|
||||
if (availableWidth === undefined) {
|
||||
console.warn(`Container ${container.properties.id} cannot fit in any space due to its minimum width being to large. Consequently, its rigid body property is disabled.`);
|
||||
Swal.fire({
|
||||
position: 'top-end',
|
||||
title: `Container ${container.properties.id} cannot fit!`,
|
||||
text: 'Its rigid body property is now disabled. Change its the minimum width or free the parent container.',
|
||||
timerProgressBar: true,
|
||||
showConfirmButton: false,
|
||||
timer: 5000
|
||||
});
|
||||
container.properties.isRigidBody = false;
|
||||
return container;
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ export function AddContainer(
|
|||
|
||||
// Update the state
|
||||
history.push({
|
||||
LastAction: `Add ${type} in ${parentClone.properties.id}`,
|
||||
LastAction: `Add ${newContainer.properties.id} in ${parentClone.properties.id}`,
|
||||
MainContainer: clone,
|
||||
SelectedContainer: parentClone,
|
||||
SelectedContainerId: parentClone.properties.id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue