Kevin Burnett eae5f7dd2d
the big message improvements branch (#1549)
* imported patch from old message_improvements branch w/ burnettk

* wip.

* merging in changes from message_improvements

* remove patch files that were accidendetally added.

* Added a modal for editing a correlation.  Added ability to delete whole correlation keys.
A little css cleanup.

* * Removing migration - will add back in at the end.
* The Message models API should not require page and per_age parameters, it will return all.
* The Message model list should return a full json description of all messages/correlations for all containing groups.
*

* wip

* Add import, fix class name

* Getting ./bin/pyl to pass

* Getting ./bin/pyl to pass

* Some fe lint fixes

* Some ruff fixes

* Commands to nuke poetry dirs

* Temp skipping of a couple tests

* Getting ./bin/pyl to pass

* This needs to be back in

* Revert back to main

* Factored out data store handling

* Working on factoring out collecting messages, has test failure

* Formatting

* Fixed up test failures

* Remove commentted out lines

* Adding fields

* Fix merge issue

* Re-enable modal

* WIP

* Untested relationships

* Remove correlation key table

* Remove retrieval expression from uniqueness

* Remove commentted out lines

* WIP

* WIP

* WIP

* WIP

* WIP

* Make mypy pass

* Getting formatters to pass

* Add migration

* WIP fixing tests

* WIP fixing tests

* WIP fixing tests

* WIP fixing tests

* WIP fixing tests

* Getting ./bin/pyl to pass

* Fix skipped test

* Fix skipped test

* Getting ./bin/pyl to pass

* Remove unused method

* Remove unused methods

* Clean up unused code

* Refactor to support creating single messages from the UI

* Untested support for processing one process_group

* WIP test

* WIP test

* Filled out test

* Getting ./bin/pyl to pass

* Message Editor Modal Work

* Change migration and add in schemas.

* Swtich to using the associated branch of the process BPMN.io mods

* Get the backend returning messages created from the frontend to the drop down list in the BPMN.io editor.

* Merge main, fix up test

* Getting ./bin/pyl to pass

* Show path in location

* Rename var

* install packages from bpmn-js-spiffworkflow as well for local development

* process group api can add and update message models now w/ burnettk

* backend tests are passing now w/ burnettk

* the launch message edit button is loading the editor w/ burnettk

* updated bpmn-js-spiffworkflow

* pyl is passing w/ burnettk

* updated bpmn-js-spiffworkflow w/ burnettk

* updated bpmn-js-spiffworkflow w/ burnettk

* fixed console errors w/ burnettk

* a couple tweaks w/ burnettk

* save the message json in the new format from the mform w/ burnettk

* display the correlation props in the form w/ burnettk

* default to empty schema so the format is obvious

* allow removing correlation props from web ui w/ burnettk

* added save notification when saving a message on a process model w/ burnettk

* fixed broken test w/ burnettk

* Updating test cases to new message format, tests are failing

* support schema from messages in frontend

* Fixing tests

* Fixing tests

* Fixing tests

* removed references to correlation keys and removed unused components w/ burnettk

* removed temp mesasge model edit button w/ burnettk

* Make mypy pass

* Fixing tests

* Fixing tests

* Getting ./bin/pyl to pass

* save deleted messages before attempting to add new ones w/ burnettk

* set state for the message id so it can be changed w/ burnettk

* do not wait for the message id to be set since it is not necessary w/ burnettk

* updated bpmn-js-spiffworkflow w/ burnettk

* build images for this branch w/ burnettk

* put location in path of message-models so we can control permissions on it w/ burnettk

* fix black

* some coderabbit suggestions

* pull in spiff fix

* Default schema to {}

* Temp fix for invalid schema

* updated bpmn-js-spiffworkflow

* some updates for issue 1626

* minor name tweaks and attempts to update message dropdown in panel when message changes - does not work yet w/ burnettk

* updated bpmn-js-spiffworkflow w/ burnettk

* attempt to call add_message.returned event when message updates w/ burnettk

* treat formData as a state in the MesasgeEditor so it can be updated when the form contents is modified w/ burnettk

* updated bpmn-js-spiffworkflow w/ burnettk

* Feature/merge correlation properties (#1693)

* Merge XML Correlation properties with Process group properties

* updates for messages w/ burnettk

---------

Co-authored-by: theaubmov <ayoubaitlachgar98@gmail.com>
Co-authored-by: jasquat <jasquat@users.noreply.github.com>

* do not wait for message id state to be set to better support new messages w/ burnettk

* updated SpiffWorkflow w/ burnettk

* some cleanup from coderabbit and linting

* added index to message tables, run typecheck in ci, and other updates while code reviewing w/ burnettk

* updated bpmn-js-spiffworkflow w/ burnettk

* remove branch to build

---------

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
Co-authored-by: danfunk <daniel.h.funk@gmail.com>
Co-authored-by: Jon Herron <jon.herron@yahoo.com>
Co-authored-by: burnettk <burnettk@users.noreply.github.com>
Co-authored-by: jasquat <2487833+jasquat@users.noreply.github.com>
Co-authored-by: theaubmov <ayoubaitlachgar98@gmail.com>
2024-06-10 09:15:54 -07:00

86 lines
4.1 KiB
Python

"""empty message
Revision ID: 43afc70a7016
Revises: d4b900e71852
Create Date: 2024-06-10 11:17:19.060779
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '43afc70a7016'
down_revision = 'd4b900e71852'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('message',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('identifier', sa.String(length=255), nullable=False),
sa.Column('location', sa.String(length=255), nullable=False),
sa.Column('schema', sa.JSON(), nullable=False),
sa.Column('updated_at_in_seconds', sa.Integer(), nullable=False),
sa.Column('created_at_in_seconds', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('identifier', 'location', name='message_identifier_location_unique')
)
with op.batch_alter_table('message', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_message_identifier'), ['identifier'], unique=False)
batch_op.create_index(batch_op.f('ix_message_location'), ['location'], unique=False)
op.create_table('message_correlation_property',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('message_id', sa.Integer(), nullable=False),
sa.Column('identifier', sa.String(length=255), nullable=False),
sa.Column('retrieval_expression', sa.String(length=255), nullable=False),
sa.Column('updated_at_in_seconds', sa.Integer(), nullable=False),
sa.Column('created_at_in_seconds', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['message_id'], ['message.id'], name='message_correlation_property_message_id_fk'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('message_id', 'identifier', name='message_correlation_property_unique')
)
with op.batch_alter_table('message_correlation_property', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_message_correlation_property_identifier'), ['identifier'], unique=False)
batch_op.create_index(batch_op.f('ix_message_correlation_property_message_id'), ['message_id'], unique=False)
with op.batch_alter_table('correlation_property_cache', schema=None) as batch_op:
batch_op.drop_index('ix_correlation_property_cache_message_name')
batch_op.drop_index('ix_correlation_property_cache_name')
op.drop_table('correlation_property_cache')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('correlation_property_cache',
sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False),
sa.Column('name', mysql.VARCHAR(collation='utf8mb4_0900_as_cs', length=50), nullable=False),
sa.Column('message_name', mysql.VARCHAR(collation='utf8mb4_0900_as_cs', length=50), nullable=False),
sa.Column('process_model_id', mysql.VARCHAR(collation='utf8mb4_0900_as_cs', length=255), nullable=False),
sa.Column('retrieval_expression', mysql.VARCHAR(collation='utf8mb4_0900_as_cs', length=255), nullable=True),
sa.PrimaryKeyConstraint('id'),
mysql_collate='utf8mb4_0900_as_cs',
mysql_default_charset='utf8mb4',
mysql_engine='InnoDB'
)
with op.batch_alter_table('correlation_property_cache', schema=None) as batch_op:
batch_op.create_index('ix_correlation_property_cache_name', ['name'], unique=False)
batch_op.create_index('ix_correlation_property_cache_message_name', ['message_name'], unique=False)
with op.batch_alter_table('message_correlation_property', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_message_correlation_property_message_id'))
batch_op.drop_index(batch_op.f('ix_message_correlation_property_identifier'))
op.drop_table('message_correlation_property')
with op.batch_alter_table('message', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_message_location'))
batch_op.drop_index(batch_op.f('ix_message_identifier'))
op.drop_table('message')
# ### end Alembic commands ###