Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement user activity properties / events #949

Open
AlexKirkouski opened this issue Jun 9, 2023 · 1 comment
Open

Implement user activity properties / events #949

AlexKirkouski opened this issue Jun 9, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request
Projects

Comments

@AlexKirkouski
Copy link
Contributor

For now, there should 3 types of such activities:

FILTER - changing filter
ORDER - changing order
FOCUS - changing focus

All this activities should be scoped to group objects for now (later it maybe also possible to scope such action / events to properties).

So syntax should be:

Event block:
ON [FILTER | ORDER | FOCUS] go [TO propertyNoParams]
Action:
[FILTER | ORDER | FOCUS] go [FROM propertyNoParams]

Property should store JSON (or CSV) string which should contain the data about the filter / order / focus.

For example (for order):

propA;true
propB;false

PS: Property action / event syntax could be the same, but property should contain more "granular data" (for example, for order, REPLACE, ADD, REMOVE, DIRECTION)/

@AlexKirkouski AlexKirkouski added the enhancement New feature or request label Jun 9, 2023
@AlexKirkouski AlexKirkouski added this to New in lsfusion via automation Jun 9, 2023
pavel-miniutka added a commit that referenced this issue Nov 9, 2023
* Implemented ORDER action and event

* 'ORDER FROM' and 'ON ORDER TO' properties

* FILTER action and event

* Short 'compare' JSON values

* READ ORDER/FILTER actions

* READ ORDER -> ORDERS; READ FILTER -> FILTERS

* user activity info storage type fix

* Added 'orders', 'filters' forms

* Removing auto-added leading and trailing "%" for "contains" filters

* ClientFilterAction: keep filter controls visibility state; single remote apply call

* compile fix

* api version 257

---------

Co-authored-by: pavel-miniutka <[email protected]>
@pavel-miniutka
Copy link
Collaborator

pavel-miniutka commented Nov 9, 2023

2 types of activities are implemented for the moment: ORDER and FILTER

Examples of actions:

ORDERS|FILTERS form.obj [TO jsonProp];
This will store current form.obj orders/filters info into jsonProp or default UserEvents.orders()/UserEvents.filters() property
ORDER|FILTER form.obj [FROM jsonProp];
This will read JSON orders/filters info from jsonProp or default UserEvents.orders()/UserEvents.filters() property and apply corresponding orders/filters to form.obj group object.

For access to default properties module UserEvents should be added into required modules list.

Form events block:

ON ORDER obj {
    ...
}
ON FILTER obj {
    ...
}

JSON structure:

For ORDER:

[{
    "property":<property_draw_SID>,
    "desc":true/false
}]

For FILTER:

[{
    "property":<property_draw_SID>,
    "compare":<=, >, <, >=, <=, !=, @, _, IN ARRAY>,
    "negation":true/false, 
    "value":<value>,
    "or":true/false
}]

"desc", "compare", "negation", "value" and "or" are optional keys

Also forms for quick import and modification of user activity info were added: UserEvents.ordersForm and UserEvents.filtersForm.
Here is the simple example of action which reverses current orders in grid:

reverseOrders() {
    ORDERS form.obj;
    IMPORT orders FROM orders();
    FOR property(INTEGER i) DO {
        desc(i) <- NOT desc(i);
    }
    EXPORT orders TO orders;
    ORDER form.obj;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
lsfusion
  
New
Development

No branches or pull requests

2 participants