mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
Merge branch 'master' into ticket-app-master
# Conflicts: # src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php # src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php # src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php # src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue # src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php # src/Bundle/ChillPersonBundle/Resources/public/types.ts # src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue
This commit is contained in:
84
docs/source/development/export-sequence.puml
Normal file
84
docs/source/development/export-sequence.puml
Normal file
@@ -0,0 +1,84 @@
|
||||
@startuml
|
||||
'https://plantuml.com/sequence-diagram
|
||||
|
||||
autonumber
|
||||
|
||||
User -> ExportController: configure export using form
|
||||
activate ExportController
|
||||
ExportController -> ExportForm: build form
|
||||
activate ExportForm
|
||||
|
||||
loop for every ExportElement (Filter, Aggregator)
|
||||
ExportForm -> ExportElement: `buildForm`
|
||||
activate ExportElement
|
||||
ExportElement -> ExportForm: add form to builders
|
||||
deactivate ExportElement
|
||||
end
|
||||
|
||||
ExportForm -> ExportController
|
||||
deactivate ExportForm
|
||||
|
||||
ExportController -> User: show form
|
||||
deactivate ExportController
|
||||
|
||||
note left of User: Configure the export:\ncheck filters, aggregators, …
|
||||
|
||||
User -> ExportController: post configuration of the export
|
||||
activate ExportController
|
||||
|
||||
ExportController -> ExportForm: `getData`
|
||||
activate ExportForm
|
||||
ExportForm -> ExportController: return data: list of entities, etc.
|
||||
deactivate ExportForm
|
||||
|
||||
loop for every ExportElement (Filter, Aggregator)
|
||||
ExportController -> ExportElement: serializeData (data)
|
||||
activate ExportElement
|
||||
ExportElement -> ExportController: return serializedData (simple array with string, int, …)
|
||||
deactivate ExportElement
|
||||
end
|
||||
|
||||
ExportController -> Database: `INSERT INTO RequestGeneration_table` (insert new entity)
|
||||
ExportController -> MessageQueue: warn about a new request
|
||||
activate MessageQueue
|
||||
ExportController -> User: "ok, generation is in process"
|
||||
deactivate ExportController
|
||||
|
||||
note left of User: The user see a waiting screen
|
||||
|
||||
MessageQueue -> MessengerConsumer: forward the message to the MessengerConsumer
|
||||
deactivate MessageQueue
|
||||
activate MessengerConsumer
|
||||
MessengerConsumer -> Database: `SELECT * FROM RequestGeneration_table WHERE id = %s`
|
||||
activate Database
|
||||
Database -> MessengerConsumer: return RequestGeneration with serializedData
|
||||
deactivate Database
|
||||
|
||||
loop for every ExportElement (Filter, Aggregator)
|
||||
MessengerConsumer -> ExportElement: deserializeData
|
||||
activate ExportElement
|
||||
ExportElement -> MessengerConsumer: return data (list of entities, etc.) from the serialized array
|
||||
deactivate ExportElement
|
||||
MessengerConsumer -> ExportElement: alter the sql query (`ExportElement::alterQuery`)
|
||||
activate ExportElement
|
||||
ExportElement -> MessengerConsumer: return the query with WHERE and GROUP BY clauses
|
||||
deactivate ExportElement
|
||||
end
|
||||
|
||||
MessengerConsumer -> MessengerConsumer: prepare the export
|
||||
MessengerConsumer -> MessengerConsumer: save the export as a stored object
|
||||
MessengerConsumer -> Database: `UPDATE RequestGeneration_table SET ready = true`
|
||||
deactivate MessengerConsumer
|
||||
|
||||
User -> ExportController: pull every 5s to know if the export is generated
|
||||
activate ExportController
|
||||
ExportController -> User: warn the export is generated
|
||||
deactivate ExportController
|
||||
|
||||
User -> ExportController: download the export from object storage
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@enduml
|
@@ -15,24 +15,31 @@ Messages to users, flashbags and buttons
|
||||
Flashbags
|
||||
==========
|
||||
|
||||
The four following levels are defined :
|
||||
The four following levels are defined :
|
||||
|
||||
+-----------+----------------------------------------------------------------------------------------------+
|
||||
|Key |Intent |
|
||||
+===========+==============================================================================================+
|
||||
|alert |A message not linked with the user action, but which should require an action or a |
|
||||
| |correction. |
|
||||
+-----------+----------------------------------------------------------------------------------------------+
|
||||
|success |The user action succeeds. |
|
||||
+-----------+----------------------------------------------------------------------------------------------+
|
||||
|notice |A simple message to give information to the user. The message may be linked or not linked with|
|
||||
| |the user action. |
|
||||
+-----------+----------------------------------------------------------------------------------------------+
|
||||
|warning |A message linked with an action, the user should correct. |
|
||||
+-----------+----------------------------------------------------------------------------------------------+
|
||||
|error |The user's action failed: he must correct something to process the action. |
|
||||
+-----------+----------------------------------------------------------------------------------------------+
|
||||
|
||||
We can use :code:`TranslatableMessage` (and other :code:`TranslatableMessageInterface` instances) into the controller:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// in a controller action:
|
||||
if (($session = $request->getSession()) instanceof Session) {
|
||||
$session->getFlashBag()->add(
|
||||
'success',
|
||||
new TranslatableMessage('saved_export.Saved export is saved!')
|
||||
);
|
||||
}
|
||||
|
||||
.. seealso::
|
||||
|
||||
`Flash Messages on Symfony documentation <http://symfony.com/doc/current/book/controller.html#flash-messages>`_
|
||||
@@ -66,7 +73,7 @@ To add the action on button, use them as class along with ``sc-button`` :
|
||||
| | | - Submitting this form will remove the entity |
|
||||
+-----------+----------------+------------------------------------------------------------------------------+
|
||||
| Edit | ``bt-edit`` or | Link to a form to edit an entity |
|
||||
| | ``bt-update`` | |
|
||||
| | ``bt-update`` | |
|
||||
+-----------+----------------+------------------------------------------------------------------------------+
|
||||
| Save | ``bt-save`` | Submitting this form will save change on the entity |
|
||||
+-----------+----------------+------------------------------------------------------------------------------+
|
||||
|
Reference in New Issue
Block a user